diff options
Diffstat (limited to 'modules/organize')
-rw-r--r-- | modules/organize/controllers/organize.php | 8 | ||||
-rw-r--r-- | modules/organize/views/organize_tree.html.php | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 0611c334..4639777c 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -41,14 +41,14 @@ class Organize_Controller extends Controller { "sort_order" => $album->sort_order)); } - function move_to($album_id) { + function move_to($target_album_id) { access::verify_csrf(); - $album = ORM::factory("item", $album_id); + $target_album = ORM::factory("item", $target_album_id); foreach ($this->input->post("source_ids") as $source_id) { $source = ORM::factory("item", $source_id); - if ($album->id != $source->parent_id && $album->id != $source->id) { - item::move($source, $album); + if (!$source->contains($target_album)) { + item::move($source, $target_album); } } diff --git a/modules/organize/views/organize_tree.html.php b/modules/organize/views/organize_tree.html.php index c0c23f94..e5d91c04 100644 --- a/modules/organize/views/organize_tree.html.php +++ b/modules/organize/views/organize_tree.html.php @@ -9,7 +9,7 @@ </span> <ul> <? foreach ($album->children(null, 0, array("type" => "album")) as $child): ?> - <? if ($selected && $child->is_descendant($selected)): ?> + <? if ($selected && $child->contains($selected)): ?> <?= View::factory("organize_tree.html", array("selected" => $selected, "album" => $child)); ?> <? else: ?> <li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $child) ? "" : "gViewOnly" ?>" |