diff options
author | Chris Case <kahotep@bunda.dreamhost.com> | 2011-05-21 21:40:16 -0700 |
---|---|---|
committer | Chris Case <kahotep@bunda.dreamhost.com> | 2011-05-21 21:40:16 -0700 |
commit | 4cff911939b263993eb41682ca558c975e2db01f (patch) | |
tree | 78f58e08d04413827744689d0f5df7660bee6caa /include/nav.php | |
parent | 2cf696d0b5d647e1741d2f94ee379aa19b25ae1b (diff) | |
parent | f3f063c0dd7fd8b706987b856d79c7b58924acbb (diff) | |
download | volse-hubzilla-4cff911939b263993eb41682ca558c975e2db01f.tar.gz volse-hubzilla-4cff911939b263993eb41682ca558c975e2db01f.tar.bz2 volse-hubzilla-4cff911939b263993eb41682ca558c975e2db01f.zip |
merged multipart email changes
Diffstat (limited to 'include/nav.php')
-rw-r--r-- | include/nav.php | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/include/nav.php b/include/nav.php index 4104cf3cf..66fdbc49b 100644 --- a/include/nav.php +++ b/include/nav.php @@ -27,24 +27,23 @@ function nav(&$a) { $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : ''); - $a->page['nav'] .= '<div id="site-location">' . $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ) . '</div>'; + $sitelocation = $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ); + // nav links: array of array('href', 'text', 'extra css classes') + $nav = Array(); + /** * Display login or logout */ if(local_user()) { - $a->page['nav'] .= '<a id="nav-logout-link" class="nav-link" href="logout">' . t('Logout') . "</a>\r\n"; + $nav['logout'] = Array('logout',t('Logout'), ""); } else { - $a->page['nav'] .= '<a id="nav-login-link" class="nav-login-link'; - if ($a->module == 'login') { $a->page['nav'] .= ' nav-selected'; } - - $a->page['nav'] .= '" href="login">' . t('Login') . "</a>\r\n"; + $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':'')); } - $a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n"; /** * "Home" should also take you home from an authenticated remote profile connection @@ -53,18 +52,22 @@ function nav(&$a) { $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : ''); if(($a->module != 'home') && (! (local_user()))) - $a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="' . $homelink . '">' . t('Home') . "</a>\r\n"; + $nav['home'] = array($homelink, t('Home'), ""); if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) - $a->page['nav'] .= '<a id="nav-register-link" class="nav-commlink" href="register" >' - . t('Register') . "</a>\r\n"; + $nav['register'] = array('register',t('Register'), ""); + + $help_url = $a->get_baseurl() . '/help'; + + if(! get_config('system','hide-help')) + $nav['help'] = array($help_url, t('Help'), ""); + - if(strlen($a->apps)) { - $a->page['nav'] .= '<a id="nav-apps-link" class="nav-link" href="apps">' . t('Apps') . "</a>\r\n"; - } - $a->page['nav'] .= '<a id="nav-search-link" class="nav-link" href="search">' . t('Search') . "</a>\r\n"; + $nav['apps'] = array('apps', t('Apps'), ""); + + $nav['search'] = array('search', t('Search'), ""); $gdirpath = 'directory'; @@ -74,7 +77,7 @@ function nav(&$a) { $gdirpath = $gdir; } - $a->page['nav'] .= '<a id="nav-directory-link" class="nav-link" href="' . $gdirpath . '">' . t('Directory') . "</a>\r\n"; + $nav['directory'] = array($gdirpath, t('Directory'), ""); /** * @@ -84,36 +87,30 @@ function nav(&$a) { if(local_user()) { - $a->page['nav'] .= '<a id="nav-network-link" class="nav-commlink" href="network">' . t('Network') - . '</a><span id="net-update" class="nav-ajax-left"></span>' . "\r\n"; + $nav['network'] = array('network', t('Network'), ""); + + $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), ""); - $a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="profile/' . $a->user['nickname'] . '">' - . t('Home') . '</a><span id="home-update" class="nav-ajax-left"></span>' . "\r\n"; /* only show friend requests for normal pages. Other page types have automatic friendship. */ if($_SESSION['page_flags'] == PAGE_NORMAL) { - $a->page['nav'] .= '<a id="nav-notify-link" class="nav-commlink" href="notifications">' . t('Notifications') - . '</a><span id="notify-update" class="nav-ajax-left"></span>' . "\r\n"; + $nav['notifications'] = array('notifications', t('Notifications'), ""); } - $a->page['nav'] .= '<a id="nav-messages-link" class="nav-commlink" href="message">' . t('Messages') - . '</a><span id="mail-update" class="nav-ajax-left"></span>' . "\r\n"; + $nav['messages'] = array('message', t('Messages'), ""); if(is_array($a->identities) && count($a->identities) > 1) { - $a->page['nav'] .= '<a id="nav-manage-link" class="nav-commlink" href="manage">' . t('Manage') . '</a>' . "\r\n"; + $nav['manage'] = array('manage', t('Manage'), ""); } - $a->page['nav'] .= '<a id="nav-settings-link" class="nav-link" href="settings">' . t('Settings') . "</a>\r\n"; - - $a->page['nav'] .= '<a id="nav-profiles-link" class="nav-link" href="profiles">' . t('Profiles') . "</a>\r\n"; - - $a->page['nav'] .= '<a id="nav-contacts-link" class="nav-link" href="contacts">' . t('Contacts') . "</a>\r\n"; + $nav['settings'] = array('settings', t('Settings'),""); + $nav['profiles'] = array('profiles', t('Profiles'),""); + $nav['contacts'] = array('contacts', t('Contacts'),""); } - $a->page['nav'] .= "</span>\r\n<span id=\"nav-end\"></span>\r\n"; /** * @@ -124,10 +121,17 @@ function nav(&$a) { $banner = get_config('system','banner'); if($banner === false) - $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>'; + $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>'; + + $tpl = get_markup_template('nav.tpl'); - $a->page['nav'] .= '<span id="banner">' . $banner . '</span>'; + $a->page['nav'] .= replace_macros($tpl, array( + '$langselector' => lang_selector(), + '$sitelocation' => $sitelocation, + '$nav' => $nav, + '$banner' => $banner, + )); call_hooks('page_header', $a->page['nav']); |