From 908618960b831fa153d3a2a6de8ab30fc7f4430b Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 26 May 2009 14:43:31 +0000 Subject: Since organize is now in the preview stage and will probably be rewritten by beta2, pull all of its "tenticles" back into itself and out of core or tags module. --- core/controllers/core_organize.php | 99 -------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 core/controllers/core_organize.php (limited to 'core/controllers') diff --git a/core/controllers/core_organize.php b/core/controllers/core_organize.php deleted file mode 100644 index ca73076d..00000000 --- a/core/controllers/core_organize.php +++ /dev/null @@ -1,99 +0,0 @@ -post("item"); - $item = ORM::factory("item") - ->in("id", $itemids[0]) - ->find(); - access::required("edit", $item); - - $form = core_organize::get_general_edit_form($item); - if ($form->validate()) { - $orig = clone $item; - $item->title = $form->title->value; - $item->description = $form->description->value; - $item->rename($form->dirname->value); - $item->save(); - - module::event("item_updated", $orig, $item); - - if ($item->is_album()) { - log::success("content", "Updated album", "id\">view"); - $message = t("Saved album %album_title", array("album_title" => $item->title)); - } else { - log::success("content", "Updated photo", "id\">view"); - $message = t("Saved photo %photo_title", array("photo_title" => $item->title)); - } - print json_encode(array("form" => $form->__toString(), "message" => $message)); - } else { - print json_encode(array("form" => $form->__toString())); - } - } - - public function sort() { - access::verify_csrf(); - - $itemids = Input::instance()->post("item"); - $item = ORM::factory("item") - ->in("id", $itemids[0]) - ->find(); - access::required("edit", $item); - - $form = core_organize::get_sort_edit_form($item); - if ($form->validate()) { - $orig = clone $item; - $item->sort_column = $form->column->value; - $item->sort_order = $form->direction->value; - $item->save(); - - module::event("item_updated", $orig, $item); - - log::success("content", "Updated album", "id\">view"); - $message = t("Saved album %album_title", array("album_title" => $item->title)); - print json_encode(array("form" => $form->__toString(), "message" => $message)); - } else { - print json_encode(array("form" => $form->__toString())); - } - } - - public function reset_general() { - $itemids = Input::instance()->get("item"); - $item = ORM::factory("item") - ->in("id", $itemids[0]) - ->find(); - access::required("edit", $item); - - print core_organize::get_general_edit_form($item); - } - - public function reset_sort() { - $itemids = Input::instance()->get("item"); - $item = ORM::factory("item") - ->in("id", $itemids[0]) - ->find(); - access::required("edit", $item); - - print core_organize::get_sort_edit_form($item); - } - -} -- cgit v1.2.3