7 * Build page header and site navigation bars
11 if(!(x($a->page,'nav')))
15 * Placeholder div for popup panel
18 $a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
22 * Our network is distributed, and as you visit friends some of the
23 * sites look exactly the same - it isn't always easy to know where you are.
24 * Display the current site location as a navigation aid.
28 $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
30 $a->page['nav'] .= '<div id="site-location">' . $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ) . '</div>';
34 * Display login or logout
38 $a->page['nav'] .= '<a id="nav-logout-link" class="nav-link" href="logout">' . t('Logout') . "</a>\r\n";
41 $a->page['nav'] .= '<a id="nav-login-link" class="nav-login-link';
42 if ($a->module == 'login') { $a->page['nav'] .= ' nav-selected'; }
44 $a->page['nav'] .= '" href="login">' . t('Login') . "</a>\r\n";
47 $a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n";
50 * "Home" should also take you home from an authenticated remote profile connection
53 $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
55 if(($a->module != 'home') && (! (local_user())))
56 $a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="' . $homelink . '">' . t('Home') . "</a>\r\n";
59 if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
60 $a->page['nav'] .= '<a id="nav-register-link" class="nav-commlink" href="register" >'
61 . t('Register') . "</a>\r\n";
63 if(strlen($a->apps)) {
64 $a->page['nav'] .= '<a id="nav-apps-link" class="nav-link" href="apps">' . t('Apps') . "</a>\r\n";
67 $a->page['nav'] .= '<a id="nav-search-link" class="nav-link" href="search">' . t('Search') . "</a>\r\n";
69 $gdirpath = 'directory';
71 if(strlen(get_config('system','singleuser'))) {
72 $gdir = dirname(get_config('system','directory_submit_url'));
77 $a->page['nav'] .= '<a id="nav-directory-link" class="nav-link" href="' . $gdirpath . '">' . t('Directory') . "</a>\r\n";
81 * The following nav links are only show to logged in users
87 $a->page['nav'] .= '<a id="nav-network-link" class="nav-commlink" href="network">' . t('Network')
88 . '</a><span id="net-update" class="nav-ajax-left"></span>' . "\r\n";
90 $a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="profile/' . $a->user['nickname'] . '">'
91 . t('Home') . '</a><span id="home-update" class="nav-ajax-left"></span>' . "\r\n";
93 /* only show friend requests for normal pages. Other page types have automatic friendship. */
95 if($_SESSION['page_flags'] == PAGE_NORMAL) {
96 $a->page['nav'] .= '<a id="nav-notify-link" class="nav-commlink" href="notifications">' . t('Notifications')
97 . '</a><span id="notify-update" class="nav-ajax-left"></span>' . "\r\n";
100 $a->page['nav'] .= '<a id="nav-messages-link" class="nav-commlink" href="message">' . t('Messages')
101 . '</a><span id="mail-update" class="nav-ajax-left"></span>' . "\r\n";
103 if(is_array($a->identities) && count($a->identities) > 1) {
104 $a->page['nav'] .= '<a id="nav-manage-link" class="nav-commlink" href="manage">' . t('Manage') . '</a>' . "\r\n";
107 $a->page['nav'] .= '<a id="nav-settings-link" class="nav-link" href="settings">' . t('Settings') . "</a>\r\n";
109 $a->page['nav'] .= '<a id="nav-profiles-link" class="nav-link" href="profiles">' . t('Profiles') . "</a>\r\n";
111 $a->page['nav'] .= '<a id="nav-contacts-link" class="nav-link" href="contacts">' . t('Contacts') . "</a>\r\n";
116 $a->page['nav'] .= "</span>\r\n<span id=\"nav-end\"></span>\r\n";
120 * Provide a banner/logo/whatever
124 $banner = get_config('system','banner');
126 if($banner === false)
127 $banner .= '<a href="http://friendika.com"><img id="logo-img" src="images/friendika-32.png" alt="logo" /></a><span id="logo-text"><a href="http://friendika.com">Friendika</a></span>';
130 $a->page['nav'] .= '<span id="banner">' . $banner . '</span>';
132 call_hooks('page_header', $a->page['nav']);