exit(1);
}
-require_once INSTALLDIR . '/lib/accountsettingsaction.php';
-require_once INSTALLDIR . '/lib/webcolor.php';
-
/**
* Base class for setting a user or group design
*
* @link http://status.net/
*/
-class DesignSettingsAction extends AccountSettingsAction
+class DesignSettingsAction extends SettingsAction
{
-
var $submitaction = null;
/**
*
* @return string Title of the page
*/
-
function title()
{
+ // TRANS: Page title for profile design page.
return _('Profile design');
}
*
* @return instructions for use
*/
-
function getInstructions()
{
+ // TRANS: Instructions for profile design page.
return _('Customize the way your profile looks ' .
'with a background image and a colour palette of your choice.');
}
*
* @return nothing
*/
-
function showDesignForm($design)
{
$form = new DesignForm($this, $design, $this->selfUrl());
$form->show();
+
}
/**
*
* @return void
*/
-
function handlePost()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
&& empty($_POST)
&& ($_SERVER['CONTENT_LENGTH'] > 0)
) {
- $msg = _('The server was unable to handle that much POST ' .
- 'data (%s bytes) due to its current configuration.');
+ // TRANS: Form validation error in design settings form. POST should remain untranslated.
+ $msg = _m('The server was unable to handle that much POST data (%s byte) due to its current configuration.',
+ 'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
+ intval($_SERVER['CONTENT_LENGTH']));
$this->showForm(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
return;
// CSRF protection
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
+ // TRANS: Client error displayed when the session token does not match or is not given.
$this->showForm(_('There was a problem with your session token. '.
'Try again, please.'));
return;
} else if ($this->arg('defaults')) {
$this->restoreDefaults();
} else {
+ // TRANS: Unknown form validation error in design settings form.
$this->showForm(_('Unexpected form submission.'));
}
}
*
* @return void
*/
-
function showStylesheets()
{
parent::showStylesheets();
*
* @return void
*/
-
function showScripts()
{
parent::showScripts();
*
* @return nothing
*/
-
function saveBackgroundImage($design)
{
// Now that we have a Design ID we can add a file to the design.
if ($result === false) {
common_log_db_error($design, 'UPDATE', __FILE__);
- $this->showForm(_('Couldn\'t update your design.'));
+ // TRANS: Error message displayed if design settings could not be saved.
+ $this->showForm(_('Could not update your design.'));
return;
}
}
*
* @return nothing
*/
-
function restoreDefaults()
{
$design = $this->getWorkingDesign();
if ($result === false) {
common_log_db_error($design, 'DELETE', __FILE__);
- $this->showForm(_('Couldn\'t update your design.'));
+ // TRANS: Error message displayed if design settings could not be saved after clicking "Use defaults".
+ $this->showForm(_('Could not update your design.'));
return;
}
}
+ // TRANS: Success message displayed if design settings were saved after clicking "Use defaults".
$this->showForm(_('Design defaults restored.'), true);
}
-
}