return false;
case 'TagsubAction':
case 'TagunsubAction':
+ case 'TagsubsAction':
case 'TagSubForm':
case 'TagUnsubForm':
include_once $dir.'/'.strtolower($cls).'.php';
$action = $widget->out;
$action_name = $action->trimmed('action');
- $widget->item('tagsubs',
- array(),
- // TRANS: SubMirror plugin menu item on user settings page.
- _m('MENU', 'Tags'),
- // TRANS: SubMirror plugin tooltip for user settings menu item.
- _m('Configure tag subscriptions'));
+ $action->menuItem(common_local_url('tagsubs', array('nickname' => $action->user->nickname)),
+ // TRANS: SubMirror plugin menu item on user settings page.
+ _m('MENU', 'Tags'),
+ // TRANS: SubMirror plugin tooltip for user settings menu item.
+ _m('Configure tag subscriptions'),
+ $action_name == 'tagsubs' && $action->arg('nickname') == $action->user->nickname);
return true;
}
$entry = array(
'id' => 'tagsubs',
'label' => _m('Tag subscriptions'),
- 'link' => common_local_url('tagsubs'),
+ 'link' => common_local_url('tagsubs', array('nickname' => $profile->nickname)),
'value' => $tagsub->count(),
);
$this->element('p', null,
// TRANS: Page notice for page with an overview of all tag subscriptions
// TRANS: of the logged in user's own profile.
- _m('You have subscribed to receive all notices on this site containing the following tags.'));
+ _m('You have subscribed to receive all notices on this site containing the following tags:'));
} else {
$this->element('p', null,
// TRANS: Page notice for page with an overview of all subscriptions of a user other
// TRANS: than the logged in user. %s is the user nickname.
- sprintf(_m('%s has subscribed to receive all notices on this site containing the following tags.'),
+ sprintf(_m('%s has subscribed to receive all notices on this site containing the following tags:'),
$this->profile->nickname));
}
}
$tagsub = new TagSub();
$tagsub->profile_id = $this->user->id;
- $tagsub->limit($limit);
- $tagsub->offset($offset);
+ $tagsub->limit($limit, $offset);
$tagsub->find();
if ($tagsub->N) {
if (0 == $cnt) {
$this->showEmptyListMessage();
}
+ } else {
+ $this->showEmptyListMessage();
}
$this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
if (common_logged_in()) {
$current_user = common_current_user();
if ($this->user->id === $current_user->id) {
- // TRANS: Subscription list text when the logged in user has no subscriptions.
- // TRANS: This message contains Markdown URLs. The link description is between
- // TRANS: square brackets, and the link between parentheses. Do not separate "]("
- // TRANS: and do not change the URL part.
- $message = _('You\'re not listening to anyone\'s notices right now, try subscribing to people you know. '.
- 'Try [people search](%%action.peoplesearch%%), look for members in groups you\'re interested '.
- 'in and in our [featured users](%%action.featured%%). '.
- 'If you\'re a [Twitter user](%%action.twittersettings%%), you can automatically subscribe to '.
- 'people you already follow there.');
+ // TRANS: Tag subscription list text when the logged in user has no tag subscriptions.
+ $message = _('You\'re not listening to any hash tags right now. You can push the "Subscribe" button ' .
+ 'on any hashtag page to automatically receive any public messages on this site that use that ' .
+ 'tag, even if you\'re not subscribed to the poster.');
} else {
- // TRANS: Subscription list text when looking at the subscriptions for a of a user other
- // TRANS: than the logged in user that has no subscriptions. %s is the user nickname.
+ // TRANS: Tag subscription list text when looking at the subscriptions for a of a user other
+ // TRANS: than the logged in user that has no tag subscriptions. %s is the user nickname.
$message = sprintf(_('%s is not listening to any tags.'), $this->user->nickname);
}
}
class TagSubscriptionsListItem extends SubscriptionListItem
{
+ function startItem()
+ {
+ $this->out->elementStart('li', array('class' => 'tagsub'));
+ }
+
function showProfile()
{
- $this->startProfile();
+ $tagsub = $this->profile;
+ $tag = $tagsub->tag;
+
// Relevant portion!
$cur = common_current_user();
if (!empty($cur) && $cur->id == $this->owner->id) {
$this->showOwnerControls();
}
- $this->endProfile();
+
+ $url = common_local_url('tag', array('tag' => $tag));
+ $linkline = sprintf(_m('#<a href="%s">%s</a> since %s'),
+ htmlspecialchars($url),
+ htmlspecialchars($tag),
+ common_date_string($tagsub->created));
+
+ $this->out->elementStart('div', 'tagsub-item');
+ $this->out->raw($linkline);
+ $this->out->element('div', array('style' => 'clear: both'));
+ $this->out->elementEnd('div');
+ }
+
+ function showActions()
+ {
}
function showOwnerControls()
{
+ $this->out->elementStart('div', 'entity_actions');
+
$tagsub = $this->profile; // ?
- $form = new TagSubForm($this->out, $tagsub->tag);
+ $form = new TagUnsubForm($this->out, $tagsub->tag);
$form->show();
+
+ $this->out->elementEnd('div');
return;
}
}