}
}
+ function showSections()
+ {
+ $this->showSubscriptions();
+ $ibs = new InviteButtonSection($this);
+ $ibs->show();
+ $this->showSubscribers();
+ $this->showGroups();
+ $this->showLists();
+ }
+
function showPageTitle()
{
$user = common_current_user();
mail_send($recipients, $headers, $body);
}
-
- function showObjectNav()
- {
- $nav = new SubGroupNav($this, common_current_user());
- $nav->show();
- }
}
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();
}
$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);
function title()
{
// TRANS: Title for groups with the most members section.
- return _('Groups with most members');
+ return _('Popular groups');
}
function divId()
function title()
{
// TRANS: Title for groups with the most posts section.
- return _('Groups with most posts');
+ return _('Active groups');
}
function divId()
--- /dev/null
+<?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;
+ }
+}
\ No newline at end of file
}
}
- 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');
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',
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');
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');
$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()