forked from q2a-projects/Q2A-Ultimate-SEO
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAdminMenuLayer.php
More file actions
46 lines (36 loc) · 1.22 KB
/
AdminMenuLayer.php
File metadata and controls
46 lines (36 loc) · 1.22 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
<?php
class qa_html_theme_layer extends qa_html_theme_base
{
public function initialize()
{
parent::initialize();
$this->adminMenuItem();
}
private function adminMenuItem()
{
if ($this->template !== 'admin') {
return;
}
// For qa_get_logged_in_level(), QA_USER_LEVEL_ADMIN
require_once QA_INCLUDE_DIR . 'app/posts.php';
if (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
return;
}
$this->content['navigation']['sub']['ultimate_seo'] = array(
'label' => 'Ultimate SEO',
'url' => qa_path_html('admin/ultimate_seo'),
);
if ($this->request === 'admin/ultimate_seo') {
if (empty($this->content['navigation']['sub'])) {
$this->content['navigation']['sub'] = array();
}
// For qa_admin_sub_navigation()
require_once QA_INCLUDE_DIR . 'app/admin.php';
$this->content['navigation']['sub'] = array_merge(
qa_admin_sub_navigation(),
$this->content['navigation']['sub']
);
$this->content['navigation']['sub']['ultimate_seo']['selected'] = true;
}
}
}