<?php
-
+/**
+ * @file include/nav.php
+ */
use Friendica\App;
+use Friendica\Content\Feature;
use Friendica\Core\Config;
use Friendica\Core\System;
+use Friendica\Database\DBM;
function nav(App $a) {
// user info
$r = dba::select('contact', array('micro'), array('uid' => $a->user['uid'], 'self' => true), array('limit' => 1));
$userinfo = array(
- 'icon' => (dbm::is_result($r) ? $a->remove_baseurl($r['micro']) : 'images/person-48.jpg'),
+ 'icon' => (DBM::is_result($r) ? $a->remove_baseurl($r['micro']) : 'images/person-48.jpg'),
'name' => $a->user['username'],
);
} else {
if (strlen($gdir)) {
$gdirpath = zrl($gdir, true);
}
- } elseif (Config::get('system', 'community_page_style') == CP_USERS_ON_SERVER) {
- $nav['community'] = array('community', t('Community'), '', t('Conversations on this site'));
- } elseif (Config::get('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()) {
$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'));
}
// Provide a banner/logo/whatever
$banner = Config::get('system', 'banner');
- if ($banner === false) {
+ if (is_null($banner)) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
function nav_set_selected($item){
$a = get_app();
$a->nav_sel = array(
+ 'global' => null,
'community' => null,
'network' => null,
'home' => null,