diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-04-25 06:17:39 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-04-25 06:17:39 -0400 |
commit | f027bf81cdaddee5d6474199c1b7adce50e6e07d (patch) | |
tree | 23fd281c6627b7adc1421fcddf939e6447a4d18b /include | |
parent | f3eae7132f8c104db2197858208f16a5792507be (diff) | |
parent | a9d926886e6f8ed389031791799ffd352b8cb651 (diff) | |
download | volse-hubzilla-f027bf81cdaddee5d6474199c1b7adce50e6e07d.tar.gz volse-hubzilla-f027bf81cdaddee5d6474199c1b7adce50e6e07d.tar.bz2 volse-hubzilla-f027bf81cdaddee5d6474199c1b7adce50e6e07d.zip |
Merge remote-tracking branch 'upstream/dev' into help-content
Diffstat (limited to 'include')
-rw-r--r-- | include/nav.php | 17 | ||||
-rwxr-xr-x | include/plugin.php | 15 |
2 files changed, 17 insertions, 15 deletions
diff --git a/include/nav.php b/include/nav.php index c59aaae37..70faec598 100644 --- a/include/nav.php +++ b/include/nav.php @@ -143,19 +143,17 @@ EOT; if((App::$module != 'home') && (! (local_channel()))) $nav['home'] = array($homelink, t('Home'), "", t('Home Page'),'home_nav_btn'); - if((App::$config['system']['register_policy'] == REGISTER_OPEN) && (! local_channel()) && (! remote_channel())) $nav['register'] = array('register',t('Register'), "", t('Create an account'),'register_nav_btn'); - $help_url = z_root() . '/help?f=&cmd=' . App::$cmd; - if(! get_config('system','hide_help')) { + $help_url = z_root() . '/help?f=&cmd=' . App::$cmd; $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 + //point 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); @@ -166,7 +164,6 @@ EOT; $nav['search'] = array('search', t('Search'), "", t('Search site @name, #tag, ?docs, content')); - $nav['directory'] = array('directory', t('Directory'), "", t('Channel Directory'),'directory_nav_btn'); @@ -240,16 +237,10 @@ $powered_by = ''; // $powered_by = '<strong>red<img class="smiley" src="' . z_root() . '/images/rm-16.png" alt="r#" />matrix</strong>'; - $tpl = get_markup_template('nav_header.tpl'); - - App::$page['htmlhead'] .= replace_macros($tpl, array( - '$enable_context_help' => $enable_context_help - )); - $tpl = get_markup_template('nav.tpl'); App::$page['nav'] .= replace_macros($tpl, array( - '$baseurl' => z_root(), + '$baseurl' => z_root(), '$sitelocation' => $sitelocation, '$nav' => $x['nav'], '$banner' => $banner, @@ -260,7 +251,7 @@ $powered_by = ''; '$powered_by' => $powered_by, '$help' => t('@name, #tag, ?doc, content'), '$pleasewait' => t('Please wait...') - )); + )); call_hooks('page_header', App::$page['nav']); } diff --git a/include/plugin.php b/include/plugin.php index 80e3ae20e..8dd67bb0c 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -282,10 +282,21 @@ function call_hooks($name, &$data = null) { $a = 0; if((is_array(App::$hooks)) && (array_key_exists($name, App::$hooks))) { foreach(App::$hooks[$name] as $hook) { + $origfn = $hook[1]; if($hook[0]) @include_once($hook[0]); + if(preg_match('|^a:[0-9]+:{.*}$|s', $hook[1])) { + $hook[1] = unserialize($hook[1]); + } + elseif(strpos($hook[1],'::')) { + // We shouldn't need to do this, but it appears that PHP + // isn't able to directly execute a string variable with a class + // method in the manner we are attempting it, so we'll + // turn it into an array. + $hook[1] = explode('::',$hook[1]); + } - if(function_exists($hook[1])) { + if(is_callable($hook[1])) { $func = $hook[1]; if($hook[3]) $func($data); @@ -295,7 +306,7 @@ function call_hooks($name, &$data = null) { q("DELETE FROM hook WHERE hook = '%s' AND file = '%s' AND function = '%s'", dbesc($name), dbesc($hook[0]), - dbesc($hook[1]) + dbesc($origfn) ); } } |