Skip to content

Commit

Permalink
Reuse $theme->item() for our descendants_count() call.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Dec 26, 2009
1 parent 32d25da commit e885ca1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions modules/slideshow/helpers/slideshow_event.php
Expand Up @@ -31,9 +31,7 @@ static function module_change($changes) {
}

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"))
Expand Down

0 comments on commit e885ca1

Please sign in to comment.