use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
+use Friendica\Model\Profile;
function nav(App $a) {
$nav['usermenu'][] = array('notes/', t('Personal notes'), '', t('Your personal notes'));
// user info
- $r = dba::select('contact', array('micro'), array('uid' => $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 {
}
// "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()))) {
if (strlen(Config::get('system', 'singleuser'))) {
$gdir = Config::get('system', 'directory');
if (strlen($gdir)) {
- $gdirpath = zrl($gdir, true);
+ $gdirpath = Profile::zrl($gdir, true);
}
}
- if (in_array(Config::get('system', 'community_page_style'), [CP_USERS_ON_SERVER, CP_USERS_AND_GLOBAL])) {
- $nav['community'] = array('community/local', t('Community'), '', t('Conversations on this site'));
- }
-
- if (in_array(Config::get('system', 'community_page_style'), [CP_GLOBAL_COMMUNITY, CP_USERS_AND_GLOBAL])) {
- $nav['global'] = array('community/global', t('Global Timeline'), '', 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()) {