Index: trunk/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r4457 -r4464 --- trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4457) +++ trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4464) @@ -1,9 +1,9 @@ Application->ProcessParsedTag('m', 'Phrase', $params); } - + /** * Returns section icon with #section# keyword replaced with current section * @@ -41,7 +41,7 @@ { return replaceModuleSection($params['icon']); } - + /** * Save module & section once passed in REQUEST for future use * @@ -53,7 +53,7 @@ $this->Application->LinkVar('module'); $this->Application->LinkVar('section'); } - + /** * Saves all required data for popups to return to it's parent window * @@ -65,7 +65,7 @@ $this->Application->LinkVar('dst_field'); // field to set value choosed in selector $this->Application->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup) } - + /** * Allows to detect if current template is one of listed ones * @@ -78,7 +78,7 @@ $t = $this->Application->GetVar('t'); return in_array($t, $templates) ? 1 : 0; } - + /** * Save return script in cases, when old sections are opened from new sections * @@ -90,10 +90,10 @@ $url = str_replace($this->Application->BaseURL(), '', $this->Application->ProcessParsedTag('m', 'Link', $params) ); $url = explode('?', $url, 2); $url = 'save_redirect.php?'.$url[1].'&do='.$url[0]; - + $this->Application->StoreVar('ReturnScript', $url); } - + /** * Redirects to correct next import step template based on import script data * @@ -105,14 +105,14 @@ if ($import_id) { // redirect forward to step3 (import parameters coosing) $this->Application->StoreVar('ImportScriptID', $import_id); - + $sql = 'SELECT * FROM '.TABLE_PREFIX.'ImportScripts WHERE is_id = '.$import_id; - + $db =& $this->Application->GetADODBConnection(); $is_params = $db->GetRow($sql); - + if ($is_params['is_type'] == 'db') { $this->Application->Redirect('', null, '', 'import/step3.php'); } @@ -132,7 +132,7 @@ $this->Application->Redirect('', null, '', 'import/step2.php'); } } - + /** * Returns version of module by name * @@ -144,7 +144,7 @@ $module_info = $this->Application->findModule('Name', $params['module']); return $module_info['Version']; } - + /** * Builds xml for tree in left frame in admin * @@ -159,44 +159,44 @@ $config =& $unit_config_reader->configData[$prefix]; $sections = getArrayValue($config, 'Sections'); if (!$sections) continue; - - echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections
'; - + +// echo 'Prefix: ['.$prefix.'] has ['.count($sections).'] sections
'; + foreach ($sections as $section_name => $section_params) { // we could also skip not allowed sections here in future if ($section_params['type'] != stTREE) continue; $section_params['SectionPrefix'] = $prefix; $section_params['url']['m_opener'] = 'r'; $section_params['url']['section'] = $section_name; - + if (!isset($section_params['url']['module'])) { $module = $this->Application->findModule('Path', $config['ModuleFolder'].'/'); $section_params['url']['module'] = $module['Name']; } - + if (!isset($section_params['url']['t'])) { $section_params['url']['t'] = 'index'; } - + $current_data = isset($this->Tree[$section_name]) ? $this->Tree[$section_name] : Array(); $this->Tree[$section_name] = array_merge_recursive2($current_data, $section_params); - + $this->Tree[ $section_params['parent'] ]['children'][ "{$section_params['priority']}" ] = $section_name; } - + } - + // return '
'.print_r($this->Tree, true).'
'; - } - - + } + + function DrawTree($params) { // when processings, then sort children by priority (key of children array) $ret = ''; $section_name = $params['section_name']; $params['name'] = $this->SelectParam($params, 'name,render_as,block'); - + $section_data =& $this->Tree[$section_name]; $template = $section_data['url']['t']; unset($section_data['url']['t']); @@ -205,41 +205,53 @@ if (!isset($section_data['children'])) { return $ret; } - + ksort($section_data['children'], SORT_NUMERIC); foreach ($section_data['children'] as $section_name) { $params['section_name'] = $section_name; $ret .= $this->DrawTree($params); } - + return $ret; } - + function PrintSections($params) { // when processings, then sort children by priority (key of children array) $ret = ''; $section_name = $params['section_name']; $section_data =& $this->Tree[$section_name]; $params['name'] = $this->SelectParam($params, 'name,render_as,block'); - if (!isset($section_data['children'])) { return ''; } - + ksort($section_data['children'], SORT_NUMERIC); foreach ($section_data['children'] as $section_name) { $params['section_name'] = $section_name; $section_data =& $this->Tree[$section_name]; + $params['children_count'] = count($section_data['children']); $template = $section_data['url']['t']; unset($section_data['url']['t']); - + $section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']); + + if (getArrayValue($section_data, 'late_load')) { + $late_load = getArrayValue($section_data, 'late_load'); + $t = $late_load['t']; + unset($late_load['t']); + $section_data['late_load'] = $this->Application->HREF($t, '', $late_load); + $params['children_count'] = 99; + } + else { + $section_data['late_load'] = ''; + } + $ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) ); $params['section_name'] = $section_name; } - - return $ret; + + return preg_replace("/\r\n|\n/", '', $ret); } }