public static function getSitioDefault() { $sitios = new Sitios(); $sitio_default = $sitios->fetchRow("por_defecto = 1"); if ($sitio_default == NULL) { $sitio_default = Sitios::getAll(null, 1, "orden"); } return $sitio_default; }
protected function cargarMenuHorizontal() { $opciones = array(); /* * FIXME: eliminar los tildes para las urls ( url => nombre) */ $opciones = Sitios::getAll(null, null, "orden")->toArray(); if (isset($opciones) && count($opciones) > 0) { foreach ($opciones as $op) { $ret[] = array('url' => '/default/index/index/sitio/' . strtolower($op['nombre']), 'alt' => strtolower($op['nombre']), 'text' => ucfirst($op['titulo'])); } $this->view->menuHorizontalOpciones = $ret; } else { $this->view->menuHorizontalOpciones = array(); } }
public function indexAction() { $this->view->subtitle = "ABM Sitios"; $orden = (string) $this->_request->getParam('orden', 0); $asc = (bool) $this->_request->getParam('asc', 0); if (empty($orden)) { $orden = "id"; } if ($asc) { $orden .= " ASC"; } else { $orden .= " DESC"; } $this->view->orden_asc = $asc; $this->view->sitios = Sitios::getAll(null, 0, $orden); $this->render(); }