Comstants for features

This commit is contained in:
Michael 2024-03-24 13:42:48 +00:00
parent d824bb536f
commit c041c65c1d
20 changed files with 273 additions and 274 deletions

View file

@ -91,7 +91,7 @@ class BaseProfile extends BaseModule
];
} else {
$owner = User::getByNickname($nickname, ['uid']);
if(DI::userSession()->isAuthenticated() || $owner && Feature::isEnabled($owner['uid'], 'public_calendar')) {
if(DI::userSession()->isAuthenticated() || $owner && Feature::isEnabled($owner['uid'], Feature::PUBLIC_CALENDAR)) {
$tabs[] = [
'label' => DI::l10n()->t('Calendar'),
'url' => DI::baseUrl() . '/calendar/show/' . $nickname,

View file

@ -78,7 +78,7 @@ class Export extends BaseModule
$this->baseUrl->redirect('profile/' . $nickname . '/restricted');
}
if (!$this->session->isAuthenticated() && !Feature::isEnabled($owner['uid'], 'public_calendar')) {
if (!$this->session->isAuthenticated() && !Feature::isEnabled($owner['uid'], Feature::PUBLIC_CALENDAR)) {
$this->sysMessages->addNotice($this->t('Permission denied.'));
$this->baseUrl->redirect('profile/' . $nickname);
}

View file

@ -78,7 +78,7 @@ class Show extends BaseModule
$this->baseUrl->redirect('profile/' . $nickname . '/restricted');
}
if (!$this->session->isAuthenticated() && !Feature::isEnabled($owner['uid'], 'public_calendar')) {
if (!$this->session->isAuthenticated() && !Feature::isEnabled($owner['uid'], Feature::PUBLIC_CALENDAR)) {
$this->sysMessages->addNotice($this->t('Permission denied.'));
return Login::form();
}

View file

@ -119,7 +119,7 @@ class Channel extends Timeline
$this->page['aside'] .= $this->getNoSharerWidget('channel');
}
if (Feature::isEnabled($this->session->getLocalUserId(), 'trending_tags')) {
if (Feature::isEnabled($this->session->getLocalUserId(), Feature::TRENDING_TAGS)) {
$this->page['aside'] .= TrendingTags::getHTML($this->selectedTab);
}

View file

@ -110,7 +110,7 @@ class Community extends Timeline
$this->page['aside'] .= $this->getNoSharerWidget('community');
}
if (Feature::isEnabled($this->session->getLocalUserId(), 'trending_tags')) {
if (Feature::isEnabled($this->session->getLocalUserId(), Feature::TRENDING_TAGS)) {
$this->page['aside'] .= TrendingTags::getHTML($this->selectedTab);
}

View file

@ -144,7 +144,7 @@ class Network extends Timeline
$this->page['aside'] .= $this->getNoSharerWidget('network');
}
if (Feature::isEnabled($this->session->getLocalUserId(), 'trending_tags')) {
if (Feature::isEnabled($this->session->getLocalUserId(), Feature::TRENDING_TAGS)) {
$this->page['aside'] .= TrendingTags::getHTML($this->selectedTab);
}

View file

@ -205,7 +205,7 @@ class Compose extends BaseModule
'location_disabled' => $this->l10n->t('Location services are disabled. Please check the website\'s permissions on your device'),
'wait' => $this->l10n->t('Please wait'),
'placeholdertitle' => $this->l10n->t('Set title'),
'placeholdercategory' => Feature::isEnabled(DI::userSession()->getLocalUserId(),'categories') ? $this->l10n->t('Categories (comma-separated list)') : '',
'placeholdercategory' => Feature::isEnabled(DI::userSession()->getLocalUserId(), Feature::CATEGORIES) ? $this->l10n->t('Categories (comma-separated list)') : '',
'always_open_compose' => $this->pConfig->get(DI::userSession()->getLocalUserId(), 'frio', 'always_open_compose',
$this->config->get('frio', 'always_open_compose', false)) ? '' :
$this->l10n->t('You can make this page always open when you use the New Post button in the <a href="/settings/display">Theme Customization settings</a>.'),

View file

@ -156,7 +156,7 @@ class Edit extends BaseModule
'$title' => $item['title'],
'$placeholdertitle' => $this->t('Set title'),
'$category' => Post\Category::getCSVByURIId($item['uri-id'], $this->session->getLocalUserId(), Post\Category::CATEGORY),
'$placeholdercategory' => (Feature::isEnabled($this->session->getLocalUserId(), 'categories') ? $this->t("Categories \x28comma-separated list\x29") : ''),
'$placeholdercategory' => (Feature::isEnabled($this->session->getLocalUserId(), Feature::CATEGORIES) ? $this->t("Categories \x28comma-separated list\x29") : ''),
'$emtitle' => $this->t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
'$acl' => '',

View file

@ -240,7 +240,7 @@ class Photos extends \Friendica\Module\BaseProfile
// Create item container
$lat = $lon = null;
if (!empty($exif['GPS']) && Feature::isEnabled($this->owner['uid'], 'photo_location')) {
if (!empty($exif['GPS']) && Feature::isEnabled($this->owner['uid'], Feature::PHOTO_LOCATION)) {
$lat = Photo::getGps($exif['GPS']['GPSLatitude'], $exif['GPS']['GPSLatitudeRef']);
$lon = Photo::getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']);
}

View file

@ -166,7 +166,7 @@ class Profile extends BaseProfile
$basic_fields += self::buildField('fullname', $this->t('Full Name:'), $profile['name']);
if (Feature::isEnabled($profile['uid'], 'profile_membersince')) {
if (Feature::isEnabled($profile['uid'], Feature::MEMBER_SINCE)) {
$basic_fields += self::buildField(
'membersince',
$this->t('Member since:'),
@ -255,7 +255,7 @@ class Profile extends BaseProfile
}
//show subscribed group if it is enabled in the usersettings
if (Feature::isEnabled($profile['uid'], 'forumlist_profile')) {
if (Feature::isEnabled($profile['uid'], Feature::GROUPS)) {
$custom_fields += self::buildField(
'group_list',
$this->t('Groups:'),