]> git.mxchange.org Git - friendica.git/blobdiff - include/nav.php
Merge remote-tracking branch 'friendika/master' into newui
[friendica.git] / include / nav.php
index bb1a5b2d814aabd42e1ca812fef790c241dc6157..b290a8da23ddeb0e7b24f58fccdc68a0b1003ae4 100644 (file)
@@ -81,7 +81,7 @@ function nav(&$a) {
        if(! get_config('system','hide_help'))
                $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));
 
-       if($a->apps)
+       if(count($a->apps)>0)
                $nav['apps'] = array('apps', t('Apps'), "", t('Addon applications, utilities, games'));
 
        $nav['search'] = array('search', t('Search'), "", t('Search site content'));
@@ -157,8 +157,29 @@ function nav(&$a) {
                '$banner' =>  $banner,
                '$emptynotifications' => t('Nothing new here'),
                '$userinfo' => $userinfo,
+               '$sel' =>       $a->nav_sel,
+               '$apps' => $a->apps,
        ));
 
        call_hooks('page_header', $a->page['nav']);
+}
 
+/*
+ * Set a menu item in navbar as selected
+ * 
+ */
+function nav_set_selected($item){
+       $a = get_app();
+    $a->nav_sel = array(
+               'community'     => null,
+               'network'               => null,
+               'home'                  => null,
+               'profiles'              => null,
+               'notifications' => null,
+               'messages'              => null,
+               'directyory'    => null,
+               'settings'              => null,
+               'contacts'              => null,
+       );
+       $a->nav_sel[$item] = 'selected';
 }