mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-19 19:09:13 -04:00
Remove Menu::compact() in favor of putting an if-then clause in
menu.html.php. This serves two purposes: 1) It's more efficient since we're doing less passes over the Menu tree 2) We're allowing themers to decide whether or not to show empty menus
This commit is contained in:
@@ -155,19 +155,6 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __construct($type) {
|
||||
parent::__construct($type);
|
||||
$this->elements = array();
|
||||
|
||||
Reference in New Issue
Block a user