예제 #1
0
 public function init()
 {
     parent::init();
     $this->_identity = Zend_Auth::getInstance()->getIdentity();
     $this->view->identity = $this->_identity;
     if (isset($this->_session->carritoCompras)) {
         $this->view->carrito = $this->_session->carritoCompras;
     }
     $productos = new Application_Entity_Producto();
     if (!isset($this->_identity) && empty($this->_identity)) {
         $formLogin = new Application_Form_FormularioLogin();
         $formLogin->removeDecorators();
         $formLogin->customDecoratorFile("/form-custom/_formLoginHeader.phtml");
         $this->view->formLoginHeader = $formLogin . '
             <div class="clear"></div>
             <div style="float:right; padding-right:32px">
             <a href="/recuperar-contrasena">Olvido Contraseña</a>
             </div>';
         $configNavigationArray = array('home' => array('label' => 'Inicio', 'uri' => '/', 'orden' => '1', 'class' => 'first'), 'productos' => array('label' => 'Productos', 'uri' => '/productos', 'orden' => '2'), 'registrate' => array('label' => 'Registrate', 'uri' => '/registrate', 'orden' => '3'), 'contactenos' => array('label' => 'Contactenos', 'uri' => '/contactenos', 'orden' => '4'));
     } else {
         $string = '<div>' . $this->_identity->NombreUsuario . ' | ' . $this->_identity->Correo . ' | <a href="/login/salir">Salir</a> </div>
             <div>&nbsp;</div>';
         $this->view->formLoginHeader = $string;
         $configNavigationArray = array('home' => array('label' => 'Inicio', 'uri' => '/', 'orden' => '1', 'class' => 'first'), 'productos' => array('label' => 'Productos', 'uri' => '/productos', 'orden' => '2'), 'micuenta' => array('label' => 'Mi cuenta', 'uri' => '/mi-cuenta', 'orden' => '3'), 'contactenos' => array('label' => 'Contactenos', 'uri' => '/contactenos', 'orden' => '4'));
     }
     $categoria = new Application_Entity_Categoria();
     $listaCategorias = $categoria->listarArbolCategorias();
     $configNavigationArray['productos']['pages'] = $listaCategorias;
     $this->view->listaCategoriasNavigator = $listaCategorias;
     $navigation = new Zend_Navigation($configNavigationArray);
     $this->view->navigation($navigation);
     $this->view->ofertasRecienteRandon = $productos->listarOfertasRecientesAleatorio();
     $uri = $this->getRequest()->getPathInfo();
     $position = strpos($uri, '/page');
     if ($position > 0) {
         $uri = substr($uri, 0, $position);
     }
     $this->view->getPathInfo = $uri;
     $activeNavi = $this->view->navigation()->findByUri($uri);
     $activeNavi->active = true;
 }
예제 #2
0
 public function init()
 {
     parent::init();
     $this->_sessiondefault = new Zend_Session_Namespace('default');
     $this->view->cantProductosCotizar = count($this->_sessiondefault->cotizacion);
     $listaCategorias = Application_Entity_Producto::listarArbolCategoriasProductos();
     $listaSoluciones = Application_Entity_Soluciones::listarArbolCategoriasSoluciones();
     $configNavigationArray = array('home' => array('label' => 'Inicio', 'uri' => '/', 'orden' => '1'), 'nosotros' => array('label' => 'Nosotros', 'uri' => '/nosotros', 'orden' => '2'), 'productos' => array('label' => 'Productos', 'uri' => '/productos', 'orden' => '3'), 'marcas' => array('label' => 'Marcas', 'uri' => '/marcas', 'orden' => '4'), 'soluciones' => array('label' => 'Soluciones', 'uri' => '/soluciones', 'orden' => '5'), 'contactenos' => array('label' => 'Contactenos', 'uri' => '/contactenos', 'orden' => '6'));
     $configNavigationArray['productos']['pages'] = $listaCategorias;
     $configNavigationArray['soluciones']['pages'] = $listaSoluciones;
     $this->view->listaCategoriasNavigator = $listaCategorias;
     $navigation = new Zend_Navigation($configNavigationArray);
     $this->view->navigation($navigation);
     $uri = $this->getRequest()->getPathInfo();
     $position = strpos($uri, '/page');
     if ($position > 0) {
         $uri = substr($uri, 0, $position);
     }
     $this->view->getPathInfo = $uri;
     $activeNavi = $this->view->navigation()->findByUri($uri);
     $activeNavi->active = true;
 }
예제 #3
0
 public function init()
 {
     parent::init();
     Zend_Layout::getMvcInstance()->setLayout('layout-admin');
 }
예제 #4
0
 public function init()
 {
     parent::init();
 }