]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/groupmembers.php
use homepage link attributes method for peopletaglist
[quix0rs-gnu-social.git] / actions / groupmembers.php
index dcbdd375972272a709afe0fee6cb7c2805095653..a16debd7b068ecd4e69deec35d61e42475f83752 100644 (file)
@@ -73,14 +73,21 @@ class GroupmembersAction extends GroupDesignAction
         }
 
         if (!$nickname) {
-            $this->clientError(_('No nickname'), 404);
+            $this->clientError(_('No nickname.'), 404);
             return false;
         }
 
-        $this->group = User_group::staticGet('nickname', $nickname);
+        $local = Local_group::staticGet('nickname', $nickname);
+
+        if (!$local) {
+            $this->clientError(_('No such group.'), 404);
+            return false;
+        }
+
+        $this->group = User_group::staticGet('id', $local->group_id);
 
         if (!$this->group) {
-            $this->clientError(_('No such group'), 404);
+            $this->clientError(_('No such group.'), 404);
             return false;
         }
 
@@ -93,7 +100,7 @@ class GroupmembersAction extends GroupDesignAction
             return sprintf(_('%s group members'),
                            $this->group->nickname);
         } else {
-            return sprintf(_('%s group members, page %d'),
+            return sprintf(_('%1$s group members, page %2$d'),
                            $this->group->nickname,
                            $this->page);
         }
@@ -179,9 +186,12 @@ class GroupMemberListItem extends ProfileListItem
     function showActions()
     {
         $this->startActions();
-        $this->showSubscribeButton();
-        $this->showMakeAdminForm();
-        $this->showGroupBlockForm();
+        if (Event::handle('StartProfileListItemActionElements', array($this))) {
+            $this->showSubscribeButton();
+            $this->showMakeAdminForm();
+            $this->showGroupBlockForm();
+            Event::handle('EndProfileListItemActionElements', array($this));
+        }
         $this->endActions();
     }
 
@@ -189,7 +199,9 @@ class GroupMemberListItem extends ProfileListItem
     {
         $user = common_current_user();
 
-        if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group) &&
+        if (!empty($user) &&
+            $user->id != $this->profile->id &&
+            ($user->isAdmin($this->group) || $user->hasRight(Right::MAKEGROUPADMIN)) &&
             !$this->profile->isAdmin($this->group)) {
             $this->out->elementStart('li', 'entity_make_admin');
             $maf = new MakeAdminForm($this->out, $this->profile, $this->group,