Ejemplo n.º 1
0
 function editerAction()
 {
     $page = $this->_getParam('page');
     if (!$page) {
         throw new Strass_Controller_Action_Exception("Aucune page à éditer");
     }
     $this->view->statique = $page = new Statique($page);
     $this->metas(array('DC.Title' => "Éditer " . $page->getTitle()));
     $this->branche->append($page->getTitle(), array('action' => 'index'));
     $this->branche->append('Éditer');
     $this->assert(null, $page, 'editer', "Vous n'avez pas le droit d'éditer cette page");
     $this->view->model = $m = new Wtk_Form_Model('editer');
     $m->addNewSubmission('enregistrer', 'Enregistrer');
     $m->addString('wiki', 'Texte', $page->read());
     if ($m->validate()) {
         $page->write($m->get('wiki'));
         $this->redirectSimple('index');
     }
 }