function __construct() { //-----vytvorenie objektu menu $menu = new MenuItem(); $menu->menuAction(); //-----vytvorenie objektu node $node = new node(); $node->nodeAction(); MT::addContent($menu->render(), 'leftHolder'); try { if (isset($_GET['id_menu_item']) or isset($_GET['addMenuItem']) or isset($_GET['changeMenuItem'])) { MT::addTemplate(APP_DIR . '/templates/admin/modulHolder.phtml', 'modulHolder'); MT::addVar('modulHolder', 'type_modul', dibi::fetchAll("SELECT * FROM [type_modul] WHERE visible_for_user='******'")); } //zobrazenie zmeny polozky pre menu if (isset($_GET['changeMenuItem'])) { $menu->showChangeMenuItem($_GET['id_menu_item']); } if (isset($_GET['id_menu_item']) and !isset($_GET['changeMenuItem'])) { $node->showModul(); } //pridanie polozky do menu if (isset($_GET['addMenuItem'])) { $menu->showAddMenuItem(); } //zachytenie vynimie } catch (NodeException $e) { echo '<div style="border: 2px solid red; padding: 5px;">' . $e->getMessage() . '</div>'; exit; } }
function write_child() { $all_childs = $this->data["childs"]; $child = new MenuItem($this->menu_layout_dir, $all_childs[$this->current_index], $this->level + 1); $this->current_index += 1; $child->render(); }
static function build($menu_name, $content_dir_name) { $final_root = self::get_menu_entries($content_dir_name); $final_root["key"] = $menu_name; $menu_layout_dir = new Dir(self::MENU_LAYOUT_FOLDER . $menu_name . "/"); $root_item = new MenuItem($menu_layout_dir, $final_root, 0); $root_item->render(); }