Search docs/context/ hierarchically for help.html files to reduce redundancy

This commit is contained in:
Andrew Manning
2016-03-26 14:31:41 -04:00
parent 661b0084f3
commit c25ef1d9a8
6 changed files with 27 additions and 42 deletions

View File

@@ -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);
}