-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathCurated.class.php
More file actions
executable file
·96 lines (79 loc) · 2.58 KB
/
Copy pathCurated.class.php
File metadata and controls
executable file
·96 lines (79 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
class Curated
{
var $name;
var $by;
var $scroll;
var $resize;
var $width;
var $height;
var $image;
var $description;
var $location;
var $links = array();
function Curated($xml)
{
$this->name = getAttribute($xml, 'name');
$this->by = getAttribute($xml, 'by');
$this->scroll = getAttribute($xml, 'scroll');
$this->resize = getAttribute($xml, 'resize');
$this->width = getAttribute($xml, 'width');
$this->height = getAttribute($xml, 'height');
$this->image = getValue($xml, 'image');
//$this->description = innerHTML($xml, 'description');
$this->description = getValue($xml, 'description');
$this->location = getValue($xml, 'location');
$links = $xml->getElementsByTagName('link');
$links = $links->toArray();
foreach($links as $link) {
$this->links[] = array('href' => $link->getAttribute('href'), 'title' => $link->getText());
}
}
function display()
{
$html = $this->display_piece();
$html .= "\t<p>{$this->description}</p><p>Links: \n";
$linkcount = count($links);
$ii = 0;
foreach ($this->links as $link) {
if ($ii > 0) {
$html .= sprintf(", ");
}
$html .= sprintf("<a href=\"%s\">%s</a>", $link['href'], $link['title']);
$ii++;
}
$html .= "</p></div>\n\n";
return $html;
}
function display_short_home()
{
$html = $this->display_piece_home();
$html .= "</div>\n\n";
return $html;
}
function display_short()
{
$html = $this->display_piece();
$html .= "</div>\n\n";
return $html;
}
function display_piece_home()
{
$link = sprintf("<a href=\"%s\">", $this->location);
$html = "<div class=\"curated-item\">\n";
$html .= "\t$link<img src=\"/exhibition/{$this->image}\" width=\"223\" height=\"72\" alt=\"preview image\" title=\"{$this->name} by {$this->by}\" /></a>\n";
$html .= "\t<p>$link{$this->name}</a><br />\n";
$html .= "\tby {$this->by}</p>\n";
return $html;
}
function display_piece()
{
$link = sprintf("<a href=\"%s\">", $this->location);
$html = "<div class=\"curated-item\">\n";
$html .= "\t$link<img src=\"/exhibition/{$this->image}\" width=\"223\" height=\"72\" alt=\"preview image\" title=\"{$this->name} by {$this->by}\" /></a>\n";
$html .= "\t<br /><p>$link{$this->name}</a><br />\n";
$html .= "\tby {$this->by}</p>\n";
return $html;
}
}
?>