diff options
author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-02-10 20:57:53 +0000 |
---|---|---|
committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-02-10 20:57:53 +0000 |
commit | 10e36fcf1b5acf07c5cc128105af03fb09aac89e (patch) | |
tree | c5e815b0a4c540d0dc7bc5f90dd1eae3df31017e /modules/organize/controllers | |
parent | 052476ef44ca801766cbd6bdbfe42d5a0a362e52 (diff) | |
parent | 8ef08d20883d9b9aa0b7560ce3bf6da8a6632149 (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/organize/controllers')
-rw-r--r-- | modules/organize/controllers/organize.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 4a4b9f13..9d9da65e 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -48,8 +48,12 @@ class Organize_Controller extends Controller { access::required("view", $target_album); access::required("add", $target_album); + $source_album = null; foreach (Input::instance()->post("source_ids") as $source_id) { $source = ORM::factory("item", $source_id); + if (empty($source_album)) { // get the source_album + $source_album = $source->parent(); + } if (!$source->contains($target_album)) { access::required("edit", $source); item::move($source, $target_album); @@ -57,8 +61,8 @@ class Organize_Controller extends Controller { } print json_encode( - array("tree" => (string)self::_expanded_tree(ORM::factory("item", 1), $target_album), - "grid" => (string)self::_get_micro_thumb_grid($target_album, 0))); + array("tree" => (string)self::_expanded_tree(ORM::factory("item", 1), $source_album), + "grid" => (string)self::_get_micro_thumb_grid($source_album, 0))); } function rearrange($target_id, $before_or_after) { @@ -69,6 +73,10 @@ class Organize_Controller extends Controller { access::required("view", $album); access::required("edit", $album); + //if (locales::is_rtl()) { // invert the position if the locale is rtl + // $before_or_after = $before_or_after == "after" ? "before" : "after"; + //} + $source_ids = Input::instance()->post("source_ids", array()); if ($album->sort_column != "weight") { |