]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/groupprofileblock.php
better output for registration confirmation
[quix0rs-gnu-social.git] / lib / groupprofileblock.php
index 9df541e343bacadb12973248d501829d3306f3b3..10dddb84676b90f6317d91cc5b3ad96828e546ce 100644 (file)
@@ -97,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();
                     }
@@ -119,4 +123,14 @@ class GroupProfileBlock extends ProfileBlock
         $this->out->elementEnd('ul');
         $this->out->elementEnd('div');
     }
+
+    function show()
+    {
+        $this->out->elementStart('div', 'profile_block group_profile_block section');
+        if (Event::handle('StartShowGroupProfileBlock', array($this->out, $this->group))) {
+            parent::show();
+            Event::handle('EndShowGroupProfileBlock', array($this->out, $this->group));
+        }
+        $this->out->elementEnd('div');
+    }
 }