예제 #1
0
 public function editAction()
 {
     $this->view->form = new Admin_Form_Page();
     $this->view->form->addID();
     if ($this->getRequest()->isPost()) {
         $FormData = $this->getRequest()->getPost();
         $this->view->form->addUrlValidator($FormData['parent'], $FormData['id']);
         if ($this->view->form->isValid($this->getRequest()->getPost())) {
             Zwe_Model_Page::editPage($this->view->form->getValue('id'), $this->view->form->getValue('title'), $this->view->form->getValue('parent'), $this->view->form->getValue('url'), $this->view->form->getValue('type'), $this->view->form->getValue('text'));
             $this->_helper->redirector('index');
         }
     }
     $Page = Zwe_Model_Page::getPageByID($this->getRequest()->getParam('page'));
     $this->view->form->populate($Page->toForm());
     $this->view->form->getElement('page')->setLabel('Edit the page');
 }