diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-21 12:57:45 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-21 12:57:45 -0800 |
commit | d59c6ed4f149c201542c8b38f9ad9d61b4daabf4 (patch) | |
tree | ec977402f5a2a83990efb5159654d8083be22b0f /modules/gallery/views/admin_modules.html.php | |
parent | 6dd92cfa1cbdade77721f153aa1b6aab965cff82 (diff) |
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
Diffstat (limited to 'modules/gallery/views/admin_modules.html.php')
-rw-r--r-- | modules/gallery/views/admin_modules.html.php | 40 |
1 files changed, 39 insertions, 1 deletions
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 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <div class="g-block ui-helper-clearfix"> + <script type="text/javascript"> + $("#g-module-update-form").ready(function() { + $("#g-module-update-form").ajaxForm({ + dataType: "json", + success: function(data) { + if (data.reload) { + window.location.reload(); + } else { + $("body").append('<div id="g-dialog">' + data.dialog + '</div>'); + $("#g-dialog").dialog({ + bgiframe: true, + autoOpen: true, + autoResize: true, + modal: true, + resizable: false, + height: 400, + width: 500, + position: "center", + title: "Confirm Module Activation", + buttons: { + "Continue": function() { + $("form", this).submit(); + }, + Cancel: function() { + $(this).dialog("destroy").remove(); + } + } + }); + if (!data.allow_continue) { + $(".ui-dialog-buttonpane button:contains(Continue)") + .attr("disabled", "disabled") + .addClass("ui-state-disabled"); + } + } + } + }); + }); + </script> <h1> <?= t("Gallery Modules") ?> </h1> <p> <?= t("Power up your Gallery by adding more modules! Each module provides new cool features.") ?> </p> <div class="g-block-content"> - <form method="post" action="<?= url::site("admin/modules/save") ?>"> + <form id="g-module-update-form" method="post" action="<?= url::site("admin/modules/confirm") ?>"> <?= access::csrf_form_field() ?> <table> <tr> |