pdo Conexión de base de datos */ function __construct($titulo, $pdo, $menuArr){ $this->titulo = trim($titulo); $this->menu = $menuArr; $this->pdo = $pdo; } private function creaMenu($id, $nombre){ $this->xtpl->assign("MENU_ID", $id); $this->xtpl->assign("MENU_NOMBRE", $nombre); $this->xtpl->parse("main.sidebar.menus.menu.inactivo"); $this->xtpl->parse("main.sidebar.menus.menu.collapsed"); } public function printMenu(){ require_once("./include/xTemplate/xtemplate.class.php"); $this->xtpl = new XTemplate('./tpl/main_menu.tpl.html'); //$this->xtpl->assign("LOGO_LINK", "main.php"); $rutaLogo = "/img/logo_lasalle.png"; //$rutaLogo = 'img/60_logo.svg'; //logo 60 $this->xtpl->assign("LOGO_IMG", $rutaLogo); $stmt = $this->pdo->prepare('Select * from fs_sistema(null)'); if(!$stmt->execute()){ echo "Error al obtener sistemas"; print_r($stmt->errorInfo()); exit(); } $sistemasArr = $stmt->fetchAll(); $stmt->closeCursor(); $stmt = null; //Menus superadmin /* foreach($sistemasArr as $sistema){ $this->xtpl->assign("TEXTO", $sistema["Sistema_nombre"]); $this->xtpl->parse("main.sistemas.list.texto"); } $this->xtpl->parse("main.sistemas.list"); $this->xtpl->parse("main.sistemas");*/ foreach($this->menu as $apsaOld){ $this->xtpl->assign("MENU_LINK", $apsaOld["link"]); $this->xtpl->assign("MENU_NOMBRE", $apsaOld["nombre"]); $this->xtpl->parse("main.sidebar.menus.menu_link"); } $this->xtpl->parse("main.sidebar.menus"); $this->xtpl->parse("main.sidebar"); $this->xtpl->parse("main.menu_index"); if($this->titulo != "") $this->xtpl->assign("TITULO", $this->titulo); $this->xtpl->parse("main"); $this->xtpl->out("main"); } function printMenuFooter(){ } /* * @return string Texto con el código HTML del menú */ public function textMenu(){ return $this->xtpl->text("main"); } }