diff options
author | redmatrix <git@macgirvin.com> | 2016-04-05 22:43:15 +1000 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-04-05 22:43:15 +1000 |
commit | ec41170121fc364b7d7394080c29f646720ad923 (patch) | |
tree | 6325564a53cb0b5237401293dc819c14ece88d97 /include | |
parent | 01ad485f6517caba49b1917818ceaa477e6cc846 (diff) | |
parent | 0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f (diff) | |
download | volse-hubzilla-ec41170121fc364b7d7394080c29f646720ad923.tar.gz volse-hubzilla-ec41170121fc364b7d7394080c29f646720ad923.tar.bz2 volse-hubzilla-ec41170121fc364b7d7394080c29f646720ad923.zip |
Merge pull request #338 from anaqreon/contextual-help
Contextual help
Diffstat (limited to 'include')
-rw-r--r-- | include/nav.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/nav.php b/include/nav.php index 201882fd1..4bcef4425 100644 --- a/include/nav.php +++ b/include/nav.php @@ -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'); |