From ac67847f9d08c110f78a372c47b63312de79527b Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 20 Nov 2009 16:03:27 +0100 Subject: UI text fixes and tweaks. --- actions/siteadminpanel.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actions') diff --git a/actions/siteadminpanel.php b/actions/siteadminpanel.php index 40197d6e2..b963336e6 100644 --- a/actions/siteadminpanel.php +++ b/actions/siteadminpanel.php @@ -196,18 +196,18 @@ class SiteadminpanelAction extends AdminPanelAction if (in_array($values['site']['ssl'], array('sometimes', 'always'))) { if (empty($values['site']['sslserver'])) { - $this->clientError(_("You must set an SSL sever when enabling SSL.")); + $this->clientError(_("You must set an SSL server when enabling SSL.")); } } if (mb_strlen($values['site']['sslserver']) > 255) { - $this->clientError(_("Invalid SSL server. Max length is 255 characters.")); + $this->clientError(_("Invalid SSL server. The maximum length is 255 characters.")); } // Validate text limit if (!Validate::number($values['site']['textlimit'], array('min' => 140))) { - $this->clientError(_("Minimum text limit is 140c.")); + $this->clientError(_("Minimum text limit is 140 characters.")); } // Validate dupe limit @@ -281,7 +281,7 @@ class SiteAdminPanelForm extends AdminForm $this->unli(); $this->li(); $this->input('email', _('Email'), - _('contact email address for your site')); + _('Contact email address for your site')); $this->unli(); $this->out->elementEnd('ul'); $this->out->elementEnd('fieldset'); @@ -364,7 +364,7 @@ class SiteAdminPanelForm extends AdminForm $this->li(); $this->input('frequency', _('Frequency'), - _('Snapshots will be sent once every N Web hits'), + _('Snapshots will be sent once every N web hits'), 'snapshot'); $this->unli(); -- cgit v1.2.3-54-g00ecf From 05a0f45de569d7a779da128ca45042ebc5fc3cb7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 20 Nov 2009 14:52:29 -0800 Subject: Fix bug 1997: notice search rss utter failure Since commit c4072ef7c930b82b74f8e90f6554974b761c686c in March there's no longer an automatic run of $this->getNotices() from RssAction parent class; added to the subclass. It might make sense to put it back in the parent class, but of course only if those dupe calls can be resolved. --- actions/noticesearchrss.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actions') diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index 18f07f855..a59e7b99b 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -53,6 +53,13 @@ class NoticesearchrssAction extends Rss10Action { return true; } + + function prepare($args) + { + parent::prepare($args); + $this->notices = $this->getNotices(); + return true; + } function getNotices($limit=0) { -- cgit v1.2.3-54-g00ecf From bd063b8d5af3c0bdb07f8a47fc15ab52e215d0cf Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 21 Nov 2009 16:53:25 +0100 Subject: Capitalise "same as password above" --- actions/passwordsettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index 11d7bf785..4395f772b 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -110,7 +110,7 @@ class PasswordsettingsAction extends AccountSettingsAction $this->elementEnd('li'); $this->elementStart('li'); $this->password('confirm', _('Confirm'), - _('same as password above')); + _('Same as password above')); $this->elementEnd('li'); $this->elementEnd('ul'); -- cgit v1.2.3-54-g00ecf From d5e436003659688749b0679fc7401cee2bed7d93 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 25 Nov 2009 12:23:58 +0000 Subject: Removed unnecessary className --- actions/pathsadminpanel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/pathsadminpanel.php b/actions/pathsadminpanel.php index c4ab18c00..f1a2b1b8a 100644 --- a/actions/pathsadminpanel.php +++ b/actions/pathsadminpanel.php @@ -293,7 +293,7 @@ class PathsAdminPanelForm extends AdminForm function formActions() { - $this->out->submit('save', _('Save'), 'submit form_action-secondary', + $this->out->submit('save', _('Save'), 'submit', 'save', _('Save paths')); } -- cgit v1.2.3-54-g00ecf From 1b9e801703800a1249422069cf4ff53e8ef6435f Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 28 Nov 2009 20:52:46 +0100 Subject: Fix typo in UI string --- actions/remotesubscribe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index 74025cf80..c723d53a1 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -166,7 +166,7 @@ class RemotesubscribeAction extends Action omb_oauth_datastore()); } catch (OMB_InvalidYadisException $e) { $this->showForm(_('Not a valid profile URL (no YADIS document or ' . - 'no or invalid XRDS defined).')); + 'invalid XRDS defined).')); return; } -- cgit v1.2.3-54-g00ecf From a36612866e591ff8521ddd3e66f803e768bd6e83 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 30 Nov 2009 14:55:02 -0800 Subject: Fix bad function call --- actions/apigroupshow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index f9b960747..aae4d249c 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -96,7 +96,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction switch($this->format) { case 'xml': - $this->show_single_xml_group($this->group); + $this->showSingleXmlGroup($this->group); break; case 'json': $this->showSingleJsonGroup($this->group); -- cgit v1.2.3-54-g00ecf From e28e8cc1d7e3c6683237c86955b7c1da23c02696 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 1 Dec 2009 12:31:21 -0800 Subject: typo fix: '$this' now spelled correctly. Looks like this'll fix acceptance of 'source' param for direct messages posted to API @fixme: there's duplication of reserved sources list between at least this and apistatusesupdate module --- actions/apidirectmessagenew.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/apidirectmessagenew.php b/actions/apidirectmessagenew.php index fed6acc30..e6c39ce4a 100644 --- a/actions/apidirectmessagenew.php +++ b/actions/apidirectmessagenew.php @@ -79,7 +79,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction $this->source = $this->trimmed('source'); // Not supported by Twitter. $reserved_sources = array('web', 'omb', 'mail', 'xmpp', 'api'); - if (empty($thtis->source) || in_array($this->source, $reserved_sources)) { + if (empty($this->source) || in_array($this->source, $reserved_sources)) { $source = 'api'; } -- cgit v1.2.3-54-g00ecf From a3a2168292855ce99246b6244084be58552e8172 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 1 Dec 2009 15:44:07 -0800 Subject: Fix regression in password settings: users have been unable to change their passwords since introduction of ChangePassword event (later StartChangePassword) November 5 in commit d6ddb84132d7b9510ba82064c67f2a39822dab49 Logic was inversed; new password was only being saved if a plugin claimed the event; so when no auth plugin was present to take it, passwords never got saved. --- actions/passwordsettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index 4395f772b..3bb8e3bb9 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -170,7 +170,7 @@ class PasswordsettingsAction extends AccountSettingsAction } $success = false; - if(! Event::handle('StartChangePassword', array($user, $oldpassword, $newpassword))){ + if(Event::handle('StartChangePassword', array($user, $oldpassword, $newpassword))){ //no handler changed the password, so change the password internally $original = clone($user); -- cgit v1.2.3-54-g00ecf From 4f359d2a8baa89f3ced8b9d7ac2c9dd1b4cfb73b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 2 Dec 2009 16:44:23 -0800 Subject: Delete design when user chooses to restore default design, instead of saving a design with site defaults. --- actions/groupdesignsettings.php | 13 ++++---- actions/userdesignsettings.php | 14 ++++----- lib/api.php | 3 +- lib/designsettings.php | 66 +++++------------------------------------ 4 files changed, 23 insertions(+), 73 deletions(-) (limited to 'actions') diff --git a/actions/groupdesignsettings.php b/actions/groupdesignsettings.php index b87b7d156..1c998efe1 100644 --- a/actions/groupdesignsettings.php +++ b/actions/groupdesignsettings.php @@ -173,17 +173,12 @@ class GroupDesignSettingsAction extends DesignSettingsAction function getWorkingDesign() { - $design = null; if (isset($this->group)) { $design = $this->group->getDesign(); } - if (empty($design)) { - $design = $this->defaultDesign(); - } - return $design; } @@ -197,7 +192,13 @@ class GroupDesignSettingsAction extends DesignSettingsAction function showContent() { - $this->showDesignForm($this->getWorkingDesign()); + $design = $this->getWorkingDesign(); + + if (empty($design)) { + $design = Design::siteDesign(); + } + + $this->showDesignForm($design); } /** diff --git a/actions/userdesignsettings.php b/actions/userdesignsettings.php index 568c1d624..31a097970 100644 --- a/actions/userdesignsettings.php +++ b/actions/userdesignsettings.php @@ -96,14 +96,8 @@ class UserDesignSettingsAction extends DesignSettingsAction function getWorkingDesign() { - $user = common_current_user(); $design = $user->getDesign(); - - if (empty($design)) { - $design = $this->defaultDesign(); - } - return $design; } @@ -117,7 +111,13 @@ class UserDesignSettingsAction extends DesignSettingsAction function showContent() { - $this->showDesignForm($this->getWorkingDesign()); + $design = $this->getWorkingDesign(); + + if (empty($design)) { + $design = Design::siteDesign(); + } + + $this->showDesignForm($design); } /** diff --git a/lib/api.php b/lib/api.php index e2ea87b43..5a3bb5ee4 100644 --- a/lib/api.php +++ b/lib/api.php @@ -134,7 +134,6 @@ class ApiAction extends Action $twitter_user['protected'] = false; # not supported by StatusNet yet $twitter_user['followers_count'] = $profile->subscriberCount(); - $defaultDesign = Design::siteDesign(); $design = null; $user = $profile->getUser(); @@ -145,7 +144,7 @@ class ApiAction extends Action } if (empty($design)) { - $design = $defaultDesign; + $design = Design::siteDesign(); } $color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor); diff --git a/lib/designsettings.php b/lib/designsettings.php index 99f44b5b7..b70ba0dfc 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -333,49 +333,6 @@ class DesignSettingsAction extends AccountSettingsAction $this->autofocus('design_background-image_file'); } - /** - * Get a default design - * - * @return Design design - */ - - function defaultDesign() - { - $defaults = common_config('site', 'design'); - - $design = new Design(); - - try { - - $color = new WebColor(); - - $color->parseColor($defaults['backgroundcolor']); - $design->backgroundcolor = $color->intValue(); - - $color->parseColor($defaults['contentcolor']); - $design->contentcolor = $color->intValue(); - - $color->parseColor($defaults['sidebarcolor']); - $design->sidebarcolor = $color->intValue(); - - $color->parseColor($defaults['textcolor']); - $design->textcolor = $color->intValue(); - - $color->parseColor($defaults['linkcolor']); - $design->linkcolor = $color->intValue(); - - $design->backgroundimage = $defaults['backgroundimage']; - - $design->disposition = $defaults['disposition']; - - } catch (WebColorException $e) { - common_log(LOG_ERR, _('Bad default color settings: ' . - $e->getMessage())); - } - - return $design; - } - /** * Save the background image, if any, and set its disposition * @@ -445,24 +402,17 @@ class DesignSettingsAction extends AccountSettingsAction function restoreDefaults() { - $design = $this->getWorkingDesign(); - $default = $this->defaultDesign(); - $original = clone($design); - - $design->backgroundcolor = $default->backgroundcolor; - $design->contentcolor = $default->contentcolor; - $design->sidebarcolor = $default->sidebarcolor; - $design->textcolor = $default->textcolor; - $design->linkcolor = $default->linkcolor; + $design = $this->getWorkingDesign(); - $design->setDisposition(false, true, false); + if (!empty($design)) { - $result = $design->update($original); + $result = $design->delete(); - if ($result === false) { - common_log_db_error($design, 'UPDATE', __FILE__); - $this->showForm(_('Couldn\'t update your design.')); - return; + if ($result === false) { + common_log_db_error($design, 'DELETE', __FILE__); + $this->showForm(_('Couldn\'t update your design.')); + return; + } } $this->showForm(_('Design defaults restored.'), true); -- cgit v1.2.3-54-g00ecf From bb2311ea18dd4519db6db5428bf3acb239e809ad Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 2 Dec 2009 17:50:51 -0800 Subject: Only pick up new default site colors if the theme has NOT changed. --- actions/designadminpanel.php | 49 ++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'actions') diff --git a/actions/designadminpanel.php b/actions/designadminpanel.php index 8bc8c4450..a64a900b8 100644 --- a/actions/designadminpanel.php +++ b/actions/designadminpanel.php @@ -129,8 +129,6 @@ class DesignadminpanelAction extends AdminPanelAction $bgimage = $this->saveBackgroundImage(); - common_debug("background image: $bgimage"); - static $settings = array('theme', 'logo'); $values = array(); @@ -141,13 +139,28 @@ class DesignadminpanelAction extends AdminPanelAction $this->validate($values); - // assert(all values are valid); + $oldtheme = common_config('site', 'theme'); + + $config = new Config(); + + $config->query('BEGIN'); + + // Only update colors if the theme has not changed. - $bgcolor = new WebColor($this->trimmed('design_background')); - $ccolor = new WebColor($this->trimmed('design_content')); - $sbcolor = new WebColor($this->trimmed('design_sidebar')); - $tcolor = new WebColor($this->trimmed('design_text')); - $lcolor = new WebColor($this->trimmed('design_links')); + if ($oldtheme == $values['theme']) { + + $bgcolor = new WebColor($this->trimmed('design_background')); + $ccolor = new WebColor($this->trimmed('design_content')); + $sbcolor = new WebColor($this->trimmed('design_sidebar')); + $tcolor = new WebColor($this->trimmed('design_text')); + $lcolor = new WebColor($this->trimmed('design_links')); + + Config::save('design', 'backgroundcolor', $bgcolor->intValue()); + Config::save('design', 'contentcolor', $ccolor->intValue()); + Config::save('design', 'sidebarcolor', $sbcolor->intValue()); + Config::save('design', 'textcolor', $tcolor->intValue()); + Config::save('design', 'linkcolor', $lcolor->intValue()); + } $onoff = $this->arg('design_background-image_onoff'); @@ -162,9 +175,11 @@ class DesignadminpanelAction extends AdminPanelAction $tile = $this->boolean('design_background-image_repeat'); - $config = new Config(); + // Hack to use Design's bit setter + $scratch = new Design(); + $scratch->setDisposition($on, $off, $tile); - $config->query('BEGIN'); + Config::save('design', 'disposition', $scratch->disposition); foreach ($settings as $setting) { Config::save('site', $setting, $values[$setting]); @@ -174,21 +189,7 @@ class DesignadminpanelAction extends AdminPanelAction Config::save('design', 'backgroundimage', $bgimage); } - Config::save('design', 'backgroundcolor', $bgcolor->intValue()); - Config::save('design', 'contentcolor', $ccolor->intValue()); - Config::save('design', 'sidebarcolor', $sbcolor->intValue()); - Config::save('design', 'textcolor', $tcolor->intValue()); - Config::save('design', 'linkcolor', $lcolor->intValue()); - - // Hack to use Design's bit setter - $scratch = new Design(); - $scratch->setDisposition($on, $off, $tile); - - Config::save('design', 'disposition', $scratch->disposition); - $config->query('COMMIT'); - - return; } /** -- cgit v1.2.3-54-g00ecf From 56b3e13d4aec5649b5858597729a1af5e5407c9c Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 2 Dec 2009 18:05:19 -0800 Subject: Reload the admin design panel page to show the new CSS when the design gets reset. --- actions/designadminpanel.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actions') diff --git a/actions/designadminpanel.php b/actions/designadminpanel.php index a64a900b8..f862aff0e 100644 --- a/actions/designadminpanel.php +++ b/actions/designadminpanel.php @@ -213,6 +213,10 @@ class DesignadminpanelAction extends AdminPanelAction } // XXX: Should we restore the default dir settings, etc.? --Z + + // XXX: I can't get it to show the new settings without forcing + // this terrible reload -- FIX ME! + common_redirect(common_local_url('designadminpanel'), 303); } /** -- cgit v1.2.3-54-g00ecf