Skip to content

Commit

Permalink
Add page_type to the rotate and delete context menu items so that the
Browse files Browse the repository at this point in the history
quick menu knows where to send you after the action is done.
  • Loading branch information
bharat committed Jan 29, 2010
1 parent aacafaa commit 743fbe7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/gallery/helpers/gallery_event.php
Expand Up @@ -286,6 +286,7 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
->label(t("Options"))
->css_class("ui-icon-carat-1-n"));

$page_type = $theme->page_type();
if (access::can("edit", $item)) {
switch ($item->type) {
case "movie":
Expand Down Expand Up @@ -324,15 +325,15 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
->css_class("ui-icon-rotate-ccw")
->ajax_handler("function(data) { " .
"\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&from_id=$theme_item->id")))
->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type")))
->append(
Menu::factory("ajax_link")
->id("rotate_cw")
->label(t("Rotate 90° clockwise"))
->css_class("ui-icon-rotate-cw")
->ajax_handler("function(data) { " .
"\$.gallery_replace_image(data, \$('$thumb_css_selector')) }")
->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&from_id=$theme_item->id")));
->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
Expand Down Expand Up @@ -372,7 +373,7 @@ static function context_menu($menu, $theme, $item, $thumb_css_selector) {
->label($delete_title)
->css_class("ui-icon-trash")
->css_id("g-quick-delete")
->url(url::site("quick/form_delete/$item->id?csrf=$csrf&from_id=$theme_item->id")));
->url(url::site("quick/form_delete/$item->id?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type")));
}

if ($item->is_album()) {
Expand Down

0 comments on commit 743fbe7

Please sign in to comment.