public function execute(HTTPRequestCustom $request) { parent::execute($request); $note_type = $request->get_poststring('note_type', ''); $comment_id = $request->get_poststring('comment_id', ''); $comments_lang = LangLoader::get('comments-common'); if ($this->verificate_note_type($note_type) && $this->is_access_authorizations() && !empty($comment_id)) { $this->register_note($note_type, $comment_id); $object = array('success' => true, 'message' => $comments_lang['comment.note.success']); } else { if (!$this->is_access_authorizations()) { $object = array('success' => false, 'message' => $comments_lang['comments.not-authorized.note']); } else { $object = array('success' => false, 'message' => $comments_lang['comment.note.error']); } } return new JSONResponse($object); }
public function execute(HTTPRequestCustom $request) { parent::execute($request); $view = CommentsService::display_comments($this->get_module_id(), $this->get_id_in_module(), $this->get_topic_identifier(), $this->get_number_comments_display(), $this->get_authorizations(), true); return new SiteNodisplayResponse($view); }