diff options
author | ckieffer <ckieffer@192.168.0.219> | 2010-05-14 17:14:34 -0600 |
---|---|---|
committer | ckieffer <ckieffer@192.168.0.219> | 2010-05-14 17:14:34 -0600 |
commit | d98b85f7d3142676e6b4f407a18ed81564823f88 (patch) | |
tree | 6fccf880a085368b3b20f201e261318c87d33dc5 | |
parent | dcd09c09e817e9e12223fc11ac9f830a81abea83 (diff) |
Drop context_menu for wind's photo/resize view. Move photo edit options to the site_menu.
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 54 | ||||
-rw-r--r-- | themes/wind/views/photo.html.php | 1 |
2 files changed, 54 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index c77ed9d4..d01b2956 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -227,6 +227,60 @@ class gallery_event_Core { } } } + + if ($item->is_photo() && graphics::can("rotate")) { + $options_menu + ->append( + Menu::factory("ajax_link") + ->id("rotate_ccw") + ->label(t("Rotate 90° counter clockwise")) + ->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&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&page_type=$page_type"))); + } + + if ($item->id != item::root()->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 + // already the album cover. + if (($item->type == "album" && empty($item->album_cover_item_id)) || + ($item->type == "album" && $parent->album_cover_item_id == $item->album_cover_item_id) || + $parent->album_cover_item_id == $item->id) { + $disabledState = " ui-state-disabled"; + } else { + $disabledState = " "; + } + + if ($item->parent()->id != 1) { + $options_menu + ->append( + Menu::factory("ajax_link") + ->id("make_album_cover") + ->label(t("Choose as the album cover")) + ->css_class("ui-icon-star") + ->ajax_handler("function(data) { window.location.reload() }") + ->url(url::site("quick/make_album_cover/$item->id?csrf=$csrf"))); + } + $options_menu + ->append( + Menu::factory("dialog") + ->id("delete") + ->label(t("Delete this photo")) + ->css_class("ui-icon-trash") + ->css_class("g-quick-delete") + ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))); + } + } } if (identity::active_user()->admin) { diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index e0fae3f1..07952c94 100644 --- a/themes/wind/views/photo.html.php +++ b/themes/wind/views/photo.html.php @@ -27,7 +27,6 @@ </a> <? endif ?> <?= $theme->resize_bottom($item) ?> - <?= $theme->context_menu($item, "#g-photo-id-{$item->id}") ?> </div> <div id="g-info"> |