forked from hugowetterberg/cbisimport
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcbis_product.tpl.php
More file actions
56 lines (50 loc) · 1.31 KB
/
cbis_product.tpl.php
File metadata and controls
56 lines (50 loc) · 1.31 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
<?php
// $Id$
$attr = $product['Attributes'];
$arenas = $product['Occasions'];
foreach($arenas as $arena) {
$arena_name = $arena->ArenaName;
if($arena_name) {
$attr['arena'] = $arena_name;
break;
}
}
$links = array();
if (!empty($attr['email'])) {
$links['email'] = array(
'href' => 'mailto:' . $attr['email'],
'title' => $attr['email'],
);
}
if (!empty($attr['website'])) {
$attr['website'] = check_plain($attr['website']);
if (!preg_match('/^https?\:\/\//', $attr['website'])) {
$href = 'http://' . $attr['website'];
}
else {
$href = $attr['website'];
}
$links['website'] = array(
'href' => $href,
'title' => $attr['website'],
'attributes' => array('rel' => 'home'),
);
}
if(!empty($attr['Copytext'])) {
print $attr['Copytext'];
} else {
print $attr['Description'];
}
print theme('links', $links);
print theme('cbis_product_address', $attr);
if ($attr['Latitude'] && $attr['Longitude']) {
// Could've made this microformats.. but that would require additional
// stylesheet changes. Besides, Simple Geo already prints microformat tags.
print '<div id="coordinates">';
printf('<strong>%s:</strong> <span class="latitude">%s</span> <span class="longitude">%s</span>',
t('Coordinates'),
$attr['Latitude'],
$attr['Longitude']
);
print '</div>';
}