-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfunctions.php
More file actions
38 lines (36 loc) · 1.49 KB
/
functions.php
File metadata and controls
38 lines (36 loc) · 1.49 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
<?php
function centerrow_featured_html() {
$featuredHtml = '';
$featuredRecordTypes = ['Exhibit', 'Collection', 'Item'];
foreach ($featuredRecordTypes as $featuredRecordType) {
if (get_theme_option('display_featured_' . strtolower($featuredRecordType)) == '1') {
$featuredHtml .= display_records($featuredRecordType, 5, 'common/featured.php', ['recordType' => $featuredRecordType]);
}
}
return $featuredHtml;
}
function centerrow_get_square_thumbnail_url($file, $view) {
if ($file->hasThumbnail()) {
$squareThumbnail = file_display_url($file, 'square_thumbnail');
} else {
$mimeType = $file->mime_type;
$fileType = (strpos($mimeType, 'image')) ? 'image' : 'video';
$squareThumbnail = $view->baseUrl() . '/application/views/scripts/images/fallback-' . $fileType . '.png';
}
return $squareThumbnail;
}
function centerrow_public_nav_main() {
$html = '';
if (get_theme_option('nav_show_levels') == 1) {
$view = get_view();
$nav = new Omeka_Navigation;
$nav->loadAsOption(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME);
$nav->addPagesFromFilter(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_FILTER_NAME);
$html = $view->navigation()->menu($nav)->setPartial('common/accessible-megamenu.php')->render();
$view->navigation()->menu($nav)->setPartial(null);
} else {
$html = public_nav_main(array('role' => 'navigation'))->setMaxDepth(0);
}
return $html;
}
?>