X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fnav.php;h=b8b65f84d00b1f24e62e120545cd173bb6aff55d;hb=b8479cc2f98bdd3b144cfda127c799ba4740fc83;hp=adcef77f284a2484b8d66ad5cb523cb9fbfde857;hpb=aaa06c57e609a0c57dec355ff0db95938dd40b25;p=friendica.git
diff --git a/include/nav.php b/include/nav.php
index adcef77f28..b8b65f84d0 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -1,17 +1,89 @@
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'] .= '' . t('Home') . "\r\n";
-
- $a->page['nav'] .= '' . t('Site Directory') . "\r\n";
+ /**
+ * "Home" should also take you home from an authenticated remote profile connection
+ */
+
+ $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
+
+ if(($a->module != 'home') && (! (local_user())))
+ $a->page['nav'] .= '' . t('Home') . "\r\n";
+
+
+ if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
+ $a->page['nav'] .= ''
+ . t('Register') . "\r\n";
- if(x($_SESSION,'uid')) {
+ if(strlen($a->apps)) {
+ $a->page['nav'] .= '' . t('Apps') . "\r\n";
+ }
+
+ $a->page['nav'] .= '' . t('Search') . "\r\n";
+
+ $gdirpath = 'directory';
+
+ 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";
@@ -19,12 +91,19 @@ if(x($_SESSION['uid'])) {
$a->page['nav'] .= ''
. t('Home') . '' . "\r\n";
- $a->page['nav'] .= '' . t('Notifications')
- . '' . "\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')
+ $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'] .= '' . t('Settings') . "\r\n";
@@ -32,8 +111,25 @@ if(x($_SESSION['uid'])) {
$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']);
+
+}