Index: branches/5.1.x/core/units/helpers/sections_helper.php =================================================================== diff -u -N -r13086 -r13113 --- branches/5.1.x/core/units/helpers/sections_helper.php (.../sections_helper.php) (revision 13086) +++ branches/5.1.x/core/units/helpers/sections_helper.php (.../sections_helper.php) (revision 13113) @@ -1,6 +1,6 @@ Tree[$section_name]['icon'] = $regs[2]; $this->Tree[$section_name]['icon_module'] = $regs[1]; // set "icon_module" used in "combined_header" block $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'); if (!array_key_exists('icon_module', $section_params)) { - $this->Tree[$section_name]['icon_module'] = $module_folder; // set "icon_module" used in "combined_header" block + // set "icon_module" used in "combined_header" block + $this->Tree[$section_name]['icon_module'] = $this->Application->findModule('Path', $module_folder . '/', 'Name'); } } // 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']; - /*$core_file = FULL_PATH.'/core/admin_templates/img/icons/icon24_' . $this->Tree[$section_name]['icon'].'.gif'; - if ($module_folder != 'core' && file_exists($core_file) && file_exists(FULL_PATH.'/'.$icon_file.'.gif')) { - if (crc32(file_get_contents($core_file)) == crc32(file_get_contents(FULL_PATH.'/'.$icon_file.'.gif'))) { + /*$core_file = FULL_PATH.'/core/admin_templates/img/icons/icon24_' . $this->Tree[$section_name]['icon'].'.png'; + if ($module_folder != 'core' && file_exists($core_file) && file_exists(FULL_PATH.'/'.$icon_file.'.png')) { + if (crc32(file_get_contents($core_file)) == crc32(file_get_contents(FULL_PATH.'/'.$icon_file.'.png'))) { trigger_error('Section "' . $section_name . '" uses icon copy from "Core" module', E_USER_NOTICE); } }*/ -// if (!file_exists(FULL_PATH.'/'.$icon_file.'.png')) { -// $this->Tree[$section_name]['icon'] = 'help'; -// $this->Tree[$section_name]['icon_module'] = 'core'; -// } + if (!file_exists(FULL_PATH . '/' . $icon_file . '.png')) { + $this->Tree[$section_name]['icon'] = 'help'; + $this->Tree[$section_name]['icon_module'] = 'core'; + } } + $this->Application->HandleEvent( new kEvent('adm:OnAfterBuildTree') ); if (isset($this->Application->Memcached)) {