first commit

This commit is contained in:
alazhar
2020-01-02 22:20:31 +07:00
commit 10eb3340ad
5753 changed files with 631345 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="Comments" hidden="true"/>
</metadata>

View File

@ -0,0 +1,46 @@
<?php
/**
* @version $Id: report.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die;
?>
<div class="k2ReportCommentFormContainer">
<h2 class="componentheading">
<?php echo JText::_('K2_REPORT_COMMENT'); ?>
</h2>
<blockquote class="commentPreview">
<span class="quoteIconLeft">&ldquo;</span>
<span class="theComment"><?php echo nl2br($this->row->commentText); ?></span>
<span class="quoteIconRight">&rdquo;</span>
</blockquote>
<form action="<?php echo JURI::root(true); ?>/index.php" name="k2ReportCommentForm" id="k2ReportCommentForm" method="post">
<label for="name"><?php echo JText::_('K2_YOUR_NAME'); ?></label>
<input type="text" id="name" name="name" value="" />
<label for="reportReason"><?php echo JText::_('K2_REPORT_REASON'); ?></label>
<textarea name="reportReason" id="reportReason" cols="60" rows="10"></textarea>
<?php if($this->params->get('recaptcha') && $this->user->guest): ?>
<label class="formRecaptcha"><?php echo JText::_('K2_ENTER_THE_TWO_WORDS_YOU_SEE_BELOW'); ?></label>
<div id="recaptcha"></div>
<?php endif; ?>
<button class="button"><?php echo JText::_('K2_SEND_REPORT'); ?></button>
<span id="formLog"></span>
<input type="hidden" name="option" value="com_k2" />
<input type="hidden" name="view" value="comments" />
<input type="hidden" name="task" value="sendReport" />
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
<input type="hidden" name="format" value="raw" />
<?php echo JHTML::_('form.token'); ?>
</form>
</div>

View File

@ -0,0 +1,66 @@
<?php
/**
* @version $Id: view.html.php 1992 2013-07-04 16:36:38Z lefteris.kavadas $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die ;
jimport('joomla.application.component.view');
class K2ViewComments extends K2View
{
function report($tpl = null)
{
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');
$row = &JTable::getInstance('K2Comment', 'Table');
$row->load(JRequest::getInt('commentID'));
if (!$row->published)
{
JError::raiseError(404, JText::_('K2_NOT_FOUND'));
}
$this->assignRef('row', $row);
$user = JFactory::getUser();
$this->assignRef('user', $user);
$params = &K2HelperUtilities::getParams('com_k2');
if (!$params->get('comments') || !$params->get('commentsReporting') || ($params->get('commentsReporting') == '2' && $user->guest))
{
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
}
// Pass the old parameter to the view in order to avoid layout changes
if ($params->get('antispam') == 'recaptcha' || $params->get('antispam') == 'both')
{
$params->set('recaptcha', true);
}
else
{
$params->set('recaptcha', false);
}
$this->assignRef('params', $params);
if ($params->get('recaptcha') && $user->guest)
{
$document = JFactory::getDocument();
$document->addScript('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js');
$js = '
function showRecaptcha(){
Recaptcha.create("'.$params->get('recaptcha_public_key').'", "recaptcha", {
theme: "'.$params->get('recaptcha_theme', 'clean').'"
});
}
$K2(window).load(function() {
showRecaptcha();
});
';
$document->addScriptDeclaration($js);
}
parent::display($tpl);
}
}