X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FGroup.php;h=0a51518324c0540dea36b598aabee39f0a6e0abe;hb=a9d114316d9ba423cb7440a78e0190e81d2f9625;hp=a810fff6707708ecbcc43f31cf6d3b54376258b4;hpb=5dfee31108fc92a7abca5f99b8fdf1b34aec5dd5;p=friendica.git diff --git a/src/Model/Group.php b/src/Model/Group.php index a810fff670..0a51518324 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -1,16 +1,32 @@ . + * */ namespace Friendica\Model; use Friendica\BaseModule; -use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Database\DBA; +use Friendica\DI; /** * functions for interacting with the group database table @@ -73,7 +89,7 @@ class Group $group = DBA::selectFirst('group', ['deleted'], ['id' => $gid]); if (DBA::isResult($group) && $group['deleted']) { DBA::update('group', ['deleted' => 0], ['id' => $gid]); - notice(DI::l10n()->t('A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL); + notice(DI::l10n()->t('A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name.')); } return true; } @@ -117,6 +133,16 @@ class Group } DBA::close($stmt); + // Meta-groups + $contact = Contact::getById($cid, ['rel']); + if ($contact['rel'] == Contact::FOLLOWER || $contact['rel'] == Contact::FRIEND) { + $return[] = self::FOLLOWERS; + } + + if ($contact['rel'] == Contact::FRIEND) { + $return[] = self::MUTUALS; + } + return $return; } @@ -479,10 +505,17 @@ class Group $groupedit = null; } + if ($each == 'group') { + $count = DBA::count('group_member', ['gid' => $group['id']]); + $group_name = sprintf('%s (%d)', $group['name'], $count); + } else { + $group_name = $group['name']; + } + $display_groups[] = [ 'id' => $group['id'], 'cid' => $cid, - 'text' => $group['name'], + 'text' => $group_name, 'href' => $each . '/' . $group['id'], 'edit' => $groupedit, 'selected' => $selected,