summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-30 18:28:55 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-30 18:28:55 -0700
commit5e8e3ab6b59731733d830acadd4b218619eb3656 (patch)
treeecb46e39399330ad1e38ee8f17063f5d654a35cb /modules/gallery
parent050c5a0383b6b1729dbd828d820d5eb347d1b795 (diff)
Rejigger the way we handle "done" status in the upgrader. Now we
present the done box if you're done and let you get rid of it if you want. It's not beautiful, by any means, but it gives you an easy link back to your Gallery when you're finished. Fixes ticket #479.
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/upgrader.php11
-rw-r--r--modules/gallery/css/upgrader.css6
-rw-r--r--modules/gallery/views/upgrader.html.php1
3 files changed, 16 insertions, 2 deletions
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php
index 91952fa9..0f6cbc2c 100644
--- a/modules/gallery/controllers/upgrader.php
+++ b/modules/gallery/controllers/upgrader.php
@@ -32,11 +32,18 @@ class Upgrader_Controller extends Controller {
@unlink(TMPPATH . $upgrade_token);
}
+ $available_upgrades = 0;
+ foreach (module::available() as $module) {
+ if ($module->version && $module->version != $module->code_version) {
+ $available_upgrades++;
+ }
+ }
+
$view = new View("upgrader.html");
$view->can_upgrade = user::active()->admin || $session->get("can_upgrade");
$view->upgrade_token = $upgrade_token;
$view->available = module::available();
- $view->done = Input::instance()->get("done");
+ $view->done = ($available_upgrades == 0);
print $view;
}
@@ -67,7 +74,7 @@ class Upgrader_Controller extends Controller {
if (php_sapi_name() == "cli") {
print "Upgrade complete\n";
} else {
- url::redirect("upgrader?done=1");
+ url::redirect("upgrader");
}
}
}
diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css
index b877df49..7c377817 100644
--- a/modules/gallery/css/upgrader.css
+++ b/modules/gallery/css/upgrader.css
@@ -99,6 +99,12 @@ div#confirmation {
text-align: center;
}
+div#confirmation a.close {
+ float: right;
+ padding: 10px;
+ text-decoration: none;
+}
+
div#confirmation div {
margin: 2px;
padding: 20px;
diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php
index 90b03fce..f9e242a8 100644
--- a/modules/gallery/views/upgrader.html.php
+++ b/modules/gallery/views/upgrader.html.php
@@ -13,6 +13,7 @@
<? if ($can_upgrade): ?>
<? if ($done): ?>
<div id="confirmation">
+ <a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a>
<div>
<h1> <?= t("That's it!") ?> </h1>
<p>