/** * Edit a comment * *@return void */ public function editAction($id = null, $pageKey = null, $redirect = '') { $comment = $this->comments->findComment($id, $pageKey); $now = gmdate('Y-m-d H:i:s'); if ($comment) { $values = array('name' => $comment->getProperties()['name'], 'mail' => $comment->getProperties()['mail'], 'web' => $comment->getProperties()['web'], 'content' => $comment->getProperties()['content'], 'updated' => $now); $form = new \Anax\HTMLForm\CFormCommentEdit($id, $pageKey, $redirect, $values); $form->setDI($this->di); $status = $form->check(); $this->theme->setTitle("Uppdatera kommentar"); $this->views->add('comment/form', ['title' => "Uppdatera kommentar", 'content' => $form->getHTML()], 'main'); } }
/** * Edit a comment * *@return void */ public function editAction($id = null, $key = null, $type = null) { $comment = $this->comments->find($id); $now = gmdate('Y-m-d H:i:s'); if ($comment) { if ($this->users->isAuthenticated() && ($this->users->isCurrentUser($id) || $this->users->isAdmin())) { $value = $comment->getProperties()['content']; $redirect = ''; $form = new \Anax\HTMLForm\CFormCommentEdit($id, $value, $redirect); $form->setDI($this->di); $status = $form->check(); $this->views->add('comment/form', ['title' => "Uppdatera kommentar", 'content' => $form->getHTML()], 'main'); } } }