[TagSub] Fix User's tags list issue
Issue introduced with6d9f390b
and9a92b58057
This commit is contained in:
parent
306d80de94
commit
f2705180e0
@ -32,7 +32,7 @@ defined('GNUSOCIAL') || die();
|
||||
define('GNUSOCIAL_ENGINE', 'GNU social');
|
||||
define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/');
|
||||
|
||||
define('GNUSOCIAL_BASE_VERSION', '1.20.2');
|
||||
define('GNUSOCIAL_BASE_VERSION', '1.20.3');
|
||||
define('GNUSOCIAL_LIFECYCLE', 'release'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
|
||||
|
||||
define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);
|
||||
|
@ -37,13 +37,17 @@ class ProfileListItem extends Widget
|
||||
/** Action object using us. */
|
||||
var $action = null;
|
||||
|
||||
// FIXME: Directory plugin sends a User_group here, but should send a Profile and handle User_group specifics itself
|
||||
function __construct($target, HTMLOutputter $action)
|
||||
// FIXME: Directory plugin sends a User_group here, but should send a Profile and handle User_group specifics itself?
|
||||
function __construct($target, HTMLOutputter $action, Profile $owner = null)
|
||||
{
|
||||
parent::__construct($action);
|
||||
|
||||
$this->target = $target;
|
||||
if ($owner !== null) {
|
||||
$this->profile = $owner;
|
||||
} else {
|
||||
$this->profile = $this->target;
|
||||
}
|
||||
$this->action = $action;
|
||||
}
|
||||
|
||||
@ -165,7 +169,7 @@ class ProfileListItem extends Widget
|
||||
{
|
||||
$user = common_current_user();
|
||||
if (!empty($user)) {
|
||||
if ($user->id == $this->profile->id) {
|
||||
if ($user->id == $this->profile->getID()) {
|
||||
$tags = new SelftagsWidget($this->out, $user, $this->profile);
|
||||
$tags->show();
|
||||
} else if ($user->getProfile()->canTag($this->profile)) {
|
||||
|
@ -44,7 +44,7 @@ class SubscriptionList extends ProfileList
|
||||
/** Owner of this list */
|
||||
var $owner = null;
|
||||
|
||||
public function __construct(Profile $profile, $owner=null, $action=null)
|
||||
public function __construct($profile, $owner=null, $action=null)
|
||||
{
|
||||
parent::__construct($profile, $action);
|
||||
|
||||
|
@ -7,9 +7,14 @@ class SubscriptionListItem extends ProfileListItem
|
||||
/** Owner of this list */
|
||||
var $owner = null;
|
||||
|
||||
function __construct(Profile $profile, $owner, $action)
|
||||
// FIXME: TagSubs plugin sends a TagSub here, but should send a Profile and handle TagSub specifics itself?
|
||||
function __construct($target, $owner, HTMLOutputter $action)
|
||||
{
|
||||
parent::__construct($profile, $action);
|
||||
if ($owner instanceof Profile) {
|
||||
parent::__construct($target, $action, $owner);
|
||||
} else {
|
||||
parent::__construct($target, $action);
|
||||
}
|
||||
|
||||
$this->owner = $owner;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-06-11 18:37+0100\n"
|
||||
"POT-Creation-Date: 2019-06-17 15:27+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -44,16 +44,16 @@ if (!defined('STATUSNET')) {
|
||||
*/
|
||||
class TagSubPlugin extends Plugin
|
||||
{
|
||||
const PLUGIN_VERSION = '0.1.0';
|
||||
const PLUGIN_VERSION = '0.1.1';
|
||||
|
||||
/**
|
||||
* Database schema setup
|
||||
*
|
||||
* @return bool hook value; true means continue processing, false means stop.
|
||||
* @see Schema
|
||||
*
|
||||
* @return boolean hook value; true means continue processing, false means stop.
|
||||
*/
|
||||
function onCheckSchema()
|
||||
public function onCheckSchema()
|
||||
{
|
||||
$schema = Schema::get();
|
||||
$schema->ensureTable('tagsub', TagSub::schemaDef());
|
||||
@ -69,16 +69,22 @@ class TagSubPlugin extends Plugin
|
||||
*/
|
||||
public function onRouterInitialized(URLMapper $m)
|
||||
{
|
||||
$m->connect('tag/:tag/subscribe',
|
||||
$m->connect(
|
||||
'tag/:tag/subscribe',
|
||||
array('action' => 'tagsub'),
|
||||
array('tag' => Router::REGEX_TAG));
|
||||
$m->connect('tag/:tag/unsubscribe',
|
||||
array('tag' => Router::REGEX_TAG)
|
||||
);
|
||||
$m->connect(
|
||||
'tag/:tag/unsubscribe',
|
||||
array('action' => 'tagunsub'),
|
||||
array('tag' => Router::REGEX_TAG));
|
||||
array('tag' => Router::REGEX_TAG)
|
||||
);
|
||||
|
||||
$m->connect(':nickname/tag-subscriptions',
|
||||
$m->connect(
|
||||
':nickname/tag-subscriptions',
|
||||
array('action' => 'tagsubs'),
|
||||
array('nickname' => Nickname::DISPLAY_FMT));
|
||||
array('nickname' => Nickname::DISPLAY_FMT)
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -87,17 +93,17 @@ class TagSubPlugin extends Plugin
|
||||
*
|
||||
* @param array &$versions array of version data
|
||||
*
|
||||
* @return value
|
||||
* @return bool true hook value
|
||||
*/
|
||||
function onPluginVersion(array &$versions)
|
||||
public function onPluginVersion(array &$versions)
|
||||
{
|
||||
$versions[] = array('name' => 'TagSub',
|
||||
$versions[] = ['name' => 'TagSub',
|
||||
'version' => self::PLUGIN_VERSION,
|
||||
'author' => 'Brion Vibber',
|
||||
'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/TagSub',
|
||||
'rawdescription' =>
|
||||
// TRANS: Plugin description.
|
||||
_m('Plugin to allow following all messages with a given tag.'));
|
||||
_m('Plugin to allow following all messages with a given tag.')];
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -113,7 +119,7 @@ class TagSubPlugin extends Plugin
|
||||
* @param array $ni in/out map of profile IDs to inbox constants
|
||||
* @return boolean hook result
|
||||
*/
|
||||
function onStartNoticeWhoGets(Notice $notice, array &$ni)
|
||||
public function onStartNoticeWhoGets(Notice $notice, array &$ni)
|
||||
{
|
||||
foreach ($notice->getTags() as $tag) {
|
||||
$tagsub = new TagSub();
|
||||
@ -133,7 +139,7 @@ class TagSubPlugin extends Plugin
|
||||
* @param TagAction $action
|
||||
* @return boolean hook result
|
||||
*/
|
||||
function onStartTagShowContent(TagAction $action)
|
||||
public function onStartTagShowContent(TagAction $action)
|
||||
{
|
||||
$user = common_current_user();
|
||||
if ($user) {
|
||||
@ -162,28 +168,30 @@ class TagSubPlugin extends Plugin
|
||||
* @param Widget $widget Widget being executed
|
||||
*
|
||||
* @return boolean hook return
|
||||
* @throws Exception
|
||||
*/
|
||||
function onEndSubGroupNav($widget)
|
||||
public function onEndSubGroupNav($widget)
|
||||
{
|
||||
$action = $widget->out;
|
||||
$action_name = $action->trimmed('action');
|
||||
|
||||
$action->menuItem(common_local_url('tagsubs', array('nickname' => $action->user->nickname)),
|
||||
$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);
|
||||
$action_name == 'tagsubs' && $action->arg('nickname') == $action->user->nickname
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onEndDefaultLocalNav($menu, $user)
|
||||
public function onEndDefaultLocalNav($menu, $user)
|
||||
{
|
||||
$user = common_current_user();
|
||||
$user = $user ? $user : common_current_user();
|
||||
|
||||
if (!empty($user)) {
|
||||
|
||||
$tags = TagSub::forProfile($user->getProfile());
|
||||
|
||||
if (!empty($tags) && count($tags) > 0) {
|
||||
|
@ -53,8 +53,8 @@ if (!defined('STATUSNET')) {
|
||||
*/
|
||||
class TagsubAction extends Action
|
||||
{
|
||||
var $user;
|
||||
var $tag;
|
||||
public $user;
|
||||
public $tag;
|
||||
|
||||
/**
|
||||
* Check pre-requisites and instantiate attributes
|
||||
@ -62,8 +62,9 @@ class TagsubAction extends Action
|
||||
* @param Array $args array of arguments (URL, GET, POST)
|
||||
*
|
||||
* @return boolean success flag
|
||||
* @throws ClientException
|
||||
*/
|
||||
function prepare(array $args = array())
|
||||
public function prepare(array $args = array())
|
||||
{
|
||||
parent::prepare($args);
|
||||
if ($this->boolean('ajax')) {
|
||||
@ -84,7 +85,7 @@ class TagsubAction extends Action
|
||||
|
||||
if (!$token || $token != common_session_token()) {
|
||||
// TRANS: Client error displayed when the session token is not okay.
|
||||
$this->clientError(_m('There was a problem with your session token.'.
|
||||
$this->clientError(_m('There was a problem with your session token.' .
|
||||
' Try again, please.'));
|
||||
}
|
||||
|
||||
@ -114,16 +115,17 @@ class TagsubAction extends Action
|
||||
*
|
||||
* Does the subscription and returns results.
|
||||
*
|
||||
* @param Array $args unused.
|
||||
*
|
||||
* @return void
|
||||
* @throws ClientException
|
||||
*/
|
||||
function handle()
|
||||
public function handle()
|
||||
{
|
||||
// Throws exception on error
|
||||
|
||||
TagSub::start($this->user->getProfile(),
|
||||
$this->tag);
|
||||
TagSub::start(
|
||||
$this->user->getProfile(),
|
||||
$this->tag
|
||||
);
|
||||
|
||||
if ($this->boolean('ajax')) {
|
||||
$this->startHTML('text/xml;charset=utf-8');
|
||||
@ -137,8 +139,10 @@ class TagsubAction extends Action
|
||||
$this->elementEnd('body');
|
||||
$this->endHTML();
|
||||
} else {
|
||||
$url = common_local_url('tag',
|
||||
array('tag' => $this->tag));
|
||||
$url = common_local_url(
|
||||
'tag',
|
||||
array('tag' => $this->tag)
|
||||
);
|
||||
common_redirect($url, 303);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,9 @@
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
if (!defined('GNUSOCIAL')) { exit(1); }
|
||||
if (!defined('GNUSOCIAL')) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of the user's subscriptions
|
||||
@ -41,7 +43,7 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
||||
*/
|
||||
class TagSubsAction extends GalleryAction
|
||||
{
|
||||
function title()
|
||||
public function title()
|
||||
{
|
||||
if ($this->page == 1) {
|
||||
// TRANS: Header for subscriptions overview for a user (first page).
|
||||
@ -50,34 +52,44 @@ class TagSubsAction extends GalleryAction
|
||||
} else {
|
||||
// TRANS: Header for subscriptions overview for a user (not first page).
|
||||
// TRANS: %1$s is a user nickname, %2$d is the page number.
|
||||
return sprintf(_m('%1$s\'s tag subscriptions, page %2$d'),
|
||||
return sprintf(
|
||||
_m('%1$s\'s tag subscriptions, page %2$d'),
|
||||
$this->getTarget()->getNickname(),
|
||||
$this->page);
|
||||
$this->page
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function showPageNotice()
|
||||
public function showPageNotice()
|
||||
{
|
||||
if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
|
||||
$this->element('p', null,
|
||||
$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,
|
||||
$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:'),
|
||||
$this->getTarget()->getNickname()));
|
||||
sprintf(
|
||||
_m('%s has subscribed to receive all notices on this site containing the following tags:'),
|
||||
$this->getTarget()->getNickname()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function showContent()
|
||||
public function showContent()
|
||||
{
|
||||
if (Event::handle('StartShowTagSubscriptionsContent', array($this))) {
|
||||
parent::showContent();
|
||||
|
||||
$offset = ($this->page-1) * PROFILES_PER_PAGE;
|
||||
$offset = ($this->page - 1) * PROFILES_PER_PAGE;
|
||||
$limit = PROFILES_PER_PAGE + 1;
|
||||
|
||||
$cnt = 0;
|
||||
@ -97,16 +109,20 @@ class TagSubsAction extends GalleryAction
|
||||
$this->showEmptyListMessage();
|
||||
}
|
||||
|
||||
$this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
|
||||
$this->page, 'tagsubs',
|
||||
array('nickname' => $this->getTarget()->getNickname()));
|
||||
$this->pagination(
|
||||
$this->page > 1,
|
||||
$cnt > PROFILES_PER_PAGE,
|
||||
$this->page,
|
||||
'tagsubs',
|
||||
array('nickname' => $this->getTarget()->getNickname())
|
||||
);
|
||||
|
||||
|
||||
Event::handle('EndShowTagSubscriptionsContent', array($this));
|
||||
}
|
||||
}
|
||||
|
||||
function showEmptyListMessage()
|
||||
public function showEmptyListMessage()
|
||||
{
|
||||
if (common_logged_in()) {
|
||||
if ($this->scoped->sameAs($this->getTarget())) {
|
||||
@ -119,8 +135,7 @@ class TagSubsAction extends GalleryAction
|
||||
// TRANS: than the logged in user that has no tag subscriptions. %s is the user nickname.
|
||||
$message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// TRANS: Subscription list text when looking at the subscriptions for a of a user that has none
|
||||
// TRANS: as an anonymous user. %s is the user nickname.
|
||||
$message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname());
|
||||
@ -136,7 +151,7 @@ class TagSubsAction extends GalleryAction
|
||||
|
||||
class TagSubscriptionsList extends SubscriptionList
|
||||
{
|
||||
function newListItem(Profile $tagsub)
|
||||
public function newListItem($tagsub)
|
||||
{
|
||||
return new TagSubscriptionsListItem($tagsub, $this->owner, $this->action);
|
||||
}
|
||||
@ -144,14 +159,14 @@ class TagSubscriptionsList extends SubscriptionList
|
||||
|
||||
class TagSubscriptionsListItem extends SubscriptionListItem
|
||||
{
|
||||
function startItem()
|
||||
public function startItem()
|
||||
{
|
||||
$this->out->elementStart('li', array('class' => 'tagsub'));
|
||||
}
|
||||
|
||||
function showProfile()
|
||||
public function showProfile()
|
||||
{
|
||||
$tagsub = $this->profile;
|
||||
$tagsub = $this->getTarget();
|
||||
$tag = $tagsub->tag;
|
||||
|
||||
// Relevant portion!
|
||||
@ -163,10 +178,12 @@ class TagSubscriptionsListItem extends SubscriptionListItem
|
||||
$url = common_local_url('tag', array('tag' => $tag));
|
||||
// TRANS: %1$s is a URL to a tag, %2$s is a tag,
|
||||
// TRANS: %3$s a date string.
|
||||
$linkline = sprintf(_m('#<a href="%1$s">%2$s</a> since %3$s'),
|
||||
$linkline = sprintf(
|
||||
_m('#<a href="%1$s">%2$s</a> since %3$s'),
|
||||
htmlspecialchars($url),
|
||||
htmlspecialchars($tag),
|
||||
common_date_string($tagsub->created));
|
||||
common_date_string($tagsub->created)
|
||||
);
|
||||
|
||||
$this->out->elementStart('div', 'tagsub-item');
|
||||
$this->out->raw($linkline);
|
||||
@ -174,15 +191,15 @@ class TagSubscriptionsListItem extends SubscriptionListItem
|
||||
$this->out->elementEnd('div');
|
||||
}
|
||||
|
||||
function showActions()
|
||||
public function showActions()
|
||||
{
|
||||
}
|
||||
|
||||
function showOwnerControls()
|
||||
public function showOwnerControls()
|
||||
{
|
||||
$this->out->elementStart('div', 'entity_actions');
|
||||
|
||||
$tagsub = $this->profile; // ?
|
||||
$tagsub = $this->target;
|
||||
$form = new TagUnsubForm($this->out, $tagsub->tag);
|
||||
$form->show();
|
||||
|
||||
|
@ -58,16 +58,17 @@ class TagunsubAction extends TagsubAction
|
||||
*
|
||||
* Does the subscription and returns results.
|
||||
*
|
||||
* @param Array $args unused.
|
||||
*
|
||||
* @return void
|
||||
* @throws ClientException
|
||||
*/
|
||||
function handle()
|
||||
public function handle()
|
||||
{
|
||||
// Throws exception on error
|
||||
|
||||
TagSub::cancel($this->user->getProfile(),
|
||||
$this->tag);
|
||||
TagSub::cancel(
|
||||
$this->user->getProfile(),
|
||||
$this->tag
|
||||
);
|
||||
|
||||
if ($this->boolean('ajax')) {
|
||||
$this->startHTML('text/xml;charset=utf-8');
|
||||
@ -81,8 +82,10 @@ class TagunsubAction extends TagsubAction
|
||||
$this->elementEnd('body');
|
||||
$this->endHTML();
|
||||
} else {
|
||||
$url = common_local_url('tag',
|
||||
array('tag' => $this->tag));
|
||||
$url = common_local_url(
|
||||
'tag',
|
||||
array('tag' => $this->tag)
|
||||
);
|
||||
common_redirect($url, 303);
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class TagSub extends Managed_DataObject
|
||||
* @param string $tag subscribee
|
||||
* @return TagSub
|
||||
*/
|
||||
static function start(Profile $profile, $tag)
|
||||
public static function start(Profile $profile, $tag)
|
||||
{
|
||||
$ts = new TagSub();
|
||||
$ts->tag = $tag;
|
||||
@ -96,7 +96,7 @@ class TagSub extends Managed_DataObject
|
||||
* @param profile $profile subscriber
|
||||
* @param string $tag subscribee
|
||||
*/
|
||||
static function cancel(Profile $profile, $tag)
|
||||
public static function cancel(Profile $profile, $tag)
|
||||
{
|
||||
$ts = TagSub::pkeyGet(array('tag' => $tag,
|
||||
'profile_id' => $profile->id));
|
||||
@ -106,7 +106,7 @@ class TagSub extends Managed_DataObject
|
||||
}
|
||||
}
|
||||
|
||||
static function forProfile(Profile $profile)
|
||||
public static function forProfile(Profile $profile)
|
||||
{
|
||||
$tags = array();
|
||||
|
||||
|
@ -51,7 +51,7 @@ class TagSubForm extends Form
|
||||
/**
|
||||
* Name of tag to subscribe to
|
||||
*/
|
||||
var $tag = '';
|
||||
public $tag = '';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -59,7 +59,7 @@ class TagSubForm extends Form
|
||||
* @param HTMLOutputter $out output channel
|
||||
* @param string $tag name of tag to subscribe to
|
||||
*/
|
||||
function __construct($out=null, $tag=null)
|
||||
public function __construct($out = null, $tag = null)
|
||||
{
|
||||
parent::__construct($out);
|
||||
|
||||
@ -71,7 +71,7 @@ class TagSubForm extends Form
|
||||
*
|
||||
* @return int ID of the form
|
||||
*/
|
||||
function id()
|
||||
public function id()
|
||||
{
|
||||
return 'tag-subscribe-' . $this->tag;
|
||||
}
|
||||
@ -81,7 +81,7 @@ class TagSubForm extends Form
|
||||
*
|
||||
* @return string of the form class
|
||||
*/
|
||||
function formClass()
|
||||
public function formClass()
|
||||
{
|
||||
// class to match existing styles...
|
||||
return 'form_user_subscribe ajax';
|
||||
@ -92,7 +92,7 @@ class TagSubForm extends Form
|
||||
*
|
||||
* @return string URL of the action
|
||||
*/
|
||||
function action()
|
||||
public function action()
|
||||
{
|
||||
return common_local_url('tagsub', array('tag' => $this->tag));
|
||||
}
|
||||
@ -101,8 +101,9 @@ class TagSubForm extends Form
|
||||
* Legend of the Form
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
function formLegend()
|
||||
public function formLegend()
|
||||
{
|
||||
// TRANS: Form legend.
|
||||
$this->out->element('legend', null, _m('Subscribe to this tag'));
|
||||
@ -113,23 +114,31 @@ class TagSubForm extends Form
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function formData()
|
||||
public function formData()
|
||||
{
|
||||
$this->out->hidden('subscribeto-' . $this->tag,
|
||||
$this->out->hidden(
|
||||
'subscribeto-' . $this->tag,
|
||||
$this->tag,
|
||||
'subscribeto');
|
||||
'subscribeto'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Action elements
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
function formActions()
|
||||
public function formActions()
|
||||
{
|
||||
// TRANS: Submit button text to subscribe to a tag.
|
||||
$this->out->submit('submit', _m('BUTTON','Subscribe'),
|
||||
$this->out->submit(
|
||||
'submit',
|
||||
_m('BUTTON', 'Subscribe'),
|
||||
// TRANS: Submit button title to subscribe to a tag.
|
||||
'submit', null, _m('Subscribe to this tag.'));
|
||||
'submit',
|
||||
null,
|
||||
_m('Subscribe to this tag.')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class TagUnsubForm extends TagSubForm
|
||||
*
|
||||
* @return int ID of the form
|
||||
*/
|
||||
function id()
|
||||
public function id()
|
||||
{
|
||||
return 'tag-unsubscribe-' . $this->tag;
|
||||
}
|
||||
@ -63,7 +63,7 @@ class TagUnsubForm extends TagSubForm
|
||||
*
|
||||
* @return string of the form class
|
||||
*/
|
||||
function formClass()
|
||||
public function formClass()
|
||||
{
|
||||
// class to match existing styles...
|
||||
return 'form_user_unsubscribe ajax';
|
||||
@ -74,7 +74,7 @@ class TagUnsubForm extends TagSubForm
|
||||
*
|
||||
* @return string URL of the action
|
||||
*/
|
||||
function action()
|
||||
public function action()
|
||||
{
|
||||
return common_local_url('tagunsub', array('tag' => $this->tag));
|
||||
}
|
||||
@ -83,8 +83,9 @@ class TagUnsubForm extends TagSubForm
|
||||
* Legend of the Form
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
function formLegend()
|
||||
public function formLegend()
|
||||
{
|
||||
// TRANS: Form legend.
|
||||
$this->out->element('legend', null, _m('Unsubscribe from this tag'));
|
||||
@ -94,12 +95,18 @@ class TagUnsubForm extends TagSubForm
|
||||
* Action elements
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
function formActions()
|
||||
public function formActions()
|
||||
{
|
||||
// TRANS: Submit button text to unsubscribe from a tag.
|
||||
$this->out->submit('submit', _m('BUTTON','Unsubscribe'),
|
||||
$this->out->submit(
|
||||
'submit',
|
||||
_m('BUTTON', 'Unsubscribe'),
|
||||
// TRANS: Submit button title to unsubscribe from a tag.
|
||||
'submit', null, _m('Unsubscribe from this tag.'));
|
||||
'submit',
|
||||
null,
|
||||
_m('Unsubscribe from this tag.')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -49,14 +49,14 @@ class TagSubMenu extends MoreMenu
|
||||
protected $user;
|
||||
protected $tags;
|
||||
|
||||
function __construct($out, $user, $tags)
|
||||
public function __construct($out, $user, $tags)
|
||||
{
|
||||
parent::__construct($out);
|
||||
$this->user = $user;
|
||||
$this->tags = $tags;
|
||||
}
|
||||
|
||||
function getItems()
|
||||
public function getItems()
|
||||
{
|
||||
$items = array();
|
||||
|
||||
@ -73,12 +73,12 @@ class TagSubMenu extends MoreMenu
|
||||
return $items;
|
||||
}
|
||||
|
||||
function tag()
|
||||
public function tag()
|
||||
{
|
||||
return 'tagsubs';
|
||||
}
|
||||
|
||||
function seeAllItem()
|
||||
public function seeAllItem()
|
||||
{
|
||||
return array('tagsubs',
|
||||
array('nickname' => $this->user->nickname),
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-06-08 18:20+0100\n"
|
||||
"POT-Creation-Date: 2019-06-13 00:46+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -19,29 +19,25 @@ msgstr ""
|
||||
|
||||
#. TRANS: Header for subscriptions overview for a user (first page).
|
||||
#. TRANS: %s is a user nickname.
|
||||
#: actions/tagsubs.php:49
|
||||
#: actions/tagsubs.php:51
|
||||
#, php-format
|
||||
msgid "%s's tag subscriptions"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Header for subscriptions overview for a user (not first page).
|
||||
#. TRANS: %1$s is a user nickname, %2$d is the page number.
|
||||
#: actions/tagsubs.php:53
|
||||
#: actions/tagsubs.php:56
|
||||
#, php-format
|
||||
msgid "%1$s's tag subscriptions, page %2$d"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Page notice for page with an overview of all tag subscriptions
|
||||
#. TRANS: of the logged in user's own profile.
|
||||
#: actions/tagsubs.php:65
|
||||
#: actions/tagsubs.php:71
|
||||
msgid ""
|
||||
"You have subscribed to receive all notices on this site containing the "
|
||||
"following tags:"
|
||||
msgstr ""
|
||||
|
||||
#. 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.
|
||||
#: actions/tagsubs.php:70
|
||||
#: actions/tagsubs.php:80
|
||||
#, php-format
|
||||
msgid ""
|
||||
"%s has subscribed to receive all notices on this site containing the "
|
||||
@ -49,7 +45,7 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Tag subscription list text when the logged in user has no tag subscriptions.
|
||||
#: actions/tagsubs.php:114
|
||||
#: actions/tagsubs.php:130
|
||||
msgid ""
|
||||
"You are not listening to any hash tags right now. You can push the "
|
||||
"\"Subscribe\" button on any hashtag page to automatically receive any public "
|
||||
@ -61,98 +57,92 @@ msgstr ""
|
||||
#. TRANS: than the logged in user that has no tag subscriptions. %s is the user nickname.
|
||||
#. TRANS: Subscription list text when looking at the subscriptions for a of a user that has none
|
||||
#. TRANS: as an anonymous user. %s is the user nickname.
|
||||
#: actions/tagsubs.php:120 actions/tagsubs.php:126
|
||||
#: actions/tagsubs.php:136 actions/tagsubs.php:141
|
||||
#, php-format
|
||||
msgid "%s is not following any tags."
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: %1$s is a URL to a tag, %2$s is a tag,
|
||||
#. TRANS: %3$s a date string.
|
||||
#: actions/tagsubs.php:166
|
||||
#: actions/tagsubs.php:182
|
||||
#, php-format
|
||||
msgid "#<a href=\"%1$s\">%2$s</a> since %3$s"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Client error displayed trying to perform any request method other than POST.
|
||||
#. TRANS: Do not translate POST.
|
||||
#: actions/tagsub.php:78
|
||||
#: actions/tagsub.php:79
|
||||
msgid "This action only accepts POST requests."
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Client error displayed when the session token is not okay.
|
||||
#: actions/tagsub.php:87
|
||||
#: actions/tagsub.php:88
|
||||
msgid "There was a problem with your session token. Try again, please."
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||
#: actions/tagsub.php:97
|
||||
#: actions/tagsub.php:98
|
||||
msgid "Not logged in."
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Client error displayed trying to subscribe to a non-existing profile.
|
||||
#: actions/tagsub.php:106
|
||||
#: actions/tagsub.php:107
|
||||
msgid "No such profile."
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Page title when tag subscription succeeded.
|
||||
#: actions/tagsub.php:132
|
||||
#: actions/tagsub.php:134
|
||||
msgid "Subscribed"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Page title when tag unsubscription succeeded.
|
||||
#: actions/tagunsub.php:76
|
||||
#: actions/tagunsub.php:77
|
||||
msgid "Unsubscribed"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Plugin description.
|
||||
#: TagSubPlugin.php:100
|
||||
#: TagSubPlugin.php:106
|
||||
msgid "Plugin to allow following all messages with a given tag."
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: SubMirror plugin menu item on user settings page.
|
||||
#: TagSubPlugin.php:173
|
||||
#: TagSubPlugin.php:181
|
||||
msgctxt "MENU"
|
||||
msgid "Tags"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: SubMirror plugin tooltip for user settings menu item.
|
||||
#: TagSubPlugin.php:175
|
||||
#: TagSubPlugin.php:183
|
||||
msgid "Configure tag subscriptions"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Menu item text for tags submenu.
|
||||
#: TagSubPlugin.php:192
|
||||
#: TagSubPlugin.php:200
|
||||
msgid "Tags"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Form legend.
|
||||
#: forms/tagsub.php:108
|
||||
#: forms/tagsub.php:109
|
||||
msgid "Subscribe to this tag"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Submit button text to subscribe to a tag.
|
||||
#: forms/tagsub.php:131
|
||||
#: forms/tagsub.php:137
|
||||
msgctxt "BUTTON"
|
||||
msgid "Subscribe"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Submit button title to subscribe to a tag.
|
||||
#: forms/tagsub.php:133
|
||||
#: forms/tagsub.php:141
|
||||
msgid "Subscribe to this tag."
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Form legend.
|
||||
#: forms/tagunsub.php:90
|
||||
#: forms/tagunsub.php:91
|
||||
msgid "Unsubscribe from this tag"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Submit button text to unsubscribe from a tag.
|
||||
#: forms/tagunsub.php:101
|
||||
#: forms/tagunsub.php:105
|
||||
msgctxt "BUTTON"
|
||||
msgid "Unsubscribe"
|
||||
msgstr ""
|
||||
|
||||
#. TRANS: Submit button title to unsubscribe from a tag.
|
||||
#: forms/tagunsub.php:103
|
||||
#: forms/tagunsub.php:109
|
||||
msgid "Unsubscribe from this tag."
|
||||
msgstr ""
|
||||
|
Loading…
Reference in New Issue
Block a user