People tags -> Lists (only UI changes, for experimentation)

This commit is contained in:
Shashi Gowda 2011-04-13 13:45:25 +05:30 committed by Zach Copley
parent 22f6151a10
commit 53af608ef8
21 changed files with 231 additions and 139 deletions

View File

@ -49,11 +49,11 @@ class EditpeopletagAction extends OwnerDesignAction
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $this->boolean('delete')) { if ($_SERVER['REQUEST_METHOD'] == 'POST' && $this->boolean('delete')) {
// TRANS: Title for edit people tag page after deleting a tag. // TRANS: Title for edit people tag page after deleting a tag.
// TRANS: %s is a tag. // TRANS: %s is a tag.
return sprintf(_('Delete %s people tag'), $this->peopletag->tag); return sprintf(_('Delete %s list'), $this->peopletag->tag);
} }
// TRANS: Title for edit people tag page. // TRANS: Title for edit people tag page.
// TRANS: %s is a tag. // TRANS: %s is a tag.
return sprintf(_('Edit people tag %s'), $this->peopletag->tag); return sprintf(_('Edit list %s'), $this->peopletag->tag);
} }
/** /**
@ -106,7 +106,7 @@ class EditpeopletagAction extends OwnerDesignAction
if (!$this->peopletag) { if (!$this->peopletag) {
// TRANS: Client error displayed when referring to a non-exsting people tag. // TRANS: Client error displayed when referring to a non-exsting people tag.
$this->clientError(_('No such people tag.'), 404); $this->clientError(_('No such list.'), 404);
return false; return false;
} }
@ -216,7 +216,7 @@ class EditpeopletagAction extends OwnerDesignAction
} else { } else {
$this->element('p', 'instructions', $this->element('p', 'instructions',
// TRANS: Form instruction for edit people tag form. // TRANS: Form instruction for edit people tag form.
_('Use this form to edit the people tag.')); _('Use this form to edit the list.'));
} }
} }
@ -294,7 +294,7 @@ class EditpeopletagAction extends OwnerDesignAction
if (!$result) { if (!$result) {
common_log_db_error($this->group, 'UPDATE', __FILE__); common_log_db_error($this->group, 'UPDATE', __FILE__);
// TRANS: TRANS: Server error displayed when updating a people tag fails. // TRANS: TRANS: Server error displayed when updating a people tag fails.
$this->serverError(_('Could not update people tag.')); $this->serverError(_('Could not update list.'));
} }
$this->peopletag->query('COMMIT'); $this->peopletag->query('COMMIT');

View File

@ -93,7 +93,7 @@ class PeopletaggedAction extends OwnerDesignAction
if (!$this->peopletag) { if (!$this->peopletag) {
// TRANS: Client error displayed when referring to non-existing people tag. // TRANS: Client error displayed when referring to non-existing people tag.
$this->clientError(_('No such people tag.'), 404); $this->clientError(_('No such list.'), 404);
return false; return false;
} }
@ -105,12 +105,12 @@ class PeopletaggedAction extends OwnerDesignAction
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Title for list of people tagged by the user with a tag. // TRANS: Title for list of people tagged by the user with a tag.
// TRANS: %1$s is a tag, %2$s is a username. // TRANS: %1$s is a tag, %2$s is a username.
return sprintf(_('People tagged %1$s by %2$s'), return sprintf(_('People listed in %1$s by %2$s'),
$this->peopletag->tag, $this->tagger->nickname); $this->peopletag->tag, $this->tagger->nickname);
} else { } else {
// TRANS: Title for list of people tagged by the user with a tag. // TRANS: Title for list of people tagged by the user with a tag.
// TRANS: %1$s is a tag, %2$s is a username, %2$s is a page number. // TRANS: %1$s is a tag, %2$s is a username, %2$s is a page number.
return sprintf(_('People tagged %1$s by %2$s, page %3$d'), return sprintf(_('People listed in %1$s by %2$s, page %3$d'),
$this->peopletag->tag, $this->user->nickname, $this->peopletag->tag, $this->user->nickname,
$this->page); $this->page);
} }

View File

@ -2,7 +2,7 @@
/** /**
* StatusNet, the distributed open-source microblogging tool * StatusNet, the distributed open-source microblogging tool
* *
* People tags by a user * Lists by a user
* *
* PHP version 5 * PHP version 5
* *
@ -49,22 +49,22 @@ class PeopletagsbyuserAction extends OwnerDesignAction
if ($this->page == 1) { if ($this->page == 1) {
if ($this->isOwner()) { if ($this->isOwner()) {
if ($this->arg('private')) { if ($this->arg('private')) {
// TRANS: Title for people tags by a user page for a private tag. // TRANS: Title for lists by a user page for a private tag.
return _('Private people tags by you'); return _('Private lists by you');
} else if ($this->arg('public')) { } else if ($this->arg('public')) {
// TRANS: Title for people tags by a user page for a public tag. // TRANS: Title for lists by a user page for a public tag.
return _('Public people tags by you'); return _('Public lists by you');
} }
// TRANS: Title for people tags by a user page. // TRANS: Title for lists by a user page.
return _('People tags by you'); return _('Lists by you');
} }
// TRANS: Title for people tags by a user page. // TRANS: Title for lists by a user page.
// TRANS: %s is a user nickname. // TRANS: %s is a user nickname.
return sprintf(_('People tags by %s'), $this->tagger->nickname); return sprintf(_('Lists by %s'), $this->tagger->nickname);
} else { } else {
// TRANS: Title for people tags by a user page. // TRANS: Title for lists by a user page.
// TRANS: %1$s is a user nickname, %2$d is a page number. // TRANS: %1$s is a user nickname, %2$d is a page number.
return sprintf(_('People tags by %1$s, page %2$d'), $this->tagger->nickname, $this->page); return sprintf(_('Lists by %1$s, page %2$d'), $this->tagger->nickname, $this->page);
} }
} }
@ -124,8 +124,8 @@ class PeopletagsbyuserAction extends OwnerDesignAction
if ($this->isOwner()) { if ($this->isOwner()) {
$this->tags = $this->tagger->getPrivateTags($offset, $limit); $this->tags = $this->tagger->getPrivateTags($offset, $limit);
} else { } else {
// TRANS: Client error displayed when trying view another user's private people tags. // TRANS: Client error displayed when trying view another user's private lists.
$this->clientError(_('You cannot view others\' private people tags'), 403); $this->clientError(_('You cannot view others\' private lists'), 403);
} }
} else { } else {
$this->tags = $this->tagger->getOwnedTags(common_current_user(), $offset, $limit); $this->tags = $this->tagger->getOwnedTags(common_current_user(), $offset, $limit);
@ -160,8 +160,8 @@ class PeopletagsbyuserAction extends OwnerDesignAction
array('href' => array('href' =>
common_local_url('peopletagsforuser', common_local_url('peopletagsforuser',
array('nickname' => $this->user->nickname))), array('nickname' => $this->user->nickname))),
// TRANS: Link text to show people tags for user %s. // TRANS: Link text to show lists for user %s.
sprintf(_('People tags for %s'), $this->tagger->nickname)); sprintf(_('Lists for %s'), $this->tagger->nickname));
$this->elementEnd('li'); $this->elementEnd('li');
if ($this->isOwner()) { if ($this->isOwner()) {
@ -204,11 +204,11 @@ class PeopletagsbyuserAction extends OwnerDesignAction
function showAnonymousMessage() function showAnonymousMessage()
{ {
$notice = $notice =
// TRANS: Message displayed for anonymous users on page that displays people tags by a user. // TRANS: Message displayed for anonymous users on page that displays lists by a user.
// TRANS: This message contains Markdown links in the form [description](links). // TRANS: This message contains Markdown links in the form [description](links).
// TRANS: %s is a tagger nickname. // TRANS: %s is a tagger nickname.
sprintf(_('These are people tags created by **%s**. ' . sprintf(_('These are lists created by **%s**. ' .
'People tags are how you sort similar ' . 'Lists are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' . 'people on %%%%site.name%%%%, a [micro-blogging]' .
'(http://en.wikipedia.org/wiki/Micro-blogging) service ' . '(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' . 'based on the Free Software [StatusNet](http://status.net/) tool. ' .
@ -259,17 +259,29 @@ class PeopletagsbyuserAction extends OwnerDesignAction
return !empty($user) && $user->id == $this->tagger->id; return !empty($user) && $user->id == $this->tagger->id;
} }
function showObjectNav()
{
$nav = new PeopletagNav($this, $this->tagger);
$nav->show();
}
function showEmptyListMessage() function showEmptyListMessage()
{ {
// TRANS: Message displayed on page that displays people tags by a user when there are none. // TRANS: Message displayed on page that displays lists by a user when there are none.
// TRANS: This message contains Markdown links in the form [description](links). // TRANS: This message contains Markdown links in the form [description](links).
// TRANS: %s is a tagger nickname. // TRANS: %s is a tagger nickname.
$message = sprintf(_('%s has not created any [people tags](%%%%doc.tags%%%%) yet.'), $this->tagger->nickname); $message = sprintf(_('%s has not created any [lists](%%%%doc.lists%%%%) yet.'), $this->tagger->nickname);
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message)); $this->raw(common_markup_to_html($message));
$this->elementEnd('div'); $this->elementEnd('div');
} }
function showProfileBlock()
{
$block = new AccountProfileBlock($this, $this->tagger);
$block->show();
}
function showSections() function showSections()
{ {
#TODO: tags with most subscribers #TODO: tags with most subscribers

View File

@ -47,10 +47,10 @@ class PeopletagsforuserAction extends OwnerDesignAction
{ {
if ($this->page == 1) { if ($this->page == 1) {
// Page title. %s is a tagged user's nickname. // Page title. %s is a tagged user's nickname.
return sprintf(_('People tags for %s'), $this->tagged->nickname); return sprintf(_('Lists with %s in them'), $this->tagged->nickname);
} else { } else {
// Page title. %1$s is a tagged user's nickname, %2$s is a page number. // Page title. %1$s is a tagged user's nickname, %2$s is a page number.
return sprintf(_('People tags for %1$s, page %2$d'), $this->tagged->nickname, $this->page); return sprintf(_('Lists with %1$s, page %2$d'), $this->tagged->nickname, $this->page);
} }
} }
@ -105,8 +105,8 @@ class PeopletagsforuserAction extends OwnerDesignAction
// TRANS: Message displayed for anonymous users on page that displays people tags for a user. // TRANS: Message displayed for anonymous users on page that displays people tags for a user.
// TRANS: This message contains Markdown links in the form [description](links). // TRANS: This message contains Markdown links in the form [description](links).
// TRANS: %s is a tagger nickname. // TRANS: %s is a tagger nickname.
sprintf(_('These are people tags for **%s**. ' . sprintf(_('These are lists for **%s**. ' .
'People tags are how you sort similar ' . 'lists are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' . 'people on %%%%site.name%%%%, a [micro-blogging]' .
'(http://en.wikipedia.org/wiki/Micro-blogging) service ' . '(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' . 'based on the Free Software [StatusNet](http://status.net/) tool. ' .
@ -117,27 +117,6 @@ class PeopletagsforuserAction extends OwnerDesignAction
$this->elementEnd('div'); $this->elementEnd('div');
} }
function showPageNotice()
{
$this->elementStart('dl', 'filter_tags');
$this->elementStart('dd', array('id' => 'filter_tags_for',
'class' => 'child_1'));
$user = common_current_user();
// TRANS: Page notice.
$text = ($this->tagged->id == @$user->id) ? _('People tags by you') :
// TRANS: Page notice. %s is a tagger's nickname.
sprintf(_('People tags by %s'), $this->tagged->nickname);
$this->element('a',
array('href' =>
common_local_url('peopletagsbyuser',
array('nickname' => $this->tagged->nickname))),
$text);
$this->elementEnd('dd');
$this->elementEnd('dl');
}
function showContent() function showContent()
{ {
#TODO: controls here. #TODO: controls here.
@ -162,12 +141,24 @@ class PeopletagsforuserAction extends OwnerDesignAction
// TRANS: Message displayed on page that displays people tags for a user when there are none. // TRANS: Message displayed on page that displays people tags for a user when there are none.
// TRANS: This message contains Markdown links in the form [description](links). // TRANS: This message contains Markdown links in the form [description](links).
// TRANS: %s is a tagger nickname. // TRANS: %s is a tagger nickname.
$message = sprintf(_('%s has not been [tagged](%%%%doc.tags%%%%) by anyone yet.'), $this->tagged->nickname); $message = sprintf(_('%s has not been [listed](%%%%doc.lists%%%%) by anyone yet.'), $this->tagged->nickname);
$this->elementStart('div', 'guide'); $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message)); $this->raw(common_markup_to_html($message));
$this->elementEnd('div'); $this->elementEnd('div');
} }
function showObjectNav()
{
$nav = new PeopletagNav($this, $this->tagged);
$nav->show();
}
function showProfileBlock()
{
$block = new AccountProfileBlock($this, $this->tagged);
$block->show();
}
function showSections() function showSections()
{ {
#TODO: tags with most subscribers #TODO: tags with most subscribers

View File

@ -48,11 +48,11 @@ class PeopletagsubscriptionsAction extends OwnerDesignAction
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Title for page that displays people tags subscribed to by a user. // TRANS: Title for page that displays people tags subscribed to by a user.
// TRANS: %s is a profile nickname. // TRANS: %s is a profile nickname.
return sprintf(_('People tags subscriptions by %s'), $this->profile->nickname); return sprintf(_('Lists subscribed to by %s'), $this->profile->nickname);
} else { } else {
// TRANS: Title for page that displays people tags subscribed to by a user. // TRANS: Title for page that displays people tags subscribed to by a user.
// TRANS: %1$s is a profile nickname, %2$d is a page number. // TRANS: %1$s is a profile nickname, %2$d is a page number.
return sprintf(_('People tags subscriptions by %1$s, page %2$d'), $this->profile->nickname, $this->page); return sprintf(_('Lists subscribed to by %1$s, page %2$d'), $this->profile->nickname, $this->page);
} }
} }
@ -107,13 +107,13 @@ class PeopletagsubscriptionsAction extends OwnerDesignAction
// TRANS: Message displayed for anonymous users on page that displays people tags subscribed to by a user. // TRANS: Message displayed for anonymous users on page that displays people tags subscribed to by a user.
// TRANS: This message contains Markdown links in the form [description](links). // TRANS: This message contains Markdown links in the form [description](links).
// TRANS: %s is a profile nickname. // TRANS: %s is a profile nickname.
sprintf(_('These are people tags subscribed to by **%s**. ' . sprintf(_('These are lists subscribed to by **%s**. ' .
'People tags are how you sort similar ' . 'Lists are how you sort similar ' .
'people on %%%%site.name%%%%, a [micro-blogging]' . 'people on %%%%site.name%%%%, a [micro-blogging]' .
'(http://en.wikipedia.org/wiki/Micro-blogging) service ' . '(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' . 'based on the Free Software [StatusNet](http://status.net/) tool. ' .
'You can easily keep track of what they ' . 'You can easily keep track of what they ' .
'are doing by subscribing to the tag\'s timeline.' ), $this->profile->nickname); 'are doing by subscribing to the list\'s timeline.' ), $this->profile->nickname);
$this->elementStart('div', array('id' => 'anon_notice')); $this->elementStart('div', array('id' => 'anon_notice'));
$this->raw(common_markup_to_html($notice)); $this->raw(common_markup_to_html($notice));
$this->elementEnd('div'); $this->elementEnd('div');
@ -133,6 +133,18 @@ class PeopletagsubscriptionsAction extends OwnerDesignAction
$this->page, 'peopletagsubscriptions', array('nickname' => $this->profile->id)); $this->page, 'peopletagsubscriptions', array('nickname' => $this->profile->id));
} }
function showObjectNav()
{
$nav = new PeopletagNav($this, $this->profile);
$nav->show();
}
function showProfileBlock()
{
$block = new AccountProfileBlock($this, $this->profile);
$block->show();
}
function showSections() function showSections()
{ {
#TODO: tags with most subscribers #TODO: tags with most subscribers

View File

@ -122,7 +122,7 @@ class ShowprofiletagAction extends Action
if($this->peopletag->private) { if($this->peopletag->private) {
// TRANS: Title for private people tag timeline. // TRANS: Title for private people tag timeline.
// TRANS: %1$s is a people tag, %2$s is a page number. // TRANS: %1$s is a people tag, %2$s is a page number.
return sprintf(_('Private timeline for people tagged %1$s by you, page %2$d'), return sprintf(_('Private timeline for %1$s list by you, page %2$d'),
$this->peopletag->tag, $this->page); $this->peopletag->tag, $this->page);
} }
@ -130,13 +130,13 @@ class ShowprofiletagAction extends Action
if (!empty($current) && $current->id == $this->peopletag->tagger) { if (!empty($current) && $current->id == $this->peopletag->tagger) {
// TRANS: Title for public people tag timeline where the viewer is the tagger. // TRANS: Title for public people tag timeline where the viewer is the tagger.
// TRANS: %1$s is a people tag, %2$s is a page number. // TRANS: %1$s is a people tag, %2$s is a page number.
return sprintf(_('Timeline for people tagged %1$s by you, page %2$d'), return sprintf(_('Timeline for %1$s list by you, page %2$d'),
$this->peopletag->tag, $this->page); $this->peopletag->tag, $this->page);
} }
// TRANS: Title for private people tag timeline. // TRANS: Title for private people tag timeline.
// TRANS: %1$s is a people tag, %2$s is the tagger's nickname, %3$d is a page number. // TRANS: %1$s is a people tag, %2$s is the tagger's nickname, %3$d is a page number.
return sprintf(_('Timeline for people tagged %1$s by %2$s, page %3$d'), return sprintf(_('Timeline for %1$s list by %2$s, page %3$d'),
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname, $this->tagger->nickname,
$this->page $this->page
@ -145,7 +145,7 @@ class ShowprofiletagAction extends Action
if($this->peopletag->private) { if($this->peopletag->private) {
// TRANS: Title for private people tag timeline. // TRANS: Title for private people tag timeline.
// TRANS: %s is a people tag. // TRANS: %s is a people tag.
return sprintf(_('Private timeline of people tagged %s by you'), return sprintf(_('Private timeline of %s list by you'),
$this->peopletag->tag); $this->peopletag->tag);
} }
@ -153,13 +153,13 @@ class ShowprofiletagAction extends Action
if (!empty($current) && $current->id == $this->peopletag->tagger) { if (!empty($current) && $current->id == $this->peopletag->tagger) {
// TRANS: Title for public people tag timeline where the viewer is the tagger. // TRANS: Title for public people tag timeline where the viewer is the tagger.
// TRANS: %s is a people tag. // TRANS: %s is a people tag.
return sprintf(_('Timeline for people tagged %s by you'), return sprintf(_('Timeline for %s list by you'),
$this->peopletag->tag); $this->peopletag->tag);
} }
// TRANS: Title for private people tag timeline. // TRANS: Title for private people tag timeline.
// TRANS: %1$s is a people tag, %2$s is the tagger's nickname. // TRANS: %1$s is a people tag, %2$s is the tagger's nickname.
return sprintf(_('Timeline for people tagged %1$s by %2$s'), return sprintf(_('Timeline for %1$s list by %2$s'),
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname $this->tagger->nickname
); );
@ -190,7 +190,7 @@ class ShowprofiletagAction extends Action
), ),
// TRANS: Feed title. // TRANS: Feed title.
// TRANS: %1$s is a people tag, %2$s is tagger's nickname. // TRANS: %1$s is a people tag, %2$s is tagger's nickname.
sprintf(_('Feed for people tagged %1$s by %2$s (Atom)'), sprintf(_('Feed for %1$s list by %2$s (Atom)'),
$this->peopletag->tag, $this->tagger->nickname $this->peopletag->tag, $this->tagger->nickname
) )
) )
@ -207,7 +207,7 @@ class ShowprofiletagAction extends Action
{ {
// TRANS: Empty list message for people tag timeline. // TRANS: Empty list message for people tag timeline.
// TRANS: %1$s is a people tag, %2$s is a tagger's nickname. // TRANS: %1$s is a people tag, %2$s is a tagger's nickname.
$message = sprintf(_('This is the timeline for people tagged %1$s by %2$s but no one has posted anything yet.'), $message = sprintf(_('This is the timeline for %1$s list by %2$s but no one has posted anything yet.'),
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname) . ' '; $this->tagger->nickname) . ' ';
@ -291,11 +291,11 @@ class ShowprofiletagAction extends Action
if(!empty($current) && $this->peopletag->tagger == $current->id) { if(!empty($current) && $this->peopletag->tagger == $current->id) {
// TRANS: Header on show profile tag page. // TRANS: Header on show profile tag page.
// TRANS: %s is a people tag. // TRANS: %s is a people tag.
$title = sprintf(_('People tagged %s by you'), $this->peopletag->tag); $title = sprintf(_('Listed'), $this->peopletag->tag);
} else { } else {
// TRANS: Header on show profile tag page. // TRANS: Header on show profile tag page.
// TRANS: %1$s is a people tag, %2$s is a tagger's nickname. // TRANS: %1$s is a people tag, %2$s is a tagger's nickname.
$title = sprintf(_('People tagged %1$s by %2$s'), $title = sprintf(_('Listed'),
$this->peopletag->tag, $this->peopletag->tag,
$this->tagger->nickname); $this->tagger->nickname);
} }

View File

@ -107,7 +107,7 @@ class PeopletagEditForm extends Form
{ {
// TRANS: Form legend for people tag edit form. // TRANS: Form legend for people tag edit form.
// TRANS: %s is a people tag. // TRANS: %s is a people tag.
$this->out->element('legend', null, sprintf(_('Edit people tag %s'), $this->peopletag->tag)); $this->out->element('legend', null, sprintf(_('Edit list %s'), $this->peopletag->tag));
} }
/** /**
@ -138,12 +138,12 @@ class PeopletagEditForm extends Form
$desclimit = Profile_list::maxDescription(); $desclimit = Profile_list::maxDescription();
if ($desclimit == 0) { if ($desclimit == 0) {
// TRANS: Field title for description of people tag. // TRANS: Field title for description of people tag.
$descinstr = _('Describe the people tag or topic.'); $descinstr = _('Describe the list or topic.');
} else { } else {
// TRANS: Field title for description of people tag. // TRANS: Field title for description of people tag.
// TRANS: %d is the maximum number of characters for the description. // TRANS: %d is the maximum number of characters for the description.
$descinstr = sprintf(_m('Describe the people tag or topic in %d character.', $descinstr = sprintf(_m('Describe the list or topic in %d character.',
'Describe the people tag or topic in %d characters.', 'Describe the list or topic in %d characters.',
$desclimit), $desclimit),
$desclimit); $desclimit);
} }
@ -172,7 +172,7 @@ class PeopletagEditForm extends Form
'submit', 'submit',
'delete', 'delete',
// TRANS: Button title to delete a people tag. // TRANS: Button title to delete a people tag.
_('Delete this people tag.')); _('Delete this list.'));
} }
function showProfileList() function showProfileList()

View File

@ -104,10 +104,10 @@ class PeopletagGroupNav extends Widget
$this->out->menuItem(common_local_url('showprofiletag', array('tagger' => $user_profile->nickname, $this->out->menuItem(common_local_url('showprofiletag', array('tagger' => $user_profile->nickname,
'tag' => $tag->tag)), 'tag' => $tag->tag)),
// TRANS: Menu item in people tag navigation panel. // TRANS: Menu item in people tag navigation panel.
_m('MENU','People tag'), _m('MENU','List'),
// TRANS: Menu item title in people tag navigation panel. // TRANS: Menu item title in people tag navigation panel.
// TRANS: %1$s is a tag, %2$s is a nickname. // TRANS: %1$s is a tag, %2$s is a nickname.
sprintf(_('%1$s tag by %2$s.'), $tag->tag, sprintf(_('%1$s list by %2$s.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'showprofiletag', 'nav_timeline_peopletag'); $action == 'showprofiletag', 'nav_timeline_peopletag');
@ -115,10 +115,10 @@ class PeopletagGroupNav extends Widget
$this->out->menuItem(common_local_url('peopletagged', array('tagger' => $user->nickname, $this->out->menuItem(common_local_url('peopletagged', array('tagger' => $user->nickname,
'tag' => $tag->tag)), 'tag' => $tag->tag)),
// TRANS: Menu item in people tag navigation panel. // TRANS: Menu item in people tag navigation panel.
_m('MENU','Tagged'), _m('MENU','Listed'),
// TRANS: Menu item title in people tag navigation panel. // TRANS: Menu item title in people tag navigation panel.
// TRANS: %1$s is a tag, %2$s is a nickname. // TRANS: %1$s is a tag, %2$s is a nickname.
sprintf(_('%1$s tag by %2$s.'), $tag->tag, sprintf(_('%1$s list by %2$s.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'peopletagged', 'nav_peopletag_tagged'); $action == 'peopletagged', 'nav_peopletag_tagged');
@ -129,7 +129,7 @@ class PeopletagGroupNav extends Widget
_m('MENU','Subscribers'), _m('MENU','Subscribers'),
// TRANS: Menu item title in people tag navigation panel. // TRANS: Menu item title in people tag navigation panel.
// TRANS: %1$s is a tag, %2$s is a nickname. // TRANS: %1$s is a tag, %2$s is a nickname.
sprintf(_('Subscribers to %1$s tag by %2$s.'), $tag->tag, sprintf(_('Subscribers to %1$s list by %2$s.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'peopletagsubscribers', 'nav_peopletag_subscribers'); $action == 'peopletagsubscribers', 'nav_peopletag_subscribers');
@ -142,7 +142,7 @@ class PeopletagGroupNav extends Widget
_m('MENU','Edit'), _m('MENU','Edit'),
// TRANS: Menu item title in people tag navigation panel. // TRANS: Menu item title in people tag navigation panel.
// TRANS: %s is a tag. // TRANS: %s is a tag.
sprintf(_('Edit %s tag by you.'), $tag->tag, sprintf(_('Edit %s list by you.'), $tag->tag,
(($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
$action == 'editpeopletag', 'nav_peopletag_edit'); $action == 'editpeopletag', 'nav_peopletag_edit');
} }

View File

@ -193,7 +193,7 @@ class PeopletagListItem extends Widget
common_local_url('editpeopletag', array('tagger' => $this->profile->nickname, common_local_url('editpeopletag', array('tagger' => $this->profile->nickname,
'tag' => $this->peopletag->tag)), 'tag' => $this->peopletag->tag)),
// TRANS: Title for link to edit people tag settings. // TRANS: Title for link to edit people tag settings.
'title' => _('Edit people tag settings.')), 'title' => _('Edit list settings.')),
// TRANS: Text for link to edit people tag settings. // TRANS: Text for link to edit people tag settings.
_('Edit')); _('Edit'));
$this->out->elementEnd('li'); $this->out->elementEnd('li');

106
lib/peopletagnav.php Normal file
View File

@ -0,0 +1,106 @@
<?php
/**
* StatusNet, the distributed open-source microblogging tool
*
* Tabset for a particular list
*
* PHP version 5
*
* LICENCE: 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 Action
* @package StatusNet
* @author Shashi Gowda <connect2shashi@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
require_once INSTALLDIR.'/lib/widget.php';
/**
* Tabset for a group
*
* Shows a group of tabs for a particular user group
*
* @category Output
* @package StatusNet
* @author Shashi Gowda <connect2shashi@gmail.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*
* @see HTMLOutputter
*/
class PeopletagNav extends Menu
{
var $group = null;
/**
* Construction
*
* @param Action $action current action, used for output
*/
function __construct($action=null, $profile=null)
{
parent::__construct($action);
$this->profile = $profile;
}
/**
* Show the menu
*
* @return void
*/
function show()
{
$action_name = $this->action->trimmed('action');
$nickname = $this->profile->nickname;
$this->out->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartPeopletagGroupNav', array($this))) {
$this->out->menuItem(common_local_url('peopletagsubscriptions', array('nickname' =>
$nickname)),
// TRANS: Menu item in the group navigation page.
_m('MENU','List Subscriptions'),
// TRANS: Tooltip for menu item in the group navigation page.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','Lists subscribed to by %s'), $nickname),
$action_name == 'peopletagsubscriptions',
'nav_list_group');
$this->out->menuItem(common_local_url('peopletagsforuser', array('nickname' =>
$nickname)),
// TRANS: Menu item in the group navigation page.
sprintf(_m('MENU','Lists with %s'), $nickname),
// TRANS: Tooltip for menu item in the group navigation page.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','Lists with %s'), $nickname),
$action_name == 'peopletagsforuser',
'nav_lists_with');
$this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' =>
$nickname)),
// TRANS: Menu item in the group navigation page.
sprintf(_m('MENU','Lists by %s'), $nickname),
// TRANS: Tooltip for menu item in the group navigation page.
// TRANS: %s is the nickname of the group.
sprintf(_m('TOOLTIP','Lists by %s'), $nickname),
$action_name == 'peopletagsbyuser',
'nav_lists_by');
Event::handle('EndGroupGroupNav', array($this));
}
$this->out->elementEnd('ul');
}
}

View File

@ -66,7 +66,7 @@ class PeopletagsBySubsSection extends PeopletagSection
function title() function title()
{ {
// TRANS: Title for section contaning people tags with the most subscribers. // TRANS: Title for section contaning people tags with the most subscribers.
return _('People tags with most subscribers'); return _('Lists with most subscribers');
} }
function divId() function divId()

View File

@ -83,6 +83,7 @@ class PeopletagSection extends Section
class PeopletagSectionItem extends PeopletagListItem class PeopletagSectionItem extends PeopletagListItem
{ {
function showStart() function showStart()
{ {
} }
@ -104,10 +105,11 @@ class PeopletagSectionItem extends PeopletagListItem
common_log(LOG_WARNING, "Trying to show missing peopletag; skipping."); common_log(LOG_WARNING, "Trying to show missing peopletag; skipping.");
return; return;
} }
$mode = ($this->peopletag->private) ? 'private' : 'public';
$this->out->elementStart('tr'); $this->out->elementStart('tr');
$this->out->elementStart('td', 'peopletag'); $this->out->elementStart('td', 'peopletag mode-' . $mode);
$this->showPeopletag(); $this->showPeopletag();
$this->out->elementEnd('td'); $this->out->elementEnd('td');
@ -121,11 +123,12 @@ class PeopletagSectionItem extends PeopletagListItem
{ {
// TRANS: Tag summary. %1$d is the number of users tagged with the tag, // TRANS: Tag summary. %1$d is the number of users tagged with the tag,
// TRANS: %2$d is the number of subscribers to the tag. // TRANS: %2$d is the number of subscribers to the tag.
$title = sprintf(_('Tagged: %1$d Subscribers: %2$d'), $title = sprintf(_('Listed: %1$d Subscribers: %2$d'),
$this->peopletag->taggedCount(), $this->peopletag->taggedCount(),
$this->peopletag->subscriberCount()); $this->peopletag->subscriberCount());
$this->out->elementStart('span', 'entry-title tag'); $this->out->elementStart('span', 'entry-title tag');
$this->out->element('a', $this->out->element('a',
array('rel' => 'bookmark', array('rel' => 'bookmark',
'href' => $this->url(), 'href' => $this->url(),

View File

@ -62,13 +62,15 @@ class PeopletagsForUserSection extends PeopletagSection
function title() function title()
{ {
$name = $this->profile->getBestName(); $user = common_current_user();
if ($this->profile->id == common_current_user()->id) {
$name = 'you'; if (!empty($user) && $this->profile->id == $user->id) {
return sprintf(_('Lists with you'));
} }
// TRANS: Title for page that displays which people tags a user has been tagged with. // TRANS: Title for page that displays
// which people tags a user has been tagged with.
// TRANS: %s is a profile name. // TRANS: %s is a profile name.
return sprintf(_('People tags for %s'), $name); return sprintf(_('Lists with %s'), $this->profile->getBestName());
} }
function link() function link()

View File

@ -62,7 +62,7 @@ class PeopletagSubscriptionsSection extends PeopletagSection
function title() function title()
{ {
// TRANS: Title for page that displays people tags a user has subscribed to. // TRANS: Title for page that displays people tags a user has subscribed to.
return _('People tag subscriptions'); return _('List subscriptions');
} }
function link() function link()

View File

@ -103,18 +103,6 @@ class PersonalGroupNav extends Menu
// TRANS: Replaces %s in '%s\'s favorite notices'. (Yes, we know we need to fix this.) // TRANS: Replaces %s in '%s\'s favorite notices'. (Yes, we know we need to fix this.)
($user_profile) ? $name : _m('FIXME','User')), ($user_profile) ? $name : _m('FIXME','User')),
$mine && $action =='showfavorites', 'nav_timeline_favorites'); $mine && $action =='showfavorites', 'nav_timeline_favorites');
$this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' =>
$nickname)),
// TRANS: Menu item in personal group navigation menu.
_m('MENU','People tags'),
// @todo i18n FIXME: Need to make this two messages.
// TRANS: Menu item title in personal group navigation menu.
// TRANS: %s is a username.
sprintf(_('People tags by %s'),
// TRANS: Replaces %s in 'People tags by %s'. (Yes, we know we need to fix this.)
($user_profile) ? $name : _('User')),
in_array($action, array('peopletagsbyuser', 'peopletagsforuser')),
'nav_timeline_peopletags');
$cur = common_current_user(); $cur = common_current_user();

View File

@ -97,7 +97,6 @@ class ProfileAction extends OwnerDesignAction
$this->showSubscriptions(); $this->showSubscriptions();
$this->showSubscribers(); $this->showSubscribers();
$this->showGroups(); $this->showGroups();
$this->showPeopletagSubs();
$this->showPeopletags(); $this->showPeopletags();
$this->showStatistics(); $this->showStatistics();
} }
@ -190,21 +189,6 @@ class ProfileAction extends OwnerDesignAction
$this->elementEnd('div'); $this->elementEnd('div');
} }
function showPeopletagSubs()
{
$user = common_current_user();
if (!empty($user) && $this->profile->id == $user->id) {
if (Event::handle('StartShowPeopletagSubscriptionsSection', array($this))) {
$profile = $user->getProfile();
$section = new PeopletagSubscriptionsSection($this, $profile);
$section->show();
Event::handle('EndShowPeopletagSubscriptionsSection', array($this));
}
}
}
function showPeopletags() function showPeopletags()
{ {
if (Event::handle('StartShowPeopletagsSection', array($this))) { if (Event::handle('StartShowPeopletagsSection', array($this))) {

View File

@ -77,12 +77,6 @@ class PublicGroupNav extends Menu
// TRANS: Menu item title in search group navigation panel. // TRANS: Menu item title in search group navigation panel.
_('Recent tags'), $this->actionName == 'publictagcloud', 'nav_recent-tags'); _('Recent tags'), $this->actionName == 'publictagcloud', 'nav_recent-tags');
// TRANS: Menu item in search group navigation panel.
$this->out->menuItem(common_local_url('publicpeopletagcloud'), _m('MENU','People tags'),
// TRANS: Menu item title in search group navigation panel.
_('People tags'), in_array($this->actionName, array('publicpeopletagcloud',
'peopletag', 'selftag')), 'nav_people-tags');
if (count(common_config('nickname', 'featured')) > 0) { if (count(common_config('nickname', 'featured')) > 0) {
// TRANS: Menu item in search group navigation panel. // TRANS: Menu item in search group navigation panel.
$this->out->menuItem(common_local_url('featured'), _m('MENU','Featured'), $this->out->menuItem(common_local_url('featured'), _m('MENU','Featured'),

View File

@ -128,16 +128,16 @@ class SubGroupNav extends Menu
$this->user->nickname), $this->user->nickname),
$action == 'usergroups', $action == 'usergroups',
'nav_usergroups'); 'nav_usergroups');
$this->out->menuItem(common_local_url('peopletagsbyuser', $this->out->menuItem(common_local_url('peopletagsubscriptions',
array('nickname' => array('nickname' =>
$this->user->nickname)), $this->user->nickname)),
// TRANS: Menu item title in local navigation menu. // TRANS: Menu item title in local navigation menu.
_m('MENU','People tags'), _m('MENU','Lists'),
// TRANS: Menu item title in local navigation menu. // TRANS: Menu item title in local navigation menu.
// TRANS: %s is a user nickname. // TRANS: %s is a user nickname.
sprintf(_('People tags by %s.'), sprintf(_('List subscriptions by %s.'),
$this->user->nickname), $this->user->nickname),
in_array($action, array('peopletagsbyuser', 'peopletagsforuser')), in_array($action, array('peopletagsbyuser', 'peopletagsubscriptions', 'peopletagsforuser')),
'nav_timeline_peopletags'); 'nav_timeline_peopletags');
if (common_config('invite', 'enabled') && !is_null($cur) && $this->user->id === $cur->id) { if (common_config('invite', 'enabled') && !is_null($cur) && $this->user->id === $cur->id) {

View File

@ -855,7 +855,7 @@ class OStatusPlugin extends Plugin
if ($oprofile) { if ($oprofile) {
if (!$oprofile->subscribe()) { if (!$oprofile->subscribe()) {
// TRANS: Exception thrown when setup of remote people tag subscription fails. // TRANS: Exception thrown when setup of remote people tag subscription fails.
throw new Exception(_m('Could not set up remote people tag subscription.')); throw new Exception(_m('Could not set up remote list subscription.'));
} }
$sub = $user->getProfile(); $sub = $user->getProfile();
@ -876,7 +876,7 @@ class OStatusPlugin extends Plugin
$act->title = _m('TITLE','Follow list'); $act->title = _m('TITLE','Follow list');
// TRANS: Success message for remote list follow through OStatus. // TRANS: Success message for remote list follow through OStatus.
// TRANS: %1$s is the subscriber name, %2$s the prople tag, %3$s is the tagger's name. // TRANS: %1$s is the subscriber name, %2$s the prople tag, %3$s is the tagger's name.
$act->content = sprintf(_m("%1$s is now following people tagged %2$s by %3$s."), $act->content = sprintf(_m("%1$s is now following people listed in %2$s by %3$s."),
$sub->getBestName(), $sub->getBestName(),
$oprofile->getBestName(), $oprofile->getBestName(),
$tagger->getBestName()); $tagger->getBestName());
@ -1000,7 +1000,7 @@ class OStatusPlugin extends Plugin
common_date_iso8601(time())); common_date_iso8601(time()));
$act->time = time(); $act->time = time();
$act->title = _m('TITLE','Tag'); $act->title = _m('TITLE','Tag');
$act->content = sprintf(_m('%1$s tagged %2$s in the list %3$s.'), $act->content = sprintf(_m('%1$s listed %2$s in the list %3$s.'),
$tagger->getBestName(), $tagger->getBestName(),
$tagged->getBestName(), $tagged->getBestName(),
$plist->getBestName()); $plist->getBestName());

View File

@ -169,7 +169,7 @@ class OStatusPeopletagAction extends OStatusSubAction
function getInstructions() function getInstructions()
{ {
return _m('You can subscribe to people tags from other supported sites. Paste the tag\'s profile URI below:'); return _m('You can subscribe to lists from other supported sites. Paste the lists\'s URI below:');
} }
function selfLink() function selfLink()

View File

@ -42,13 +42,13 @@ class PeopletagsalmonAction extends SalmonAction
$this->peopletag = Profile_list::staticGet('id', $id); $this->peopletag = Profile_list::staticGet('id', $id);
if (empty($this->peopletag)) { if (empty($this->peopletag)) {
$this->clientError(_m('No such people tag.')); $this->clientError(_m('No such list.'));
} }
$oprofile = Ostatus_profile::staticGet('peopletag_id', $id); $oprofile = Ostatus_profile::staticGet('peopletag_id', $id);
if (!empty($oprofile)) { if (!empty($oprofile)) {
$this->clientError(_m('Cannot accept remote posts for a remote people tag.')); $this->clientError(_m('Cannot accept remote posts for a remote list.'));
} }
return true; return true;
@ -89,7 +89,7 @@ class PeopletagsalmonAction extends SalmonAction
$this->clientError(_m('Cannot read profile to set up profile tag subscription.')); $this->clientError(_m('Cannot read profile to set up profile tag subscription.'));
} }
if ($oprofile->isGroup()) { if ($oprofile->isGroup()) {
$this->clientError(_m('Groups cannot subscribe to people tags.')); $this->clientError(_m('Groups cannot subscribe to lists.'));
} }
common_log(LOG_INFO, "Remote profile {$oprofile->uri} subscribing to local peopletag ".$this->peopletag->getBestName()); common_log(LOG_INFO, "Remote profile {$oprofile->uri} subscribing to local peopletag ".$this->peopletag->getBestName());
@ -107,7 +107,7 @@ class PeopletagsalmonAction extends SalmonAction
try { try {
Profile_tag_subscription::add($this->peopletag, $profile); Profile_tag_subscription::add($this->peopletag, $profile);
} catch (Exception $e) { } catch (Exception $e) {
$this->serverError(sprintf(_m('Could not subscribe remote user %1$s to people tag %2$s.'), $this->serverError(sprintf(_m('Could not subscribe remote user %1$s to list %2$s.'),
$oprofile->uri, $this->peopletag->getBestName())); $oprofile->uri, $this->peopletag->getBestName()));
} }
} }
@ -120,10 +120,10 @@ class PeopletagsalmonAction extends SalmonAction
{ {
$oprofile = $this->ensureProfile(); $oprofile = $this->ensureProfile();
if (!$oprofile) { if (!$oprofile) {
$this->clientError(_m('Cannot read profile to cancel people tag membership.')); $this->clientError(_m('Cannot read profile to cancel list membership.'));
} }
if ($oprofile->isGroup()) { if ($oprofile->isGroup()) {
$this->clientError(_m('Groups cannot subscribe to people tags.')); $this->clientError(_m('Groups cannot subscribe to lists.'));
} }
common_log(LOG_INFO, "Remote profile {$oprofile->uri} unsubscribing from local peopletag ".$this->peopletag->getBestName()); common_log(LOG_INFO, "Remote profile {$oprofile->uri} unsubscribing from local peopletag ".$this->peopletag->getBestName());
@ -133,7 +133,7 @@ class PeopletagsalmonAction extends SalmonAction
Profile_tag_subscription::remove($this->peopletag->tagger, $this->peopletag->tag, $profile->id); Profile_tag_subscription::remove($this->peopletag->tagger, $this->peopletag->tag, $profile->id);
} catch (Exception $e) { } catch (Exception $e) {
$this->serverError(sprintf(_m('Could not remove remote user %1$s from people tag %2$s.'), $this->serverError(sprintf(_m('Could not remove remote user %1$s from list %2$s.'),
$oprofile->uri, $this->peopletag->getBestName())); $oprofile->uri, $this->peopletag->getBestName()));
return; return;
} }