Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue an information message if the user clicks "Save Settings" indic…

…ating that the key was not changed as it as identical. This addresses the obscure issue raised in ticket #756
  • Loading branch information...
commit f1366d275e007141a28a933a6221c6337d7aa1d7 1 parent b310fab
@talmdal talmdal authored
Showing with 17 additions and 15 deletions.
  1. +17 −15 modules/gallery/controllers/admin_languages.php
View
32 modules/gallery/controllers/admin_languages.php
@@ -24,7 +24,7 @@ public function index($share_translations_form=null) {
$v->content->available_locales = locales::available();
$v->content->installed_locales = locales::installed();
$v->content->default_locale = module::get_var("gallery", "default_locale");
-
+
if (empty($share_translations_form)) {
$share_translations_form = $this->_share_translations_form();
}
@@ -35,21 +35,21 @@ public function index($share_translations_form=null) {
public function save() {
access::verify_csrf();
-
- locales::update_installed($this->input->post("installed_locales"));
-
- $installed_locales = array_keys(locales::installed());
+
+ locales::update_installed($this->input->post("installed_locales"));
+
+ $installed_locales = array_keys(locales::installed());
$new_default_locale = $this->input->post("default_locale");
- if (!in_array($new_default_locale, $installed_locales)) {
- if (!empty($installed_locales)) {
- $new_default_locale = $installed_locales[0];
- } else {
- $new_default_locale = "en_US";
- }
- }
- module::set_var("gallery", "default_locale", $new_default_locale);
-
- print json_encode(array("result" => "success"));
+ if (!in_array($new_default_locale, $installed_locales)) {
+ if (!empty($installed_locales)) {
+ $new_default_locale = $installed_locales[0];
+ } else {
+ $new_default_locale = "en_US";
+ }
+ }
+ module::set_var("gallery", "default_locale", $new_default_locale);
+
+ print json_encode(array("result" => "success"));
}
public function share() {
@@ -88,6 +88,8 @@ private function _save_api_key($form) {
message::success(t("Your API key has been changed."));
} else if (!$old_key && $new_key) {
message::success(t("Your API key has been saved."));
+ } else if ($old_key && $new_key && $old_key == $new_key) {
+ message::info(t("Your API key was not changed as it was identical to the current key."));
}
log::success(t("gallery"), t("l10n_client API key changed."));
Please sign in to comment.
Something went wrong with that request. Please try again.