Skip to content

Commit 722383f

Browse files
committed
Автоматическое версиирование скриптов.
1 parent f4f4b3f commit 722383f

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

jllike/helper.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
**/
1111
defined('_JEXEC') or die;
1212

13+
use Joomla\CMS\HTML\HTMLHelper;
14+
1315
jimport('joomla.plugin.plugin');
1416

1517
if (version_compare(JVERSION, '3.5.0', 'ge')) {
@@ -37,8 +39,8 @@ class PlgJLLikeHelper
3739

3840
/**
3941
* Пример вывода лайков в любом месте макетов, шаблонов и т.п.
40-
* require_once JPATH_ROOT .'plugins/content/jllikepro/helper.php';
41-
* $helper = PlgJLLikeProHelper::getInstance();
42+
* require_once JPATH_ROOT .'plugins/content/jllike/helper.php';
43+
* $helper = PlgJLLikeHelper::getInstance();
4244
* $helper->loadScriptAndStyle(0); //1-если в категории, 0-если в контенте
4345
* echo $helper->ShowIN($id, $link, $title, $image, $desc, $enable_opengraph);
4446
*/
@@ -256,16 +258,15 @@ function loadScriptAndStyle($isCategory = 1)
256258

257259
$doc->addScriptDeclaration($script);
258260

259-
JHtml::_('jquery.framework');
260-
261-
$doc->addScript(JURI::base() . "plugins/content/jllike/js/buttons.min.js?12");
261+
JHtml::_('jquery.framework');
262+
263+
HTMLHelper::_('script', 'plugins/content/jllike/js/buttons.min.js', array('version' => 'auto'));
262264

263265
if ($this->params->get('enable_twit', 0)) {
264-
$doc->addScript(JURI::base() . "plugins/content/jllike/js/twit.min.js");
266+
HTMLHelper::_('script', 'plugins/content/jllike/js/twit.min.js', array('version' => 'auto'));
265267
}
266268

267-
268-
$doc->addStyleSheet(JURI::base() . "plugins/content/jllike/js/buttons.min.css?12");
269+
HTMLHelper::_('stylesheet', 'plugins/content/jllike/js/buttons.min.css', array('version' => 'auto'));
269270

270271
$btn_border_radius = (int) $this->params->get('btn_border_radius', 15);
271272
$btn_dimensions = (int) $this->params->get('btn_dimensions', 30);

jllike/jllike.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<extension version="3.5.0" type="plugin" group="content" method="upgrade">
2+
<extension version="3.8.0" type="plugin" group="content" method="upgrade">
33
<name>JL Like</name>
44
<author>JoomLine</author>
55
<creationDate>29.11.2020</creationDate>

pkg_jllike.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
2-
<extension type="package" version="3.5" method="upgrade">
2+
<extension type="package" version="3.8" method="upgrade">
33
<name>JL Like</name>
44
<packagename>jllike</packagename>
55
<author>JoomLine</author>

0 commit comments

Comments
 (0)