XoopsCore25
XoopsCore25 copied to clipboard
Add .tpl extension option for module_index help file
Enhancement
To be consistent with other help file loading it would be beneficial to also allow a .tpl extension for the 'module_index' file too.
in ./modules/system/help.php (around line 105) change:
} else {
if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.html')) {
$helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.html');
} else {
$helpcontent = $module->getInfo('description');
$helpcontent = '<div id="non-modhelp">' . $helpcontent . '</div>';
}
$xoopsTpl->assign('helpcontent', $helpcontent);
}
to also allow for .tpl using:
} else {
if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.html')) {
$helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.html');
} elseif (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.tpl')) {
$helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.tpl');
} else {
$helpcontent = $module->getInfo('description');
$helpcontent = '<div id="non-modhelp">' . $helpcontent . '</div>';
}
$xoopsTpl->assign('helpcontent', $helpcontent);
}