function showReportForm($id, $target) { if (JCommentsSecurity::badRequest() == 1) { JCommentsSecurity::notAuth(); } $response =& JCommentsFactory::getAjaxResponse(); $db =& JCommentsFactory::getDBO(); $comment = new JCommentsDB($db); if ($comment->load($id)) { $form = JComments::getCommentsReportForm($id, $comment->object_id, $comment->object_group); $response->addAssign($target, 'innerHTML', $form); } return $response; }
public static function showReportForm($id, $target) { if (JCommentsSecurity::badRequest() == 1) { JCommentsSecurity::notAuth(); } $config = JCommentsFactory::getConfig(); if ($config->getInt('report_reason_required') == 0) { $_POST['commentid'] = (int) $id; $response = JCommentsFactory::getAjaxResponse(); $response->addAssign($target, 'innerHTML', '<div id="comments-report-form"></div>'); return self::reportComment(); } else { $response = JCommentsFactory::getAjaxResponse(); $db = JCommentsFactory::getDBO(); $comment = new JCommentsTableComment($db); if ($comment->load($id)) { $form = JComments::getCommentsReportForm($id, $comment->object_id, $comment->object_group); $response->addAssign($target, 'innerHTML', $form); } return $response; } }