From 7594796ee11c0b245d02d145868a13ac3d84ebfc Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Tue, 19 Apr 2016 05:52:16 -0400 Subject: Try toggling context help using onclick attribute --- include/nav.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/nav.php') diff --git a/include/nav.php b/include/nav.php index 541ab3aed..b088d171d 100644 --- a/include/nav.php +++ b/include/nav.php @@ -152,7 +152,8 @@ EOT; if(! get_config('system','hide_help')) { require_once('mod/help.php'); $context_help = load_context_help(); - $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'),'help_nav_btn',$context_help); + $enable_context_help = get_config('system','enable_context_help') || 0; + $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'),'help_nav_btn',$context_help,$enable_context_help); } if(! UNO) @@ -248,7 +249,7 @@ $powered_by = ''; '$powered_by' => $powered_by, '$help' => t('@name, #tag, ?doc, content'), '$pleasewait' => t('Please wait...') - )); + )); call_hooks('page_header', App::$page['nav']); } -- cgit v1.2.3 From 82de68c3d3ff931fad4ddb48a69cf62576a5397a Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Thu, 21 Apr 2016 06:41:55 -0400 Subject: Added admin/site setting that toggles context help panel. If disabled, original help menu button behavior is restored. --- include/nav.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/nav.php') diff --git a/include/nav.php b/include/nav.php index ef5b5df45..9d8fdc30e 100644 --- a/include/nav.php +++ b/include/nav.php @@ -235,6 +235,12 @@ $powered_by = ''; // $powered_by = 'redr#matrix'; + $tpl = get_markup_template('nav_header.tpl'); + + App::$page['htmlhead'] .= replace_macros($tpl, array( + '$enable_context_help' => ((intval(get_config('system','enable_context_help')) === 1 || get_config('system','enable_context_help') === false) ? true : false) + )); + $tpl = get_markup_template('nav.tpl'); App::$page['nav'] .= replace_macros($tpl, array( -- cgit v1.2.3 From d7f4bfedd5164596504d17b1ef4b8597a1304d98 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 21 Apr 2016 23:03:09 +0200 Subject: some fixes for contextual help and disable transition animation for now - it looked really wired because main moved with a different speed than help-content and help-content can not be displayed under the panel as it is implemented now. --- include/nav.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'include/nav.php') diff --git a/include/nav.php b/include/nav.php index 9d8fdc30e..c59aaae37 100644 --- a/include/nav.php +++ b/include/nav.php @@ -150,10 +150,15 @@ EOT; $help_url = z_root() . '/help?f=&cmd=' . App::$cmd; if(! get_config('system','hide_help')) { - require_once('include/help.php'); - $context_help = load_context_help(); - $enable_context_help = get_config('system','enable_context_help') || 0; - $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'),'help_nav_btn',$context_help,$enable_context_help); + $context_help = ''; + $enable_context_help = ((intval(get_config('system','enable_context_help')) === 1 || get_config('system','enable_context_help') === false) ? true : false); + if($enable_context_help === true) { + require_once('include/help.php'); + $context_help = load_context_help(); + //direct directly to /help if $context_help is empty - this can be removed once we have context help for all modules + $enable_context_help = (($context_help) ? true : false); + } + $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'), 'help_nav_btn', $context_help, $enable_context_help); } if(! UNO) @@ -238,8 +243,8 @@ $powered_by = ''; $tpl = get_markup_template('nav_header.tpl'); App::$page['htmlhead'] .= replace_macros($tpl, array( - '$enable_context_help' => ((intval(get_config('system','enable_context_help')) === 1 || get_config('system','enable_context_help') === false) ? true : false) - )); + '$enable_context_help' => $enable_context_help + )); $tpl = get_markup_template('nav.tpl'); -- cgit v1.2.3