From f1c91ab9779542f1605476bc52c57d5f14294e97 Mon Sep 17 00:00:00 2001 From: jhilden Date: Tue, 9 Jun 2009 23:54:02 -0400 Subject: fixed that you couldn't copy and paste text from the admin dashboard * made only the block headers draggable, so that the rest of the block could be normal * this should fix bug #292 --- modules/gallery/views/admin_dashboard.html.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/gallery/views/admin_dashboard.html.php b/modules/gallery/views/admin_dashboard.html.php index c266d7e1..5b8cae2e 100644 --- a/modules/gallery/views/admin_dashboard.html.php +++ b/modules/gallery/views/admin_dashboard.html.php @@ -10,23 +10,23 @@ }; $(document).ready(function(){ - $("#gAdminDashboard .gBlock *:first").addClass("gDraggable"); + $("#gAdminDashboard .gBlock .ui-widget-header").addClass("gDraggable"); $("#gAdminDashboard").sortable({ connectWith: ["#gAdminDashboardSidebar"], containment: "document", cursor: "move", - handle: $("div:first"), + handle: $(".ui-widget-header"), opacity: 0.6, placeholder: "gDropTarget", stop: update_blocks }); - $("#gAdminDashboardSidebar .gBlock *:first").addClass("gDraggable"); + $("#gAdminDashboardSidebar .gBlock .ui-widget-header").addClass("gDraggable"); $("#gAdminDashboardSidebar").sortable({ connectWith: ["#gAdminDashboard"], containment: "document", cursor: "move", - handle: $("div:first"), + handle: $(".ui-widget-header"), opacity: 0.6, placeholder: "gDropTarget", stop: update_blocks -- cgit v1.2.3 From accce788d97d19663a4c39666de03a417b5837b6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 9 Jun 2009 21:26:28 -0700 Subject: Fix a bug in set_version() where we were always forcing the value to 1. Oops! --- modules/gallery/helpers/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index 58f9b20d..dea8e22c 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -40,7 +40,7 @@ class module_Core { $module->name = $module_name; $module->active = $module_name == "gallery"; // only gallery is active by default } - $module->version = 1; + $module->version = $version; $module->save(); Kohana::log("debug", "$module_name: version is now $version"); } -- cgit v1.2.3 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 From d6b808b726a20570e294e6d3eeeb8ea384979ecf Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 9 Jun 2009 21:27:55 -0700 Subject: Add security checks --- modules/gallery/controllers/upgrader.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules') diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index b8769b27..0d5bb4f6 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -19,6 +19,11 @@ */ class Upgrader_Controller extends Controller { public function index() { + // Todo: give the admin a chance to log in here + if (!user::active()->admin) { + access::forbidden(); + } + $view = new View("upgrader.html"); $view->available = module::available(); $view->done = Input::instance()->get("done"); @@ -26,6 +31,11 @@ class Upgrader_Controller extends Controller { } public function upgrade() { + // Todo: give the admin a chance to log in here + if (!user::active()->admin) { + access::forbidden(); + } + // Upgrade gallery and user first module::install("gallery"); module::install("user"); -- cgit v1.2.3