Skip to content

Commit

Permalink
Get rid of the move dialog and move option. Instead, replace it with
Browse files Browse the repository at this point in the history
a call to Organize with the appropriate album open.  I have not yet
figured out how to get the SWF code to highlight the active image, but
that's coming.  Partial fix for #1204.
  • Loading branch information
bharat committed Aug 22, 2010
1 parent 91fab0f commit 04add75
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 159 deletions.
71 changes: 0 additions & 71 deletions modules/gallery/controllers/move.php

This file was deleted.

12 changes: 0 additions & 12 deletions modules/gallery/helpers/gallery_event.php
Expand Up @@ -447,7 +447,6 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
break;
}
$cover_title = t("Choose as the album cover");
$move_title = t("Move to another album");

$csrf = access::csrf_token();

Expand Down Expand Up @@ -478,17 +477,6 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
->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
Expand Down
50 changes: 0 additions & 50 deletions modules/gallery/views/move_browse.html.php

This file was deleted.

19 changes: 0 additions & 19 deletions modules/gallery/views/move_tree.html.php

This file was deleted.

1 change: 1 addition & 0 deletions modules/organize/controllers/organize.php
Expand Up @@ -42,6 +42,7 @@ function dialog($album_id) {
$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?") .
Expand Down
24 changes: 17 additions & 7 deletions modules/organize/helpers/organize_event.php
Expand Up @@ -32,13 +32,23 @@ static function site_menu($menu, $theme) {
}

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}")));
}
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/organize/views/organize_dialog.html.php
Expand Up @@ -94,6 +94,7 @@ function getGalleryParameters() {
sortOrder: "<?= $sort_order ?>",
sortFields: "<?= $sort_fields ?>",
albumId: "<?= $album->id ?>",
selectedId: "<?= $selected_id ?>",
restUri: "<?= $rest_uri ?>",
controllerUri: "<?= $controller_uri ?>"
};
Expand Down

0 comments on commit 04add75

Please sign in to comment.