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 $sitelocation = $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 );
33 // nav links: array of array('href', 'text', 'extra css classes')
37 * Display login or logout
41 $nav['logout'] = Array('logout',t('Logout'), "");
44 $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':''));
49 * "Home" should also take you home from an authenticated remote profile connection
52 $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
54 if(($a->module != 'home') && (! (local_user())))
55 $nav['home'] = array($homelink, t('Home'), "");
58 if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
59 $nav['register'] = array('register',t('Register'), "");
61 $help_url = $a->get_baseurl() . '/help';
63 if(! get_config('system','hide-help'))
64 $nav['help'] = array($help_url, t('Help'), "");
68 $nav['apps'] = array('apps', t('Apps'), "");
70 $nav['search'] = array('search', t('Search'), "");
72 $gdirpath = 'directory';
74 if(strlen(get_config('system','singleuser'))) {
75 $gdir = dirname(get_config('system','directory_submit_url'));
80 $nav['directory'] = array($gdirpath, t('Directory'), "");
84 * The following nav links are only show to logged in users
90 $nav['network'] = array('network', t('Network'), "");
92 $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), "");
95 /* only show friend requests for normal pages. Other page types have automatic friendship. */
97 if($_SESSION['page_flags'] == PAGE_NORMAL) {
98 $nav['notifications'] = array('notifications', t('Notifications'), "");
101 $nav['messages'] = array('message', t('Messages'), "");
103 if(is_array($a->identities) && count($a->identities) > 1) {
104 $nav['manage'] = array('manage', t('Manage'), "");
107 $nav['settings'] = array('settings', t('Settings'),"");
108 $nav['profiles'] = array('profiles', t('Profiles'),"");
109 $nav['contacts'] = array('contacts', t('Contacts'),"");
115 if (is_site_admin()){
116 $nav['admin'] = array('admin/', t('Admin'), "");
122 * Provide a banner/logo/whatever
126 $banner = get_config('system','banner');
128 if($banner === false)
129 $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>';
132 $tpl = get_markup_template('nav.tpl');
134 $a->page['nav'] .= replace_macros($tpl, array(
135 '$langselector' => lang_selector(),
136 '$sitelocation' => $sitelocation,
138 '$banner' => $banner,
141 call_hooks('page_header', $a->page['nav']);