summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/apidirectmessage.php6
-rw-r--r--actions/apidirectmessagenew.php20
-rw-r--r--actions/pathsadminpanel.php100
-rw-r--r--actions/showfavorites.php14
-rw-r--r--actions/shownotice.php2
-rw-r--r--actions/showstream.php2
6 files changed, 102 insertions, 42 deletions
diff --git a/actions/apidirectmessage.php b/actions/apidirectmessage.php
index e7ea38dfa..4e2ec5eb0 100644
--- a/actions/apidirectmessage.php
+++ b/actions/apidirectmessage.php
@@ -74,6 +74,7 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->user = $this->auth_user;
if (empty($this->user)) {
+ // TRANS: Client error given when a user was not found (404).
$this->clientError(_('No such user.'), 404, $this->format);
return;
}
@@ -86,10 +87,12 @@ class ApiDirectMessageAction extends ApiAuthAction
// Action was called by /api/direct_messages/sent.format
$this->title = sprintf(
+ // TRANS: %s is a user nickname.
_("Direct messages from %s"),
$this->user->nickname
);
$this->subtitle = sprintf(
+ // TRANS: %s is a user nickname.
_("All the direct messages sent from %s"),
$this->user->nickname
);
@@ -98,10 +101,12 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->id = "tag:$taguribase:SentDirectMessages:" . $this->user->id;
} else {
$this->title = sprintf(
+ // TRANS: %s is a user nickname.
_("Direct messages to %s"),
$this->user->nickname
);
$this->subtitle = sprintf(
+ // TRANS: %s is a user nickname.
_("All the direct messages sent to %s"),
$this->user->nickname
);
@@ -153,6 +158,7 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->showJsonDirectMessages();
break;
default:
+ // TRANS: Client error given when an API method was not found (404).
$this->clientError(_('API method not found.'), $code = 404);
break;
}
diff --git a/actions/apidirectmessagenew.php b/actions/apidirectmessagenew.php
index 44e205ebb..c126cd312 100644
--- a/actions/apidirectmessagenew.php
+++ b/actions/apidirectmessagenew.php
@@ -49,7 +49,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiDirectMessageNewAction extends ApiAuthAction
{
var $other = null;
@@ -63,7 +62,6 @@ class ApiDirectMessageNewAction extends ApiAuthAction
* @return boolean success flag
*
*/
-
function prepare($args)
{
parent::prepare($args);
@@ -99,7 +97,6 @@ class ApiDirectMessageNewAction extends ApiAuthAction
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
@@ -116,6 +113,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
if (empty($this->content)) {
$this->clientError(
+ // TRANS: Client error (406).
_('No message text!'),
406,
$this->format
@@ -123,9 +121,10 @@ class ApiDirectMessageNewAction extends ApiAuthAction
} else {
$content_shortened = common_shorten_links($this->content);
if (Message::contentTooLong($content_shortened)) {
+ // TRANS: Client error displayed when message content is too long.
+ // TRANS: %d is the maximum number of characters for a message.
$this->clientError(
- sprintf(
- _('That\'s too long. Max message size is %d chars.'),
+ sprintf(_m('That\'s too long. Maximum message size is %d character.', 'That\'s too long. Maximum message size is %d characters.', Message::maxContent()),
Message::maxContent()
),
406,
@@ -136,10 +135,12 @@ class ApiDirectMessageNewAction extends ApiAuthAction
}
if (empty($this->other)) {
+ // TRANS: Client error displayed if a recipient user could not be found (403).
$this->clientError(_('Recipient user not found.'), 403, $this->format);
return;
} else if (!$this->user->mutuallySubscribed($this->other)) {
$this->clientError(
+ // TRANS: Client error displayed trying to direct message another user who's not a friend (403).
_('Can\'t send direct messages to users who aren\'t your friend.'),
403,
$this->format
@@ -149,10 +150,9 @@ class ApiDirectMessageNewAction extends ApiAuthAction
// Note: sending msgs to yourself is allowed by Twitter
- $errmsg = 'Don\'t send a message to yourself; ' .
- 'just say it to yourself quietly instead.';
-
- $this->clientError(_($errmsg), 403, $this->format);
+ // TRANS: Client error displayed trying to direct message self (403).
+ $this->clientError(_('Do not send a message to yourself; ' .
+ 'just say it to yourself quietly instead.'), 403, $this->format);
return;
}
@@ -176,6 +176,4 @@ class ApiDirectMessageNewAction extends ApiAuthAction
$this->showSingleJsondirectMessage($message);
}
}
-
}
-
diff --git a/actions/pathsadminpanel.php b/actions/pathsadminpanel.php
index 0c83aa29e..e073b0a2a 100644
--- a/actions/pathsadminpanel.php
+++ b/actions/pathsadminpanel.php
@@ -92,16 +92,17 @@ class PathsadminpanelAction extends AdminPanelAction
function saveSettings()
{
static $settings = array(
- 'site' => array('path', 'locale_path', 'ssl', 'sslserver'),
- 'theme' => array('server', 'dir', 'path'),
- 'avatar' => array('server', 'dir', 'path'),
- 'background' => array('server', 'dir', 'path')
- );
+ 'site' => array('path', 'locale_path', 'ssl', 'sslserver'),
+ 'theme' => array('server', 'dir', 'path', 'sslserver', 'sslpath'),
+ 'avatar' => array('server', 'dir', 'path'),
+ 'background' => array('server', 'dir', 'path', 'sslserver', 'sslpath'),
+ 'attachments' => array('server', 'dir', 'path', 'sslserver', 'sslpath')
+ );
- // XXX: If we're only going to have one boolean on thi page we
- // can remove some of the boolean processing code --Z
+ // XXX: If we're only going to have one boolean on thi page we
+ // can remove some of the boolean processing code --Z
- static $booleans = array('site' => array('fancy'));
+ static $booleans = array('site' => array('fancy'));
$values = array();
@@ -131,13 +132,13 @@ class PathsadminpanelAction extends AdminPanelAction
}
}
- foreach ($booleans as $section => $parts) {
- foreach ($parts as $setting) {
+ foreach ($booleans as $section => $parts) {
+ foreach ($parts as $setting) {
Config::save($section, $setting, $values[$section][$setting]);
}
- }
+ }
- $config->query('COMMIT');
+ $config->query('COMMIT');
return;
}
@@ -230,11 +231,11 @@ class PathsAdminPanelForm extends AdminForm
function formData()
{
- $this->out->elementStart('fieldset', array('id' => 'settings_paths_locale'));
+ $this->out->elementStart('fieldset', array('id' => 'settings_paths_locale'));
$this->out->element('legend', null, _('Site'), 'site');
$this->out->elementStart('ul', 'form_data');
- $this->li();
+ $this->li();
$this->input('server', _('Server'), _('Site\'s server hostname.'));
$this->unli();
@@ -243,14 +244,14 @@ class PathsAdminPanelForm extends AdminForm
$this->unli();
$this->li();
- $this->input('locale_path', _('Path to locales'), _('Directory path to locales'), 'site');
+ $this->input('locale_path', _('Locale Directory'), _('Directory path to locales'), 'site');
$this->unli();
- $this->li();
+ $this->li();
$this->out->checkbox('fancy', _('Fancy URLs'),
(bool) $this->value('fancy'),
_('Use fancy (more readable and memorable) URLs?'));
- $this->unli();
+ $this->unli();
$this->out->elementEnd('ul');
$this->out->elementEnd('fieldset');
@@ -261,15 +262,23 @@ class PathsAdminPanelForm extends AdminForm
$this->out->elementStart('ul', 'form_data');
$this->li();
- $this->input('server', _('Theme server'), 'Server for themes', 'theme');
+ $this->input('server', _('Server'), _('Server for themes'), 'theme');
+ $this->unli();
+
+ $this->li();
+ $this->input('path', _('Path'), _('Web path to themes'), 'theme');
+ $this->unli();
+
+ $this->li();
+ $this->input('sslserver', _('SSL server'), _('SSL server for themes (default: SSL server)'), 'theme');
$this->unli();
$this->li();
- $this->input('path', _('Theme path'), 'Web path to themes', 'theme');
+ $this->input('sslpath', _('SSL path'), _('SSL path to themes (default: /theme/)'), 'theme');
$this->unli();
$this->li();
- $this->input('dir', _('Theme directory'), 'Directory where themes are located', 'theme');
+ $this->input('dir', _('Directory'), _('Directory where themes are located'), 'theme');
$this->unli();
$this->out->elementEnd('ul');
@@ -297,20 +306,57 @@ class PathsAdminPanelForm extends AdminForm
$this->out->elementEnd('fieldset');
$this->out->elementStart('fieldset', array('id' =>
- 'settings_design_background-paths'));
+ 'settings_design_background-paths'));
$this->out->element('legend', null, _('Backgrounds'));
$this->out->elementStart('ul', 'form_data');
$this->li();
- $this->input('server', _('Background server'), 'Server for backgrounds', 'background');
+ $this->input('server', _('Server'), 'Server for backgrounds', 'background');
+ $this->unli();
+
+ $this->li();
+ $this->input('path', _('Path'), 'Web path to backgrounds', 'background');
$this->unli();
$this->li();
- $this->input('path', _('Background path'), 'Web path to backgrounds', 'background');
+ $this->input('sslserver', _('SSL server'), 'Server for backgrounds on SSL pages', 'background');
$this->unli();
$this->li();
- $this->input('dir', _('Background directory'), 'Directory where backgrounds are located', 'background');
+ $this->input('sslpath', _('SSL path'), 'Web path to backgrounds on SSL pages', 'background');
+ $this->unli();
+
+ $this->li();
+ $this->input('dir', _('Directory'), 'Directory where backgrounds are located', 'background');
+ $this->unli();
+
+ $this->out->elementEnd('ul');
+ $this->out->elementEnd('fieldset');
+
+ $this->out->elementStart('fieldset', array('id' =>
+ 'settings_design_attachments-paths'));
+
+ $this->out->element('legend', null, _('Attachments'));
+ $this->out->elementStart('ul', 'form_data');
+
+ $this->li();
+ $this->input('server', _('Server'), 'Server for attachments', 'attachments');
+ $this->unli();
+
+ $this->li();
+ $this->input('path', _('Path'), 'Web path to attachments', 'attachments');
+ $this->unli();
+
+ $this->li();
+ $this->input('sslserver', _('SSL server'), 'Server for attachments on SSL pages', 'attachments');
+ $this->unli();
+
+ $this->li();
+ $this->input('sslpath', _('SSL path'), 'Web path to attachments on SSL pages', 'attachments');
+ $this->unli();
+
+ $this->li();
+ $this->input('dir', _('Directory'), 'Directory where attachments are located', 'attachments');
$this->unli();
$this->out->elementEnd('ul');
@@ -320,12 +366,11 @@ class PathsAdminPanelForm extends AdminForm
$this->out->element('legend', null, _('SSL'));
$this->out->elementStart('ul', 'form_data');
$this->li();
+
$ssl = array('never' => _('Never'),
'sometimes' => _('Sometimes'),
'always' => _('Always'));
- common_debug("site ssl = " . $this->value('site', 'ssl'));
-
$this->out->dropdown('site-ssl', _('Use SSL'),
$ssl, _('When to use SSL'),
false, $this->value('ssl', 'site'));
@@ -349,7 +394,7 @@ class PathsAdminPanelForm extends AdminForm
function formActions()
{
$this->out->submit('save', _('Save'), 'submit',
- 'save', _('Save paths'));
+ 'save', _('Save paths'));
}
/**
@@ -370,5 +415,4 @@ class PathsAdminPanelForm extends AdminForm
{
$this->out->input("$section-$setting", $title, $this->value($setting, $section), $instructions);
}
-
}
diff --git a/actions/showfavorites.php b/actions/showfavorites.php
index d8042e91c..77b73711d 100644
--- a/actions/showfavorites.php
+++ b/actions/showfavorites.php
@@ -227,7 +227,7 @@ class ShowfavoritesAction extends OwnerDesignAction
function showContent()
{
- $nl = new NoticeList($this->notice, $this);
+ $nl = new FavoritesNoticeList($this->notice, $this);
$cnt = $nl->show();
if (0 == $cnt) {
@@ -244,3 +244,15 @@ class ShowfavoritesAction extends OwnerDesignAction
}
}
+class FavoritesNoticeList extends NoticeList
+{
+ function newListItem($notice)
+ {
+ return new FavoritesNoticeListItem($notice, $this->out);
+ }
+}
+
+// All handled by superclass
+class FavoritesNoticeListItem extends DoFollowListItem
+{
+}
diff --git a/actions/shownotice.php b/actions/shownotice.php
index 93d056aca..5b3ec93de 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -305,7 +305,7 @@ class ShownoticeAction extends OwnerDesignAction
}
}
-class SingleNoticeItem extends NoticeListItem
+class SingleNoticeItem extends DoFollowListItem
{
/**
* recipe function for displaying a single notice.
diff --git a/actions/showstream.php b/actions/showstream.php
index b2082eb4b..8178dafb1 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -269,7 +269,7 @@ class ProfileNoticeList extends NoticeList
}
}
-class ProfileNoticeListItem extends NoticeListItem
+class ProfileNoticeListItem extends DoFollowListItem
{
function showAuthor()
{