diff --git a/modules/gallery/controllers/move.php b/modules/gallery/controllers/move.php
deleted file mode 100644
index 7b2d6165..00000000
--- a/modules/gallery/controllers/move.php
+++ /dev/null
@@ -1,71 +0,0 @@
-source = $source;
- $view->tree = $this->_get_tree_html($source, ORM::factory("item", 1));
- print $view;
- }
-
- public function save($source_id) {
- access::verify_csrf();
- $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);
-
- json::reply(array("result" => "success", "location" => $target->url()));
- }
-
- public function show_sub_tree($source_id, $target_id) {
- $source = ORM::factory("item", $source_id);
- $target = ORM::factory("item", $target_id);
- access::required("view", $source);
- access::required("edit", $source);
- access::required("view", $target);
- // show targets even if they're not editable because they may contain children which *are*
- // editable
-
- print $this->_get_tree_html($source, $target);
- }
-
- private function _get_tree_html($source, $target) {
- $view = new View("move_tree.html");
- $view->source = $source;
- $view->parent = $target;
- $view->children = ORM::factory("item")
- ->viewable()
- ->where("type", "=", "album")
- ->where("parent_id", "=", $target->id)
- ->find_all();
- return $view;
- }
-
-}
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index e048118b..df5394c9 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -447,7 +447,6 @@ class gallery_event_Core {
break;
}
$cover_title = t("Choose as the album cover");
- $move_title = t("Move to another album");
$csrf = access::csrf_token();
@@ -478,17 +477,6 @@ class gallery_event_Core {
->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&from_id={$theme_item->id}&page_type=$page_type")));
}
- // @todo Don't move photos from the photo page; we don't yet have a good way of redirecting
- // after move
- if ($theme->page_subtype() == "album") {
- $options_menu
- ->append(Menu::factory("dialog")
- ->id("move")
- ->label($move_title)
- ->css_class("ui-icon-folder-open")
- ->url(url::site("move/browse/$item->id")));
- }
-
$parent = $item->parent();
if (access::can("edit", $parent)) {
// We can't make this item the highlight if it's an album with no album cover, or if it's
diff --git a/modules/gallery/views/move_browse.html.php b/modules/gallery/views/move_browse.html.php
deleted file mode 100644
index f77c724c..00000000
--- a/modules/gallery/views/move_browse.html.php
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
- if ($source->type == "photo"): ?>
- = t("Move this photo to a new album") ?>
- elseif ($source->type == "movie"): ?>
- = t("Move this movie to a new album") ?>
- elseif ($source->type == "album"): ?>
- = t("Move this album to a new album") ?>
- endif ?>
-
-
-
diff --git a/modules/gallery/views/move_tree.html.php b/modules/gallery/views/move_tree.html.php
deleted file mode 100644
index e629e1bb..00000000
--- a/modules/gallery/views/move_tree.html.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
-= $parent->thumb_img(array(), 25); ?>
- if (!access::can("edit", $parent) || $source->contains($parent)): ?>
- = html::clean($parent->title) ?> = t("(locked)") ?>
- else: ?>
- = html::clean($parent->title) ?>
- endif ?>
-
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php
index d2f3fbf5..2b6e4186 100644
--- a/modules/organize/controllers/organize.php
+++ b/modules/organize/controllers/organize.php
@@ -42,6 +42,7 @@ class Organize_Controller extends Controller {
$v->file_filter = addslashes($file_filter);
$v->sort_order = addslashes(json_encode($sort_order));
$v->sort_fields = addslashes(json_encode($sort_fields));
+ $v->selected_id = Input::instance()->get("selected_id", null);
$v->rest_uri = url::site("rest") . "/";
$v->controller_uri = url::site("organize") . "/";
$v->swf_uri = url::file("modules/organize/lib/Gallery3WebClient.swf?") .
diff --git a/modules/organize/helpers/organize_event.php b/modules/organize/helpers/organize_event.php
index ae05fb5d..1593d30e 100644
--- a/modules/organize/helpers/organize_event.php
+++ b/modules/organize/helpers/organize_event.php
@@ -32,13 +32,23 @@ class organize_event_Core {
}
static function context_menu($menu, $theme, $item) {
- if ($item->is_album() && access::can("edit", $item)) {
- $menu->get("options_menu")
- ->append(Menu::factory("dialog")
- ->id("organize")
- ->label(t("Organize album"))
- ->css_class("ui-icon-folder-open g-organize-link")
- ->url(url::site("organize/dialog/{$item->id}")));
+ if (access::can("edit", $item)) {
+ if ($item->is_album()) {
+ $menu->get("options_menu")
+ ->append(Menu::factory("dialog")
+ ->id("organize")
+ ->label(t("Organize album"))
+ ->css_class("ui-icon-folder-open g-organize-link")
+ ->url(url::site("organize/dialog/{$item->id}")));
+ } else {
+ $parent = $item->parent();
+ $menu->get("options_menu")
+ ->append(Menu::factory("dialog")
+ ->id("move")
+ ->label(t("Move to another album"))
+ ->css_class("ui-icon-folder-open g-organize-link")
+ ->url(url::site("organize/dialog/{$parent->id}?selected_id={$item->id}")));
+ }
}
}
diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php
index 4cc6385e..83143f97 100644
--- a/modules/organize/views/organize_dialog.html.php
+++ b/modules/organize/views/organize_dialog.html.php
@@ -94,6 +94,7 @@
sortOrder: "= $sort_order ?>",
sortFields: "= $sort_fields ?>",
albumId: "= $album->id ?>",
+ selectedId: "= $selected_id ?>",
restUri: "= $rest_uri ?>",
controllerUri: "= $controller_uri ?>"
};