Merge branch '1.0.x' of git@gitorious.org:statusnet/mainline into 1.0.x
This commit is contained in:
		| @@ -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(); | ||||
|   | ||||
| @@ -296,10 +296,4 @@ class InviteAction extends CurrentUserDesignAction | ||||
|  | ||||
|         mail_send($recipients, $headers, $body); | ||||
|     } | ||||
|  | ||||
|     function showObjectNav() | ||||
|     { | ||||
|         $nav = new SubGroupNav($this, common_current_user()); | ||||
|         $nav->show(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -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(); | ||||
|     } | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
| @@ -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() | ||||
|   | ||||
| @@ -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() | ||||
|   | ||||
							
								
								
									
										63
									
								
								lib/invitebuttonsection.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								lib/invitebuttonsection.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| <?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'), | ||||
|                                   'class' => 'invite_button'), | ||||
|                             _('Invite more colleagues')); | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| @@ -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'); | ||||
|   | ||||
| @@ -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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user