Index: trunk/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r6791 -r7391 --- trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 6791) +++ trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 7391) @@ -171,6 +171,7 @@ } $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'); @@ -208,16 +209,28 @@ return ''; } + $debug_mode = $this->Application->isDebugMode(); // cache this for performance 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); + if (!$debug_mode && isset($section_data['debug_only']) && $section_data['debug_only']) { + // don't show section for debug mode only without debug mode turned on + continue; + } 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) { + // 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'); + } + $perm_status = $this->Application->CheckPermission($section_name.'.view', 1); if ($perm_status) { break; @@ -233,8 +246,13 @@ $section_data['label'] = $folder_label; // use folder label in tree $section_data['is_tab'] = 1; } - elseif (!$this->Application->CheckPermission($section_name.'.view', 1)) { - continue; + 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'); + } + + if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue; } $params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0; @@ -346,7 +364,7 @@ foreach ($this->Application->ModuleInfo as $module_name => $module_info) { $prefix = $module_info['Var']; - if (in_array($prefix, $skip_prefixes) || !$this->Application->getUnitOption($prefix, 'CatalogItem')) continue; + if (in_array($prefix, $skip_prefixes) || !$this->Application->prefixRegistred($prefix) || !$this->Application->getUnitOption($prefix, 'CatalogItem')) continue; if ($prefix == 'm' && $replace_main) $prefix = 'c'; $label = $this->Application->getUnitOption($prefix, $params['title_property']); $block_params['title'] = $label; @@ -358,18 +376,18 @@ function FCKEditor($params) { - include_once(FULL_PATH.'/admin/editor/cmseditor/fckeditor.php'); + include_once(FULL_PATH.'/core/cmseditor/fckeditor.php'); $oFCKeditor = new FCKeditor($params['name']); - $oFCKeditor->BasePath = BASE_PATH.'/admin/editor/cmseditor/'; + $oFCKeditor->BasePath = BASE_PATH.'/core/cmseditor/'; $oFCKeditor->Width = $params['width'] ; $oFCKeditor->Height = $params['height'] ; $oFCKeditor->ToolbarSet = 'Advanced' ; $oFCKeditor->Value = '' ; $oFCKeditor->Config = Array( //'UserFilesPath' => $pathtoroot.'kernel/user_files', 'ProjectPath' => BASE_PATH.'/', - 'CustomConfigurationsPath' => $this->Application->BaseURL().'admin/editor/inp_fckconfig.js', - 'EditorAreaCSS' => $this->Application->BaseURL().'/themes/inportal_site/inc/inportal.css', //GetThemeCSS(), + 'CustomConfigurationsPath' => $this->Application->BaseURL().'core/cmseditor/inp_fckconfig.js', +// 'EditorAreaCSS' => $this->Application->BaseURL().'/themes/inportal_site/inc/inportal.css', //GetThemeCSS(), //'StylesXmlPath' => '../../inp_styles.xml', // 'Debug' => 1, 'Admin' => 1, @@ -393,7 +411,7 @@ unset($params['mode']); } - $params['t'] = 'item_selector/item_selector_'.$mode; + $params['t'] = 'in-portal/item_selector/item_selector_'.$mode; $default_params = Array('no_amp' => 1, 'pass' => 'all,'.$params['prefix']); unset($params['prefix']); @@ -500,10 +518,108 @@ * @param Array $params * @return int */ - function IsSSL($params) - { - return (PROTOCOL == 'https://')? 1 : 0; + function IsSSL($params) + { + return (PROTOCOL == 'https://')? 1 : 0; } + + function PrintColumns($params) + { + $picker_helper =& $this->Application->RecallObject('ColumnPickerHelper'); + $picker_helper->SetGridName($this->Application->GetLinkedVar('grid_name')); + /* @var $picker_helper kColumnPickerHelper */ + + $main_prefix = $this->Application->RecallVar('main_prefix'); + $cols = $picker_helper->LoadColumns($main_prefix); + + $o = ''; + if (isset($params['hidden']) && $params['hidden']) { + foreach ($cols['hidden_fields'] as $col) { + $title = $this->Application->Phrase($cols['titles'][$col]); + $o .= "