* i18n/L10n updates.
* translator documentation added/updated. * superfluous whitespace removed.
This commit is contained in:
parent
83233a8a43
commit
08edd1fedf
|
@ -42,7 +42,6 @@ require_once INSTALLDIR.'/lib/attachmentlist.php';
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AttachmentAction extends Action
|
class AttachmentAction extends Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -70,6 +69,7 @@ class AttachmentAction extends Action
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->attachment)) {
|
if (empty($this->attachment)) {
|
||||||
|
// TRANS: Client error displayed trying to get a non-existing attachment.
|
||||||
$this->clientError(_('No such attachment.'), 404);
|
$this->clientError(_('No such attachment.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,6 @@ class AttachmentAction extends Action
|
||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isReadOnly($args)
|
function isReadOnly($args)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -129,7 +128,6 @@ class AttachmentAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
@ -150,7 +148,6 @@ class AttachmentAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showLocalNavBlock()
|
function showLocalNavBlock()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -162,7 +159,6 @@ class AttachmentAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
$ali = new Attachment($this->attachment, $this);
|
$ali = new Attachment($this->attachment, $this);
|
||||||
|
@ -174,7 +170,6 @@ class AttachmentAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showPageNoticeBlock()
|
function showPageNoticeBlock()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -191,4 +186,3 @@ class AttachmentAction extends Action
|
||||||
$atcs->show();
|
$atcs->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ require_once INSTALLDIR.'/actions/attachment.php';
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Attachment_ajaxAction extends AttachmentAction
|
class Attachment_ajaxAction extends AttachmentAction
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -80,4 +79,3 @@ class Attachment_ajaxAction extends AttachmentAction
|
||||||
$this->elementEnd('div');
|
$this->elementEnd('div');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,8 @@ require_once INSTALLDIR.'/actions/attachment.php';
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Attachment_thumbnailAction extends AttachmentAction
|
class Attachment_thumbnailAction extends AttachmentAction
|
||||||
{
|
{
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
|
@ -79,6 +77,4 @@ class Attachment_thumbnailAction extends AttachmentAction
|
||||||
}
|
}
|
||||||
$this->element('img', array('src' => $file_thumbnail->url, 'alt' => 'Thumbnail'));
|
$this->element('img', array('src' => $file_thumbnail->url, 'alt' => 'Thumbnail'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,27 +56,32 @@ class AvatarbynicknameAction extends Action
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
$nickname = $this->trimmed('nickname');
|
$nickname = $this->trimmed('nickname');
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
|
// TRANS: Client error displayed trying to get an avatar without providing a nickname.
|
||||||
$this->clientError(_('No nickname.'));
|
$this->clientError(_('No nickname.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$size = $this->trimmed('size');
|
$size = $this->trimmed('size');
|
||||||
if (!$size) {
|
if (!$size) {
|
||||||
|
// TRANS: Client error displayed trying to get an avatar without providing an avatar size.
|
||||||
$this->clientError(_('No size.'));
|
$this->clientError(_('No size.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$size = strtolower($size);
|
$size = strtolower($size);
|
||||||
if (!in_array($size, array('original', '96', '48', '24'))) {
|
if (!in_array($size, array('original', '96', '48', '24'))) {
|
||||||
|
// TRANS: Client error displayed trying to get an avatar providing an invalid avatar size.
|
||||||
$this->clientError(_('Invalid size.'));
|
$this->clientError(_('Invalid size.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::staticGet('nickname', $nickname);
|
$user = User::staticGet('nickname', $nickname);
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
|
// TRANS: Client error displayed trying to get an avatar for a non-existing user.
|
||||||
$this->clientError(_('No such user.'));
|
$this->clientError(_('No such user.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
|
// TRANS: Client error displayed trying to get an avatar for a user without a profile.
|
||||||
$this->clientError(_('User has no profile.'));
|
$this->clientError(_('User has no profile.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -103,4 +108,3 @@ class AvatarbynicknameAction extends Action
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,6 @@ define('MAX_ORIGINAL', 480);
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AvatarsettingsAction extends AccountSettingsAction
|
class AvatarsettingsAction extends AccountSettingsAction
|
||||||
{
|
{
|
||||||
var $mode = null;
|
var $mode = null;
|
||||||
|
@ -61,9 +60,9 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
*
|
*
|
||||||
* @return string Title of the page
|
* @return string Title of the page
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Title for avatar upload page.
|
||||||
return _('Avatar');
|
return _('Avatar');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,10 +71,12 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
*
|
*
|
||||||
* @return instructions for use
|
* @return instructions for use
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getInstructions()
|
function getInstructions()
|
||||||
{
|
{
|
||||||
return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'), ImageFile::maxFileSize());
|
// TRANS: Instruction for avatar upload page.
|
||||||
|
// TRANS: %s is the maximum file size, for example "500b", "10kB" or "2MB".
|
||||||
|
return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'),
|
||||||
|
ImageFile::maxFileSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,6 +104,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
|
|
||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
common_log_db_error($user, 'SELECT', __FILE__);
|
common_log_db_error($user, 'SELECT', __FILE__);
|
||||||
|
// TRANS: Server error displayed in avatar upload page when no matching profile can be found for a user.
|
||||||
$this->serverError(_('User without matching profile.'));
|
$this->serverError(_('User without matching profile.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -116,6 +118,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
'action' =>
|
'action' =>
|
||||||
common_local_url('avatarsettings')));
|
common_local_url('avatarsettings')));
|
||||||
$this->elementStart('fieldset');
|
$this->elementStart('fieldset');
|
||||||
|
// TRANS: Avatar upload page form legend.
|
||||||
$this->element('legend', null, _('Avatar settings'));
|
$this->element('legend', null, _('Avatar settings'));
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
|
||||||
|
@ -124,6 +127,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
if ($original) {
|
if ($original) {
|
||||||
$this->elementStart('li', array('id' => 'avatar_original',
|
$this->elementStart('li', array('id' => 'avatar_original',
|
||||||
'class' => 'avatar_view'));
|
'class' => 'avatar_view'));
|
||||||
|
// TRANS: Header on avatar upload page for thumbnail of originally uploaded avatar (h2).
|
||||||
$this->element('h2', null, _("Original"));
|
$this->element('h2', null, _("Original"));
|
||||||
$this->elementStart('div', array('id'=>'avatar_original_view'));
|
$this->elementStart('div', array('id'=>'avatar_original_view'));
|
||||||
$this->element('img', array('src' => $original->url,
|
$this->element('img', array('src' => $original->url,
|
||||||
|
@ -139,6 +143,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
if ($avatar) {
|
if ($avatar) {
|
||||||
$this->elementStart('li', array('id' => 'avatar_preview',
|
$this->elementStart('li', array('id' => 'avatar_preview',
|
||||||
'class' => 'avatar_view'));
|
'class' => 'avatar_view'));
|
||||||
|
// TRANS: Header on avatar upload page for thumbnail of to be used rendition of uploaded avatar (h2).
|
||||||
$this->element('h2', null, _("Preview"));
|
$this->element('h2', null, _("Preview"));
|
||||||
$this->elementStart('div', array('id'=>'avatar_preview_view'));
|
$this->elementStart('div', array('id'=>'avatar_preview_view'));
|
||||||
$this->element('img', array('src' => $original->url,
|
$this->element('img', array('src' => $original->url,
|
||||||
|
@ -146,7 +151,8 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
'height' => AVATAR_PROFILE_SIZE,
|
'height' => AVATAR_PROFILE_SIZE,
|
||||||
'alt' => $user->nickname));
|
'alt' => $user->nickname));
|
||||||
$this->elementEnd('div');
|
$this->elementEnd('div');
|
||||||
$this->submit('delete', _('Delete'));
|
// TRANS: Button on avatar upload page to delete current avatar.
|
||||||
|
$this->submit('delete', _m('BUTTON','Delete'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +169,8 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
|
|
||||||
$this->elementStart('ul', 'form_actions');
|
$this->elementStart('ul', 'form_actions');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
$this->submit('upload', _('Upload'));
|
// TRANS: Button on avatar upload page to upload an avatar.
|
||||||
|
$this->submit('upload', _m('BUTTON','Upload'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
}
|
}
|
||||||
|
@ -171,7 +178,6 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
|
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
$this->elementEnd('form');
|
$this->elementEnd('form');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showCropForm()
|
function showCropForm()
|
||||||
|
@ -182,6 +188,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
|
|
||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
common_log_db_error($user, 'SELECT', __FILE__);
|
common_log_db_error($user, 'SELECT', __FILE__);
|
||||||
|
// TRANS: Server error displayed in avatar upload page when no matching profile can be found for a user.
|
||||||
$this->serverError(_('User without matching profile.'));
|
$this->serverError(_('User without matching profile.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -194,6 +201,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
'action' =>
|
'action' =>
|
||||||
common_local_url('avatarsettings')));
|
common_local_url('avatarsettings')));
|
||||||
$this->elementStart('fieldset');
|
$this->elementStart('fieldset');
|
||||||
|
// TRANS: Avatar upload page crop form legend.
|
||||||
$this->element('legend', null, _('Avatar settings'));
|
$this->element('legend', null, _('Avatar settings'));
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
|
||||||
|
@ -202,6 +210,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
$this->elementStart('li',
|
$this->elementStart('li',
|
||||||
array('id' => 'avatar_original',
|
array('id' => 'avatar_original',
|
||||||
'class' => 'avatar_view'));
|
'class' => 'avatar_view'));
|
||||||
|
// TRANS: Header on avatar upload crop form for thumbnail of originally uploaded avatar (h2).
|
||||||
$this->element('h2', null, _("Original"));
|
$this->element('h2', null, _("Original"));
|
||||||
$this->elementStart('div', array('id'=>'avatar_original_view'));
|
$this->elementStart('div', array('id'=>'avatar_original_view'));
|
||||||
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
|
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
|
||||||
|
@ -214,6 +223,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
$this->elementStart('li',
|
$this->elementStart('li',
|
||||||
array('id' => 'avatar_preview',
|
array('id' => 'avatar_preview',
|
||||||
'class' => 'avatar_view'));
|
'class' => 'avatar_view'));
|
||||||
|
// TRANS: Header on avatar upload crop form for thumbnail of to be used rendition of uploaded avatar (h2).
|
||||||
$this->element('h2', null, _("Preview"));
|
$this->element('h2', null, _("Preview"));
|
||||||
$this->elementStart('div', array('id'=>'avatar_preview_view'));
|
$this->elementStart('div', array('id'=>'avatar_preview_view'));
|
||||||
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
|
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
|
||||||
|
@ -228,13 +238,14 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'id' => $crop_info));
|
'id' => $crop_info));
|
||||||
}
|
}
|
||||||
$this->submit('crop', _('Crop'));
|
|
||||||
|
// TRANS: Button on avatar upload crop form to confirm a selected crop as avatar.
|
||||||
|
$this->submit('crop', _m('BUTTON','Crop'));
|
||||||
|
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
$this->elementEnd('form');
|
$this->elementEnd('form');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -244,7 +255,6 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handlePost()
|
function handlePost()
|
||||||
{
|
{
|
||||||
// Workaround for PHP returning empty $_POST and $_FILES when POST
|
// Workaround for PHP returning empty $_POST and $_FILES when POST
|
||||||
|
@ -280,6 +290,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
} else if ($this->arg('delete')) {
|
} else if ($this->arg('delete')) {
|
||||||
$this->deleteAvatar();
|
$this->deleteAvatar();
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: Unexpected validation error on avatar upload form.
|
||||||
$this->showForm(_('Unexpected form submission.'));
|
$this->showForm(_('Unexpected form submission.'));
|
||||||
}
|
}
|
||||||
Event::handle('EndAvatarSaveForm', array($this));
|
Event::handle('EndAvatarSaveForm', array($this));
|
||||||
|
@ -294,7 +305,6 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function uploadAvatar()
|
function uploadAvatar()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@ -304,6 +314,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($imagefile === null) {
|
if ($imagefile === null) {
|
||||||
|
// TRANS: Validation error on avatar upload form when no file was uploaded.
|
||||||
$this->showForm(_('No file uploaded.'));
|
$this->showForm(_('No file uploaded.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -331,6 +342,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
|
|
||||||
$this->mode = 'crop';
|
$this->mode = 'crop';
|
||||||
|
|
||||||
|
// TRANS: Avatar upload form unstruction after uploading a file.
|
||||||
$this->showForm(_('Pick a square area of the image to be your avatar'),
|
$this->showForm(_('Pick a square area of the image to be your avatar'),
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
@ -340,12 +352,12 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function cropAvatar()
|
function cropAvatar()
|
||||||
{
|
{
|
||||||
$filedata = $_SESSION['FILEDATA'];
|
$filedata = $_SESSION['FILEDATA'];
|
||||||
|
|
||||||
if (!$filedata) {
|
if (!$filedata) {
|
||||||
|
// TRANS: Server error displayed if an avatar upload went wrong somehow server side.
|
||||||
$this->serverError(_('Lost our file data.'));
|
$this->serverError(_('Lost our file data.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -372,6 +384,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
$this->showForm(_('Avatar updated.'), true);
|
$this->showForm(_('Avatar updated.'), true);
|
||||||
common_broadcast_profile($profile);
|
common_broadcast_profile($profile);
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: Error displayed on the avatar upload page if the avatar could not be updated for an unknown reason.
|
||||||
$this->showForm(_('Failed updating avatar.'));
|
$this->showForm(_('Failed updating avatar.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,7 +394,6 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function deleteAvatar()
|
function deleteAvatar()
|
||||||
{
|
{
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
@ -396,6 +408,7 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
|
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
|
||||||
if($avatar) $avatar->delete();
|
if($avatar) $avatar->delete();
|
||||||
|
|
||||||
|
// TRANS: Success message for deleting a user avatar.
|
||||||
$this->showForm(_('Avatar deleted.'), true);
|
$this->showForm(_('Avatar deleted.'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,7 +429,6 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showScripts()
|
function showScripts()
|
||||||
{
|
{
|
||||||
parent::showScripts();
|
parent::showScripts();
|
||||||
|
|
|
@ -42,7 +42,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BlockAction extends ProfileFormAction
|
class BlockAction extends ProfileFormAction
|
||||||
{
|
{
|
||||||
var $profile = null;
|
var $profile = null;
|
||||||
|
@ -54,7 +53,6 @@ class BlockAction extends ProfileFormAction
|
||||||
*
|
*
|
||||||
* @return boolean success flag
|
* @return boolean success flag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($args)
|
function prepare($args)
|
||||||
{
|
{
|
||||||
if (!parent::prepare($args)) {
|
if (!parent::prepare($args)) {
|
||||||
|
@ -66,6 +64,7 @@ class BlockAction extends ProfileFormAction
|
||||||
assert(!empty($cur)); // checked by parent
|
assert(!empty($cur)); // checked by parent
|
||||||
|
|
||||||
if ($cur->hasBlocked($this->profile)) {
|
if ($cur->hasBlocked($this->profile)) {
|
||||||
|
// TRANS: Client error displayed when blocking a user that has already been blocked.
|
||||||
$this->clientError(_('You already blocked that user.'));
|
$this->clientError(_('You already blocked that user.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +81,6 @@ class BlockAction extends ProfileFormAction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
|
@ -104,6 +102,7 @@ class BlockAction extends ProfileFormAction
|
||||||
}
|
}
|
||||||
|
|
||||||
function title() {
|
function title() {
|
||||||
|
// TRANS: Title for block user page.
|
||||||
return _('Block user');
|
return _('Block user');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,8 +132,10 @@ class BlockAction extends ProfileFormAction
|
||||||
'action' => common_local_url('block')));
|
'action' => common_local_url('block')));
|
||||||
$this->elementStart('fieldset');
|
$this->elementStart('fieldset');
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
// TRANS: Legend for block user form.
|
||||||
$this->element('legend', _('Block user'));
|
$this->element('legend', _('Block user'));
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
|
// TRANS: Explanation of consequences when blocking a user on the block user page.
|
||||||
_('Are you sure you want to block this user? '.
|
_('Are you sure you want to block this user? '.
|
||||||
'Afterwards, they will be unsubscribed from you, '.
|
'Afterwards, they will be unsubscribed from you, '.
|
||||||
'unable to subscribe to you in the future, and '.
|
'unable to subscribe to you in the future, and '.
|
||||||
|
@ -184,6 +185,7 @@ class BlockAction extends ProfileFormAction
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
// TRANS: Server error displayed when blocking a user fails.
|
||||||
$this->serverError(_('Failed to save block information.'));
|
$this->serverError(_('Failed to save block information.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BlockedfromgroupAction extends GroupDesignAction
|
class BlockedfromgroupAction extends GroupDesignAction
|
||||||
{
|
{
|
||||||
var $page = null;
|
var $page = null;
|
||||||
|
@ -70,6 +69,7 @@ class BlockedfromgroupAction extends GroupDesignAction
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
|
// TRANS: Client error displayed when requesting a list of blocked users for a group without providing a group nickname.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,7 @@ class BlockedfromgroupAction extends GroupDesignAction
|
||||||
$local = Local_group::staticGet('nickname', $nickname);
|
$local = Local_group::staticGet('nickname', $nickname);
|
||||||
|
|
||||||
if (!$local) {
|
if (!$local) {
|
||||||
|
// TRANS: Client error displayed when requesting a list of blocked users for a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +85,7 @@ class BlockedfromgroupAction extends GroupDesignAction
|
||||||
$this->group = User_group::staticGet('id', $local->group_id);
|
$this->group = User_group::staticGet('id', $local->group_id);
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
|
// TRANS: Client error displayed when requesting a list of blocked users for a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -94,9 +96,13 @@ class BlockedfromgroupAction extends GroupDesignAction
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
if ($this->page == 1) {
|
if ($this->page == 1) {
|
||||||
|
// TRANS: Title for first page with list of users blocked from a group.
|
||||||
|
// TRANS: %s is a group nickname.
|
||||||
return sprintf(_('%s blocked profiles'),
|
return sprintf(_('%s blocked profiles'),
|
||||||
$this->group->nickname);
|
$this->group->nickname);
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: Title for any but the first page with list of users blocked from a group.
|
||||||
|
// TRANS: %1$s is a group nickname, %2$d is a page number.
|
||||||
return sprintf(_('%1$s blocked profiles, page %2$d'),
|
return sprintf(_('%1$s blocked profiles, page %2$d'),
|
||||||
$this->group->nickname,
|
$this->group->nickname,
|
||||||
$this->page);
|
$this->page);
|
||||||
|
@ -112,6 +118,7 @@ class BlockedfromgroupAction extends GroupDesignAction
|
||||||
function showPageNotice()
|
function showPageNotice()
|
||||||
{
|
{
|
||||||
$this->element('p', 'instructions',
|
$this->element('p', 'instructions',
|
||||||
|
// TRANS: Instructions for list of users blocked from a group.
|
||||||
_('A list of the users blocked from joining this group.'));
|
_('A list of the users blocked from joining this group.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +212,6 @@ class GroupBlockListItem extends ProfileListItem
|
||||||
*
|
*
|
||||||
* @see UnblockForm
|
* @see UnblockForm
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class GroupUnblockForm extends Form
|
class GroupUnblockForm extends Form
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -234,7 +240,6 @@ class GroupUnblockForm extends Form
|
||||||
* @param User_group $group group to block user from
|
* @param User_group $group group to block user from
|
||||||
* @param array $args return-to args
|
* @param array $args return-to args
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($out=null, $profile=null, $group=null, $args=null)
|
function __construct($out=null, $profile=null, $group=null, $args=null)
|
||||||
{
|
{
|
||||||
parent::__construct($out);
|
parent::__construct($out);
|
||||||
|
@ -249,7 +254,6 @@ class GroupUnblockForm extends Form
|
||||||
*
|
*
|
||||||
* @return int ID of the form
|
* @return int ID of the form
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function id()
|
function id()
|
||||||
{
|
{
|
||||||
// This should be unique for the page.
|
// This should be unique for the page.
|
||||||
|
@ -261,7 +265,6 @@ class GroupUnblockForm extends Form
|
||||||
*
|
*
|
||||||
* @return string class of the form
|
* @return string class of the form
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function formClass()
|
function formClass()
|
||||||
{
|
{
|
||||||
return 'form_group_unblock';
|
return 'form_group_unblock';
|
||||||
|
@ -272,7 +275,6 @@ class GroupUnblockForm extends Form
|
||||||
*
|
*
|
||||||
* @return string URL of the action
|
* @return string URL of the action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function action()
|
function action()
|
||||||
{
|
{
|
||||||
return common_local_url('groupunblock');
|
return common_local_url('groupunblock');
|
||||||
|
@ -285,6 +287,7 @@ class GroupUnblockForm extends Form
|
||||||
*/
|
*/
|
||||||
function formLegend()
|
function formLegend()
|
||||||
{
|
{
|
||||||
|
// TRANS: Form legend for unblocking a user from a group.
|
||||||
$this->out->element('legend', null, _('Unblock user from group'));
|
$this->out->element('legend', null, _('Unblock user from group'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +296,6 @@ class GroupUnblockForm extends Form
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function formData()
|
function formData()
|
||||||
{
|
{
|
||||||
$this->out->hidden('unblockto-' . $this->profile->id,
|
$this->out->hidden('unblockto-' . $this->profile->id,
|
||||||
|
@ -314,9 +316,14 @@ class GroupUnblockForm extends Form
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function formActions()
|
function formActions()
|
||||||
{
|
{
|
||||||
$this->out->submit('submit', _('Unblock'), 'submit', null, _('Unblock this user'));
|
$this->out->submit('submit',
|
||||||
|
// TRANS: Button text for unblocking a user from a group.
|
||||||
|
_m('BUTTON','Unblock'),
|
||||||
|
'submit',
|
||||||
|
null,
|
||||||
|
// TRANS: Tooltip for button for unblocking a user from a group.
|
||||||
|
_('Unblock this user'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,12 +42,12 @@ require_once INSTALLDIR . '/actions/newnotice.php';
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BookmarkletAction extends NewnoticeAction
|
class BookmarkletAction extends NewnoticeAction
|
||||||
{
|
{
|
||||||
function showTitle()
|
function showTitle()
|
||||||
{
|
{
|
||||||
// TRANS: Title for mini-posting window loaded from bookmarklet.
|
// TRANS: Title for mini-posting window loaded from bookmarklet.
|
||||||
|
// TRANS: %s is the StatusNet site name.
|
||||||
$this->element('title', null, sprintf(_('Post to %s'), common_config('site', 'name')));
|
$this->element('title', null, sprintf(_('Post to %s'), common_config('site', 'name')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,4 +73,3 @@ class BookmarkletAction extends NewnoticeAction
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConfirmaddressAction extends Action
|
class ConfirmaddressAction extends Action
|
||||||
{
|
{
|
||||||
/** type of confirmation. */
|
/** type of confirmation. */
|
||||||
|
@ -61,7 +60,6 @@ class ConfirmaddressAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
@ -72,27 +70,30 @@ class ConfirmaddressAction extends Action
|
||||||
}
|
}
|
||||||
$code = $this->trimmed('code');
|
$code = $this->trimmed('code');
|
||||||
if (!$code) {
|
if (!$code) {
|
||||||
|
// TRANS: Client error displayed when not providing a confirmation code in the contact address confirmation action.
|
||||||
$this->clientError(_('No confirmation code.'));
|
$this->clientError(_('No confirmation code.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$confirm = Confirm_address::staticGet('code', $code);
|
$confirm = Confirm_address::staticGet('code', $code);
|
||||||
if (!$confirm) {
|
if (!$confirm) {
|
||||||
|
// TRANS: Client error displayed when providing a non-existing confirmation code in the contact address confirmation action.
|
||||||
$this->clientError(_('Confirmation code not found.'));
|
$this->clientError(_('Confirmation code not found.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
if ($cur->id != $confirm->user_id) {
|
if ($cur->id != $confirm->user_id) {
|
||||||
|
// TRANS: Client error displayed when not providing a confirmation code for another user in the contact address confirmation action.
|
||||||
$this->clientError(_('That confirmation code is not for you!'));
|
$this->clientError(_('That confirmation code is not for you!'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$type = $confirm->address_type;
|
$type = $confirm->address_type;
|
||||||
if (!in_array($type, array('email', 'jabber', 'sms'))) {
|
if (!in_array($type, array('email', 'jabber', 'sms'))) {
|
||||||
// TRANS: Server error for an unknow address type, which can be 'email', 'jabber', or 'sms'.
|
// TRANS: Server error for a unknow address type %s, which can be 'email', 'jabber', or 'sms'.
|
||||||
$this->serverError(sprintf(_('Unrecognized address type %s.'), $type));
|
$this->serverError(sprintf(_('Unrecognized address type %s.'), $type));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($cur->$type == $confirm->address) {
|
if ($cur->$type == $confirm->address) {
|
||||||
// TRANS: Client error for an already confirmed email/jabbel/sms address.
|
// TRANS: Client error for an already confirmed email/jabber/sms address.
|
||||||
$this->clientError(_('That address has already been confirmed.'));
|
$this->clientError(_('That address has already been confirmed.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -113,6 +114,7 @@ class ConfirmaddressAction extends Action
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($cur, 'UPDATE', __FILE__);
|
common_log_db_error($cur, 'UPDATE', __FILE__);
|
||||||
|
// TRANS: Server error displayed when a user update to the database fails in the contact address confirmation action.
|
||||||
$this->serverError(_('Couldn\'t update user.'));
|
$this->serverError(_('Couldn\'t update user.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +127,9 @@ class ConfirmaddressAction extends Action
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($confirm, 'DELETE', __FILE__);
|
common_log_db_error($confirm, 'DELETE', __FILE__);
|
||||||
$this->serverError(_('Couldn\'t delete email confirmation.'));
|
// TRANS: Server error displayed when an address confirmation code deletion from the
|
||||||
|
// TRANS: database fails in the contact address confirmation action.
|
||||||
|
$this->serverError(_('Could not delete address confirmation.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,9 +144,9 @@ class ConfirmaddressAction extends Action
|
||||||
*
|
*
|
||||||
* @return string title
|
* @return string title
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Title for the contact address confirmation action.
|
||||||
return _('Confirm address');
|
return _('Confirm address');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,13 +155,14 @@ class ConfirmaddressAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
$type = $this->type;
|
$type = $this->type;
|
||||||
|
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
|
// TRANS: Success message for the contact address confirmation action.
|
||||||
|
// TRANS: %s can be 'email', 'jabber', or 'sms'.
|
||||||
sprintf(_('The address "%s" has been '.
|
sprintf(_('The address "%s" has been '.
|
||||||
'confirmed for your account.'),
|
'confirmed for your account.'),
|
||||||
$cur->$type));
|
$cur->$type));
|
||||||
|
|
|
@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/noticelist.php';
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConversationAction extends Action
|
class ConversationAction extends Action
|
||||||
{
|
{
|
||||||
var $id = null;
|
var $id = null;
|
||||||
|
@ -58,7 +57,6 @@ class ConversationAction extends Action
|
||||||
*
|
*
|
||||||
* @return boolean false if id not passed in
|
* @return boolean false if id not passed in
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($args)
|
function prepare($args)
|
||||||
{
|
{
|
||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
|
@ -81,7 +79,6 @@ class ConversationAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
@ -93,10 +90,10 @@ class ConversationAction extends Action
|
||||||
*
|
*
|
||||||
* @return string page title
|
* @return string page title
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
return _("Conversation");
|
// TRANS: Title for page with a conversion (multiple notices in context).
|
||||||
|
return _('Conversation');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,7 +104,6 @@ class ConversationAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
$notices = Notice::conversationStream($this->id, null, null);
|
$notices = Notice::conversationStream($this->id, null, null);
|
||||||
|
@ -134,7 +130,6 @@ class ConversationAction extends Action
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConversationTree extends NoticeList
|
class ConversationTree extends NoticeList
|
||||||
{
|
{
|
||||||
var $tree = null;
|
var $tree = null;
|
||||||
|
@ -145,12 +140,12 @@ class ConversationTree extends NoticeList
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
$cnt = $this->_buildTree();
|
$cnt = $this->_buildTree();
|
||||||
|
|
||||||
$this->out->elementStart('div', array('id' =>'notices_primary'));
|
$this->out->elementStart('div', array('id' =>'notices_primary'));
|
||||||
|
// TRANS: Header on conversation page. Hidden by default (h2).
|
||||||
$this->out->element('h2', null, _('Notices'));
|
$this->out->element('h2', null, _('Notices'));
|
||||||
$this->out->elementStart('ol', array('class' => 'notices xoxo'));
|
$this->out->elementStart('ol', array('class' => 'notices xoxo'));
|
||||||
|
|
||||||
|
@ -200,7 +195,6 @@ class ConversationTree extends NoticeList
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showNoticePlus($id)
|
function showNoticePlus($id)
|
||||||
{
|
{
|
||||||
$notice = $this->table[$id];
|
$notice = $this->table[$id];
|
||||||
|
@ -237,7 +231,6 @@ class ConversationTree extends NoticeList
|
||||||
*
|
*
|
||||||
* @return NoticeListItem a list item to show
|
* @return NoticeListItem a list item to show
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function newListItem($notice)
|
function newListItem($notice)
|
||||||
{
|
{
|
||||||
return new ConversationTreeItem($notice, $this->out);
|
return new ConversationTreeItem($notice, $this->out);
|
||||||
|
@ -255,7 +248,6 @@ class ConversationTree extends NoticeList
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConversationTreeItem extends NoticeListItem
|
class ConversationTreeItem extends NoticeListItem
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -266,7 +258,6 @@ class ConversationTreeItem extends NoticeListItem
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showStart()
|
function showStart()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -280,7 +271,6 @@ class ConversationTreeItem extends NoticeListItem
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showEnd()
|
function showEnd()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -293,7 +283,6 @@ class ConversationTreeItem extends NoticeListItem
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showContext()
|
function showContext()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -45,14 +45,13 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class EditgroupAction extends GroupDesignAction
|
class EditgroupAction extends GroupDesignAction
|
||||||
{
|
{
|
||||||
|
|
||||||
var $msg;
|
var $msg;
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Title for form to edit a group. %s is a group nickname.
|
||||||
return sprintf(_('Edit %s group'), $this->group->nickname);
|
return sprintf(_('Edit %s group'), $this->group->nickname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +64,7 @@ class EditgroupAction extends GroupDesignAction
|
||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
|
|
||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
|
// TRANS: Client error displayed trying to edit a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to create a group.'));
|
$this->clientError(_('You must be logged in to create a group.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ class EditgroupAction extends GroupDesignAction
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
|
// TRANS: Client error displayed trying to edit a group while not proving a nickname for the group to edit.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -97,6 +98,7 @@ class EditgroupAction extends GroupDesignAction
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
|
// TRANS: Client error displayed trying to edit a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -104,6 +106,7 @@ class EditgroupAction extends GroupDesignAction
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
|
|
||||||
if (!$cur->isAdmin($this->group)) {
|
if (!$cur->isAdmin($this->group)) {
|
||||||
|
// TRANS: Client error displayed trying to edit a group while not being a group admin.
|
||||||
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +123,6 @@ class EditgroupAction extends GroupDesignAction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
@ -155,6 +157,7 @@ class EditgroupAction extends GroupDesignAction
|
||||||
$this->element('p', 'error', $this->msg);
|
$this->element('p', 'error', $this->msg);
|
||||||
} else {
|
} else {
|
||||||
$this->element('p', 'instructions',
|
$this->element('p', 'instructions',
|
||||||
|
// TRANS: Form instructions for group edit form.
|
||||||
_('Use this form to edit the group.'));
|
_('Use this form to edit the group.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,6 +172,7 @@ class EditgroupAction extends GroupDesignAction
|
||||||
{
|
{
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
if (!$cur->isAdmin($this->group)) {
|
if (!$cur->isAdmin($this->group)) {
|
||||||
|
// TRANS: Client error displayed trying to edit a group while not being a group admin.
|
||||||
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -183,28 +187,39 @@ class EditgroupAction extends GroupDesignAction
|
||||||
if (!Validate::string($nickname, array('min_length' => 1,
|
if (!Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => NICKNAME_FMT))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(_('Nickname must have only lowercase letters '.
|
$this->showForm(_('Nickname must have only lowercase letters '.
|
||||||
'and numbers and no spaces.'));
|
'and numbers and no spaces.'));
|
||||||
return;
|
return;
|
||||||
} else if ($this->nicknameExists($nickname)) {
|
} else if ($this->nicknameExists($nickname)) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(_('Nickname already in use. Try another one.'));
|
$this->showForm(_('Nickname already in use. Try another one.'));
|
||||||
return;
|
return;
|
||||||
} else if (!User_group::allowedNickname($nickname)) {
|
} else if (!User_group::allowedNickname($nickname)) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(_('Not a valid nickname.'));
|
$this->showForm(_('Not a valid nickname.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
|
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
|
||||||
!Validate::uri($homepage,
|
!Validate::uri($homepage,
|
||||||
array('allowed_schemes' =>
|
array('allowed_schemes' =>
|
||||||
array('http', 'https')))) {
|
array('http', 'https')))) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(_('Homepage is not a valid URL.'));
|
$this->showForm(_('Homepage is not a valid URL.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(_('Full name is too long (maximum 255 characters).'));
|
$this->showForm(_('Full name is too long (maximum 255 characters).'));
|
||||||
return;
|
return;
|
||||||
} else if (User_group::descriptionTooLong($description)) {
|
} else if (User_group::descriptionTooLong($description)) {
|
||||||
$this->showForm(sprintf(_('Description is too long (max %d chars).'), User_group::maxDescription()));
|
$this->showForm(sprintf(
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
|
_m('Description is too long (maximum %d character).',
|
||||||
|
'Description is too long (maximum %d characters).',
|
||||||
|
User_group::maxDescription()),
|
||||||
|
User_group::maxDescription()));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(_('Location is too long (maximum 255 characters).'));
|
$this->showForm(_('Location is too long (maximum 255 characters).'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +231,11 @@ class EditgroupAction extends GroupDesignAction
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($aliases) > common_config('group', 'maxaliases')) {
|
if (count($aliases) > common_config('group', 'maxaliases')) {
|
||||||
$this->showForm(sprintf(_('Too many aliases! Maximum %d.'),
|
// TRANS: Group edit form validation error.
|
||||||
|
// TRANS: %d is the maximum number of allowed aliases.
|
||||||
|
$this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.',
|
||||||
|
'Too many aliases! Maximum %d allowed.',
|
||||||
|
common_config('group', 'maxaliases')),
|
||||||
common_config('group', 'maxaliases')));
|
common_config('group', 'maxaliases')));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -225,16 +244,19 @@ class EditgroupAction extends GroupDesignAction
|
||||||
if (!Validate::string($alias, array('min_length' => 1,
|
if (!Validate::string($alias, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => NICKNAME_FMT))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(sprintf(_('Invalid alias: "%s"'), $alias));
|
$this->showForm(sprintf(_('Invalid alias: "%s"'), $alias));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->nicknameExists($alias)) {
|
if ($this->nicknameExists($alias)) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'),
|
$this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'),
|
||||||
$alias));
|
$alias));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// XXX assumes alphanum nicknames
|
// XXX assumes alphanum nicknames
|
||||||
if (strcmp($alias, $nickname) == 0) {
|
if (strcmp($alias, $nickname) == 0) {
|
||||||
|
// TRANS: Group edit form validation error.
|
||||||
$this->showForm(_('Alias can\'t be the same as nickname.'));
|
$this->showForm(_('Alias can\'t be the same as nickname.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -255,12 +277,14 @@ class EditgroupAction extends GroupDesignAction
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($this->group, 'UPDATE', __FILE__);
|
common_log_db_error($this->group, 'UPDATE', __FILE__);
|
||||||
|
// TRANS: Server error displayed when editing a group fails.
|
||||||
$this->serverError(_('Could not update group.'));
|
$this->serverError(_('Could not update group.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->group->setAliases($aliases);
|
$result = $this->group->setAliases($aliases);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
// TRANS: Server error displayed when group aliases could not be added.
|
||||||
$this->serverError(_('Could not create aliases.'));
|
$this->serverError(_('Could not create aliases.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,6 +301,7 @@ class EditgroupAction extends GroupDesignAction
|
||||||
array('nickname' => $nickname)),
|
array('nickname' => $nickname)),
|
||||||
303);
|
303);
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: Group edit form success message.
|
||||||
$this->showForm(_('Options saved.'));
|
$this->showForm(_('Options saved.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,4 +325,3 @@ class EditgroupAction extends GroupDesignAction
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,25 +43,25 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class NewgroupAction extends Action
|
class NewgroupAction extends Action
|
||||||
{
|
{
|
||||||
var $msg;
|
var $msg;
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Title for form to create a group.
|
||||||
return _('New group');
|
return _('New group');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare to run
|
* Prepare to run
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($args)
|
function prepare($args)
|
||||||
{
|
{
|
||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
|
|
||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
|
// TRANS: Client error displayed trying to create a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to create a group.'));
|
$this->clientError(_('You must be logged in to create a group.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,6 @@ class NewgroupAction extends Action
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
|
@ -107,6 +106,7 @@ class NewgroupAction extends Action
|
||||||
$this->element('p', 'error', $this->msg);
|
$this->element('p', 'error', $this->msg);
|
||||||
} else {
|
} else {
|
||||||
$this->element('p', 'instructions',
|
$this->element('p', 'instructions',
|
||||||
|
// TRANS: Form instructions for group create form.
|
||||||
_('Use this form to create a new group.'));
|
_('Use this form to create a new group.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,26 +123,31 @@ class NewgroupAction extends Action
|
||||||
if (!Validate::string($nickname, array('min_length' => 1,
|
if (!Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => NICKNAME_FMT))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(_('Nickname must have only lowercase letters '.
|
$this->showForm(_('Nickname must have only lowercase letters '.
|
||||||
'and numbers and no spaces.'));
|
'and numbers and no spaces.'));
|
||||||
return;
|
return;
|
||||||
} else if ($this->nicknameExists($nickname)) {
|
} else if ($this->nicknameExists($nickname)) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(_('Nickname already in use. Try another one.'));
|
$this->showForm(_('Nickname already in use. Try another one.'));
|
||||||
return;
|
return;
|
||||||
} else if (!User_group::allowedNickname($nickname)) {
|
} else if (!User_group::allowedNickname($nickname)) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(_('Not a valid nickname.'));
|
$this->showForm(_('Not a valid nickname.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
|
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
|
||||||
!Validate::uri($homepage,
|
!Validate::uri($homepage,
|
||||||
array('allowed_schemes' =>
|
array('allowed_schemes' =>
|
||||||
array('http', 'https')))) {
|
array('http', 'https')))) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(_('Homepage is not a valid URL.'));
|
$this->showForm(_('Homepage is not a valid URL.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(_('Full name is too long (maximum 255 characters).'));
|
$this->showForm(_('Full name is too long (maximum 255 characters).'));
|
||||||
return;
|
return;
|
||||||
} else if (User_group::descriptionTooLong($description)) {
|
} else if (User_group::descriptionTooLong($description)) {
|
||||||
// TRANS: Form validation error creating a new group because the description is too long.
|
// TRANS: Group create form validation error.
|
||||||
// TRANS: %d is the maximum number of allowed characters.
|
// TRANS: %d is the maximum number of allowed characters.
|
||||||
$this->showForm(sprintf(_m('Description is too long (maximum %d character).',
|
$this->showForm(sprintf(_m('Description is too long (maximum %d character).',
|
||||||
'Description is too long (maximum %d characters).',
|
'Description is too long (maximum %d characters).',
|
||||||
|
@ -150,6 +155,7 @@ class NewgroupAction extends Action
|
||||||
User_group::maxDescription()));
|
User_group::maxDescription()));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(_('Location is too long (maximum 255 characters).'));
|
$this->showForm(_('Location is too long (maximum 255 characters).'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -161,7 +167,7 @@ class NewgroupAction extends Action
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($aliases) > common_config('group', 'maxaliases')) {
|
if (count($aliases) > common_config('group', 'maxaliases')) {
|
||||||
// TRANS: Client error shown when providing too many aliases during group creation.
|
// TRANS: Group create form validation error.
|
||||||
// TRANS: %d is the maximum number of allowed aliases.
|
// TRANS: %d is the maximum number of allowed aliases.
|
||||||
$this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.',
|
$this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.',
|
||||||
'Too many aliases! Maximum %d allowed.',
|
'Too many aliases! Maximum %d allowed.',
|
||||||
|
@ -174,16 +180,19 @@ class NewgroupAction extends Action
|
||||||
if (!Validate::string($alias, array('min_length' => 1,
|
if (!Validate::string($alias, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => NICKNAME_FMT))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(sprintf(_('Invalid alias: "%s"'), $alias));
|
$this->showForm(sprintf(_('Invalid alias: "%s"'), $alias));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->nicknameExists($alias)) {
|
if ($this->nicknameExists($alias)) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'),
|
$this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'),
|
||||||
$alias));
|
$alias));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// XXX assumes alphanum nicknames
|
// XXX assumes alphanum nicknames
|
||||||
if (strcmp($alias, $nickname) == 0) {
|
if (strcmp($alias, $nickname) == 0) {
|
||||||
|
// TRANS: Group create form validation error.
|
||||||
$this->showForm(_('Alias can\'t be the same as nickname.'));
|
$this->showForm(_('Alias can\'t be the same as nickname.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -227,4 +236,3 @@ class NewgroupAction extends Action
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
||||||
*
|
*
|
||||||
* @see BlockForm
|
* @see BlockForm
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class UnblockForm extends ProfileActionForm
|
class UnblockForm extends ProfileActionForm
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -52,7 +51,6 @@ class UnblockForm extends ProfileActionForm
|
||||||
*
|
*
|
||||||
* @return string Name of the action, lowercased.
|
* @return string Name of the action, lowercased.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function target()
|
function target()
|
||||||
{
|
{
|
||||||
return 'unblock';
|
return 'unblock';
|
||||||
|
@ -63,11 +61,10 @@ class UnblockForm extends ProfileActionForm
|
||||||
*
|
*
|
||||||
* @return string Title of the form, internationalized
|
* @return string Title of the form, internationalized
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
// TRANS: Title for the form to unblock a user.
|
// TRANS: Title for the form to unblock a user.
|
||||||
return _('Unblock');
|
return _m('TITLE','Unblock');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +72,6 @@ class UnblockForm extends ProfileActionForm
|
||||||
*
|
*
|
||||||
* @return string description of the form, internationalized
|
* @return string description of the form, internationalized
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function description()
|
function description()
|
||||||
{
|
{
|
||||||
// TRANS: Description of the form to unblock a user.
|
// TRANS: Description of the form to unblock a user.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user