Ejemplo n.º 1
0
 public static function getNewsByID($IDNews)
 {
     $Blog = parent::getNewsByID($IDNews);
     $TheBlog = new self();
     $TheBlog->copy($Blog);
     $Author = new App_Model_User();
     $Author->copy($Blog->Author);
     $TheBlog->Author = $Author;
     return $TheBlog;
 }
Ejemplo n.º 2
0
 public function editAction()
 {
     $this->view->form = new Admin_Form_News();
     $this->view->form->addID();
     if ($this->getRequest()->isPost()) {
         if ($this->view->form->isValid($this->getRequest()->getPost())) {
             Zwe_Model_News::editNews($this->view->form->getValue('id'), $this->view->form->getValue('title'), $this->view->form->getValue('page'), $this->view->form->getValue('text'));
             $this->_helper->redirector('index');
         }
     }
     $News = Zwe_Model_News::getNewsByID((int) $this->_getParam('news'));
     $this->view->form->populate($News->toForm());
     $this->view->form->getElement('news')->setLabel('Edit the news');
 }