summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-04-05 11:04:47 -0400
committerEvan Prodromou <evan@status.net>2010-04-05 11:04:47 -0400
commit0b30230b5ad482b9510775510f77dbbc62970150 (patch)
tree222e2466b96369fd687b7fce581df36f28da905d /actions
parentd4940fe148002bfd6619bcbef95763395bb6d9cc (diff)
parent2882e40540b6ca0aaeb7b9e1841622cf0442ae3d (diff)
Merge branch 'nofollow'
Diffstat (limited to 'actions')
-rw-r--r--actions/peopletag.php44
-rw-r--r--actions/showgroup.php48
2 files changed, 78 insertions, 14 deletions
diff --git a/actions/peopletag.php b/actions/peopletag.php
index 4ba1dc0f1..af40b9d82 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,41 @@ 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 showHomepage()
+ {
+ if (!empty($this->profile->homepage)) {
+ $this->out->text(' ');
+ $aAttrs = array('href' => $this->profile->homepage,
+ 'class' => 'url');
+ if (common_config('nofollow', 'peopletag')) {
+ $aAttrs['rel'] = 'nofollow';
+ }
+ $this->out->elementStart('a', $aAttrs);
+ $this->out->raw($this->highlight($this->profile->homepage));
+ $this->out->elementEnd('a');
+ }
+ }
+}
+
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;
+ }
+}
+