summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Menu.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-17 13:34:18 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-06-17 13:34:18 -0700
commita6a9b256ae7ac686ed1f53c05275ae702fb37aad (patch)
tree1e47dbd3939c83d5e582debc9a9e4be0f2a0ecdc /modules/gallery/libraries/Menu.php
parent5b767b6443011031190ce2d7580dca2d6dc33e19 (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.php12
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();