XoopsCore25 icon indicating copy to clipboard operation
XoopsCore25 copied to clipboard

Add .tpl extension option for module_index help file

Open zyspec opened this issue 8 years ago • 0 comments

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);
}

zyspec avatar May 15 '17 17:05 zyspec