diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-02 15:46:05 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-02 15:46:05 -0700 |
commit | e834c4ca2434ff687461e39ee02926f449f49287 (patch) | |
tree | d718073b0f7ca7ce8f241a6feda1c9dee857e377 /modules/gallery/libraries/Menu.php | |
parent | ffb3abdcace93c8397e4660dc0e45d932903dd5a (diff) |
Have server_add turn the "Add Photo" menu option into a dropdown and
make "Add from Server" a 2nd option there.
This requires adding the Menu::remove() API function.
Diffstat (limited to 'modules/gallery/libraries/Menu.php')
-rw-r--r-- | modules/gallery/libraries/Menu.php | 13 |
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() { |