summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/digibug/helpers/digibug_event.php17
-rw-r--r--modules/gallery/helpers/gallery_event.php55
-rw-r--r--themes/admin_wind/views/admin.html.php2
-rw-r--r--themes/wind/views/photo.html.php1
4 files changed, 65 insertions, 10 deletions
diff --git a/modules/digibug/helpers/digibug_event.php b/modules/digibug/helpers/digibug_event.php
index cf7cdf21..4c842615 100644
--- a/modules/digibug/helpers/digibug_event.php
+++ b/modules/digibug/helpers/digibug_event.php
@@ -26,14 +26,17 @@ class digibug_event_Core {
->url(url::site("admin/digibug")));
}
- static function photo_menu($menu, $theme) {
+ static function site_menu($menu, $theme) {
$item = $theme->item();
- $menu->append(Menu::factory("link")
- ->id("digibug")
- ->label(t("Print with Digibug"))
- ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf"))
- ->css_id("g-print-digibug-link")
- ->css_class("g-print-digibug-link ui-icon-print"));
+ if ($item->type == "photo") {
+ $menu->get("options_menu")
+ ->append(Menu::factory("link")
+ ->id("digibug")
+ ->label(t("Print with Digibug"))
+ ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf"))
+ ->css_id("g-print-digibug-link")
+ ->css_class("g-print-digibug-link ui-icon-print"));
+ }
}
static function context_menu($menu, $theme, $item) {
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 2416f2e5..9b3aa82d 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -238,6 +238,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) {
@@ -394,7 +448,6 @@ class gallery_event_Core {
->id("delete")
->label($delete_title)
->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")));
}
diff --git a/themes/admin_wind/views/admin.html.php b/themes/admin_wind/views/admin.html.php
index 2f64c847..6446deeb 100644
--- a/themes/admin_wind/views/admin.html.php
+++ b/themes/admin_wind/views/admin.html.php
@@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>
<? if ($page_title): ?>
- <?= $page_title ?>
+ Gallery Admin: <?= $page_title ?>
<? else: ?>
<?= t("Admin dashboard") ?>
<? endif ?>
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">