From 2fd322deeaf6b6b3f880fe21bf78664870d630a3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 9 Jun 2009 21:26:37 -0700 Subject: ACtually implement the upgrader, and add a confirmation box when the upgrade is complete. --- modules/gallery/controllers/upgrader.php | 21 +++++++++++++ modules/gallery/views/upgrader.html.php | 54 +++++++++++++++++++++++++++----- 2 files changed, 67 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index e8798de5..b8769b27 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -20,6 +20,27 @@ class Upgrader_Controller extends Controller { public function index() { $view = new View("upgrader.html"); + $view->available = module::available(); + $view->done = Input::instance()->get("done"); print $view; } + + public function upgrade() { + // Upgrade gallery and user first + module::install("gallery"); + module::install("user"); + + // Then upgrade the rest + foreach (module::available() as $id => $module) { + if ($id == "gallery") { + continue; + } + + if ($module->active && $module->code_version != $module->version) { + module::install($id); + } + } + + url::redirect("upgrader?done=1"); + } } diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index ecf2e265..6b9a0110 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -36,9 +36,15 @@ color: #999; font-style: italic; } + tr.current td.gallery { + color: #00d; + } tr.upgradeable td { font-weight: bold; } + tr.upgradeable td.gallery { + color: #00d; + } table { width: 600px; margin-bottom: 10px; @@ -63,28 +69,60 @@ border: 1px solid #999; background: #eee; } + div.button a { + text-decoration: none; + } div.button:hover { background: #ccc; } + div#confirmation { + position: fixed; + top: 400px; + left: 325px; + background: blue; + z-index: 1000; + margin: 10px; + text-align: center; + } + div#confirmation div { + margin: 2px; + padding: 20px; + border: 2px solid #999; + background: white; + } + .gray_on_done { + opacity: ; + }
" />
-

+ +

+
+

+

+ Gallery is up to date.", + array("url" => url::site("albums/1"))) ?> +

+
+
+ +

- + - + $module): ?> active): ?> " > -
+ name ?> @@ -100,18 +138,18 @@
-
+ -

+

-
    - +
      + active): ?>
    • name ?> -- cgit v1.2.3