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:
zarzuelo 2012-06-18 16:51:32 +00:00
parent f34cf1a37a
commit e042e0154f
2 changed files with 29 additions and 2 deletions

View File

@ -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

View File

@ -337,15 +337,36 @@ 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) {
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;
}