ACL_el_que_sea') === true) { haz cosas aqui } */ public function __construct( private string $name, private array $items=[], private array $menu=[] ) { } /** * Create Item function. * * @param MenuItem $menuItem Item for print. * * @return array. */ public function generateItem(MenuItem $menuItem) { // Start with empty element. $item = []; if ($menuItem->canBeDisplayed() === true) { // Handle of information. if (empty($menuItem->getUrl()) === false) { $urlPath = $menuItem->getUrl(); } else { $urlPath = ui_get_full_url( $menuItem->getSec().'/'.$menuItem->getSec2().'/'.$menuItem->getParameters() ); } // Creation of the line. $item[] = '
  • '; // Create the link if is neccesary. if (empty($urlPath) === false) { $item[] = sprintf( '%s', $urlPath, $menuItem->getText() ); } // Check if this item has submenu. If is the case, create it. if ($menuItem->hasSubmenu() === true) { $item[] = ''; } $item[] = '
  • '; } return $item; } /** * Generate the menu. * * @return void. */ public function generateMenu() { $output = []; /* Estructura */ $output[] = ''; $this->menu[] = $output; } /** * Prints the menu. * * @return void. */ public function printMenu() { if (empty($this->menu) === false) { foreach ($this->menu as $element) { echo $element."\n"; } } } }