mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-11 01:33:51 -04:00
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.
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user