aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-06 05:44:40 -0700
committerredmatrix <git@macgirvin.com>2016-04-06 05:44:40 -0700
commita20ef706fd6e7011a0dc95df71222b9a5871e3b3 (patch)
tree8491804247bf6218d37cae33dd157ebe4ba966c4
parentadad8f2ebc026b759710c3f5843460a29ee08fe4 (diff)
downloadvolse-hubzilla-a20ef706fd6e7011a0dc95df71222b9a5871e3b3.tar.gz
volse-hubzilla-a20ef706fd6e7011a0dc95df71222b9a5871e3b3.tar.bz2
volse-hubzilla-a20ef706fd6e7011a0dc95df71222b9a5871e3b3.zip
issue #340
-rw-r--r--include/nav.php10
-rw-r--r--mod/help.php14
2 files changed, 15 insertions, 9 deletions
diff --git a/include/nav.php b/include/nav.php
index e8c1a2e92..541ab3aed 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -151,15 +151,7 @@ EOT;
if(! get_config('system','hide_help')) {
require_once('mod/help.php');
- $context_help = load_doc_file('doc/context/' . App::$cmd . '/help.html');
- $parentdir = dirname(App::$cmd);
- while (! $context_help && $parentdir !== '.') {
- $context_help = load_doc_file('doc/context/' . $parentdir . '/help.html');
- $parentdir = dirname($parentdir);
- }
- if (! $context_help ) {
- $context_help = '';
- }
+ $context_help = load_context_help();
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'),'help_nav_btn',$context_help);
}
diff --git a/mod/help.php b/mod/help.php
index a266dbf7f..fb0339cd9 100644
--- a/mod/help.php
+++ b/mod/help.php
@@ -84,7 +84,21 @@ function doc_rank_sort($s1,$s2) {
}
+function load_context_help() {
+
+ $path = App::$cmd;
+ $args = App::$argv;
+
+ while($path) {
+ $context_help = load_doc_file('doc/context/' . $path . '/help.html');
+ if($context_help)
+ break;
+ array_pop($args);
+ $path = implode($args,'/');
+ }
+ return $context_help;
+}
function store_doc_file($s) {