Permalink
Browse files

Add page_type to the rotate and delete context menu items so that the

quick menu knows where to send you after the action is done.
  • Loading branch information...
1 parent aacafaa commit 743fbe76965b00087d8e091f742acd61d3a740d0 @bharat bharat committed Jan 29, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 modules/gallery/helpers/gallery_event.php
@@ -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":
@@ -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
@@ -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()) {

0 comments on commit 743fbe7

Please sign in to comment.