From 92fef908f4fc98d2b5d7f84680e8dd1ed07dd7bb Mon Sep 17 00:00:00 2001 From: rWatcher Date: Wed, 14 Dec 2011 23:45:14 -0500 Subject: [PATCH] Make sure the album contains photos before displaying the slideshow link. --- .../helpers/minislideshow_event.php | 16 +++++++++------- .../helpers/minislideshow_event.php | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/3.0/modules/minislideshow/helpers/minislideshow_event.php b/3.0/modules/minislideshow/helpers/minislideshow_event.php index a4f76361..e91198e0 100644 --- a/3.0/modules/minislideshow/helpers/minislideshow_event.php +++ b/3.0/modules/minislideshow/helpers/minislideshow_event.php @@ -49,13 +49,15 @@ class minislideshow_event_Core { 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) { diff --git a/3.1/modules/minislideshow/helpers/minislideshow_event.php b/3.1/modules/minislideshow/helpers/minislideshow_event.php index a4f76361..e91198e0 100644 --- a/3.1/modules/minislideshow/helpers/minislideshow_event.php +++ b/3.1/modules/minislideshow/helpers/minislideshow_event.php @@ -49,13 +49,15 @@ class minislideshow_event_Core { 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) {