diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-02-12 20:59:26 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-14 07:15:57 -0800 |
commit | 2dad1d7cd15bed3c89de11cadf4b3b5c43134f69 (patch) | |
tree | 6eb61a76f80a88cdb8f245c7296e2db7d0d4a245 /modules/gallery/libraries/Menu.php | |
parent | 8412aeb1337c4060a77af7c94441ca8cbc6bb4ad (diff) |
Some HTML validation fixes (don't render empty <ul> lists, empty id attributes, use & not &)
Diffstat (limited to 'modules/gallery/libraries/Menu.php')
-rw-r--r-- | modules/gallery/libraries/Menu.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index e2b68d1a..7c76ab04 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -216,6 +216,19 @@ class Menu_Core extends Menu_Element { return null; } + public function is_empty() { + foreach ($this->elements as $element) { + if ($element instanceof Menu) { + if (!$element->is_empty()) { + return false; + } + } else { + return false; + } + } + return true; + } + public function render() { $view = new View(isset($this->view) ? $this->view : "menu.html"); $view->menu = $this; |