summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Menu.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-18 04:34:18 +0800
committer <unostar@danalan.info>2009-06-18 16:29:43 +0800
commita179d6bdf87dc654d7afc903b48def3562a73af0 (patch)
treeec46f6839175e5df60a85b795862535ec3d416f1 /modules/gallery/libraries/Menu.php
parent9af8027cf30e346b8cf42ade14efee39a8221b0d (diff)
Correct the "inappropriate intimacy" smell that bharat's refined senses pick up
Signed-off-by: <unostar@danalan.info>
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();