X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fdesignsettings.php;h=eb3a5908e6ff8c05fec602461fff15553c608686;hb=1d29ba83150bdd7a23e497ca9a743ac2b6158b6f;hp=58578f18861a03d272b3eed85166839a4c43ac14;hpb=fca7ea664ba4d860dd3a3c798873b4638cd0138d;p=quix0rs-gnu-social.git diff --git a/lib/designsettings.php b/lib/designsettings.php index 58578f1886..eb3a5908e6 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -32,9 +32,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR . '/lib/accountsettingsaction.php'; -require_once INSTALLDIR . '/lib/webcolor.php'; - /** * Base class for setting a user or group design * @@ -49,9 +46,8 @@ require_once INSTALLDIR . '/lib/webcolor.php'; * @link http://status.net/ */ -class DesignSettingsAction extends AccountSettingsAction +class DesignSettingsAction extends SettingsAction { - var $submitaction = null; /** @@ -59,9 +55,9 @@ class DesignSettingsAction extends AccountSettingsAction * * @return string Title of the page */ - function title() { + // TRANS: Page title for profile design page. return _('Profile design'); } @@ -70,9 +66,9 @@ class DesignSettingsAction extends AccountSettingsAction * * @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.'); } @@ -84,11 +80,11 @@ class DesignSettingsAction extends AccountSettingsAction * * @return nothing */ - function showDesignForm($design) { $form = new DesignForm($this, $design, $this->selfUrl()); $form->show(); + } /** @@ -99,7 +95,6 @@ class DesignSettingsAction extends AccountSettingsAction * * @return void */ - function handlePost() { if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -111,8 +106,10 @@ class DesignSettingsAction extends AccountSettingsAction && 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; @@ -132,6 +129,7 @@ class DesignSettingsAction extends AccountSettingsAction } else if ($this->arg('defaults')) { $this->restoreDefaults(); } else { + // TRANS: Unknown form validation error in design settings form. $this->showForm(_('Unexpected form submission.')); } } @@ -141,7 +139,6 @@ class DesignSettingsAction extends AccountSettingsAction * * @return void */ - function showStylesheets() { parent::showStylesheets(); @@ -153,7 +150,6 @@ class DesignSettingsAction extends AccountSettingsAction * * @return void */ - function showScripts() { parent::showScripts(); @@ -171,7 +167,6 @@ class DesignSettingsAction extends AccountSettingsAction * * @return nothing */ - function saveBackgroundImage($design) { // Now that we have a Design ID we can add a file to the design. @@ -217,6 +212,7 @@ class DesignSettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($design, 'UPDATE', __FILE__); + // TRANS: Error message displayed if design settings could not be saved. $this->showForm(_('Couldn\'t update your design.')); return; } @@ -228,7 +224,6 @@ class DesignSettingsAction extends AccountSettingsAction * * @return nothing */ - function restoreDefaults() { $design = $this->getWorkingDesign(); @@ -239,12 +234,13 @@ class DesignSettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($design, 'DELETE', __FILE__); + // TRANS: Error message displayed if design settings could not be saved after clicking "Use defaults". $this->showForm(_('Couldn\'t update your design.')); return; } } + // TRANS: Success message displayed if design settings were saved after clicking "Use defaults". $this->showForm(_('Design defaults restored.'), true); } - }