]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/groupprofileblock.php
Logic to have group joins turn into pending joins automatically when group is set...
[quix0rs-gnu-social.git] / lib / groupprofileblock.php
index 32526b0458dd69c9235911fead82d1b6bde240b1..819c0fbdcc57ad29f04cd61cb3c05a89d0671daf 100644 (file)
@@ -71,22 +71,6 @@ class GroupProfileBlock extends ProfileBlock
         return $this->group->mainpage;
     }
 
-    function canEdit()
-    {
-        $user = common_current_user();
-        return ((!empty($user)) && ($user->isAdmin($this->group)));
-    }
-
-    function editUrl()
-    {
-        return common_local_url('editgroup', array('nickname' => $this->group->nickname));
-    }
-
-    function editText()
-    {
-        return _('Edit');
-    }
-
     function location()
     {
         return $this->group->location;
@@ -113,10 +97,14 @@ class GroupProfileBlock extends ProfileBlock
             $this->out->elementStart('li', 'entity_subscribe');
             if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
                 if ($cur) {
-                    if ($cur->isMember($this->group)) {
+                    $profile = $cur->getProfile();
+                    if ($profile->isMember($this->group)) {
                         $lf = new LeaveForm($this->out, $this->group);
                         $lf->show();
-                    } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
+                    } else if ($profile->isPendingMember($this->group)) {
+                        $cf = new CancelGroupForm($this->out, $this->group);
+                        $cf->show();
+                    } else if (!Group_block::isBlocked($this->group, $profile)) {
                         $jf = new JoinForm($this->out, $this->group);
                         $jf->show();
                     }