diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-29 01:29:39 +0000 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-04-29 01:29:39 +0000 |
| commit | 89bdd6ca983585d5bf41968ee355927169cc9e14 (patch) | |
| tree | 187c12592aa55b90af879d5d4e4a71bba2ee7852 /modules/organize/helpers | |
| parent | 0d49773559160120768d33b574f97d9b6b993a3d (diff) | |
The delete button now deletes the selected items
Diffstat (limited to 'modules/organize/helpers')
| -rw-r--r-- | modules/organize/helpers/organize_task.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/organize/helpers/organize_task.php b/modules/organize/helpers/organize_task.php index 1344796a..e66795b8 100644 --- a/modules/organize/helpers/organize_task.php +++ b/modules/organize/helpers/organize_task.php @@ -31,7 +31,7 @@ class organize_task_Core { $target = ORM::factory("item", $context["target"]); $total = count($context["items"]); $stop = min($total - $context["position"], $context["batch"]); - $context["refresh"] = null; + $context["post_process"] = array(); for ($offset = 0; $offset < $stop; $offset++) { $current_id = $context["position"] + $offset; $id = $context["items"][$current_id]; @@ -48,9 +48,15 @@ class organize_task_Core { case "rotateCw": $item = ORM::factory("item", $id); if ($item->is_photo()) { - $context["refresh"] = self:: _do_rotation($item, $taskType == "rotateCcw" ? -90 : 90); + $context["post_process"]["reload"][] = + self:: _do_rotation($item, $taskType == "rotateCcw" ? -90 : 90); } break; + case "delete": + $item = ORM::factory("item", $id); + $item->delete(); + $context["post_process"]["remove"][] = array("id" => $id); + break; default: throw new Exception("Task '$taskType' is not implmented"); } @@ -91,8 +97,7 @@ class organize_task_Core { $margin_top = (90 - $height) / 20; return array("src" => $item->thumb_url() . "?rnd=" . rand(), - "id" => $item->id, "marginTop" => "{$margin_top}em", - "width" => $width, "height" => $height); + "id" => $item->id, "marginTop" => "{$margin_top}em", "width" => $width, "height" => $height); } }
\ No newline at end of file |
