diff options
| author | Chad Kieffer <ckieffer@gmail.com> | 2009-07-25 09:25:31 -0600 |
|---|---|---|
| committer | Chad Kieffer <ckieffer@gmail.com> | 2009-07-25 09:25:31 -0600 |
| commit | eca46d76a7832f771d377edb3939ea1aded2fac9 (patch) | |
| tree | d4f0323202c7eb6eab60ff6e14f9905b625e349b /modules/gallery/helpers/gallery_quick.php | |
| parent | 63511316be51f193d37c4f3b9dd3455a9ab60de8 (diff) | |
| parent | 50d6cc0150b930d79d3e8b90956ffa9655fcc9c5 (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/gallery_quick.php')
| -rw-r--r-- | modules/gallery/helpers/gallery_quick.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/gallery/helpers/gallery_quick.php b/modules/gallery/helpers/gallery_quick.php index d0ffc584..8a92890b 100644 --- a/modules/gallery/helpers/gallery_quick.php +++ b/modules/gallery/helpers/gallery_quick.php @@ -108,12 +108,20 @@ class gallery_quick_Core { "href" => url::site("move/browse/$item->id")); } - if (access::can("edit", $item->parent())) { - $disabledState = - $item->type == "album" && empty($item->album_cover_item_id) ? " ui-state-disabled" : ""; + $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 = " "; + } $elements["right"][] = (object)array( "title" => $cover_title, - "class" => "gButtonLink{$disabledState}", + "class" => "gButtonLink$disabledState", "icon" => "ui-icon-star", "href" => url::site("quick/make_album_cover/$item->id?csrf=$csrf&page_type=$page_type")); |
