aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrew Manning <andrew@reticu.li>2016-03-26 14:31:41 -0400
committerAndrew Manning <andrew@reticu.li>2016-03-26 14:31:41 -0400
commitc25ef1d9a86193eb5b96484d9bfaae0bd4166653 (patch)
tree07f5cc158af2394f29a4273dab504d64e26946f4 /include
parent661b0084f3d819532c4c97c840a189d7e0c7a93d (diff)
downloadvolse-hubzilla-c25ef1d9a86193eb5b96484d9bfaae0bd4166653.tar.gz
volse-hubzilla-c25ef1d9a86193eb5b96484d9bfaae0bd4166653.tar.bz2
volse-hubzilla-c25ef1d9a86193eb5b96484d9bfaae0bd4166653.zip
Search docs/context/ hierarchically for help.html files to reduce redundancy
Diffstat (limited to 'include')
-rw-r--r--include/nav.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/nav.php b/include/nav.php
index c7483deef..d449718b8 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -154,8 +154,13 @@ EOT;
if(! get_config('system','hide_help')) {
require_once('mod/help.php');
$context_help = load_doc_file('doc/context/' . $a->cmd . '/help.html');
- if (! $context_help) {
- $context_help = '';
+ $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);
}