function eliminarAction() { //$info = Zend_Registry::get('personalizacion'); if (!$this->view->usuarioLogueado) { die($this->info->sitio->noticias->eliminar->msgRestringido); } $this->view->subtitle = $this->info->sitio->noticias->eliminar->titulo; $noticia = new Noticias(); if ($this->_request->isPost()) { Zend_Loader::loadClass('Zend_Filter_Alpha'); $filter = new Zend_Filter_Alpha(); $id = (int) $this->_request->getPost('id'); $del = $filter->filter($this->_request->getPost('del')); if ($del == 'Si' && $id > 0) { $where = 'id = ' . $id; $rows_affected = $noticia->delete($where); } } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $this->view->noticia = $noticia->fetchRow('id=' . $id); if ($this->view->noticia->id > 0) { $this->render(); return; } } } $this->_redirect('/admin/noticias/'); }