forked from vincent3569/zpBootstrap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinc_header.php
350 lines (318 loc) · 13.4 KB
/
inc_header.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<?php
// force UTF-8 Ø
if (!defined('WEBPATH')) die();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="<?php echo getOption('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<?php
if ( !((($_zp_gallery_page == 'pages.php') && (getPageTitleLink() == 'map')) || ($_zp_gallery_page == 'album.php')) ) {
zp_remove_filter('theme_head', 'GoogleMap::js');
zp_remove_filter('theme_head', 'openStreetMap::scripts');
}
zp_apply_filter('theme_head');
?>
<title>
<?php
echo getParentSiteTitle() . ' | ';
switch ($_zp_gallery_page) {
case 'index.php':
if ($isHomePage) { echo gettext('Home'); } else { echo gettext('Gallery'); }; break;
case '404.php':
echo gettext('Object not found'); break;
case 'album.php':
echo getBareAlbumTitle(); if ($_zp_page > 1) { echo ' [' . $_zp_page . ']'; }; break;
case 'archive.php':
echo gettext('Archive View'); break;
case 'contact.php':
echo gettext('Contact'); break;
case 'favorites.php':
echo gettext('My favorites'); if ($_zp_page > 1) { echo ' [' . $_zp_page . ']'; }; break;
case 'gallery.php':
echo gettext('Gallery'); if ($_zp_page > 1) { echo ' [' . $_zp_page . ']'; }; break;
case 'image.php':
echo getBareAlbumTitle() . ' | ' . getBareImageTitle(); break;
case 'news.php':
if (is_NewsArticle()) { echo getBareNewsTitle(); } else { echo gettext('News'); if ($_zp_page > 1) { echo ' [' . $_zp_page . ']'; }; }; break;
case 'pages.php':
echo getBarePageTitle(); break;
case 'password.php':
echo gettext('Password Required...'); break;
case 'register.php':
echo gettext('Register'); break;
case 'search.php':
echo gettext('Search'); if ($_zp_page > 1) { echo ' [' . $_zp_page . ']'; }; break;
}
?>
</title>
<?php
if (extensionEnabled('rss')) {
if (($_zenpage_news_enabled) && (getOption('RSS_articles'))) {
printRSSHeaderLink('News', gettext('Latest news'));
} else if (getOption('RSS_album_image')) {
printRSSHeaderLink('Gallery', gettext('Latest images RSS'));
}
}
?>
<link rel="shortcut icon" href="<?php echo $_zp_themeroot; ?>/images/favicon.ico" />
<link rel="stylesheet" href="<?php echo $_zp_themeroot; ?>/css/bootstrap.min.css" type="text/css" media="screen" />
<?php if (($_zp_gallery_page == 'index.php') && ($isHomePage)) { ?>
<link rel="stylesheet" href="<?php echo $_zp_themeroot; ?>/css/flexslider.css" type="text/css" media="screen" />
<?php } ?>
<?php if (($_zp_gallery_page == 'album.php') || ($_zp_gallery_page == 'favorites.php') || ($_zp_gallery_page == 'news.php') || ($_zp_gallery_page == 'pages.php') || ($_zp_gallery_page == 'search.php')) { ?>
<link rel="stylesheet" href="<?php echo $_zp_themeroot; ?>/css/jquery.fancybox.min.css" type="text/css" media="screen"/>
<?php } ?>
<link rel="stylesheet" href="<?php echo $_zp_themeroot; ?>/css/zpBootstrap.css" type="text/css" media="screen" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="<?php echo $_zp_themeroot; ?>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo $_zp_themeroot; ?>/js/zpBootstrap.js"></script>
<?php if (($_zp_gallery_page == 'index.php') && ($isHomePage)) { ?>
<script type="text/javascript" src="<?php echo $_zp_themeroot; ?>/js/jquery.flexslider-min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready( function() {
$('.flexslider').flexslider({
slideshowSpeed: 5000,
animationDuration: 500,
randomize: true,
pauseOnAction: false,
pauseOnHover: true
});
});
//]]>
</script>
<?php } ?>
<?php if (($_zp_gallery_page == 'album.php') || ($_zp_gallery_page == 'favorites.php') || ($_zp_gallery_page == 'news.php') || ($_zp_gallery_page == 'pages.php') || ($_zp_gallery_page == 'search.php')) { ?>
<script type="text/javascript" src="<?php echo $_zp_themeroot; ?>/js/jquery.fancybox.min.js"></script>
<script type="text/javascript" src="<?php echo $_zp_themeroot; ?>/js/zpB_fancybox_config.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready( function() {
$.fancybox.defaults.lang = '<?php $loc = substr(getOption('locale'), 0, 2); if (empty($loc)) {$loc = 'en';}; echo $loc; ?>';
$.fancybox.defaults.i18n = {
'<?php echo $loc; ?>' : {
CLOSE : '<?php echo gettext('close'); ?>',
NEXT : '<?php echo gettext('next'); ?>',
PREV : '<?php echo gettext('prev'); ?>',
PLAY_START : '<?php echo gettext('start slideshow'); ?>',
PLAY_STOP : '<?php echo gettext('stop slideshow'); ?>',
THUMBS : '<?php echo gettext_th('thumbnails'); ?>'
}
};
// cohabitation between keyboard Navigation and Fancybox
$.fancybox.defaults.onInit = function() { FancyboxActive = true; };
$.fancybox.defaults.afterClose = function() { FancyboxActive = false; };
});
//]]>
</script>
<?php } ?>
<?php if ($_zp_gallery_page == 'image.php' || ($_zp_gallery_page == 'news.php' && $_zenpage_news_enabled && is_NewsArticle())) { ?>
<script type="text/javascript">
//<![CDATA[
<?php
$NextURL = $PrevURL = false;
if ($_zp_gallery_page == 'image.php') {
if (hasNextImage()) { ?>var nextURL = "<?php echo html_encode(getNextImageURL()); $NextURL = true; ?>";<?php }
if (hasPrevImage()) { ?>var prevURL = "<?php echo html_encode(getPrevImageURL()); $PrevURL = true; ?>";<?php }
} else {
if ($_zenpage_news_enabled && is_NewsArticle()) {
if (getNextNewsURL()) { $article_url = getNextNewsURL(); ?>var nextURL = "<?php echo html_decode($article_url['link']); $NextURL = true; ?>";<?php }
if (getPrevNewsURL()) { $article_url = getPrevNewsURL(); ?>var prevURL = "<?php echo html_decode($article_url['link']); $PrevURL = true; ?>";<?php }
}
} ?>
// cohabitation between keyboard Navigation and Fancybox
var FancyboxActive = false;
function keyboardNavigation(e) {
// keyboard Navigation disabled if Fancybox active
if (FancyboxActive) return true;
if (!e) e = window.event;
if (e.altKey) return true;
var target = e.target || e.srcElement;
if (target && target.type) return true; //an input editable element
var keyCode = e.keyCode || e.which;
var docElem = document.documentElement;
switch(keyCode) {
case 63235: case 39:
if (e.ctrlKey || (docElem.scrollLeft == docElem.scrollWidth-docElem.clientWidth)) {
<?php if ($NextURL) { ?>window.location.href = nextURL; <?php } ?>return false; }
break;
case 63234: case 37:
if (e.ctrlKey || (docElem.scrollLeft == 0)) {
<?php if ($PrevURL) { ?>window.location.href = prevURL; <?php } ?>return false; }
break;
}
return true;
}
document.onkeydown = keyboardNavigation;
//]]>
</script>
<?php } ?>
</head>
<body>
<?php
zp_apply_filter('theme_body_open');
if ( ((!getOption('zpB_homepage')) && ($_zp_gallery_page == 'index.php')) ||
($_zp_gallery_page == 'gallery.php') ||
($_zp_gallery_page == 'album.php') ||
($_zp_gallery_page == 'image.php')) {
$galleryactive = true;
} else {
$galleryactive = false;
}
?>
<nav id="menu" class="navbar navbar-inverse navbar-static-top">
<div class="container"> <!-- class="navbar-inner" -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo html_encode(getSiteHomeURL()); ?>" title="<?php echo gettext('Home'); ?>"><?php echo getParentSiteTitle(); ?></a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav pull-right">
<?php if ((extensionEnabled('menu_manager')) && (getThemeOption('zpB_custom_menu'))) { ?>
<?php printCustomMenu('zpBootstrap', 'list-top', '', 'active'); ?>
<?php } else { ?>
<?php if (getOption('zpB_homepage')) { ?>
<li<?php if ((isset($isHomePage)) && ($isHomePage)) { ?> class="active"<?php } ?>>
<a href="<?php echo html_encode(getSiteHomeURL()); ?>" title="<?php echo gettext('Home'); ?>"><?php echo gettext('Home'); ?></a>
</li>
<?php } ?>
<li<?php if ($galleryactive) { ?> class="active"<?php } ?>>
<?php printCustomPageURL(gettext('Gallery'), 'gallery'); ?>
</li>
<?php if ($_zenpage_news_enabled && (getNumNews(true) > 0)) { ?>
<li<?php if ($_zp_gallery_page == 'news.php') { ?> class="active"<?php } ?>>
<?php printNewsIndexURL(gettext('News'), '', gettext('News')); ?>
</li>
<?php } ?>
<?php if ($_zenpage_pages_enabled) { ?>
<?php printPageMenu('list-top', '', 'active', '', '', '', 0, false); ?>
<?php } ?>
<?php } ?>
<?php if ((zp_loggedin()) && (extensionEnabled('favoritesHandler'))) { ?>
<li<?php if ($_zp_gallery_page == 'favorites.php') { ?> class="active"<?php } ?>>
<?php printFavoritesURL(); ?>
</li>
<?php } ?>
<?php if (extensionEnabled('contact_form')) { ?>
<li<?php if ($_zp_gallery_page == 'contact.php') { ?> class="active"<?php } ?>>
<?php printCustomPageURL(gettext('Contact'), 'contact'); ?>
</li>
<?php } ?>
<?php if (getOption('zpB_allow_search')) { ?>
<li id="look"<?php if ($_zp_gallery_page == 'archive.php') { ?> class="active"<?php } ?>>
<a id="search-icon" class="text-center" href="<?php echo getCustomPageURL('archive'); ?>" title="<?php echo gettext('Search'); ?>"><span class="glyphicon glyphicon-search"></span></a>
</li>
<?php } ?>
<?php if ((extensionEnabled('user_login-out')) && (!extensionEnabled('register_user'))) { ?>
<?php if (zp_loggedin()) { ?>
<li id="admin-single">
<?php printUserLogin_out(); ?>
</li>
<?php } else { ?>
<li id="admin-single">
<a href="#login-modal" class="logonlink-single" data-toggle="modal" title="<?php echo gettext('Login'); ?>"></a>
</li>
<?php } ?>
<?php } else if ((extensionEnabled('user_login-out')) || ((!zp_loggedin()) && (extensionEnabled('register_user')))) { ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle text-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon glyphicon-user"></span> <span class="glyphicon glyphicon-chevron-down"></span></a>
<ul class="dropdown-menu">
<?php if (extensionEnabled('user_login-out')) { ?>
<?php if (zp_loggedin()) { ?>
<li id="admin">
<?php printUserLogin_out(); ?>
</li>
<?php } else { ?>
<li id="admin">
<a href="#login-modal" class="logonlink" data-toggle="modal" title="<?php echo gettext('Login'); ?>"><?php echo gettext('Login'); ?></a>
</li>
<?php } ?>
<?php } ?>
<?php if ((!zp_loggedin()) && (extensionEnabled('register_user'))) { ?>
<li>
<?php registerUser::printLink(gettext('Register')); ?>
</li>
<?php } ?>
</ul>
</li>
<?php } ?>
<?php if (extensionEnabled('dynamic-locale')) { ?>
<li id="flags" class="dropdown">
<?php printLanguageSelector(); ?>
</li>
<?php } ?>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav><!--/.navbar -->
<?php if ((extensionEnabled('user_login-out')) && (!zp_loggedin()) && ($_zp_gallery_page <> 'password.php') && ($_zp_gallery_page <> 'register.php')) { ?>
<div id="login-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<?php printPasswordForm('', true, false); ?>
</div>
</div>
</div>
</div>
<?php } ?>
<!-- The scroll to top feature -->
<div class="scroll-to-top">
<span class="glyphicon glyphicon-chevron-up"></span>
</div>
<div id="main" class="container">
<div class="page-header row">
<?php if ((extensionEnabled('rss')) || (getOption('zpB_social_links'))) { ?>
<div class="col-sm-push-9 col-sm-3">
<?php if (extensionEnabled('rss')) {
$rss = false;
if ($_zenpage_news_enabled && (getOption('RSS_articles'))) {
$rss = true; $type = 'News';
} else if (getOption('RSS_album_image')) {
$rss = true; $type = 'Gallery';
}
if ($rss) { ?>
<div class="feed pull-right">
<?php printRSSLink($type, '', '', '', false, 'rss'); ?>
</div>
<script type="text/javascript">
//<![CDATA[
$('.rss').prepend('<img alt="RSS Feed" src="<?php echo $_zp_themeroot; ?>/images/feed_icon.png">');
//]]>
</script>
<?php } ?>
<?php } ?>
<?php if (getOption('zpB_social_links')) { ?>
<div class="addthis pull-right">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<!--<a class="addthis_button_favorites"></a>-->
<a class="addthis_button_compact"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js"></script>
<!-- AddThis Button END -->
</div>
<?php } ?>
</div>
<?php } ?>
<?php
if ((extensionEnabled('rss')) || (getOption('zpB_social_links'))) {
$col_header = ' col-sm-pull-3 col-sm-9';
} else {
$col_header = '';
}
?>
<div class="header<?php echo $col_header; ?>">