From 13faf6035d726f8a77b7dcac7e8e8fa3b24bfaf2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 27 Oct 2009 14:00:32 -0700 Subject: Remove Menu::compact() in favor of putting an if-then clause in menu.html.php. This serves two purposes: 1) It's more efficient since we're doing less passes over the Menu tree 2) We're allowing themers to decide whether or not to show empty menus --- modules/gallery/libraries/Menu.php | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'modules/gallery/libraries/Menu.php') diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index 22261557..fba21e09 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -155,19 +155,6 @@ class Menu_Core extends Menu_Element { } } - public function compact() { - foreach ($this->elements as $target_id => $element) { - if ($element->type == "submenu") { - if (empty($element->elements)) { - $this->remove($target_id); - } else { - $element->compact(); - } - } - } - return $this; - } - public function __construct($type) { parent::__construct($type); $this->elements = array(); -- cgit v1.2.3