-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplugin.php
More file actions
162 lines (156 loc) · 4.38 KB
/
plugin.php
File metadata and controls
162 lines (156 loc) · 4.38 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
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
<?php
class pluginAdminBar extends Plugin {
private $enable;
public function siteHead()
{
return '
<style>
#admin-strip {
background: #1e1e20;
color: #65656d;
display: block;
overflow: hidden;
width: 100%;
padding: 1rem;
position: fixed;
bottom: 0;
z-index: 999;
}
#admin-strip ul {
margin: 0.5rem;
padding: 0;
overflow: hidden;
}
#admin-strip ul li {
display: inline-block;
list-style: none;
margin: 0;
padding: 0;
}
#admin-strip .float-me-to-the-right {
float: right;
}
#admin-strip .you-gotta-spot-this {
color: #808687;
}
#admin-strip .you-gotta-spot-this strong {
color: #8e9596;
}
#admin-strip a {
display: block;
vertical-align: middle;
}
#admin-strip a:link, #admin-strip a:visited {
color: #7e7e90;
}
#admin-strip a:hover, #admin-strip a:active {
color: #ff8c00;
}
#admin-strip .action-buttons {
font-size: 1.6rem;
margin:10px 0 20px 0;
}
#admin-strip .admin-new-post, #admin-strip .admin-new-page {
background: #3d3d42;
color: #fff !important;
padding: 0.3rem;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
margin: 0.2rem 0.6rem;
padding: 0.3rem 1rem;
}
#admin-strip .admin-new-post:hover, #admin-strip .admin-new-page:hover {
background: #a7c520;
color: #1e1e20 !important;
text-decoration: none;
}
#admin-strip .admin-edit-item{
background: #88a825;
color: #fff !important;
padding: 0.3rem;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
margin: 0.2rem 0.6rem;
padding: 0.3rem 1rem;
}
#admin-strip .admin-edit-item:hover{
background: #fff;
color: #52631b !important;
text-decoration: none;
}
#admin-strip .admin-page-logout {
background: #ff2d00;
color: #fff !important;
padding: 0.3rem;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin: 0.2rem 0.6rem;
padding: 0.3rem 2rem;
}
#admin-strip .admin-page-logout:hover {
background: #a7c520;
color: #1e1e20 !important;
text-decoration: none;
}
#admin-strip .info-list {
font-size: 1.3rem;
line-height: 1.6rem;
}
@media (max-width: 768px) {
#admin-strip .float-me-to-the-right {
float: none;
}
#admin-strip .info-list {
display: none;
}
#admin-strip .action-buttons {
font-size: 1.2rem;
line-height: 1.2rem;
}
#admin-strip .action-buttons li {
display: block;
}
#admin-strip .action-buttons li a {
display: block;
margin: 0.5rem 0;
padding: 1rem;
}
}
</style>
';
}
public function siteBodyEnd()
{
global $Login;
global $L;
global $Url;
global $Site;
global $Post;
global $Page;
if($Login->role()=='admin') {
echo'
<div id="admin-strip">
<ul class="action-buttons">
<li><a href="'.HTML_PATH_ADMIN_ROOT.'new-post" class="admin-new-post">New post</a></li>
<li><a href="'.HTML_PATH_ADMIN_ROOT.'new-page" class="admin-new-page">New Page</a></li>';
if($Url->whereAmI()=='post') { echo '<li><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->slug().'" target="_blank" class="admin-edit-item">Edit post</a></li>';};
if($Url->whereAmI()=='page') { echo '<li><a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$Page->slug().'" target="_blank" class="admin-edit-item">Edit page</a></li>';};
echo '<li><a href="'.HTML_PATH_ADMIN_ROOT.'" class="admin-panel">Admin Panel</a></li>
<li class="float-me-to-the-right"><a href="'.HTML_PATH_ADMIN_ROOT.'/logout'.'" class="admin-page-logout">Logout</a></li>
</ul>
<ul class="info-list">
<li class="you-gotta-spot-this">'.$Site->title().'</li>
<li >Logged in as: <strong>'.$Login->username().'</strong> </li>
<li>Locale <strong>'.$Site->locale().'</strong></li>
<li>Timezone <strong>'.$Site->timezone().'</strong></li>
<li>Theme <strong>'. $theme = $Site->theme().'</strong></li>
<li>Build <strong>'. $Site->currentBuild().'</strong></li>
</ul>
</div>';
}
return false;
}
}