allow themes to mess with the navbar contents without a custom template. It's done as a callback using a transient plugin hook.

For instance to get rid of the notifications link:

insert_hook('nav','strip_notify');

function strip_notify($a,&$b) {
    unset($b['nav']['notifications']);
}
This commit is contained in:
friendica
2013-11-28 20:17:07 -08:00
parent 8cd9a2c3a9
commit 7536ed6e44
3 changed files with 42 additions and 5 deletions

View File

@@ -201,16 +201,19 @@ EOT;
if($banner === false)
$banner = 'red';
$x = array('nav' => $nav, 'usermenu' => $userinfo );
call_hooks('nav', $x);
$tpl = get_markup_template('nav.tpl');
$a->page['nav'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$langselector' => ((get_config('system','select_language')) ? lang_selector() : ''),
'$sitelocation' => $sitelocation,
'$nav' => $nav,
'$nav' => $x['nav'],
'$banner' => $banner,
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $userinfo,
'$userinfo' => $x['usermenu'],
'$localuser' => local_user(),
'$sel' => $a->nav_sel,
'$apps' => $a->get_apps(),