From 2492280cc0ec9eb64a8daeccc7b5698ece7fea66 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 15 Jun 2010 12:52:28 -0700 Subject: Change the item rest update processing to call the item::move(source, target) helper when the parent member has changed. Using the move method insures that names and slugs that could conflict in the target album are resolved properly. Changed the item::move method so it returns a message to be displayed if the caller chooses. And changed the move controller to display the message returned by the move if the item name was renamed as part of the move. --- modules/gallery/controllers/move.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/move.php b/modules/gallery/controllers/move.php index f8b85b6f..3ce44546 100644 --- a/modules/gallery/controllers/move.php +++ b/modules/gallery/controllers/move.php @@ -34,12 +34,10 @@ class Move_Controller extends Controller { $source = ORM::factory("item", $source_id); $target = ORM::factory("item", Input::instance()->post("target_id")); - access::required("view", $source); - access::required("edit", $source); - access::required("view", $target); - access::required("edit", $target); - - item::move($source, $target); + $message = item::move($source, $target); + if (!empty($message)) { + message.info($message); + } print json_encode( array("result" => "success", -- cgit v1.2.3