From 762ca225443626b69c94f6d6c833f66de69b2ce1 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 18 May 2009 19:34:03 +0000 Subject: This takes us the next step closer to providing bulk edit. We still can't edit, but we are getting closer :-). This change sets up a framework for modules to contribute edit panels to the organize drawer. Currently implemented General (albums and photos), Sort Order (albums only) and Manage Tags --- core/helpers/core_event.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'core/helpers') diff --git a/core/helpers/core_event.php b/core/helpers/core_event.php index 4cfb7598..5f13959a 100644 --- a/core/helpers/core_event.php +++ b/core/helpers/core_event.php @@ -34,4 +34,29 @@ class core_event_Core { static function item_before_delete($item) { access::delete_item($item); } + + static function organize_form_creation($event_parms) { + if (count($event_parms->itemids) > 1) { + return ; + } + + $item = ORM::factory("item") + ->in("id", $event_parms->itemids[0]) + ->find(); + + $generalPane = new View("organize_edit_general.html"); + $generalPane->item = $item; + + $event_parms->panes[] = array("label" => $item->is_album() ? t("Edit Album") : t("Edit Photo"), + "content" => $generalPane); + + if ($item->is_album()) { + $sortPane = new View("organize_edit_sort.html"); + $sortPane->sort_by = $item->sort_column; + $sortPane->sort_order = + empty($item->sort_order) || $item->sort_order == "ASC" ? t("Ascending") : t("Descending"); + + $event_parms->panes[] = array("label" => t("Sort Order"), "content" => $sortPane); + } + } } -- cgit v1.2.3