public function commentEditAction() { SxCms_Acl::requireAcl('news', 'news.comments.edit'); $mapper = new SxCms_Comment_DataMapper(); $comment = $mapper->getById($this->_getParam('id')); if ($this->getRequest()->isPost()) { $author = $comment->getCommenter(); $author->setName($this->_getParam('name'))->setEmail($this->_getParam('email'))->setWebsite($this->_getParam('website')); $comment->setMessage($this->_getParam('message'))->setApproved($this->_getParam('approved')); if ($comment->isApproved() && !$comment->getDateApproved()) { $comment->setDateApproved(date('Y-m-d H:i:s')); } $validator = new SxCms_Comment_UpdateValidator(); if ($validator->validate($comment)) { $mapper->save($comment); $flashMessenger = $this->_helper->getHelper('FlashMessenger'); $flashMessenger->addMessage($this->admin_tmx->_('messageeditedsuccess')); $this->_helper->redirector->gotoSimple('comments', 'page'); } } $this->view->messages = Sanmax_MessageStack::getInstance('SxCms_Comments'); $this->view->comment = $comment; }