protected function handle_submit() { $form = $this->get_form(); CommentsManager::edit_comment($this->id_comment, $form->get_value('message')); AppContext::get_response()->redirect(CommentsUrlBuilder::comment_added($this->topic_path, $this->id_comment)); }
protected function handle_submit() { $form = $this->get_form(); if ($form->has_field('name')) { $id_comment = CommentsManager::add_comment($this->module_id, $this->id_in_module, $this->topic_identifier, $this->topic_path, $form->get_value('message'), $form->get_value('name')); } else { $id_comment = CommentsManager::add_comment($this->module_id, $this->id_in_module, $this->topic_identifier, $this->topic_path, $form->get_value('message')); } $this->comments_topic->get_events()->execute_add_comment_event(); AppContext::get_response()->redirect(CommentsUrlBuilder::comment_added($this->topic_path, $id_comment)); }