function modificarAction() { //$info = Zend_Registry::get('personalizacion'); if (!$this->view->usuarioLogueado) { die($this->info->sitio->noticias->modificar->msgRestringido); } $this->view->subtitle = $this->info->sitio->noticias->modificar->titulo; $eNoticia = new Noticias(); if ($this->_request->isPost()) { Zend_Loader::loadClass('Zend_Filter_StripTags'); $filter = new Zend_Filter_StripTags(); $id = (int) $this->_request->getPost('id'); $titulo = trim($filter->filter($this->_request->getPost('titulo'))); $contenido = trim($this->_request->getPost('contenido')); $contenido_ext = trim($this->_request->getPost('contenido_ext')); if ($id !== false) { if ($titulo != '' && $contenido != '') { $data = array('titulo' => $titulo, 'contenido' => $contenido, 'contenido_ext' => $contenido_ext); $where = 'id = ' . $id; $eNoticia->update($data, $where); $this->_redirect('/admin/noticias/'); return; } else { $this->view->noticia = $eNoticia->fetchRow('id=' . $id); } } } else { $id = (int) $this->_request->getParam('id', 0); if ($id > 0) { $this->view->noticia = $eNoticia->fetchRow('id=' . $id); } } $this->view->action = $this->info->sitio->noticias->modificar->action; $this->view->buttonText = $this->info->sitio->noticias->modificar->buttonText; $this->render(); }