Merge pull request #338 from anaqreon/contextual-help

Contextual help
This commit is contained in:
redmatrix
2016-04-05 22:43:15 +10:00
9 changed files with 190 additions and 5 deletions

View File

@@ -149,9 +149,19 @@ EOT;
$help_url = z_root() . '/help?f=&cmd=' . App::$cmd;
if(! get_config('system','hide_help'))
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'),'help_nav_btn');
if(! get_config('system','hide_help')) {
require_once('mod/help.php');
$context_help = load_doc_file('doc/context/' . $a->cmd . '/help.html');
$parentdir = dirname($a->cmd);
while (! $context_help && $parentdir !== '.') {
$context_help = load_doc_file('doc/context/' . $parentdir . '/help.html');
$parentdir = dirname($parentdir);
}
if (! $context_help ) {
$context_help = '';
}
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'),'help_nav_btn',$context_help);
}
if(! UNO)
$nav['apps'] = array('apps', t('Apps'), "", t('Applications, utilities, links, games'),'apps_nav_btn');