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', 'title')
37 * Display login or logout
41 $nav['logout'] = Array('logout',t('Logout'), "", t('End this session'));
44 $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':''), t('Sign in'));
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'), "", t('Home Page'));
58 if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
59 $nav['register'] = array('register',t('Register'), "", t('Create an account'));
61 $help_url = $a->get_baseurl() . '/help';
63 if(! get_config('system','hide_help'))
64 $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));
67 $nav['apps'] = array('apps', t('Apps'), "", t('Addon applications, utilities, games'));
69 $nav['search'] = array('search', t('Search'), "", t('Search site content'));
71 $gdirpath = 'directory';
73 if(strlen(get_config('system','singleuser'))) {
74 $gdir = dirname(get_config('system','directory_submit_url'));
78 elseif(! get_config('system','no_community_page'))
79 $nav['community'] = array('community', t('Community'), "", t('Conversations on this site'));
81 $nav['directory'] = array($gdirpath, t('Directory'), "", t('People directory'));
85 * The following nav links are only show to logged in users
91 $nav['network'] = array('network', t('Network'), "", t('Conversations from your friends'));
93 $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), "", t('Your posts and conversations'));
96 /* only show friend requests for normal pages. Other page types have automatic friendship. */
98 if($_SESSION['page_flags'] == PAGE_NORMAL) {
99 $nav['notifications'] = array('notifications', t('Notifications'), "", t('Friend requests'));
102 $nav['messages'] = array('message', t('Messages'), "", t('Private mail'));
104 if(is_array($a->identities) && count($a->identities) > 1) {
105 $nav['manage'] = array('manage', t('Manage'), "", t('Manage other pages'));
108 $nav['settings'] = array('settings', t('Settings'),"", t('Account settings'));
109 $nav['profiles'] = array('profiles', t('Profiles'),"", t('Manage/edit profiles'));
110 $nav['contacts'] = array('contacts', t('Contacts'),"", t('Manage/edit friends and contacts'));
116 if (is_site_admin()){
117 $nav['admin'] = array('admin/', t('Admin'), "", t('Site setup and configuration'));
123 * Provide a banner/logo/whatever
127 $banner = get_config('system','banner');
129 if($banner === false)
130 $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>';
133 $tpl = get_markup_template('nav.tpl');
135 $a->page['nav'] .= replace_macros($tpl, array(
136 '$langselector' => lang_selector(),
137 '$sitelocation' => $sitelocation,
139 '$banner' => $banner,
142 call_hooks('page_header', $a->page['nav']);