Index: branches/unlabeled/unlabeled-1.11.2/core/units/general/helpers/sections_helper.php =================================================================== diff -u -r7046 -r7082 --- branches/unlabeled/unlabeled-1.11.2/core/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 7046) +++ branches/unlabeled/unlabeled-1.11.2/core/units/general/helpers/sections_helper.php (.../sections_helper.php) (revision 7082) @@ -93,13 +93,13 @@ $this->Tree[$section_name] = array_merge_recursive2($current_data, $section_params); } } - - // 2. apply section ajustments + + // 2. apply section ajustments foreach ($prefixes as $prefix) { $config =& $unit_config_reader->configData[$prefix]; $section_ajustments = getArrayValue($config, 'SectionAdjustments'); if (!$section_ajustments) continue; - + foreach ($section_ajustments as $section_name => $ajustment_params) { if (is_array($ajustment_params)) { $this->Tree[$section_name] = array_merge_recursive2($this->Tree[$section_name], $ajustment_params); @@ -110,8 +110,8 @@ } } } - - // 3. + + // 3. foreach ($this->Tree as $section_name => $section_params) { // 3.1. update parent -> children references $this->Tree[ $section_params['parent'] ]['children'][ "{$section_params['priority']}" ] = $section_name; @@ -120,12 +120,24 @@ // if this is tab, then mark parent section as TabOnly $this->Tree[ $section_params['parent'] ]['tabs_only'] = true; } - + // 3.2. process icons here, because they also can be ajusted if (isset($section_params['icon']) && preg_match('/([^:]+):(.*)/', $section_params['icon'], $regs)) { $this->Tree[$section_name]['icon'] = $regs[2]; $this->Tree[$section_name]['icon_module'] = $regs[1]; + $module_folder = trim( $this->Application->findModule('Name', $regs[1], 'Path'), '/'); + if ($module_folder == '') $module_folder = 'core'; } + else { + $module_folder = $this->Application->getUnitOption($section_params['SectionPrefix'], 'ModuleFolder'); + } + + // this is to display HELP icon instead of missing one.. can be replaced with some other icon to draw attention + $icon_file = $module_folder.'/admin_templates/img/icons/icon24_'.$this->Tree[$section_name]['icon']; + if (!file_exists(FULL_PATH.'/'.$icon_file.'.gif')) { + $this->Tree[$section_name]['icon'] = 'help'; + $this->Tree[$section_name]['icon_module'] = 'core'; + } } $this->Application->HandleEvent( new kEvent('adm:OnAfterBuildTree') );