X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fnav.php;h=5c2d6efa0edf431ba8627b93c538386a24a805b8;hb=0fe832ef8aeafa1ddba793a8b084005cf070f1f4;hp=d7a6e397c603162efdee4e551cc9725d0a777ead;hpb=4c75c59039cc9788eb351e74c637019a5361a021;p=friendica.git diff --git a/include/nav.php b/include/nav.php index d7a6e397c6..5c2d6efa0e 100644 --- a/include/nav.php +++ b/include/nav.php @@ -1,7 +1,13 @@ $a->user['uid'], 'self' => true), array('limit' => 1)); + $contact = dba::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]); $userinfo = array( - 'icon' => (dbm::is_result($r) ? $a->remove_baseurl($r['micro']) : 'images/person-48.jpg'), + 'icon' => (DBM::is_result($contact) ? $a->remove_baseurl($contact['micro']) : 'images/person-48.jpg'), 'name' => $a->user['username'], ); } else { @@ -99,9 +105,9 @@ function nav_info(App $a) } // "Home" should also take you home from an authenticated remote profile connection - $homelink = get_my_url(); + $homelink = Profile::getMyURL(); if (! $homelink) { - $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : ''); + $homelink = ((x($_SESSION, 'visitor_home')) ? $_SESSION['visitor_home'] : ''); } if (($a->module != 'home') && (! (local_user()))) { @@ -114,7 +120,7 @@ function nav_info(App $a) $help_url = 'help'; - if (! get_config('system', 'hide_help')) { + if (!Config::get('system', 'hide_help')) { $nav['help'] = array($help_url, t('Help'), '', t('Help and documentation')); } @@ -122,7 +128,7 @@ function nav_info(App $a) $nav['apps'] = array('apps', t('Apps'), '', t('Addon applications, utilities, games')); } - if (local_user() || !get_config('system', 'local_search')) { + if (local_user() || !Config::get('system', 'local_search')) { $nav['search'] = array('search', t('Search'), '', t('Search site content')); $nav['searchoption'] = array( @@ -130,22 +136,22 @@ function nav_info(App $a) t('Tags'), t('Contacts')); - if (get_config('system', 'poco_local_search')) { + if (Config::get('system', 'poco_local_search')) { $nav['searchoption'][] = t('Forums'); } } $gdirpath = 'directory'; - if (strlen(get_config('system', 'singleuser'))) { - $gdir = get_config('system', 'directory'); + if (strlen(Config::get('system', 'singleuser'))) { + $gdir = Config::get('system', 'directory'); if (strlen($gdir)) { - $gdirpath = zrl($gdir, true); + $gdirpath = Profile::zrl($gdir, true); } - } elseif (get_config('system', 'community_page_style') == CP_USERS_ON_SERVER) { - $nav['community'] = array('community', t('Community'), '', t('Conversations on this site')); - } elseif (get_config('system', 'community_page_style') == CP_GLOBAL_COMMUNITY) { - $nav['community'] = array('community', t('Community'), '', t('Conversations on the network')); + } + + if (local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) { + $nav['community'] = array('community', t('Community'), '', t('Conversations on this and other servers')); } if (local_user()) { @@ -188,7 +194,7 @@ function nav_info(App $a) $nav['settings'] = array('settings', t('Settings'), '', t('Account settings')); - if (feature_enabled(local_user(), 'multi_profiles')) { + if (Feature::isEnabled(local_user(), 'multi_profiles')) { $nav['profiles'] = array('profiles', t('Profiles'), '', t('Manage/Edit Profiles')); } @@ -203,8 +209,8 @@ function nav_info(App $a) $nav['navigation'] = array('navigation/', t('Navigation'), '', t('Site map')); // Provide a banner/logo/whatever - $banner = get_config('system', 'banner'); - if ($banner === false) { + $banner = Config::get('system', 'banner'); + if (is_null($banner)) { $banner = 'logoFriendica'; } @@ -225,6 +231,7 @@ function nav_info(App $a) function nav_set_selected($item){ $a = get_app(); $a->nav_sel = array( + 'global' => null, 'community' => null, 'network' => null, 'home' => null,