Index: trunk/kernel/units/help/help_tag_processor.php =================================================================== diff -u -N -r4903 -r6093 --- trunk/kernel/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 4903) +++ trunk/kernel/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 6093) @@ -23,28 +23,32 @@ return parent::SectionTitle($params); } - function ShowHelp($params) + function getModule() { $module = $this->Application->GetVar('h_module'); - if (!$module) $module = $this->Application->RecallVar('module'); + if (!$module) { + $module = $this->Application->RecallVar('module'); + } + return $module; + } + + function ShowHelp($params) + { + $module = $this->getModule(); $module = explode(':', $module); $module = $module[0]; $title_preset = $this->Application->GetVar('h_title_preset'); - $sql = 'SELECT Path FROM '.TABLE_PREFIX.'Modules WHERE LOWER(Name)='.$this->Conn->qstr( strtolower($module) ); - $module_path = $this->Conn->GetOne($sql); - + $module_path = $this->Application->findModule('Name', $module, 'Path'); $help_file = FULL_PATH.'/'.$module_path.'module_help/'.$title_preset.'.txt'; - if( $this->Application->isDebugMode() && constOn('DBG_EDIT_HELP') ) - { + if ($this->Application->isDebugMode() && constOn('DBG_EDIT_HELP')) { global $debugger; $ret = 'Help file: '.$debugger->getLocalFile($help_file).'
'; } - else - { + else { $ret = ''; } @@ -85,6 +89,19 @@ if(!$icon) $icon = getArrayValue($params,'default_icon'); return $icon; } + + /** + * Returns templates path for module, which is gathered from prefix module + * + * @param Array $params + * @return string + * @author Alex + */ + function ModulePath($params) + { + $module_folder = trim( $this->Application->findModule('Name', $this->getModule(), 'Path'), '/'); + return '../../'.$module_folder.'/admin_templates/'; + } } ?> \ No newline at end of file