From d59c6ed4f149c201542c8b38f9ad9d61b4daabf4 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 21 Jan 2010 12:57:45 -0800 Subject: The admin module controller allows modules to provide a check_environment method which is called prior to installation. The method allows the module to provide an error message or warnings if the module can not be installed or activated without issues. The admin module controller also will fire a pre_deactivate event, which allows modules to indicate issues that may arise be deactivating the specified module. These messages are displayed in a dialog box prior to installation in order to allow the gallery administrator to determine the appropriate action before proceeding. Lays the foundation for implementing a fix for ticket #937 --- modules/gallery/views/admin_modules.html.php | 40 +++++++++++++++++++++- .../gallery/views/admin_modules_confirm.html.php | 22 ++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 modules/gallery/views/admin_modules_confirm.html.php (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index aebedf09..7f572411 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -1,12 +1,50 @@
+

-
"> + "> diff --git a/modules/gallery/views/admin_modules_confirm.html.php b/modules/gallery/views/admin_modules_confirm.html.php new file mode 100644 index 00000000..59592505 --- /dev/null +++ b/modules/gallery/views/admin_modules_confirm.html.php @@ -0,0 +1,22 @@ + +
+

+ +

+ +
+
    + "g-error", "warn" => "g-warning") as $type => $class): ?> + +
  • + + +
+ "> + + + + + +
+
-- cgit v1.2.3 From 0da5d9e606fba5b6dc6137812df32cd1d0f5750f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 21 Jan 2010 20:33:26 -0800 Subject: Internationalize all strings in admin_modules.hmtl and corrected comments. --- modules/gallery/helpers/module.php | 6 ++++-- modules/gallery/views/admin_modules.html.php | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index 2ae83f0d..595f600b 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -122,6 +122,7 @@ class module_Core { /** * Check that the module can be installed. (i.e. all the prerequistes exist) * @param string $module_name + * @return array an array of warning or error messages to be displayed */ static function check_environment($module_name) { module::_add_to_path($module_name); @@ -132,14 +133,15 @@ class module_Core { $messages = call_user_func(array($installer_class, "check_environment")); } - // Now the module is installed but inactive, so don't leave it in the active path + // Remove it from the active path module::_remove_from_path($module_name); return $messages; } /** - * Check that the module can be installed. (i.e. all the prerequistes exist) + * Allow modules to indicate the impact of deactivating the specifeid module * @param string $module_name + * @return array an array of warning or error messages to be displayed */ static function can_deactivate($module_name) { $data = (object)array("module" => $module_name, "messages" => array()); diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 7f572411..704e7beb 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -18,12 +18,12 @@ height: 400, width: 500, position: "center", - title: "Confirm Module Activation", + title: for_js() ?>, buttons: { - "Continue": function() { + for_js() ?>: function() { $("form", this).submit(); }, - Cancel: function() { + for_js() ?>: function() { $(this).dialog("destroy").remove(); } } -- cgit v1.2.3 From 11757831233da528662864e23d89f39bfb908801 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 12:16:36 -0800 Subject: Disable the continue button after clicking so it can only clicked once. --- modules/gallery/views/admin_modules.html.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 704e7beb..a021d969 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -22,6 +22,9 @@ buttons: { for_js() ?>: function() { $("form", this).submit(); + $(".ui-dialog-buttonpane button:contains(Continue)") + .attr("disabled", "disabled") + .addClass("ui-state-disabled"); }, for_js() ?>: function() { $(this).dialog("destroy").remove(); -- cgit v1.2.3 From dabd5b84b21c711592a1f3bcd2ca298dd6d7fde2 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 12:22:31 -0800 Subject: Remove the identity manager screens and controller as alterntive identity providers are installed in the admin module screen. --- modules/gallery/controllers/admin_identity.php | 76 ---------------------- modules/gallery/helpers/gallery_event.php | 6 +- modules/gallery/views/admin_identity.html.php | 59 ----------------- .../gallery/views/admin_identity_confirm.html.php | 10 --- 4 files changed, 1 insertion(+), 150 deletions(-) delete mode 100644 modules/gallery/controllers/admin_identity.php delete mode 100644 modules/gallery/views/admin_identity.html.php delete mode 100644 modules/gallery/views/admin_identity_confirm.html.php (limited to 'modules/gallery/views') diff --git a/modules/gallery/controllers/admin_identity.php b/modules/gallery/controllers/admin_identity.php deleted file mode 100644 index 354e6c0c..00000000 --- a/modules/gallery/controllers/admin_identity.php +++ /dev/null @@ -1,76 +0,0 @@ -content = new View("admin_identity.html"); - $view->content->available = identity::providers(); - $view->content->active = module::get_var("gallery", "identity_provider", "user"); - print $view; - } - - public function confirm() { - access::verify_csrf(); - - $v = new View("admin_identity_confirm.html"); - $v->new_provider = Input::instance()->post("provider"); - - print $v; - } - - public function change() { - access::verify_csrf(); - - $active_provider = module::get_var("gallery", "identity_provider", "user"); - $providers = identity::providers(); - $new_provider = Input::instance()->post("provider"); - - if ($new_provider != $active_provider) { - - module::deactivate($active_provider); - - // Switch authentication - identity::reset(); - module::set_var("gallery", "identity_provider", $new_provider); - - module::install($new_provider); - module::activate($new_provider); - - module::event("identity_provider_changed", $active_provider, $new_provider); - - module::uninstall($active_provider); - - message::success(t("Changed to %description", - array("description" => $providers->$new_provider))); - - try { - Session::instance()->destroy(); - } catch (Exception $e) { - // We don't care if there was a problem destroying the session. - } - url::redirect(item::root()->abs_url()); - } - - message::info(t("The selected provider \"%description\" is already active.", - array("description" => $providers->$new_provider))); - url::redirect("admin/identity"); - } -} - diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 1d8e3581..6c7c2ea4 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -230,11 +230,7 @@ class gallery_event_Core { ->append(Menu::factory("link") ->id("advanced") ->label(t("Advanced")) - ->url(url::site("admin/advanced_settings"))) - ->append(Menu::factory("link") - ->id("authentication") - ->label(t("Authentication")) - ->url(url::site("admin/identity")))) + ->url(url::site("admin/advanced_settings")))) ->append(Menu::factory("link") ->id("modules") ->label(t("Modules")) diff --git a/modules/gallery/views/admin_identity.html.php b/modules/gallery/views/admin_identity.html.php deleted file mode 100644 index 51eaa58a..00000000 --- a/modules/gallery/views/admin_identity.html.php +++ /dev/null @@ -1,59 +0,0 @@ - - -
-

-

- -

- -
"> - -
- - - - - $description): ?> - "> - "provider"); ?> - - - - -
- for_html_attr() ?>" /> - -
diff --git a/modules/gallery/views/admin_identity_confirm.html.php b/modules/gallery/views/admin_identity_confirm.html.php deleted file mode 100644 index 54aae9c8..00000000 --- a/modules/gallery/views/admin_identity_confirm.html.php +++ /dev/null @@ -1,10 +0,0 @@ - -
"> - - - -

- -

-
- -- cgit v1.2.3 From 06ef3885b30be843a7c86a93f5642680ab881b1c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 23 Jan 2010 09:23:08 -0800 Subject: Increase the size of the 'select photos' button so that it doesn't wrap and set the size of the underlying flash object. --- modules/gallery/views/form_uploadify.html.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index f3b9c883..b3b81ecb 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -2,17 +2,21 @@ @@ -21,6 +25,8 @@