diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-05-14 16:55:15 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-05-14 16:55:15 -0700 |
commit | 1240878df0f4a2b0ad0cdb32814717038ff2773f (patch) | |
tree | 7cf95c440d91c2a6db28b2221ad0b063599dc8c4 /modules/gallery/helpers | |
parent | dc4fdca2ab1160e6fea1d51694a7b66ae18ef5e9 (diff) |
Fix-ups for d98b85f7d3142676e6b4f407a18ed81564823f88
- Pass the CSS selector of the active image in as an arg to site_menu
so that quick operations know what they're operating on.
- Change the ids from g-{photo,movie}-id to the generic g-item-id
- Initialize ajax handlers for site menu on the photo and movie page
- Drop the movie context menu, it's now in the site menu
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 9b3aa82d..89ad6a4c 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -167,7 +167,7 @@ class gallery_event_Core { } } - static function site_menu($menu, $theme) { + static function site_menu($menu, $theme, $item_css_selector) { if ($theme->page_subtype != "login") { $menu->append(Menu::factory("link") ->id("home") @@ -239,6 +239,9 @@ class gallery_event_Core { } } + $csrf = access::csrf_token(); + $theme_item = $theme->item(); + $page_type = $theme->page_type(); if ($item->is_photo() && graphics::can("rotate")) { $options_menu ->append( @@ -247,7 +250,7 @@ class gallery_event_Core { ->label(t("Rotate 90° counter clockwise")) ->css_class("ui-icon-rotate-ccw") ->ajax_handler("function(data) { " . - "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }") + "\$.gallery_replace_image(data, \$('$item_css_selector')) }") ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))) ->append( Menu::factory("ajax_link") @@ -255,7 +258,7 @@ class gallery_event_Core { ->label(t("Rotate 90° clockwise")) ->css_class("ui-icon-rotate-cw") ->ajax_handler("function(data) { " . - "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }") + "\$.gallery_replace_image(data, \$('$item_css_selector')) }") ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))); } |