Replace "forum" by "group" in the rest of the code

This commit is contained in:
Hypolite Petovan 2023-05-30 09:15:17 -04:00
parent 03bebf57c5
commit 3385147f25
59 changed files with 378 additions and 424 deletions

View file

@ -71,8 +71,8 @@ class BaseSearch extends BaseModule
$header = DI::l10n()->t('People Search - %s', $search);
} elseif (strpos($search, '!') === 0) {
$search = trim(substr($search, 1));
$type = Search::TYPE_FORUM;
$header = DI::l10n()->t('Forum Search - %s', $search);
$type = Search::TYPE_GROUP;
$header = DI::l10n()->t('Group Search - %s', $search);
}
$search = Network::convertToIdn($search);
@ -98,7 +98,7 @@ class BaseSearch extends BaseModule
}
if (!$results->getTotal()) {
$results = Search::getContactsFromProbe(Network::convertToIdn($search), $type == Search::TYPE_FORUM);
$results = Search::getContactsFromProbe(Network::convertToIdn($search), $type == Search::TYPE_GROUP);
}
return self::printResult($results, $pager, $header);
@ -151,4 +151,4 @@ class BaseSearch extends BaseModule
'$paginate' => $pager->renderFull($results->getTotal()),
]);
}
}
}

View file

@ -24,7 +24,7 @@ namespace Friendica\Module\Conversation;
use Friendica\BaseModule;
use Friendica\Content\BoundariesPager;
use Friendica\Content\Conversation;
use Friendica\Content\ForumManager;
use Friendica\Content\GroupManager;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Content\Text\HTML;
@ -52,7 +52,7 @@ class Network extends BaseModule
/** @var int */
private static $circleId;
/** @var int */
private static $forumContactId;
private static $groupContactId;
/** @var string */
private static $selectedTab;
/** @var mixed */
@ -90,9 +90,9 @@ class Network extends BaseModule
DI::page()['aside'] .= Widget::accountTypes($module, self::$accountTypeString);
DI::page()['aside'] .= Circle::sidebarWidget($module, $module . '/circle', 'standard', self::$circleId);
DI::page()['aside'] .= ForumManager::widget($module . '/forum', DI::userSession()->getLocalUserId(), self::$forumContactId);
DI::page()['aside'] .= GroupManager::widget($module . '/group', DI::userSession()->getLocalUserId(), self::$groupContactId);
DI::page()['aside'] .= Widget::postedByYear($module . '/archive', DI::userSession()->getLocalUserId(), false);
DI::page()['aside'] .= Widget::networks($module, !self::$forumContactId ? self::$network : '');
DI::page()['aside'] .= Widget::networks($module, !self::$groupContactId ? self::$network : '');
DI::page()['aside'] .= Widget\SavedSearches::getHTML(DI::args()->getQueryString());
DI::page()['aside'] .= Widget::fileAs('filed', '');
@ -119,9 +119,9 @@ class Network extends BaseModule
$content = '';
if (self::$forumContactId) {
// If self::$forumContactId belongs to a community forum or a private group, add a mention to the status editor
$condition = ["`id` = ? AND `contact-type` = ?", self::$forumContactId, Contact::TYPE_COMMUNITY];
if (self::$groupContactId) {
// If self::$groupContactId belongs to a community group or a private group, add a mention to the status editor
$condition = ["`id` = ? AND `contact-type` = ?", self::$groupContactId, Contact::TYPE_COMMUNITY];
$contact = DBA::selectFirst('contact', ['addr'], $condition);
if (!empty($contact['addr'])) {
$content = '!' . $contact['addr'];
@ -136,8 +136,8 @@ class Network extends BaseModule
}
$allowedCids = [];
if (self::$forumContactId) {
$allowedCids[] = (int) self::$forumContactId;
if (self::$groupContactId) {
$allowedCids[] = (int) self::$groupContactId;
} elseif (self::$network) {
$condition = [
'uid' => DI::userSession()->getLocalUserId(),
@ -160,9 +160,9 @@ class Network extends BaseModule
}
$x = [
'lockstate' => self::$circleId || self::$forumContactId || self::$network || ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',
'lockstate' => self::$circleId || self::$groupContactId || self::$network || ACL::getLockstateForUserId($a->getLoggedInUserId()) ? 'lock' : 'unlock',
'acl' => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), true, $default_permissions),
'bang' => ((self::$circleId || self::$forumContactId || self::$network) ? '!' : ''),
'bang' => ((self::$circleId || self::$groupContactId || self::$network) ? '!' : ''),
'content' => $content,
];
@ -178,8 +178,8 @@ class Network extends BaseModule
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
'$title' => DI::l10n()->t('Circle: %s', $circle['name'])
]) . $o;
} elseif (self::$forumContactId) {
$contact = Contact::getById(self::$forumContactId);
} elseif (self::$groupContactId) {
$contact = Contact::getById(self::$groupContactId);
if (DBA::isResult($contact)) {
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('contact/list.tpl'), [
'contacts' => [ModuleContact::getContactTemplateVars($contact)],
@ -307,7 +307,7 @@ class Network extends BaseModule
{
self::$circleId = $this->parameters['circle_id'] ?? 0;
self::$forumContactId = $this->parameters['contact_id'] ?? 0;
self::$groupContactId = $this->parameters['contact_id'] ?? 0;
self::$selectedTab = self::getTimelineOrderBySession(DI::userSession(), DI::pConfig());
@ -413,10 +413,10 @@ class Network extends BaseModule
if (self::$circleId) {
$conditionStrings = DBA::mergeConditions($conditionStrings, ["`contact-id` IN (SELECT `contact-id` FROM `group_member` WHERE `gid` = ?)", self::$circleId]);
} elseif (self::$forumContactId) {
} elseif (self::$groupContactId) {
$conditionStrings = DBA::mergeConditions($conditionStrings,
["((`contact-id` = ?) OR `uri-id` IN (SELECT `parent-uri-id` FROM `post-user-view` WHERE (`contact-id` = ? AND `gravity` = ? AND `vid` = ? AND `uid` = ?)))",
self::$forumContactId, self::$forumContactId, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), DI::userSession()->getLocalUserId()]);
self::$groupContactId, self::$groupContactId, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), DI::userSession()->getLocalUserId()]);
}
// Currently only the order modes "received" and "commented" are in use
@ -479,7 +479,7 @@ class Network extends BaseModule
// We aren't going to try and figure out at the item, circle, and page
// level which items you've seen and which you haven't. If you're looking
// at the top level network page just mark everything seen.
if (!self::$circleId && !self::$forumContactId && !self::$star && !self::$mention) {
if (!self::$circleId && !self::$groupContactId && !self::$star && !self::$mention) {
$condition = ['unseen' => true, 'uid' => DI::userSession()->getLocalUserId()];
self::setItemsSeenByCondition($condition);
} elseif (!empty($parents)) {

View file

@ -118,15 +118,15 @@ abstract class BaseUsers extends BaseModeration
$page_types = [
User::PAGE_FLAGS_NORMAL => $this->t('Normal Account Page'),
User::PAGE_FLAGS_SOAPBOX => $this->t('Soapbox Page'),
User::PAGE_FLAGS_COMMUNITY => $this->t('Public Forum'),
User::PAGE_FLAGS_COMMUNITY => $this->t('Public Group'),
User::PAGE_FLAGS_FREELOVE => $this->t('Automatic Friend Page'),
User::PAGE_FLAGS_PRVGROUP => $this->t('Private Forum')
User::PAGE_FLAGS_PRVGROUP => $this->t('Private Group')
];
$account_types = [
User::ACCOUNT_TYPE_PERSON => $this->t('Personal Page'),
User::ACCOUNT_TYPE_ORGANISATION => $this->t('Organisation Page'),
User::ACCOUNT_TYPE_NEWS => $this->t('News Page'),
User::ACCOUNT_TYPE_COMMUNITY => $this->t('Community Forum'),
User::ACCOUNT_TYPE_COMMUNITY => $this->t('Community Group'),
User::ACCOUNT_TYPE_RELAY => $this->t('Relay'),
];

View file

@ -52,10 +52,10 @@ class Summary extends BaseModeration
$accounts = [
[$this->t('Normal Account'), 0],
[$this->t('Automatic Follower Account'), 0],
[$this->t('Public Forum Account'), 0],
[$this->t('Public Group Account'), 0],
[$this->t('Automatic Friend Account'), 0],
[$this->t('Blog Account'), 0],
[$this->t('Private Forum Account'), 0]
[$this->t('Private Group Account'), 0]
];
$users = 0;

View file

@ -24,7 +24,7 @@ namespace Friendica\Module\Notifications;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Contact\Introduction\Repository\Introduction;
use Friendica\Content\ForumManager;
use Friendica\Content\GroupManager;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -109,14 +109,14 @@ class Ping extends BaseModule
$register_count = 0;
$sysnotify_count = 0;
$circles_unseen = [];
$forums_unseen = [];
$groups_unseen = [];
$event_count = 0;
$today_event_count = 0;
$birthday_count = 0;
$today_birthday_count = 0;
// Suppress notification display for forum accounts
// Suppress notification display for group accounts
if ($this->session->getLocalUserId() && $this->session->get('page_flags', '') != User::PAGE_FLAGS_COMMUNITY) {
if ($this->pconfig->get($this->session->getLocalUserId(), 'system', 'detailed_notif')) {
$notifications = $this->notificationRepo->selectDetailedForUser($this->session->getLocalUserId());
@ -160,9 +160,9 @@ class Ping extends BaseModule
}
}
foreach (ForumManager::countUnseenItems() as $forum_count) {
if ($forum_count['count'] > 0) {
$forums_unseen[] = $forum_count;
foreach (GroupManager::countUnseenItems() as $group_count) {
if ($group_count['count'] > 0) {
$groups_unseen[] = $group_count;
}
}
}
@ -290,7 +290,7 @@ class Ping extends BaseModule
$data['birthdays'] = $birthday_count;
$data['birthdays-today'] = $today_birthday_count;
$data['circles'] = $circles_unseen;
$data['forums'] = $forums_unseen;
$data['groups'] = $groups_unseen;
$data['notification'] = ($notification_count < 50) ? $notification_count : '49+';
$data['notifications'] = $navNotifications;

View file

@ -188,7 +188,7 @@ class Conversations extends BaseProfile
$condition = DBA::mergeConditions($condition, ["`received` >= ?", DateTimeFormat::convert($datequery2, 'UTC', $this->app->getTimeZone())]);
}
// Does the profile page belong to a forum?
// Does the profile page belong to a group?
// If not then we can improve the performance with an additional condition
if ($profile['account-type'] != User::ACCOUNT_TYPE_COMMUNITY) {
$condition = DBA::mergeConditions($condition, ['contact-id' => $profile['id']]);

View file

@ -23,7 +23,7 @@ namespace Friendica\Module\Profile;
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
use Friendica\Content\GroupManager;
use Friendica\Content\Nav;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -254,12 +254,12 @@ class Profile extends BaseProfile
);
}
//show subscribed forum if it is enabled in the usersettings
//show subscribed group if it is enabled in the usersettings
if (Feature::isEnabled($profile['uid'], 'forumlist_profile')) {
$custom_fields += self::buildField(
'forumlist',
$this->t('Forums:'),
ForumManager::profileAdvanced($profile['uid'])
'group_list',
$this->t('Groups:'),
GroupManager::profileAdvanced($profile['uid'])
);
}

View file

@ -50,7 +50,7 @@ class Acl extends BaseModule
const TYPE_MENTION_CONTACT = 'c';
const TYPE_MENTION_CIRCLE = 'g';
const TYPE_MENTION_CONTACT_CIRCLE = '';
const TYPE_MENTION_FORUM = 'f';
const TYPE_MENTION_GROUP = 'f';
const TYPE_PRIVATE_MESSAGE = 'm';
const TYPE_ANY_CONTACT = 'a';
@ -100,7 +100,7 @@ class Acl extends BaseModule
'nick' => $contact['addr'] ?: $contact['url'],
'network' => $contact['network'],
'link' => $contact['url'],
'forum' => $contact['contact-type'] == Contact::TYPE_COMMUNITY,
'group' => $contact['contact-type'] == Contact::TYPE_COMMUNITY,
];
}
@ -161,7 +161,7 @@ class Acl extends BaseModule
]);
break;
case self::TYPE_MENTION_FORUM:
case self::TYPE_MENTION_GROUP:
$condition = DBA::mergeConditions($condition,
["NOT `self` AND NOT `blocked` AND `notify` != ? AND `contact-type` = ?", '', Contact::TYPE_COMMUNITY
]);
@ -205,7 +205,7 @@ class Acl extends BaseModule
'id' => intval($circle['id']),
'uids' => array_map('intval', explode(',', $circle['uids'])),
'link' => '',
'forum' => '0'
'group' => '0'
];
}
if ((count($resultCircles) > 0) && ($search == '')) {
@ -218,7 +218,7 @@ class Acl extends BaseModule
$contacts = Contact::selectToArray([], $condition, ['order' => ['name']]);
}
$forums = [];
$groups = [];
foreach ($contacts as $contact) {
$entry = [
'type' => self::TYPE_MENTION_CONTACT,
@ -229,21 +229,21 @@ class Acl extends BaseModule
'link' => $contact['url'],
'nick' => htmlentities(($contact['attag'] ?? '') ?: $contact['nick']),
'addr' => htmlentities(($contact['addr'] ?? '') ?: $contact['url']),
'forum' => $contact['contact-type'] == Contact::TYPE_COMMUNITY,
'group' => $contact['contact-type'] == Contact::TYPE_COMMUNITY,
];
if ($entry['forum']) {
$forums[] = $entry;
if ($entry['group']) {
$groups[] = $entry;
} else {
$resultContacts[] = $entry;
}
}
if ($forums) {
if ($groups) {
if ($search == '') {
$forums[] = ['separator' => true];
$groups[] = ['separator' => true];
}
$resultContacts = array_merge($forums, $resultContacts);
$resultContacts = array_merge($groups, $resultContacts);
}
$resultItems = array_merge($resultCircles, $resultContacts);
@ -285,7 +285,7 @@ class Acl extends BaseModule
'link' => $contact['url'],
'nick' => htmlentities(($contact['nick'] ?? '') ?: $contact['addr']),
'addr' => htmlentities(($contact['addr'] ?? '') ?: $contact['url']),
'forum' => $contact['forum']
'group' => $contact['forum']
];
}
}

View file

@ -139,7 +139,7 @@ class Index extends BaseSearch
break;
case 'contacts':
return self::performContactSearch($search, '@');
case 'forums':
case 'groups':
return self::performContactSearch($search, '!');
}
}

View file

@ -452,7 +452,7 @@ class Account extends BaseSettings
$pagetype = Renderer::replaceMacros($pageset_tpl, [
'$account_types' => DI::l10n()->t("Account Types"),
'$user' => DI::l10n()->t("Personal Page Subtypes"),
'$community' => DI::l10n()->t("Community Forum Subtypes"),
'$community' => DI::l10n()->t("Community Group Subtypes"),
'$account_type' => $user['account-type'],
'$type_person' => User::ACCOUNT_TYPE_PERSON,
'$type_organisation' => User::ACCOUNT_TYPE_ORGANISATION,
@ -481,7 +481,7 @@ class Account extends BaseSettings
],
'$account_community' => [
'account-type',
DI::l10n()->t('Community Forum'),
DI::l10n()->t('Community Group'),
User::ACCOUNT_TYPE_COMMUNITY,
DI::l10n()->t('Account for community discussions.'),
$user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY
@ -502,7 +502,7 @@ class Account extends BaseSettings
],
'$page_community' => [
'page-flags',
DI::l10n()->t('Public Forum'),
DI::l10n()->t('Public Group'),
User::PAGE_FLAGS_COMMUNITY,
DI::l10n()->t('Automatically approves all contact requests.'),
$user['page-flags'] == User::PAGE_FLAGS_COMMUNITY
@ -516,7 +516,7 @@ class Account extends BaseSettings
],
'$page_prvgroup' => [
'page-flags',
DI::l10n()->t('Private Forum [Experimental]'),
DI::l10n()->t('Private Group [Experimental]'),
User::PAGE_FLAGS_PRVGROUP,
DI::l10n()->t('Requires manual approval of contact requests.'),
$user['page-flags'] == User::PAGE_FLAGS_PRVGROUP