Skip to content

Commit

Permalink
Merge pull request #174 from Globulopolis/master
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
Globulopolis authored May 23, 2024
2 parents c36cd8f + 5bb3978 commit e530e8f
Show file tree
Hide file tree
Showing 28 changed files with 125 additions and 105 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
###### 4.0.32
- \# fixed bug #175
- \# fixed #173

###### 4.0.31
- \+ Update for https://github.com/exstreme/Jcomments-4/pull/97
- \+ Added B/C for old components which uses JComments::showComments() method for main JComments::show() method.
Expand Down
2 changes: 1 addition & 1 deletion build/pkg_jcomments.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ private function displayResults($data)
<div class="text-success"><strong><?php echo $data->finish; ?></strong></div>
<?php if (!empty($data->next)): ?>
<div>
<a href="<?php echo $data->next; ?>" class="btn btn-success">
<a href="<?php echo $data->next; ?>" class="btn btn-success text-white">
<?php echo Text::_('JNEXT'); ?>
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions build/pkg_jcomments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<extension type="package" method="upgrade">
<name>JComments package</name>
<author>JComments team</author>
<creationDate>January 2023</creationDate>
<creationDate>May 2024</creationDate>
<packagename>jcomments</packagename>
<version>4.0.31</version>
<version>4.0.32</version>
<url>https://github.com/exstreme/Jcomments-4</url>
<packager>JComments team</packager>
<packagerurl>https://github.com/exstreme/Jcomments-4</packagerurl>
Expand Down
6 changes: 3 additions & 3 deletions component/administrator/controllers/controllerform.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct($config = array())
$r = null;
if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r))
{
throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
throw new Exception(Text::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
}
$this->context = strtolower($r[2]);
}
Expand Down Expand Up @@ -123,7 +123,7 @@ public function add()
{
$this->setRedirect(
Route::_($this->getRedirectToList(), false),
JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'),
Text::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'),
'error'
);

Expand Down Expand Up @@ -182,7 +182,7 @@ public function edit($key = null, $urlVar = null)
{
$this->holdEditId($context, $recordId);
$app->setUserState($context . '.data', null);
$this->setRedirect(JRoute::_($this->getRedirectToItem($recordId), false));
$this->setRedirect(Route::_($this->getRedirectToItem($recordId), false));

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions component/administrator/controllers/controllerlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct($config = array())
$r = null;
if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r))
{
throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
throw new Exception(Text::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
}
$this->context = strtolower($r[2]);
}
Expand All @@ -53,7 +53,7 @@ public function __construct($config = array())
$r = null;
if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r))
{
throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
throw new Exception(Text::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
}
$this->view = strtolower($r[2]);
}
Expand Down
6 changes: 5 additions & 1 deletion component/administrator/controllers/settings.raw.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;

Expand Down Expand Up @@ -51,7 +52,10 @@ public function saveConfig()
$app->setHeader('Expires', '-1');
$app->setHeader('Cache-Control', 'public, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', true);
$app->setHeader('Content-Transfer-Encoding', 'Binary');
$app->setHeader('Content-disposition', 'attachment; filename="com_jcomments-settings-' . JHtml::_('date', time(), 'Y-m-d_H-i-s') . '.json"');
$app->setHeader(
'Content-disposition',
'attachment; filename="com_jcomments-settings-' . HTMLHelper::_('date', time(), 'Y-m-d_H-i-s') . '.json"'
);
$app->sendHeaders();

$_access = new Access;
Expand Down
3 changes: 2 additions & 1 deletion component/administrator/controllers/subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Router\Route;
use Joomla\Utilities\ArrayHelper;

class JCommentsControllerSubscriptions extends JCommentsControllerList
Expand Down Expand Up @@ -44,7 +45,7 @@ public function publish()
$model->publish($cid, $value);
}

$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view, false));
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view, false));

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion component/administrator/models/modellist.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function saveOrder($pks = null, $order = null)
return false;
}

$reorderCondition = $this->getReorderConditions();
$reorderCondition = $this->getReorderConditions($table);
$found = false;

foreach ($conditions as $condition)
Expand Down
3 changes: 2 additions & 1 deletion component/administrator/tables/blacklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;

/**
Expand All @@ -28,7 +29,7 @@ public function check()
{
if ($this->ip == $_SERVER['REMOTE_ADDR'])
{
$this->setError(JText::_('A_BLACKLIST_ERROR_YOU_CAN_NOT_BAN_YOUR_IP'));
$this->setError(Text::_('A_BLACKLIST_ERROR_YOU_CAN_NOT_BAN_YOUR_IP'));

return false;
}
Expand Down
4 changes: 3 additions & 1 deletion component/administrator/tables/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

defined('_JEXEC') or die;

use Joomla\CMS\Table\Table;

/**
* JComments report table
*/
class JCommentsTableReport extends JTable
class JCommentsTableReport extends Table
{
public function __construct($_db)
{
Expand Down
3 changes: 2 additions & 1 deletion component/administrator/views/about/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;

Expand Down Expand Up @@ -46,7 +47,7 @@ public function display($tpl = null)
{
$this->component = Installer::parseXMLInstallFile(Path::clean(JPATH_ROOT . '/administrator/components/com_jcomments/jcomments.xml'));

ToolbarHelper::title(JText::_('A_SUBMENU_ABOUT'));
ToolbarHelper::title(Text::_('A_SUBMENU_ABOUT'));
ToolbarHelper::preferences('com_jcomments');

parent::display($tpl);
Expand Down
72 changes: 36 additions & 36 deletions component/administrator/views/blacklist/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,40 @@
->useScript('form.validate');
?>
<form action="<?php echo Route::_('index.php?option=com_jcomments&view=blacklist&layout=edit&id=' . (int) $this->item->id); ?>"
method="post" name="adminForm" id="item-form" class="form-validate">
<div class="main-card">
<div class="row">
<div class="col-12">
<fieldset id="fieldset-edit" class="options-form">
<legend><?php echo Text::_('A_BLACKLIST_EDIT'); ?></legend>

<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('ip'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('ip'); ?>
</div>
</div>

<?php echo $this->form->renderField('reason'); ?>

<?php echo $this->form->renderField('notes'); ?>

<?php echo $this->form->renderField('created'); ?>

<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('id'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('id'); ?>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" name="task" value=""/>
<?php echo HTMLHelper::_('form.token'); ?>
</div>
method="post" name="adminForm" id="item-form" class="form-validate">
<div class="main-card">
<div class="row">
<div class="col-12">
<fieldset id="fieldset-edit" class="options-form">
<legend><?php echo Text::_('A_BLACKLIST_EDIT'); ?></legend>

<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('ip'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('ip'); ?>
</div>
</div>

<?php echo $this->form->renderField('reason'); ?>

<?php echo $this->form->renderField('notes'); ?>

<?php echo $this->form->renderField('created'); ?>

<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('id'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('id'); ?>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" name="task" value=""/>
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</form>
3 changes: 2 additions & 1 deletion component/administrator/views/blacklist/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Content\Administrator\Helper\ContentHelper;
Expand Down Expand Up @@ -41,7 +42,7 @@ protected function addToolbar()
$isNew = ($this->item->id == 0);

Factory::getApplication()->input->set('hidemainmenu', 1);
ToolbarHelper::title(JText::_('A_BLACKLIST'));
ToolbarHelper::title(Text::_('A_BLACKLIST'));

if (!$checkedOut && $canDo->get('core.edit'))
{
Expand Down
3 changes: 2 additions & 1 deletion component/administrator/views/custombbcode/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
?>
<form action="<?php echo JRoute::_('index.php?option=com_jcomments&view=custombbcode&layout=edit&id=' . (int) $this->item->id); ?>"
<form action="<?php echo Route::_('index.php?option=com_jcomments&view=custombbcode&layout=edit&id=' . (int) $this->item->id); ?>"
method="post" name="adminForm" id="item-form" class="form-validate">
<div class="main-card">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'general', 'recall' => true, 'breakpoint' => 768]); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

HTMLHelper::_('stylesheet', 'media/com_jcomments/css/backend-style.css');
?>
<form action="<?php echo JRoute::_('index.php?option=com_jcomments&view=custombbcodes'); ?>" method="post"
<form action="<?php echo Route::_('index.php?option=com_jcomments&view=custombbcodes'); ?>" method="post"
name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
Expand Down
3 changes: 2 additions & 1 deletion component/administrator/views/custombbcodes/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
Expand Down Expand Up @@ -43,7 +44,7 @@ protected function addToolbar()
$toolbar = Toolbar::getInstance('toolbar');
$canDo = ContentHelper::getActions('com_jcomments', 'component');

ToolbarHelper::title(JText::_('A_SUBMENU_CUSTOM_BBCODE'));
ToolbarHelper::title(Text::_('A_SUBMENU_CUSTOM_BBCODE'));

if ($canDo->get('core.create'))
{
Expand Down
2 changes: 1 addition & 1 deletion component/administrator/views/smiley/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$wa->useScript('keepalive')
->useScript('form.validate');
?>
<form action="<?php echo Route::_('index.php?option=com_jcomments&view=smiley&layout=edit&id='. (int) $this->item->id); ?>"
<form action="<?php echo Route::_('index.php?option=com_jcomments&view=smiley&layout=edit&id=' . (int) $this->item->id); ?>"
method="post" name="adminForm" id="item-form" class="form-validate">
<div class="main-card">
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion component/administrator/views/smilies/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
HTMLHelper::_('draggablelist.draggable');
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_jcomments&view=smilies'); ?>" method="post"
<form action="<?php echo Route::_('index.php?option=com_jcomments&view=smilies'); ?>" method="post"
name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
Expand Down
3 changes: 2 additions & 1 deletion component/administrator/views/subscriptions/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
Expand Down Expand Up @@ -42,7 +43,7 @@ protected function addToolbar()
$toolbar = Toolbar::getInstance('toolbar');
$canDo = ContentHelper::getActions('com_jcomments', 'component');

ToolbarHelper::title(JText::_('A_SUBMENU_SUBSCRIPTIONS'));
ToolbarHelper::title(Text::_('A_SUBMENU_SUBSCRIPTIONS'));

if ($canDo->get('core.create'))
{
Expand Down
2 changes: 1 addition & 1 deletion component/jcomments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<author>JComments team</author>
<authorUrl>https://github.com/exstreme/Jcomments-4</authorUrl>
<license>https://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<version>4.0.31</version>
<version>4.0.32</version>
<description>JComments lets your users comment on content items.</description>
<namespace path="src">Joomla\Component\Jcomments</namespace>

Expand Down
2 changes: 1 addition & 1 deletion component/site/classes/factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static function getTemplate($objectID = 0, $objectGroup = 'com_content',
$tmpl->addGlobalVar('comment-object_id', $objectID);
$tmpl->addGlobalVar('comment-object_group', $objectGroup);

if ($needThisUrl == true)
if ($needThisUrl)
{
$tmpl->addGlobalVar('thisurl', JCommentsObject::getLink($objectID, $objectGroup, $language->getTag()));
}
Expand Down
2 changes: 0 additions & 2 deletions component/site/helpers/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public static function trigger($event, $args = null)
{
$result = Factory::getApplication()->triggerEvent($event);
}


}

return $result;
Expand Down
1 change: 1 addition & 0 deletions component/site/helpers/object.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

require_once JPATH_ROOT . '/components/com_jcomments/models/object.php';
require_once JPATH_ROOT . '/components/com_jcomments/classes/objectinfo.php';
require_once JPATH_ROOT . '/components/com_jcomments/classes/plugin.php';
require_once JPATH_ROOT . '/components/com_jcomments/classes/security.php';

/**
Expand Down
Loading

0 comments on commit e530e8f

Please sign in to comment.