Index: trunk/kernel/units/admin/admin_tag_processor.php =================================================================== diff -u -r4684 -r4702 --- trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4684) +++ trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4702) @@ -125,17 +125,11 @@ } /** - * Builds xml for tree in left frame in admin + * Used in table form section drawing * * @param Array $params + * @return string */ - function BuildTree($params) - { - $sections_helper =& $this->Application->recallObject('SectionsHelper'); - $sections_helper->BuildTree(); - } - - function DrawTree($params) { static $deep_level = 0; @@ -191,6 +185,12 @@ return $ret; } + /** + * Used in XML drawing for tree + * + * @param Array $params + * @return string + */ function PrintSections($params) { // when processings, then sort children by priority (key of children array) @@ -212,6 +212,27 @@ foreach ($section_data['children'] as $section_name) { $params['section_name'] = $section_name; $section_data =& $sections_helper->getSectionData($section_name); + + if (isset($section_data['tabs_only']) && $section_data['tabs_only']) { + $perm_status = false; + $folder_label = $section_data['label']; + ksort($section_data['children'], SORT_NUMERIC); + foreach ($section_data['children'] as $priority => $section_name) { + $perm_status = $this->Application->CheckPermission($section_name.'.view', 1); + if ($perm_status) { + break; + } + } + if (!$perm_status) { + // no permission for all tabs -> don't display tree node either + continue; + } + + $params['section_name'] = $section_name; + $section_data =& $sections_helper->getSectionData($section_name); + $section_data['label'] = $folder_label; // use folder label in tree + } + $params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0; $template = $section_data['url']['t']; @@ -278,6 +299,33 @@ $ret = str_replace('
', '\n', $ret); return $ret; } + + /** + * Draws section tabs using block name passed + * + * @param Array $params + */ + function ListTabs($params) + { + $sections_helper =& $this->Application->recallObject('SectionsHelper'); + $section_data =& $sections_helper->getSectionData($params['section_name']); + + $ret = ''; + $block_params = Array('name' => $params['render_as']); + ksort($section_data['children'], SORT_NUMERIC); + foreach ($section_data['children'] as $priority => $section_name) { + if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue; + + $tab_data =& $sections_helper->getSectionData($section_name); + $block_params['t'] = $tab_data['url']['t']; + $block_params['title'] = $tab_data['label']; + $block_params['main_prefix'] = $section_data['SectionPrefix']; + $ret .= $this->Application->ParseBlock($block_params); + } + + + return $ret; + } } ?> \ No newline at end of file