Index: branches/RC/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r8953 -r9046 --- branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 8953) +++ branches/RC/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 9046) @@ -192,6 +192,7 @@ $sections_helper =& $this->Application->recallObject('SectionsHelper'); /* @var $sections_helper kSectionsHelper */ + $section_data =& $sections_helper->getSectionData($section); if (isset($params['parent']) && $params['parent']) { @@ -216,12 +217,7 @@ break; case 'perm_section': - if (isset($section_data['perm_prefix']) && $section_data['perm_prefix']) { - $res = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection'); - } - else { - $res = $section; - } + $res = $sections_helper->getPermSection($section); break; default: @@ -244,6 +240,11 @@ $sections_helper =& $this->Application->recallObject('SectionsHelper'); /* @var $sections_helper kSectionsHelper */ + + if (isset($params['use_first_child']) && $params['use_first_child']) { + $section_name = $sections_helper->getFirstChild($section_name, true); + } + $section_data =& $sections_helper->getSectionData($section_name); $params['name'] = $this->SelectParam($params, 'name,render_as,block'); @@ -274,6 +275,8 @@ } $sections_helper =& $this->Application->recallObject('SectionsHelper'); + /* @var $sections_helper kSectionsHelper */ + $section_data =& $sections_helper->getSectionData($section_name); $params['name'] = $this->SelectParam($params, 'name,render_as,block'); @@ -308,12 +311,8 @@ ksort($section_data['children'], SORT_NUMERIC); foreach ($section_data['children'] as $priority => $section_name) { // if only tabs in this section & none of them have permission, then skip section too - $section_data =& $sections_helper->getSectionData($section_name); - if ($section_data && isset($section_data['perm_prefix'])) { - // this section uses other section permissions - $section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection'); - } + $section_name = $sections_helper->getPermSection($section_name); $perm_status = $this->Application->CheckPermission($section_name.'.view', 1); if ($perm_status) { break; @@ -330,11 +329,7 @@ $section_data['is_tab'] = 1; } else { - if ($section_data && isset($section_data['perm_prefix'])) { - // this section uses other section permissions - $section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection'); - } - + $section_name = $sections_helper->getPermSection($section_name); if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue; } @@ -540,7 +535,7 @@ $params = array_merge_recursive2($default_params, $params); $main_processor =& $this->Application->recallObject('m_TagProcessor'); - return $main_processor->T($params); + return $main_processor->T($params); } function TimeFrame($params)