include action in tags

darcs-hash:20081124025308-eefa4-b4523d386c1dd36d4856949abba1dc8bd8099da0.gz
This commit is contained in:
csarven 2008-11-23 21:53:08 -05:00
parent 525b867718
commit 079b88a688
2 changed files with 9 additions and 10 deletions

View File

@ -134,7 +134,7 @@ class GalleryAction extends Action {
$lim); $lim);
if ($display == 'list') { if ($display == 'list') {
$profile_list = new ProfileList($other, $profile); $profile_list = new ProfileList($other, $profile, $this->trimmed('action'));
$cnt = $profile_list->show_list(); $cnt = $profile_list->show_list();
} else { } else {
$cnt = $this->icon_list($other); $cnt = $this->icon_list($other);

View File

@ -26,10 +26,12 @@ class ProfileList {
var $profile = NULL; var $profile = NULL;
var $owner = NULL; var $owner = NULL;
var $action = NULL;
function __construct($profile, $owner=NULL) { function __construct($profile, $owner=NULL, $action=NULL) {
$this->profile = $profile; $this->profile = $profile;
$this->owner = $owner; $this->owner = $owner;
$this->action = $action;
} }
function show_list() { function show_list() {
@ -124,7 +126,7 @@ class ProfileList {
array('id' => $this->profile->id))), array('id' => $this->profile->id))),
_('Tags')); _('Tags'));
} else { } else {
common_element(_('Tags')); common_text(_('Tags'));
} }
common_text(":"); common_text(":");
common_element_end('dt'); common_element_end('dt');
@ -133,9 +135,9 @@ class ProfileList {
common_element_start('ul', 'tags xoxo'); common_element_start('ul', 'tags xoxo');
foreach ($tags as $tag) { foreach ($tags as $tag) {
common_element_start('li'); common_element_start('li');
common_element('a', array('rel' => "tag", common_element('a', array('rel' => 'tag',
'href' => common_local_url($action, 'href' => common_local_url($this->action,
array('nickname' => $user->nickname, array('nickname' => $this->owner->nickname,
'tag' => $tag))), 'tag' => $tag))),
$tag); $tag);
common_element_end('li'); common_element_end('li');
@ -150,16 +152,13 @@ class ProfileList {
} }
if ($user) { if ($user) {
$action = NULL; $action = NULL;
if ($user->isSubscribed($this->profile)) { if ($user->isSubscribed($this->profile)) {
$action = 'subscriptions'; $action = 'subscriptions';
} else if (Subscription::pkeyGet(array('subscriber' => $this->profile->id, } else if (Subscription::pkeyGet(array('subscriber' => $this->profile->id,
'subscribed' => $user->id))) { 'subscribed' => $user->id))) {
$action = 'subscribers'; $action = 'subscribers';
} }
} }
common_element_end('li'); common_element_end('li');