The delete button now deletes the selected items

This commit is contained in:
Tim Almdal
2009-04-29 01:29:39 +00:00
parent 0d49773559
commit 89bdd6ca98
3 changed files with 24 additions and 12 deletions
+9 -4
View File
@@ -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);
}
}