コード例 #1
0
 /**
  * Creates the custom menu
  *
  * @param string $definition the menu items definition in syntax required by {@link convert_text_to_menu_nodes()}
  * @param string $currentlanguage the current language code, null disables multilang support
  */
 public function __construct($definition = '', $currentlanguage = null)
 {
     $this->currentlanguage = $currentlanguage;
     parent::__construct('root');
     // Create virtual root element of the menu.
     if (!empty($definition)) {
         $this->override_children(self::convert_text_to_menu_nodes($definition, $currentlanguage));
     }
 }