Index: branches/5.1.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -N -r13569 -r13750 --- branches/5.1.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 13569) +++ branches/5.1.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 13750) @@ -1,6 +1,6 @@ SelectParam($params, 'name,render_as,block'); $sections_helper =& $this->Application->recallObject('SectionsHelper'); + /* @var $sections_helper kSectionsHelper */ + $section_data =& $sections_helper->getSectionData($section_name); $params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0; @@ -101,24 +103,10 @@ return $ret; } - $debug_mode = $this->Application->isDebugMode(); - $super_admin_mode = $this->Application->RecallVar('super_admin'); - ksort($section_data['children'], SORT_NUMERIC); foreach ($section_data['children'] as $section_name) { - $section_data =& $sections_helper->getSectionData($section_name); - - if (isset($section_data['show_mode']) && is_numeric($section_data['show_mode'])) { - $show_mode = $section_data['show_mode']; - // if super admin section -> show in super admin mode & debug mode - $show_section = $show_mode == smNORMAL || ((($show_mode & smSUPER_ADMIN) == smSUPER_ADMIN) && ($super_admin_mode || $debug_mode)); - if (!$show_section) { - // if section is in debug mode only && debug mode -> show - $show_section = (($show_mode & smDEBUG) == smDEBUG) && $debug_mode; - } - if (!$show_section) { - continue; - } + if (!$sections_helper->sectionVisible($section_name)) { + continue; } $params['section_name'] = $section_name; @@ -251,29 +239,17 @@ return ''; } - $debug_mode = $this->Application->isDebugMode(); - $super_admin_mode = $this->Application->RecallVar('super_admin'); - ksort($section_data['children'], SORT_NUMERIC); foreach ($section_data['children'] as $section_name) { $params['section_name'] = $section_name; $section_data =& $sections_helper->getSectionData($section_name); - $section_data['debug_only'] = 0; - if (isset($section_data['show_mode']) && is_numeric($section_data['show_mode'])) { + if (!$sections_helper->sectionVisible($section_name)) { + continue; + } + else { $show_mode = $section_data['show_mode']; - // if super admin section -> show in super admin mode & debug mode - $show_section = $show_mode == smNORMAL || ((($show_mode & smSUPER_ADMIN) == smSUPER_ADMIN) && ($super_admin_mode || $debug_mode)); - if (!$show_section) { - // if section is in debug mode only && debug mode -> show - $show_section = (($show_mode & smDEBUG) == smDEBUG) && $debug_mode; - } - if (!$show_section) { - continue; - } - if ($show_mode == smDEBUG || $show_mode == smSUPER_ADMIN) { - $section_data['debug_only'] = 1; - } + $section_data['debug_only'] = ($show_mode == smDEBUG) || ($show_mode == smSUPER_ADMIN) ? 1 : 0; } if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {