]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show group actions in profile block
authorEvan Prodromou <evan@status.net>
Mon, 14 Mar 2011 20:55:33 +0000 (16:55 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 16 Mar 2011 13:57:10 +0000 (09:57 -0400)
actions/showgroup.php
lib/groupprofileblock.php

index 411940ef9a2ed124a036e2db7d3fa53664aca0e2..b198352cb0cc5225402bdc4d29ff0248fae4de7b 100644 (file)
@@ -180,8 +180,6 @@ class ShowgroupAction extends GroupDesignAction
      */
     function showContent()
     {
-        $this->showGroupProfile();
-        $this->showGroupActions();
         $this->showGroupNotices();
     }
 
@@ -205,121 +203,6 @@ class ShowgroupAction extends GroupDesignAction
                           array('nickname' => $this->group->nickname));
     }
 
-    /**
-     * Show the group profile
-     *
-     * Information about the group
-     *
-     * @return void
-     */
-    function showGroupProfile()
-    {
-        $this->elementStart('div', array('id' => 'i',
-                                         'class' => 'entity_profile vcard author'));
-
-        $logo = ($this->group->homepage_logo) ?
-          $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE);
-
-        $this->element('img', array('src' => $logo,
-                                    'class' => 'photo avatar entity_depiction',
-                                    'width' => AVATAR_PROFILE_SIZE,
-                                    'height' => AVATAR_PROFILE_SIZE,
-                                    'alt' => $this->group->nickname));
-
-        $hasFN = ($this->group->fullname) ? 'entity_nickname nickname url uid' :
-            'entity_nickname fn org nickname url uid';
-        $this->element('a', array('href' => $this->group->homeUrl(),
-                                  'rel' => 'me', 'class' => $hasFN),
-                            $this->group->nickname);
-
-        if ($this->group->fullname) {
-            $this->element('div', 'entity_fn fn org', $this->group->fullname);
-        }
-
-        if ($this->group->location) {
-            $this->element('div', 'entity_location label', $this->group->location);
-        }
-
-        if ($this->group->homepage) {
-            $this->element('a', array('href' => $this->group->homepage,
-                                      'rel' => 'me',
-                                      'class' => 'url entity_url'),
-                           $this->group->homepage);
-        }
-
-        if ($this->group->description) {
-            $this->element('div', 'note entity_note', $this->group->description);
-        }
-
-        if (common_config('group', 'maxaliases') > 0) {
-            $aliases = $this->group->getAliases();
-
-            if (!empty($aliases)) {
-                $this->element('div',
-                               'aliases entity_aliases',
-                               implode(' ', $aliases));
-            }
-
-            if ($this->group->description) {
-                $this->elementStart('dl', 'entity_note');
-                // TRANS: Label for group description or group note (dt). Text hidden by default.
-                $this->element('dt', null, _('Note'));
-                $this->element('dd', 'note', $this->group->description);
-                $this->elementEnd('dl');
-            }
-
-            if (common_config('group', 'maxaliases') > 0) {
-                $aliases = $this->group->getAliases();
-
-                if (!empty($aliases)) {
-                    $this->elementStart('dl', 'entity_aliases');
-                    // TRANS: Label for group aliases (dt). Text hidden by default.
-                    $this->element('dt', null, _('Aliases'));
-                    $this->element('dd', 'aliases', implode(' ', $aliases));
-                    $this->elementEnd('dl');
-                }
-            }
-
-            Event::handle('EndGroupProfileElements', array($this, $this->group));
-        }
-
-        $this->elementEnd('div');
-    }
-
-    function showGroupActions()
-    {
-        $cur = common_current_user();
-        $this->elementStart('div', 'entity_actions');
-        // TRANS: Group actions header (h2). Text hidden by default.
-        $this->element('h2', null, _('Group actions'));
-        $this->elementStart('ul');
-        if (Event::handle('StartGroupActionsList', array($this, $this->group))) {
-            $this->elementStart('li', 'entity_subscribe');
-            if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
-                if ($cur) {
-                    if ($cur->isMember($this->group)) {
-                        $lf = new LeaveForm($this, $this->group);
-                        $lf->show();
-                    } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
-                        $jf = new JoinForm($this, $this->group);
-                        $jf->show();
-                    }
-                }
-                Event::handle('EndGroupSubscribe', array($this, $this->group));
-            }
-            $this->elementEnd('li');
-            if ($cur && $cur->hasRight(Right::DELETEGROUP)) {
-                $this->elementStart('li', 'entity_delete');
-                $df = new DeleteGroupForm($this, $this->group);
-                $df->show();
-                $this->elementEnd('li');
-            }
-            Event::handle('EndGroupActionsList', array($this, $this->group));
-        }
-        $this->elementEnd('ul');
-        $this->elementEnd('div');
-    }
-
     /**
      * Get a list of the feeds for this page
      *
index 8d2686085fc5224fd2a8c6f0680be7a034e5c983..32526b0458dd69c9235911fead82d1b6bde240b1 100644 (file)
@@ -58,7 +58,7 @@ class GroupProfileBlock extends ProfileBlock
     function avatar()
     {
         return ($this->group->homepage_logo) ?
-          $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE);
+            $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE);
     }
 
     function name()
@@ -101,4 +101,38 @@ class GroupProfileBlock extends ProfileBlock
     {
         return $this->group->description;
     }
+
+    function showActions()
+    {
+        $cur = common_current_user();
+        $this->out->elementStart('div', 'entity_actions');
+        // TRANS: Group actions header (h2). Text hidden by default.
+        $this->out->element('h2', null, _('Group actions'));
+        $this->out->elementStart('ul');
+        if (Event::handle('StartGroupActionsList', array($this, $this->group))) {
+            $this->out->elementStart('li', 'entity_subscribe');
+            if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
+                if ($cur) {
+                    if ($cur->isMember($this->group)) {
+                        $lf = new LeaveForm($this->out, $this->group);
+                        $lf->show();
+                    } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
+                        $jf = new JoinForm($this->out, $this->group);
+                        $jf->show();
+                    }
+                }
+                Event::handle('EndGroupSubscribe', array($this, $this->group));
+            }
+            $this->out->elementEnd('li');
+            if ($cur && $cur->hasRight(Right::DELETEGROUP)) {
+                $this->out->elementStart('li', 'entity_delete');
+                $df = new DeleteGroupForm($this->out, $this->group);
+                $df->show();
+                $this->out->elementEnd('li');
+            }
+            Event::handle('EndGroupActionsList', array($this, $this->group));
+        }
+        $this->out->elementEnd('ul');
+        $this->out->elementEnd('div');
+    }
 }