forked from InteractiveMechanics/omeka-starter-theme
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfunctions.php
executable file
·115 lines (104 loc) · 3.56 KB
/
functions.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
function random_featured_exhibit()
{
$html = '';
$featuredExhibit = exhibit_builder_random_featured_exhibit();
if ($featuredExhibit) {
$html .= get_view()->partial('exhibits/single.php', array('exhibit' => $featuredExhibit));
} else {
$html .= '<p>' . __('You have no featured exhibits.') . '</p>';
}
$html = apply_filters('exhibit_builder_display_random_featured_exhibit', $html);
return $html;
}
function public_nav_main_bootstrap() {
$partial = array('common/menu-main-partial.phtml', 'default');
$nav = public_nav_main(); // this looks like $this->navigation()->menu() from Zend
$nav->setPartial($partial);
return $nav->render();
}
function public_nav_sidebar_bootstrap() {
$partial = array('common/menu-sidebar-partial.phtml', 'default');
$nav = public_nav_main(); // this looks like $this->navigation()->menu() from Zend
$nav->setPartial($partial);
return $nav->render();
}
function public_nav_pills_bootstrap() {
$partial = array('common/menu-item-pills-partial.phtml', 'default');
$nav = public_nav_items(); // this looks like $this->navigation()->menu() from Zend
$nav->setPartial($partial);
return $nav->render();
}
function public_nav_pills_bootstrap_exhibit() {
$partial = array('common/menu-item-pills-partial.phtml', 'default');
$nav = public_nav_items(array(
array(
'label' => __('Browse All'),
'uri' => url('exhibits')
),
array(
'label' => __('Browse by Tag'),
'uri' => url('exhibits/tags')
)
)); // this looks like $this->navigation()->menu() from Zend
$nav->setPartial($partial);
return $nav->render();
}
function recent_items_bootstrap($recentItems,$type){
if($type=='list'){
return recent_items($recentItems);
}
elseif($type=='grid'){
$items = get_recent_items($recentItems);
if ($items) {
$html = '';
foreach ($items as $item) {
$html .= get_view()->partial('items/grid.php', array('item' => $item));
release_object($item);
}
} else {
$html = '<p>' . __('No recent items available.') . '</p>';
}
return $html;
}
elseif($type=='sidebar'){
$items = get_recent_items($recentItems);
if ($items) {
$html = '';
foreach ($items as $item) {
$html .= get_view()->partial('items/sidebar.php', array('item' => $item));
release_object($item);
}
} else {
$html = '<p>' . __('No recent items available.') . '</p>';
}
return $html;
}
}
function bs_link_logo_to_navbar($text = null, $props = array())
{
if (!$text) {
$text = option('site_title');
}
if(theme_logo()){$logo= "";}
else $logo="onlytext";
return '<a class="navbar-brand '.$logo.'" href="' . html_escape(WEB_ROOT) . '" '. tag_attributes($props) . '>'.theme_logo(). $text . "</a>\n";
}
function bs_header_bg()
{
$headerImage = get_theme_option('Header Background Image');
if ($headerImage) {
$storage = Zend_Registry::get('storage');
$headerImage = $storage->getUri($storage->getPathByType($headerImage, 'theme_uploads'));
return $headerImage;
}
}
function bs_header_logo()
{
$headerImage = get_theme_option('Header Logo Image');
if ($headerImage) {
$storage = Zend_Registry::get('storage');
$headerImage = $storage->getUri($storage->getPathByType($headerImage, 'theme_uploads'));
return '<img alt="header-logo" class="img-responsive center-block" src="' . $headerImage . '" />';
}
}