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 /modules/organize/controllers | |
| 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 'modules/organize/controllers')
| -rw-r--r-- | modules/organize/controllers/organize.php | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index f48d1bf4..f2827d30 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -30,9 +30,8 @@ class Organize_Controller extends Controller { $v->item = $item; $v->album_tree = $this->tree($item, $root); - $v->edit_form = new View("organize_edit.html"); $v->button_pane = new View("organize_button_pane.html"); - + print $v; } @@ -43,7 +42,7 @@ class Organize_Controller extends Controller { $offset = $this->input->get("offset", 0); $thumbsize = self::$_MICRO_THUMB_SIZE + 2 * self::$_MICRO_THUMB_PADDING; $page_size = ceil($width / $thumbsize) * ceil($height / $thumbsize); - + $v = new View("organize_thumb_grid.html"); $v->children = $item->children($page_size, $offset); $v->thumbsize = self::$_MICRO_THUMB_SIZE; @@ -70,7 +69,7 @@ class Organize_Controller extends Controller { $v = new View("organize_album.html"); $v->album = $parent; $v->selected = $parent->id == $item->id; - + if ($albums->count()) { $v->album_icon = $parent->id == 1 || $v->selected ? "ui-icon-minus" : "ui-icon-plus"; } else { @@ -87,7 +86,7 @@ class Organize_Controller extends Controller { function startTask($operation, $id) { access::verify_csrf(); $items = $this->input->post("item"); - + $item = ORM::factory("item", $id); $definition = $this->_getOperationDefinition($item, $operation); @@ -174,7 +173,7 @@ class Organize_Controller extends Controller { "state" => $task->state, "done" => $task->done))); } - + function cancelTask($task_id) { access::verify_csrf(); @@ -195,7 +194,7 @@ class Organize_Controller extends Controller { $task->status = t("Rotation was cancelled prior to completion"); break; } - $task->save(); + $task->save(); } batch::stop(); @@ -207,7 +206,19 @@ class Organize_Controller extends Controller { "state" => $task->state, "done" => $task->done))); } - + + function editForm() { + $event_parms = new stdClass(); + $event_parms->panes = array(); + $event_parms->itemids = $this->input->get("item");; + + module::event("organize_form_creation", $event_parms); + + $v = new View("organize_edit.html"); + $v->panes = $event_parms->panes; + print $v->render(); + } + private function _getOperationDefinition($item, $operation) { switch ($operation) { case "move": |
