]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
authorEvan Prodromou <evan@status.net>
Thu, 14 Apr 2011 22:28:03 +0000 (18:28 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 14 Apr 2011 22:28:03 +0000 (18:28 -0400)
Conflicts:
classes/Profile.php

actions/all.php
actions/invite.php
actions/public.php
classes/Profile.php
lib/groupsbymemberssection.php
lib/groupsbypostssection.php
lib/invitebuttonsection.php [new file with mode: 0644]
lib/profileaction.php
lib/section.php

index 5fd2475e4911f3b467a8836cfba87b92a63cdc36..a77d6014f4d116bc9aab8aae3ef3b6e1b219508a 100644 (file)
@@ -183,6 +183,16 @@ class AllAction extends ProfileAction
         }
     }
 
+    function showSections()
+    {
+        $this->showSubscriptions();
+        $ibs = new InviteButtonSection($this);
+        $ibs->show();
+        $this->showSubscribers();
+        $this->showGroups();
+        $this->showLists();
+    }
+
     function showPageTitle()
     {
         $user = common_current_user();
index be2228e703d88eecd82fc8db095ffcab7109b987..9522cac900158638d3797f0497e81958ba6fc485 100644 (file)
@@ -296,10 +296,4 @@ class InviteAction extends CurrentUserDesignAction
 
         mail_send($recipients, $headers, $body);
     }
-
-    function showObjectNav()
-    {
-        $nav = new SubGroupNav($this, common_current_user());
-        $nav->show();
-    }
 }
index 100f8d11943eeec21a295996d5da7b087a185a4e..d906d65501a996dada406b92040e692666eafb51 100644 (file)
@@ -222,14 +222,12 @@ class PublicAction extends Action
 
     function showSections()
     {
-        // $top = new TopPostersSection($this);
-        // $top->show();
         $pop = new PopularNoticeSection($this);
         $pop->show();
+        $ibs = new InviteButtonSection($this);
+        $ibs->show();
         $gbp = new GroupsByMembersSection($this);
         $gbp->show();
-        $ptp = new PeopletagsBySubsSection($this);
-        $ptp->show();
         $feat = new FeaturedUsersSection($this);
         $feat->show();
     }
index 44ab210c15963163009c268d619e14209fb06112..b9c50905a79e6dd06a3b35d01f6f7e660204d7ff 100644 (file)
@@ -1352,7 +1352,11 @@ class Profile extends Memcached_DataObject
         $lists = array();
 
         foreach ($ids as $id) {
-            $lists[] = Profile_list::staticGet('id', $id);
+            $list = Profile_list::staticGet('id', $id);
+            if (!empty($list) && 
+                ($showPrivate || !$list->private)) {
+                $lists[] = $list;
+            }
         }
 
         return new ArrayWrapper($lists);
index 5cf1a563c02c4f66bfe36e97e99dbc714e6d97fb..4cb8ed46f07bf040655222f55f8d7a76dbb99c8e 100644 (file)
@@ -68,7 +68,7 @@ class GroupsByMembersSection extends GroupSection
     function title()
     {
         // TRANS: Title for groups with the most members section.
-        return _('Groups with most members');
+        return _('Popular groups');
     }
 
     function divId()
index 50d60e87cbb226b0e95aaf66399b2e42e67693ff..c338ab7e9717f0a74df1ba2ba8111a3142d2221d 100644 (file)
@@ -68,7 +68,7 @@ class GroupsByPostsSection extends GroupSection
     function title()
     {
         // TRANS: Title for groups with the most posts section.
-        return _('Groups with most posts');
+        return _('Active groups');
     }
 
     function divId()
diff --git a/lib/invitebuttonsection.php b/lib/invitebuttonsection.php
new file mode 100644 (file)
index 0000000..8bf450b
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Section for an invite button
+ * 
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Section
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+    // This check helps protect against security problems;
+    // your code file can't be executed directly from the web.
+    exit(1);
+}
+
+/**
+ * Invite button
+ *
+ * @category  Section
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+class InviteButtonSection extends Section
+{
+    function showTitle()
+    {
+        return false;
+    }
+
+    function showContent()
+    {
+        $this->out->element('a', 
+                            array('href' => common_local_url('invite')),
+                            _('Invite more colleagues'));
+        return false;
+    }
+}
\ No newline at end of file
index 52c471909b5b570ef54e66ae6fbacaa6d15614bb..c919cb6bed65e1c818a610738590aceef502c549 100644 (file)
@@ -271,13 +271,6 @@ class ProfileAction extends OwnerDesignAction
                 }
             }
 
-            if ($cnt > GROUPS_PER_MINILIST) {
-                $this->elementStart('p');
-                // TRANS: Text for user group membership statistics if user has more subscriptions than displayed.
-                $this->statsSectionLink('usergroups', _('All groups'), 'more');
-                $this->elementEnd('p');
-            }
-
             Event::handle('EndShowGroupsMiniList', array($this));
         }
             $this->elementEnd('div');
@@ -285,7 +278,10 @@ class ProfileAction extends OwnerDesignAction
 
     function showLists()
     {
-        $lists = $this->profile->getLists();
+        $cur = common_current_user();
+        $showPrivate = (!empty($cur) && $cur->id == $this->profile->id);
+
+        $lists = $this->profile->getLists($showPrivate);
 
         if ($lists->N > 0) {
             $this->elementStart('div', array('id' => 'entity_lists',
@@ -293,38 +289,39 @@ class ProfileAction extends OwnerDesignAction
 
             if (Event::handle('StartShowListsMiniList', array($this))) {
 
+                $url = common_local_url('peopletagsbyuser',
+                                        array('nickname' => $this->profile->nickname));
+
                 $this->elementStart('h2');
                 // TRANS: H2 text for user list membership statistics.
-                $this->statsSectionLink('userlists', _('Lists'));
+                $this->element('a',
+                               array('href' => $url),
+                               _('Lists'));
                 $this->text(' ');
                 $this->text($lists->N);
                 $this->elementEnd('h2');
 
                 $this->elementStart('ul');
 
-                $cur = common_current_user();
 
                 $first = true;
 
                 while ($lists->fetch()) {
-                    if (!$lists->private ||
-                        ($lists->private && !empty($cur) && $cur->id == $profile->id)) {
-                        if (!empty($lists->mainpage)) {
-                            $url = $lists->mainpage;
-                        } else {
-                            $url = common_local_url('showprofiletag',
-                                                    array('tagger' => $this->profile->nickname,
-                                                          'tag'    => $lists->tag));
-                        }
-                        if (!$first) {
-                            $this->text(', ');
-                        } else {
-                            $first = false;
-                        }
-
-                        $this->element('a', array('href' => $url),
-                                       $lists->tag);
+                    if (!empty($lists->mainpage)) {
+                        $url = $lists->mainpage;
+                    } else {
+                        $url = common_local_url('showprofiletag',
+                                                array('tagger' => $this->profile->nickname,
+                                                      'tag'    => $lists->tag));
+                    }
+                    if (!$first) {
+                        $this->text(', ');
+                    } else {
+                        $first = false;
                     }
+
+                    $this->element('a', array('href' => $url),
+                                   $lists->tag);
                 }
 
                 $this->elementEnd('ul');
index d77673898a7d5ab7119bcd6afc4dc7e477f7b2d8..2d8d6f3673f50233ec266a964f22ea8a27297f45 100644 (file)
@@ -61,6 +61,19 @@ class Section extends Widget
                                  array('id' => $this->divId(),
                                        'class' => 'section'));
 
+        $this->showTitle();
+
+        $have_more = $this->showContent();
+
+        if ($have_more) {
+            $this->showMore();
+        }
+
+        $this->out->elementEnd('div');
+    }
+
+    function showTitle()
+    {
         $link = $this->link();
         if (!empty($link)) {
             $this->out->elementStart('h2');
@@ -70,18 +83,15 @@ class Section extends Widget
             $this->out->element('h2', null,
                                 $this->title());
         }
+    }
 
-        $have_more = $this->showContent();
-
-        if ($have_more) {
-            $this->out->elementStart('p');
-            $this->out->element('a', array('href' => $this->moreUrl(),
-                                      'class' => 'more'),
-                           $this->moreTitle());
-            $this->out->elementEnd('p');
-        }
-
-        $this->out->elementEnd('div');
+    function showMore()
+    {
+        $this->out->elementStart('p');
+        $this->out->element('a', array('href' => $this->moreUrl(),
+                                       'class' => 'more'),
+                            $this->moreTitle());
+        $this->out->elementEnd('p');
     }
 
     function divId()