X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fnav.php;h=b8b65f84d00b1f24e62e120545cd173bb6aff55d;hb=b8479cc2f98bdd3b144cfda127c799ba4740fc83;hp=0dc0f6029e42164a8aa38680171a2389a562cf52;hpb=466267fbb5b5cc466196e40b6a8fe96f25c57e2f;p=friendica.git
diff --git a/include/nav.php b/include/nav.php
index 0dc0f6029e..b8b65f84d0 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -1,37 +1,135 @@
-
page['nav'] .= "Logout\r\n";
-}
+function nav(&$a) {
+
+ /**
+ *
+ * Build page header and site navigation bars
+ *
+ */
+
+ if(!(x($a->page,'nav')))
+ $a->page['nav'] = '';
+
+ /**
+ * Placeholder div for popup panel
+ */
+
+ $a->page['nav'] .= '
' ;
+ $a->page['nav'] .= lang_selector();
+
+ /**
+ *
+ * Our network is distributed, and as you visit friends some of the
+ * sites look exactly the same - it isn't always easy to know where you are.
+ * Display the current site location as a navigation aid.
+ *
+ */
+
+ $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
+
+ $a->page['nav'] .= '' . $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ) . '
';
+
+
+ /**
+ * Display login or logout
+ */
+
+ if(local_user()) {
+ $a->page['nav'] .= '' . t('Logout') . "\r\n";
+ }
+ else {
+ $a->page['nav'] .= '' . t('Login') . "\r\n";
+ }
$a->page['nav'] .= "\r\n";
- if(($a->module != 'home') && (! (x($_SESSION['uid']))))
- $a->page['nav'] .= "Home\r\n";
-
- $a->page['nav'] .= "Site Directory\r\n";
+ /**
+ * "Home" should also take you home from an authenticated remote profile connection
+ */
- if(x($_SESSION,'uid')) {
+ $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
- $a->page['nav'] .= "Network\r\n";
+ if(($a->module != 'home') && (! (local_user())))
+ $a->page['nav'] .= '' . t('Home') . "\r\n";
- $a->page['nav'] .= "user['nickname']}\">Home\r\n";
- $a->page['nav'] .= "Notifications\r\n";
+ if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
+ $a->page['nav'] .= ''
+ . t('Register') . "\r\n";
- $a->page['nav'] .= "Messages\r\n";
-
+ if(strlen($a->apps)) {
+ $a->page['nav'] .= '' . t('Apps') . "\r\n";
+ }
+
+ $a->page['nav'] .= '' . t('Search') . "\r\n";
+ $gdirpath = 'directory';
- $a->page['nav'] .= "Settings\r\n";
+ if(strlen(get_config('system','singleuser'))) {
+ $gdir = dirname(get_config('system','directory_submit_url'));
+ if(strlen($gdir))
+ $gdirpath = $gdir;
+ }
+
+ $a->page['nav'] .= '' . t('Directory') . "\r\n";
+
+ /**
+ *
+ * The following nav links are only show to logged in users
+ *
+ */
+
+ if(local_user()) {
+
+ $a->page['nav'] .= '' . t('Network')
+ . '' . "\r\n";
+
+ $a->page['nav'] .= ''
+ . t('Home') . '' . "\r\n";
+
+ /* only show friend requests for normal pages. Other page types have automatic friendship. */
+
+ if($_SESSION['page_flags'] == PAGE_NORMAL) {
+ $a->page['nav'] .= '' . t('Notifications')
+ . '' . "\r\n";
+ }
+
+ $a->page['nav'] .= '' . t('Messages')
+ . '' . "\r\n";
+
+ if(is_array($a->identities) && count($a->identities) > 1) {
+ $a->page['nav'] .= '' . t('Manage') . '' . "\r\n";
+ }
- $a->page['nav'] .= "Profiles\r\n";
+ $a->page['nav'] .= '' . t('Settings') . "\r\n";
- $a->page['nav'] .= "Contacts\r\n";
+ $a->page['nav'] .= '' . t('Profiles') . "\r\n";
+ $a->page['nav'] .= '' . t('Contacts') . "\r\n";
}
$a->page['nav'] .= "\r\n\r\n";
+
+ /**
+ *
+ * Provide a banner/logo/whatever
+ *
+ */
+
+ $banner = get_config('system','banner');
+
+ if($banner === false)
+ $banner .= '
Friendika';
+
+
+ $a->page['nav'] .= '' . $banner . '';
+
+ call_hooks('page_header', $a->page['nav']);
+
+}