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>' ;
19 $a->page['nav'] .= lang_selector();
23 * Our network is distributed, and as you visit friends some of the
24 * sites look exactly the same - it isn't always easy to know where you are.
25 * Display the current site location as a navigation aid.
29 $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
31 $a->page['nav'] .= '<div id="site-location">' . $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ) . '</div>';
35 * Display login or logout
39 $a->page['nav'] .= '<a id="nav-logout-link" class="nav-link" href="logout">' . t('Logout') . "</a>\r\n";
42 $a->page['nav'] .= '<a id="nav-login-link" class="nav-login-link';
43 if ($a->module == 'login') { $a->page['nav'] .= ' nav-selected'; }
45 $a->page['nav'] .= '" href="login">' . t('Login') . "</a>\r\n";
48 $a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n";
51 * "Home" should also take you home from an authenticated remote profile connection
54 $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
56 if(($a->module != 'home') && (! (local_user())))
57 $a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="' . $homelink . '">' . t('Home') . "</a>\r\n";
60 if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
61 $a->page['nav'] .= '<a id="nav-register-link" class="nav-commlink" href="register" >'
62 . t('Register') . "</a>\r\n";
64 if(strlen($a->apps)) {
65 $a->page['nav'] .= '<a id="nav-apps-link" class="nav-link" href="apps">' . t('Apps') . "</a>\r\n";
68 $a->page['nav'] .= '<a id="nav-search-link" class="nav-link" href="search">' . t('Search') . "</a>\r\n";
70 $gdirpath = 'directory';
72 if(strlen(get_config('system','singleuser'))) {
73 $gdir = dirname(get_config('system','directory_submit_url'));
78 $a->page['nav'] .= '<a id="nav-directory-link" class="nav-link" href="' . $gdirpath . '">' . t('Directory') . "</a>\r\n";
82 * The following nav links are only show to logged in users
88 $a->page['nav'] .= '<a id="nav-network-link" class="nav-commlink" href="network">' . t('Network')
89 . '</a><span id="net-update" class="nav-ajax-left"></span>' . "\r\n";
91 $a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="profile/' . $a->user['nickname'] . '">'
92 . t('Home') . '</a><span id="home-update" class="nav-ajax-left"></span>' . "\r\n";
94 /* only show friend requests for normal pages. Other page types have automatic friendship. */
96 if($_SESSION['page_flags'] == PAGE_NORMAL) {
97 $a->page['nav'] .= '<a id="nav-notify-link" class="nav-commlink" href="notifications">' . t('Notifications')
98 . '</a><span id="notify-update" class="nav-ajax-left"></span>' . "\r\n";
101 $a->page['nav'] .= '<a id="nav-messages-link" class="nav-commlink" href="message">' . t('Messages')
102 . '</a><span id="mail-update" class="nav-ajax-left"></span>' . "\r\n";
104 if(is_array($a->identities) && count($a->identities) > 1) {
105 $a->page['nav'] .= '<a id="nav-manage-link" class="nav-commlink" href="manage">' . t('Manage') . '</a>' . "\r\n";
108 $a->page['nav'] .= '<a id="nav-settings-link" class="nav-link" href="settings">' . t('Settings') . "</a>\r\n";
110 $a->page['nav'] .= '<a id="nav-profiles-link" class="nav-link" href="profiles">' . t('Profiles') . "</a>\r\n";
112 $a->page['nav'] .= '<a id="nav-contacts-link" class="nav-link" href="contacts">' . t('Contacts') . "</a>\r\n";
117 $a->page['nav'] .= "</span>\r\n<span id=\"nav-end\"></span>\r\n";
121 * Provide a banner/logo/whatever
125 $banner = get_config('system','banner');
127 if($banner === false)
128 $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>';
131 $a->page['nav'] .= '<span id="banner">' . $banner . '</span>';
133 call_hooks('page_header', $a->page['nav']);