From e885ca161f1cff1c8b57190915dd42146c33bf66 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 26 Dec 2009 13:21:16 -0800 Subject: Reuse $theme->item() for our descendants_count() call. --- modules/slideshow/helpers/slideshow_event.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/slideshow') diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php index 9b77dd42..39bd8fda 100644 --- a/modules/slideshow/helpers/slideshow_event.php +++ b/modules/slideshow/helpers/slideshow_event.php @@ -31,9 +31,7 @@ class slideshow_event_Core { } static function album_menu($menu, $theme) { - $descendants_count = ORM::factory("item", $theme->item()->id) - ->descendants_count(array(array("type", "=", "photo"))); - if ($descendants_count > 1) { + if ($theme->item()->descendants_count(array(array("type", "=", "photo")))) { $menu->append(Menu::factory("link") ->id("slideshow") ->label(t("View slideshow")) -- cgit v1.2.3