File: /pages/tutorials/menu/menu-03.php
<?php class Menu03 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : Menu vertical"; // Menu 1 $menu1 = new MenuItem("Menu 1", "", "img/wsp-admin/home_16.png"); $menu_11 = new MenuItem("Menu 1.1", "http://www.meteo-europ.com"); $menu1->setMenuItems(new MenuItems($menu_11)); // Menu 2 $menu2 = new MenuItem("Menu 2", "", "img/wsp-admin/config_16.png"); $menu_21 = new MenuItem("Menu 2.1", "javascript:alert('click Menu 2.1');"); $menu_22 = new MenuItem("Menu 2.2", "javascript:alert('click Menu 2.2');"); $menu2->setMenuItems(new MenuItems($menu_21, $menu_22)); // Menu 3 $menu3 = new MenuItem("Menu 3", "", "img/wsp-admin/template_16.gif"); $menu_31 = new MenuItem("Menu 3.1"); $menu_32 = new MenuItem("Menu 3.2"); $menu_33 = new MenuItem("Menu 3.3"); $menu3->setMenuItems( new MenuItems( $menu_31, $menu_32, $menu_33)); // Define vertical menu $main_menu = new Menu(Menu::POSITION_VERTICAL); $main_menu->setMenuItems( new MenuItems( $menu1, $menu2, $menu3)); $this->render = new WSPObject($main_menu, "<br/><br/><br/><br/>", "<br/><br/><br/><br/>", "<br/><br/><br/><br/>"); } } ?>
Go back to tutorial of the componant Menu
|