summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Menu.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/libraries/Menu.php')
-rw-r--r--modules/gallery/libraries/Menu.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php
index 83bd1616..79274057 100644
--- a/modules/gallery/libraries/Menu.php
+++ b/modules/gallery/libraries/Menu.php
@@ -23,6 +23,11 @@ class Menu_Element {
public $css_id;
public $css_class;
public $id;
+ public $type;
+
+ public function __construct($type) {
+ $this->type = $type;
+ }
/**
* Set the id
@@ -125,26 +130,26 @@ class Menu_Core extends Menu_Element {
public static function factory($type) {
switch($type) {
case "link":
- return new Menu_Element_Link();
+ return new Menu_Element_Link($type);
case "dialog":
- return new Menu_Element_Dialog();
+ return new Menu_Element_Dialog($type);
case "root":
- $menu = new Menu();
- $menu->is_root = true;
- return $menu;
+ return new Menu("root");
case "submenu":
- return new Menu();
+ return new Menu("submenu");
default:
throw Exception("@todo UNKNOWN_MENU_TYPE");
}
}
- public function __construct() {
+ public function __construct($type) {
+ parent::__construct($type);
$this->elements = array();
+ $this->is_root = $type == "root";
}
/**