forked from omeka/theme-centerrow
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfunctions.php
More file actions
33 lines (30 loc) · 1.24 KB
/
functions.php
File metadata and controls
33 lines (30 loc) · 1.24 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
<?php
function mashare_display_featured_exhibit() {
$html = '';
$featuredExhibit = exhibit_builder_random_featured_exhibit();
if ($featuredExhibit) {
$html .= get_view()->partial('exhibit-builder/exhibits/single.php', array('exhibit' => $featuredExhibit));
}
$html = apply_filters('exhibit_builder_display_random_featured_exhibit', $html);
return $html;
}
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() {
$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);
return $html;
}
?>