Пример #1
0
function getHelpFileContent(Web &$w, $module, $submodule, $action)
{
    $p = HelpLib::getHelpFilePath($w, $module, $submodule, $action);
    if ($p) {
        return file_get_contents($p);
    }
    return null;
}
Пример #2
0
/**
* Show a Table of Contents by searching
* through all modules for the file
* ./help/<module>_toc.help
*
* @param \Web $w
*/
function toc_GET(Web $w)
{
    foreach ($w->modules() as $h) {
        $p = HelpLib::getHelpFilePath($w, $h, null, $h . "_toc");
        if ($p) {
            $tocs[$h] = $p;
        }
    }
    foreach ($tocs as $module => $path) {
        if ($w->Auth->allowed($module . '/index')) {
            $content = file_get_contents($path);
            $title = HelpLib::extractTitle($content);
            $ul[] = Html::a(WEBROOT . '/help/view/' . $module . '/' . $module . '_toc', $title ? $title : ucfirst($module));
        }
    }
    $w->ctx("ul", Html::ul($ul));
}