summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Menu.php
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-06-02 22:55:23 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-06-02 22:55:23 -0600
commit1df6db45dc569cc6f18a9d1622fce5ebe62f8d30 (patch)
treee4e8cac619bc2443c3e26d0f87a25c51f8a3b273 /modules/gallery/libraries/Menu.php
parent2bd8051c28621f6c25a3f85b73da2f94d62440f2 (diff)
parentdde5fb96ee9db5a67b286ea4ac4f35190453a6ef (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/libraries/Menu.php')
-rw-r--r--modules/gallery/libraries/Menu.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php
index d19d8b1e..83bd1616 100644
--- a/modules/gallery/libraries/Menu.php
+++ b/modules/gallery/libraries/Menu.php
@@ -171,10 +171,21 @@ class Menu_Core extends Menu_Element {
}
/**
+ * Remove an element from the menu
+ */
+ public function remove($target_id) {
+ unset($this->elements[$target_id]);
+ }
+
+ /**
* Retrieve a Menu_Element by id
*/
public function get($id) {
- return $this->elements[$id];
+ if (array_key_exists($id, $this->elements)) {
+ return $this->elements[$id];
+ }
+
+ return null;
}
public function __toString() {