diff options
Diffstat (limited to 'modules/gallery/views')
-rw-r--r-- | modules/gallery/views/admin_modules.html.php | 40 | ||||
-rw-r--r-- | modules/gallery/views/admin_modules_confirm.html.php | 22 |
2 files changed, 61 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> 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 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<div class="ui-helper-clearfix"> + <p> + <?= t("The following issue(s) have been identified:") ?> + </p> + + <div id="g-admin-modules-messages" class="g-block-content"> + <ul> + <? foreach (array("error" => "g-error", "warn" => "g-warning") as $type => $class): ?> + <? foreach ($messages[$type] as $message): ?> + <li class="<?= $class ?>" style="padding-bottom: 0"><?= $message ?></li> + <? endforeach ?> + <? endforeach ?> + </ul> + <form method="post" action="<?= url::site("admin/modules/save") ?>"> + <?= access::csrf_form_field() ?> + <? foreach ($modules as $module): ?> + <?= form::hidden($module, 1) ?> + <? endforeach ?> + </form> + </div> +</div> |