forked from Daniel-KM/Omeka-theme-Scribe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
80 lines (64 loc) · 2.65 KB
/
index.php
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
<?php
echo head(array('bodyid' => 'home'));
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
<div id="primary">
<?php if (get_theme_option('Homepage Text')): ?>
<p><?php echo get_theme_option('Homepage Text'); ?></p>
<?php endif; ?>
<?php
$collectionTitle = '';
$collectionIDs = collection_order_array();
$num_of_collections = count($collectionIDs);
$div_counter = 1;
foreach ($collectionIDs as $collectionID) {
$collection = get_record_by_id('collection', $collectionID);
$collection_link = link_to_collection($collectionTitle, array(), 'show', $collection);
$collection_items = get_records('Item',
array(
'collection' => $collection['id'],
'sort_field' => 'Scripto,Weight',
'sort_dir' => 'a',
),
999);
$num_of_collection_items = count($collection_items);
set_loop_records('items', $collection_items);
$collection_item_list = array();
foreach (loop('items') as $item) {
set_current_record('item', $item);
array_push($collection_item_list,
array(
'thumb' => item_image('square_thumbnail', array('alt' => metadata($item, array('Dublin Core', 'Title')))),
'link' => record_url($item),
'name' => metadata($item, array('Dublin Core', 'Title')),
));
}
echo '<h1 style="display: inline;">' .$collection_link. '</h1>';
echo '<hr style="visibility: hidden; margin-top: 2px; margin-bottom: 4px;" />';
echo '<ul id="collection'.$div_counter.'" class="slider">';
for ($i=0; $i < $num_of_collection_items; $i++) {
echo '<li>';
echo '<a href="'.$collection_item_list[$i]['link'].'" rel="tooltip" title="'.$collection_item_list[$i]['name'].'">'.$collection_item_list[$i]['thumb'].'</a>';
echo '</li>';
}
echo '</ul>';
echo '<hr style="visibility: hidden; margin-top: 3px; margin-bottom: 3px;" />';
$div_counter++;
}
echo "<script> " . PHP_EOL;
echo "!function( $ ){ " . PHP_EOL;
echo "$(function () { " . PHP_EOL;
for ($k=1; $k <= $num_of_collections; $k++) {
echo "$('#collection".$k."').bxSlider({ " . PHP_EOL;
echo "displaySlideQty: 7, " . PHP_EOL;
echo "moveSlideQty: 7 " . PHP_EOL;
echo " }); " . PHP_EOL;
}
echo "$('a[rel=tooltip]').tooltip(); " . PHP_EOL;
echo "}); " . PHP_EOL;
echo "}( window.jQuery ) " . PHP_EOL;
echo "</script> " . PHP_EOL;
fire_plugin_hook('public_home', array('view' => $this));
echo foot();
?>