diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-06-15 12:52:28 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-06-15 12:52:28 -0700 |
commit | 2492280cc0ec9eb64a8daeccc7b5698ece7fea66 (patch) | |
tree | 6fda9fdda1aec43dd8882b755d6d49a39790ea63 /modules/gallery/controllers | |
parent | 207f6beb61cf2969d07bbc6f959bba967f54b271 (diff) |
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.
Diffstat (limited to 'modules/gallery/controllers')
-rw-r--r-- | modules/gallery/controllers/move.php | 10 |
1 files changed, 4 insertions, 6 deletions
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", |