diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-17 13:34:18 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-17 13:34:18 -0700 |
commit | a6a9b256ae7ac686ed1f53c05275ae702fb37aad (patch) | |
tree | 1e47dbd3939c83d5e582debc9a9e4be0f2a0ecdc /modules/gallery/libraries/Menu.php | |
parent | 5b767b6443011031190ce2d7580dca2d6dc33e19 (diff) |
Correct the "inappropriate intimacy" smell that bharat's refined senses pick up
Diffstat (limited to 'modules/gallery/libraries/Menu.php')
-rw-r--r-- | modules/gallery/libraries/Menu.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index 79274057..6d0881ce 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -146,6 +146,18 @@ 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(); + } + } + } + } + public function __construct($type) { parent::__construct($type); $this->elements = array(); |