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 +++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'modules/gallery/views/admin_modules.html.php') 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 @@
+

-
"> + "> -- 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/admin_modules.html.php') 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/admin_modules.html.php') 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