Commit 7f8e3a71 by Scott

Fix admin/users menu item not being selected

parent 62362f80
......@@ -284,9 +284,10 @@
'url' => qa_path_html('admin/emails'),
);
$navigation['admin/user']=array(
$navigation['admin/users']=array(
'label' => qa_lang_html('admin/users_title'),
'url' => qa_path_html('admin/users'),
'selected_on' => array('admin/users$', 'admin/userfields$', 'admin/usertitles$'),
);
$navigation['admin/layout']=array(
......
......@@ -247,9 +247,9 @@
foreach ($navigation as $navprefix => $navlink) {
$selected =& $qa_content['navigation'][$navtype][$navprefix]['selected'];
if (isset($navlink['selectpaths'])) {
if (isset($navlink['selected_on'])) {
// match specified paths
foreach ($navlink['selectpaths'] as $path) {
foreach ($navlink['selected_on'] as $path) {
if (strpos($requestlower.'$', $path) === 0)
$selected = true;
}
......@@ -583,21 +583,21 @@
$qa_content['navigation']['main']['tag']=array(
'url' => qa_path_html('tags'),
'label' => qa_lang_html('main/nav_tags'),
'selectpaths' => array('tags$', 'tag/'),
'selected_on' => array('tags$', 'tag/'),
);
if (qa_using_categories() && qa_opt('nav_categories'))
$qa_content['navigation']['main']['categories']=array(
'url' => qa_path_html('categories'),
'label' => qa_lang_html('main/nav_categories'),
'selectpaths' => array('categories$', 'categories/'),
'selected_on' => array('categories$', 'categories/'),
);
if (qa_opt('nav_users'))
$qa_content['navigation']['main']['user']=array(
'url' => qa_path_html('users'),
'label' => qa_lang_html('main/nav_users'),
'selectpaths' => array('users$', 'users/', 'user/'),
'selected_on' => array('users$', 'users/', 'user/'),
);
// Only the 'level' permission error prevents the menu option being shown - others reported on qa-page-ask.php
......@@ -618,7 +618,7 @@
$qa_content['navigation']['main']['admin']=array(
'url' => qa_path_html('admin'),
'label' => qa_lang_html('main/nav_admin'),
'selectpaths' => array('admin/'),
'selected_on' => array('admin/'),
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment