summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-04-07 10:47:29 -0400
committerEvan Prodromou <evan@status.net>2010-04-07 10:47:29 -0400
commit727ea5a5163249eb40fa0c4b2c63054fc997473b (patch)
treee7c412d8d858d7d7dba60ea15fb62e6ac83ef1fc /actions
parent439fd589eb256e7ee48796ee7c880536325fa2cb (diff)
parentecf32880254666860335d4fe2a96909cd592d3e8 (diff)
Merge branch '0.9.x' into 1.0.x
Diffstat (limited to 'actions')
-rw-r--r--actions/apigrouplist.php9
-rw-r--r--actions/block.php7
-rw-r--r--actions/groupblock.php7
-rw-r--r--actions/groupmembers.php18
-rw-r--r--actions/peopletag.php36
-rw-r--r--actions/showgroup.php48
-rw-r--r--actions/subscribers.php18
7 files changed, 126 insertions, 17 deletions
diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php
index dd2a68c66..3ea2c30cb 100644
--- a/actions/apigrouplist.php
+++ b/actions/apigrouplist.php
@@ -93,6 +93,7 @@ class ApiGroupListAction extends ApiBareAuthAction
parent::handle($args);
$sitename = common_config('site', 'name');
+ // TRANS: %s is a user name
$title = sprintf(_("%s's groups"), $this->user->nickname);
$taguribase = TagURI::base();
$id = "tag:$taguribase:Groups";
@@ -100,10 +101,12 @@ class ApiGroupListAction extends ApiBareAuthAction
'usergroups',
array('nickname' => $this->user->nickname)
);
+
$subtitle = sprintf(
- _("Groups %1\$s is a member of on %2\$s."),
- $this->user->nickname,
- $sitename
+ // TRANS: Meant to convey the user %2$s is a member of each of the groups listed on site %1$s
+ _("%1\$s groups %2\$s is a member of."),
+ $sitename,
+ $this->user->nickname
);
switch($this->format) {
diff --git a/actions/block.php b/actions/block.php
index 5fae45dff..fe4ec0088 100644
--- a/actions/block.php
+++ b/actions/block.php
@@ -168,4 +168,11 @@ class BlockAction extends ProfileFormAction
return;
}
}
+
+ function showScripts()
+ {
+ parent::showScripts();
+ $this->autofocus('form_action-yes');
+ }
+
}
diff --git a/actions/groupblock.php b/actions/groupblock.php
index ec673358e..88d7634a2 100644
--- a/actions/groupblock.php
+++ b/actions/groupblock.php
@@ -214,5 +214,12 @@ class GroupblockAction extends Action
303);
}
}
+
+ function showScripts()
+ {
+ parent::showScripts();
+ $this->autofocus('form_action-yes');
+ }
+
}
diff --git a/actions/groupmembers.php b/actions/groupmembers.php
index a16debd7b..fb4e46dbc 100644
--- a/actions/groupmembers.php
+++ b/actions/groupmembers.php
@@ -212,6 +212,7 @@ class GroupMemberListItem extends ProfileListItem
}
}
+
function showGroupBlockForm()
{
$user = common_current_user();
@@ -224,7 +225,24 @@ class GroupMemberListItem extends ProfileListItem
$bf->show();
$this->out->elementEnd('li');
}
+ }
+
+ function linkAttributes()
+ {
+ $aAttrs = parent::linkAttributes();
+
+ if (common_config('nofollow', 'members')) {
+ $aAttrs['rel'] .= ' nofollow';
+ }
+
+ return $aAttrs;
+ }
+ function homepageAttributes()
+ {
+ if (common_config('nofollow', 'members')) {
+ $aAttrs['rel'] = 'nofollow';
+ }
}
}
diff --git a/actions/peopletag.php b/actions/peopletag.php
index 4ba1dc0f1..456cc21c4 100644
--- a/actions/peopletag.php
+++ b/actions/peopletag.php
@@ -32,8 +32,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
-require_once INSTALLDIR.'/lib/profilelist.php';
-
/**
* This class outputs a paginated list of profiles self-tagged with a given tag
*
@@ -124,8 +122,8 @@ class PeopletagAction extends Action
$profile->query(sprintf($qry, $this->tag, $lim));
- $pl = new ProfileList($profile, $this);
- $cnt = $pl->show();
+ $ptl = new PeopleTagList($profile, $this); // pass the ammunition
+ $cnt = $ptl->show();
$this->pagination($this->page > 1,
$cnt > PROFILES_PER_PAGE,
@@ -146,3 +144,33 @@ class PeopletagAction extends Action
}
}
+
+class PeopleTagList extends ProfileList
+{
+ function newListItem($profile)
+ {
+ return new PeopleTagListItem($profile, $this->action);
+ }
+}
+
+class PeopleTagListItem extends ProfileListItem
+{
+ function linkAttributes()
+ {
+ $aAttrs = parent::linkAttributes();
+
+ if (common_config('nofollow', 'peopletag')) {
+ $aAttrs['rel'] .= ' nofollow';
+ }
+
+ return $aAttrs;
+ }
+
+ function homepageAttributes()
+ {
+ if (common_config('nofollow', 'peopletag')) {
+ $aAttrs['rel'] = 'nofollow';
+ }
+ }
+}
+
diff --git a/actions/showgroup.php b/actions/showgroup.php
index a0d05ba37..3d369e9eb 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -388,18 +388,23 @@ class ShowgroupAction extends GroupDesignAction
$this->elementStart('div', array('id' => 'entity_members',
'class' => 'section'));
- $this->element('h2', null, _('Members'));
+ if (Event::handle('StartShowGroupMembersMiniList', array($this))) {
- $pml = new ProfileMiniList($member, $this);
- $cnt = $pml->show();
- if ($cnt == 0) {
- $this->element('p', null, _('(None)'));
- }
+ $this->element('h2', null, _('Members'));
+
+ $gmml = new GroupMembersMiniList($member, $this);
+ $cnt = $gmml->show();
+ if ($cnt == 0) {
+ $this->element('p', null, _('(None)'));
+ }
+
+ if ($cnt > MEMBERS_PER_SECTION) {
+ $this->element('a', array('href' => common_local_url('groupmembers',
+ array('nickname' => $this->group->nickname))),
+ _('All members'));
+ }
- if ($cnt > MEMBERS_PER_SECTION) {
- $this->element('a', array('href' => common_local_url('groupmembers',
- array('nickname' => $this->group->nickname))),
- _('All members'));
+ Event::handle('EndShowGroupMembersMiniList', array($this));
}
$this->elementEnd('div');
@@ -502,3 +507,26 @@ class GroupAdminSection extends ProfileSection
return null;
}
}
+
+class GroupMembersMiniList extends ProfileMiniList
+{
+ function newListItem($profile)
+ {
+ return new GroupMembersMiniListItem($profile, $this->action);
+ }
+}
+
+class GroupMembersMiniListItem extends ProfileMiniListItem
+{
+ function linkAttributes()
+ {
+ $aAttrs = parent::linkAttributes();
+
+ if (common_config('nofollow', 'members')) {
+ $aAttrs['rel'] .= ' nofollow';
+ }
+
+ return $aAttrs;
+ }
+}
+
diff --git a/actions/subscribers.php b/actions/subscribers.php
index 4bced6284..6dda7312d 100644
--- a/actions/subscribers.php
+++ b/actions/subscribers.php
@@ -163,4 +163,22 @@ class SubscribersListItem extends SubscriptionListItem
$bf->show();
}
}
+
+ function linkAttributes()
+ {
+ $aAttrs = parent::linkAttributes();
+
+ if (common_config('nofollow', 'subscribers')) {
+ $aAttrs['rel'] .= ' nofollow';
+ }
+
+ return $aAttrs;
+ }
+
+ function homepageAttributes()
+ {
+ if (common_config('nofollow', 'subscribers')) {
+ $aAttrs['rel'] = 'nofollow';
+ }
+ }
}