]> git.mxchange.org Git - friendica.git/blobdiff - include/nav.php
begin the name change
[friendica.git] / include / nav.php
index caed9453ae5db2986469d6f0bac1b7e4340b77af..62a8a6d1146f70acb947cd9c1d6de8fde4589e3d 100644 (file)
@@ -37,8 +37,26 @@ function nav(&$a) {
         * Display login or logout
         */
 
+       $nav['usermenu']=array();
+       $userinfo = null;
+
        if(local_user()) {
                $nav['logout'] = Array('logout',t('Logout'), "", t('End this session'));
+               
+               // user menu
+               $nav['usermenu'][] = Array('profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations'));
+               $nav['usermenu'][] = Array('profile/' . $a->user['nickname']. '?tab=profile', t('Profile'), "", t('Your profile page'));
+               $nav['usermenu'][] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos'));
+               $nav['usermenu'][] = Array('events/', t('Events'), "", t('Your events'));
+               $nav['usermenu'][] = Array('notes/', t('Personal notes'), "", t('Your personal photos'));
+               
+               // user info
+               $r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
+               $userinfo = array(
+                       'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"),
+                       'name' => $a->user['username'],
+               );
+               
        }
        else {
                $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'selected':''), t('Sign in'));
@@ -63,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'));
@@ -96,7 +114,9 @@ function nav(&$a) {
                /* only show friend requests for normal pages. Other page types have automatic friendship. */
 
                if($_SESSION['page_flags'] == PAGE_NORMAL) {
-                       $nav['notifications'] = array('notifications',  t('Notifications'), "", t('Friend requests'));
+                       $nav['introductions'] = array('notifications/intros',   t('Introductions'), "", t('Friend Requests'));
+                       $nav['notifications'] = array('notifications',  t('Notifications'), "", t('Notifications'));
+
                }
 
                $nav['messages'] = array('message', t('Messages'), "", t('Private mail'));
@@ -127,7 +147,7 @@ function nav(&$a) {
        $banner = get_config('system','banner');
 
        if($banner === false) 
-               $banner .= '<a href="http://project.friendika.com"><img id="logo-img" src="images/friendika-32.png" alt="logo" /></a><span id="logo-text"><a href="http://project.friendika.com">Friendika</a></span>';
+               $banner .= '<a href="http://project.friendika.com"><img id="logo-img" src="images/friendika-32.png" alt="logo" /></a><span id="logo-text"><a href="http://project.friendika.com">Friendica</a></span>';
 
 
        $tpl = get_markup_template('nav.tpl');
@@ -137,8 +157,32 @@ function nav(&$a) {
                '$sitelocation' => $sitelocation,
                '$nav' => $nav,
                '$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,
+               'introductions' => null,
+               'notifications' => null,
+               'messages'              => null,
+               'directory'     => null,
+               'settings'              => null,
+               'contacts'              => null,
+       );
+       $a->nav_sel[$item] = 'selected';
 }