diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-05-18 19:34:03 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-05-18 19:34:03 +0000 |
commit | 762ca225443626b69c94f6d6c833f66de69b2ce1 (patch) | |
tree | f2c77401b6b6f018728fc37f0b6fdbb012d75654 /core/helpers | |
parent | ad16488643017f293dda6b226024751d15cb4426 (diff) |
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
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/core_event.php | 25 |
1 files changed, 25 insertions, 0 deletions
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); + } + } } |