Revision 621
Added by doc almost 17 years ago
class.admin.php | ||
---|---|---|
95 | 95 |
} else { |
96 | 96 |
$charset='utf-8'; |
97 | 97 |
} |
98 |
|
|
99 |
// work out the URL for the 'View menu' link in the WB backend |
|
100 |
// if the page_id is set, show this page otherwise show the root directory of WB |
|
101 |
$view_url = WB_URL; |
|
102 |
if(isset($_GET['page_id'])) { |
|
103 |
// extract page link from the database |
|
104 |
$result = @$database->query("SELECT link FROM " .TABLE_PREFIX ."pages WHERE page_id = '" .(int) $_GET['page_id'] ."'"); |
|
105 |
$row = @$result->fetchRow(); |
|
106 |
if($row) $view_url .= PAGES_DIRECTORY .$row['link']. PAGE_EXTENSION; |
|
107 |
} |
|
108 |
|
|
98 | 109 |
$header_template->set_var( array( |
99 | 110 |
'SECTION_NAME' => $MENU[strtoupper($this->section_name)], |
100 | 111 |
'INTERFACE_DIR' => ADMIN_URL.'/interface', |
... | ... | |
104 | 115 |
'CHARSET' => $charset, |
105 | 116 |
'VERSION' => VERSION, |
106 | 117 |
'WB_URL' => WB_URL, |
118 |
'TITLE_START' => $MENU['START'], |
|
119 |
'TITLE_VIEW' => $MENU['VIEW'], |
|
120 |
'TITLE_HELP' => $MENU['HELP'], |
|
121 |
'TITLE_LOGOUT' => $MENU['LOGOUT'], |
|
122 |
'URL_VIEW' => $view_url, |
|
123 |
'URL_HELP' => 'http://www.websitebaker.org/help/'.WB_VERSION, |
|
107 | 124 |
'BACKEND_MODULE_CSS' => $this->register_backend_modfiles('css'), // adds backend.css |
108 | 125 |
'BACKEND_MODULE_JS' => $this->register_backend_modfiles('js') // adds backend.js |
109 | 126 |
) |
110 | 127 |
); |
111 | 128 |
|
112 |
// work out the URL for the 'View menu' link in the WB backend |
|
113 |
// if the page_id is set, show this page otherwise show the root directory of WB |
|
114 |
$view_url = WB_URL; |
|
115 |
if(isset($_GET['page_id'])) { |
|
116 |
// extract page link from the database |
|
117 |
$result = @$database->query("SELECT link FROM " .TABLE_PREFIX ."pages WHERE page_id = '" .(int) $_GET['page_id'] ."'"); |
|
118 |
$row = @$result->fetchRow(); |
|
119 |
if($row) $view_url .= PAGES_DIRECTORY .$row['link']. PAGE_EXTENSION; |
|
120 |
} |
|
121 |
|
|
122 | 129 |
// Create the menu |
123 | 130 |
$menu = array( |
124 |
array(ADMIN_URL.'/start/index.php', '', $MENU['START'], 'start', 0), |
|
125 | 131 |
array(ADMIN_URL.'/pages/index.php', '', $MENU['PAGES'], 'pages', 1), |
126 | 132 |
array(ADMIN_URL.'/media/index.php', '', $MENU['MEDIA'], 'media', 1), |
127 | 133 |
array(ADMIN_URL.'/addons/index.php', '', $MENU['ADDONS'], 'addons', 1), |
128 | 134 |
array(ADMIN_URL.'/preferences/index.php', '', $MENU['PREFERENCES'], 'preferences', 0), |
129 | 135 |
array(ADMIN_URL.'/settings/index.php', '', $MENU['SETTINGS'], 'settings', 1), |
130 | 136 |
array(ADMIN_URL.'/admintools/index.php', '', $MENU['ADMINTOOLS'], 'admintools', 1), |
131 |
array(ADMIN_URL.'/access/index.php', '', $MENU['ACCESS'], 'access', 1), |
|
132 |
array('http://www.websitebaker.org/help/'.WB_VERSION, '_blank', $MENU['HELP'], 'help', 0), |
|
133 |
array($view_url, '_blank', $MENU['VIEW'], 'view', 0), |
|
134 |
array(ADMIN_URL.'/logout/index.php', '', $MENU['LOGOUT'], 'logout', 0) |
|
137 |
array(ADMIN_URL.'/access/index.php', '', $MENU['ACCESS'], 'access', 1) |
|
135 | 138 |
); |
136 | 139 |
$header_template->set_block('header_block', 'linkBlock', 'link'); |
137 | 140 |
foreach($menu AS $menu_item) { |
Also available in: Unified diff
introduced the WB 2.7 backend style developed by Michael Brinsteiner (escpro), thanks man