Skip to content
Browse files

Make sure the album contains photos before displaying the slideshow l…

…ink.
  • Loading branch information...
1 parent 7aae256 commit 92fef908f4fc98d2b5d7f84680e8dd1ed07dd7bb @rWatcher rWatcher committed Dec 14, 2011
View
16 3.0/modules/minislideshow/helpers/minislideshow_event.php
@@ -49,13 +49,15 @@ static function pre_deactivate($data) {
static function album_menu($menu, $theme) {
// Add an option to access the slideshow from the album view.
- $menu
- ->append(Menu::factory("link")
- ->id("minislideshow")
- ->label(t("View MiniSlide Show"))
- ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id))
- ->css_class("g-dialog-link")
- ->css_id("g-mini-slideshow-link"));
+ if ($theme->item()->children_count(array(array("type", "=", "photo")))) {
+ $menu
+ ->append(Menu::factory("link")
+ ->id("minislideshow")
+ ->label(t("View MiniSlide Show"))
+ ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id))
+ ->css_class("g-dialog-link")
+ ->css_id("g-mini-slideshow-link"));
+ }
}
static function photo_menu($menu, $theme) {
View
16 3.1/modules/minislideshow/helpers/minislideshow_event.php
@@ -49,13 +49,15 @@ static function pre_deactivate($data) {
static function album_menu($menu, $theme) {
// Add an option to access the slideshow from the album view.
- $menu
- ->append(Menu::factory("link")
- ->id("minislideshow")
- ->label(t("View MiniSlide Show"))
- ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id))
- ->css_class("g-dialog-link")
- ->css_id("g-mini-slideshow-link"));
+ if ($theme->item()->children_count(array(array("type", "=", "photo")))) {
+ $menu
+ ->append(Menu::factory("link")
+ ->id("minislideshow")
+ ->label(t("View MiniSlide Show"))
+ ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id))
+ ->css_class("g-dialog-link")
+ ->css_id("g-mini-slideshow-link"));
+ }
}
static function photo_menu($menu, $theme) {

0 comments on commit 92fef90

Please sign in to comment.
Something went wrong with that request. Please try again.