-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcrumbs.php
126 lines (105 loc) · 2.87 KB
/
crumbs.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
<?php
/**
* Crumbs Navigation
*
* @package Membao
* @author Alan Kawamara
* @copyright 2017
*/
if (!defined("_VALID_PHP"))
die('Direct access to this location is not allowed.');
?>
<?php
$sname = $_SERVER["SCRIPT_NAME"];
$pages = array(
'account',
'activate',
'bills',
'category',
'committees',
'content',
'item',
'login',
'leaders',
'meetings',
'profile',
'register',
'search',
'summary',
'tags',
'view',
);
$regexp = '#' . implode('|', $pages) . '#';
$pages = preg_match($regexp, $sname, $matches) ? $matches[0] : '';
$html = '';
switch ($pages) {
case "account":
$html = Lang::$word->_UA_MYACC;
break;
case "activate":
print Lang::$word->_UA_TITLE3;
break;
case "bills":
if(isset($allbills)):
$html = "Bills";
else:
$html = ($billrow) ? "<a href='" . SITEURL . "/bills'>Bills</a><div class='divider'></div>".$billrow->title : "";
endif;
break;
case "category":
$html = ($row) ? $row->name : "";
break;
case "committees":
if(isset($allcommittees)):
$html = "Committees";
else:
$html = ($committeerow) ? "<a href='" . SITEURL . "/committees'>Committees</a><div class='divider'></div>".$committeerow->name : "";
endif;
break;
case "content":
$html = ($row) ? $row->title : "";
break;
case "item":
$html = ($row) ? $row->title : "";
break;
case "leaders":
if(isset($allleaders)):
$html = "Leaders";
else:
$html = ($leaderrow) ? "<a href='" . SITEURL . "/leaders'>Leaders</a><div class='divider'></div>".$leaderrow->name : "";
endif;
break;
case "login":
$html = Lang::$word->_UA_TITLE;
break;
case "meetings":
if(isset($allmeetings)):
$html = "Meetings";
else:
$html = ($meetingrow) ? "<a href='" . SITEURL . "/meetings'>Meetings</a><div class='divider'></div>".$meetingrow->name : "";
endif;
break;
case "profile":
$html = Lang::$word->_UA_TITLE4;
break;
case "register":
$html = Lang::$word->_UA_TITLE2;
break;
case "search":
$html = Lang::$word->FSRC_TITLE;
break;
case "summary":
$html = Lang::$word->SMY_TITLE;
break;
case "tags":
$html = ($row) ? $row->tag : "";
break;
case "view":
$html = Lang::$word->_UA_TITLE5;
break;
default:
$html = '';
break;
}
print '<div class="active section">' . $html . '</div>';
?>