-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhead.php
167 lines (156 loc) · 6.27 KB
/
head.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
<?php
// prevent script from getting called directly
if (!defined("URLAUBE")) { die(""); }
?>
<!DOCTYPE html>
<html lang="<?= html(value(Themes::class, LANGUAGE)) ?>">
<head>
<meta charset="<?= html(value(Themes::class, CHARSET)) ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="keywords" content="<?= html(value(Themes::class, KEYWORDS)) ?>">
<?php
if (null !== value(Themes::class, DESCRIPTION)) {
?>
<meta name="description" content="<?= html(value(Themes::class, DESCRIPTION)) ?>">
<meta property="og:description" content="<?= html(value(Themes::class, DESCRIPTION)) ?>">
<?php
}
if (null !== value(Themes::class, AUTHOR)) {
?>
<meta name="author" content="<?= html(value(Themes::class, AUTHOR)) ?>">
<?php
}
if (null !== value(Themes::class, "page_image")) {
?>
<meta property="og:image" content="<?= html(value(Themes::class, "page_image")) ?>">
<?php
}
?>
<meta property="og:type" content="<?= html(value(Themes::class, "page_type")) ?>">
<meta property="og:title" content="<?= html(value(Themes::class, TITLE)) ?>">
<?php
if (null !== value(Themes::class, CANONICAL)) {
?>
<meta property="og:url" content="<?= html(absoluteurl(value(Themes::class, CANONICAL))) ?>">
<link rel="canonical" href="<?= html(value(Themes::class, CANONICAL)) ?>">
<?php
}
$next = nextpage();
if (null !== $next) {
?>
<link rel="next" href="<?= html($next) ?>">
<?php
}
$prev = prevpage();
if (null !== $prev) {
?>
<link rel="prev" href="<?= html($prev) ?>">
<?php
}
$feeduri = feeduri();
if (null !== $feeduri) {
?>
<link rel="alternate" type="application/rss+xml" href="<?= html($feeduri) ?>" />
<?php
}
if (null !== value(Themes::class, FAVICON)) {
?>
<link rel="shortcut icon" type="image/x-icon" href="<?= html(value(Themes::class, FAVICON)) ?>">
<?php
}
?>
<title><?= html(value(Themes::class, TITLE)) ?></title>
<!-- Apple Touch Icon -->
<link rel="apple-touch-icon" href="/user/uploads/img/app_icon.png">
<!-- Fork Awesome Icons -->
<link href="<?= html(path2uri(__DIR__."/vendor/fork-awesome/css/fork-awesome.min.css")) ?>" rel="stylesheet">
<!-- Custom CSS -->
<link href="<?= html(path2uri(__DIR__."/css/custom.css")) ?>" rel="stylesheet">
<!-- Plugin CSS -->
<link href="<?= html(path2uri(__DIR__."/vendor/magnific-popup/magnific-popup.css")) ?>" rel="stylesheet">
<link href="<?= html(path2uri(__DIR__."/vendor/jquery-tagthis/jquery-tag-this.css")) ?>" rel="stylesheet">
<!-- Theme CSS - Includes Bootstrap -->
<link href="<?= html(path2uri(__DIR__."/css/creative.css")) ?>" rel="stylesheet">
</head>
<body id="page-top">
<!-- Menu -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top py-3" id="mainNav">
<div class="container">
<a class="navbar-brand" href="/#page-top"><?= html(value(Themes::class, SITENAME)) ?></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto my-2 my-lg-0">
<?php
// iterate through the menu entries to generate the link bar
$menu = value(Themes::class, MENU);
if (is_array($menu)) {
foreach ($menu as $menu_item) {
if (is_array($menu_item)) {
if (isset($menu_item[TITLE]) && isset($menu_item[URI])) {
if (isset($menu_item[MENU]) && is_array($menu_item[MENU])) {
?>
<li class="dropdown nav-item">
<a href="<?= html($menu_item[URI]) ?>" class="dropdown-toggle nav-link" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"><?= html($menu_item[TITLE]) ?></a>
<div class="dropdown-menu dropdown-menu-left animate slideIn" aria-labelledby="navbarDropdown">
<?php
foreach ($menu_item[MENU] as $submenu_item) {
if (isset($submenu_item[TITLE]) ) {
if ($submenu_item[TITLE] == "divider") {
?>
<div class="dropdown-divider"></div>
<?php
} elseif (isset($submenu_item[TITLE]) && isset($submenu_item[URI])) {
// handle local scrolling links
$local = false;
if (null !== value(Main::class, URI)) {
$url = parse_url($submenu_item[URI]);
if ((false !== $url) &&
!isset($url["scheme"]) && !isset($url["host"]) && !isset($url["port"]) && !isset($url["user"]) &&
!isset($url["pass"]) && isset($url["path"]) && isset($url["fragment"]) &&
(0 === strcmp(value(Main::class, URI), $url["path"]))) {
$local = true;
$submenu_item[URI] = "#".$url["fragment"];
}
}
?>
<a class="dropdown-item<?= ($local) ? " js-scroll-trigger" : "" ?>" href="<?= html($submenu_item[URI]) ?>"><?= html($submenu_item[TITLE]) ?></a>
<?php
} else {
?>
<h6 class="dropdown-header"><?= html($submenu_item[TITLE]) ?></h6>
<?php
}}
}
?>
</div>
</li>
<?php
} else {
// handle local scrolling links
$local = false;
if (null !== value(Main::class, URI)) {
$url = parse_url($menu_item[URI]);
if ((false !== $url) &&
!isset($url["scheme"]) && !isset($url["host"]) && !isset($url["port"]) && !isset($url["user"]) &&
!isset($url["pass"]) && isset($url["path"]) && isset($url["fragment"]) &&
(0 === strcmp(value(Main::class, URI), $url["path"]))) {
$local = true;
$menu_item[URI] = "#".$url["fragment"];
}
}
?>
<li class="nav-item"><a class="nav-link<?= ($local) ? " js-scroll-trigger" : "" ?>" href="<?= html($menu_item[URI]) ?>"><?= html($menu_item[TITLE]) ?></a></li>
<?php
}
}
}
}
}
?>
</ul>
</div>
</div>
</nav>