2012-06-18 Sergio Martin <sergio.martin@artica.es>
* include/functions_menu.php: Added categories in the combo of sections (Operation and Administration) Merged from 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6582 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f34cf1a37a
commit
e042e0154f
|
@ -1,3 +1,9 @@
|
|||
2012-06-18 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_menu.php: Added categories in the
|
||||
combo of sections (Operation and Administration)
|
||||
Merged from 4.0.2
|
||||
|
||||
2012-06-18 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* operation/tree.php: Fixed a bug which shows groups
|
||||
|
|
|
@ -337,14 +337,35 @@ function menu_get_full_sec() {
|
|||
/**
|
||||
* Get the sec list built in menu
|
||||
*
|
||||
* @param bool If true, the array returned will have the structure
|
||||
* to combo categories (optgroup)
|
||||
*
|
||||
* @return array Sections list
|
||||
*/
|
||||
function menu_get_sec() {
|
||||
function menu_get_sec($with_categories = false) {
|
||||
$menu = menu_get_full_sec();
|
||||
unset($menu['class']);
|
||||
|
||||
$in_godmode = false;
|
||||
foreach($menu as $k => $v) {
|
||||
$sec_array[$k] = $v['text'];
|
||||
if($with_categories) {
|
||||
if(!$in_godmode && $k[0] == 'g') {
|
||||
$in_godmode = true;
|
||||
}
|
||||
|
||||
if($in_godmode) {
|
||||
$category = __('Administration');
|
||||
}
|
||||
else {
|
||||
$category = __('Operation');
|
||||
}
|
||||
|
||||
$sec_array[$k]['optgroup'] = $category;
|
||||
$sec_array[$k]['name'] = $v['text'];
|
||||
}
|
||||
else {
|
||||
$sec_array[$k] = $v['text'];
|
||||
}
|
||||
}
|
||||
|
||||
return $sec_array;
|
||||
|
|
Loading…
Reference in New Issue