diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-01-30 21:18:26 -0500 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-01-30 21:18:26 -0500 |
commit | 075b95f0ed6f843c64756c772011a1ecb406168f (patch) | |
tree | d7c31d4024ade3169d7de00b8567d117b423c5c3 /modules/gallery | |
parent | cff1e76e8da2055f9faf7449222b43a686014b1c (diff) |
Actually disable the "make album cover" option when the item is already the album cover. Fixes #1979.
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index ee3c51cc..4bbeccc2 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -346,9 +346,9 @@ class gallery_event_Core { 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"; + $disabledState = "ui-state-disabled"; } else { - $disabledState = " "; + $disabledState = ""; } if ($item->parent()->id != 1) { @@ -357,7 +357,7 @@ class gallery_event_Core { Menu::factory("ajax_link") ->id("make_album_cover") ->label(t("Choose as the album cover")) - ->css_class("ui-icon-star") + ->css_class("ui-icon-star $disabledState") ->ajax_handler("function(data) { window.location.reload() }") ->url(url::site("quick/make_album_cover/$item->id?csrf=$csrf"))); } @@ -500,16 +500,16 @@ class gallery_event_Core { 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"; + $disabledState = "ui-state-disabled"; } else { - $disabledState = " "; + $disabledState = ""; } if ($item->parent()->id != 1) { $options_menu ->append(Menu::factory("ajax_link") ->id("make_album_cover") ->label($cover_title) - ->css_class("ui-icon-star") + ->css_class("ui-icon-star $disabledState") ->ajax_handler("function(data) { window.location.reload() }") ->url(url::site("quick/make_album_cover/$item->id?csrf=$csrf"))); } @@ -518,7 +518,8 @@ class gallery_event_Core { ->id("delete") ->label($delete_title) ->css_class("ui-icon-trash") - ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&from_id={$theme_item->id}&page_type=$page_type"))); + ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&" . + "from_id={$theme_item->id}&page_type=$page_type"))); } if ($item->is_album()) { |