Skip to content

Commit

Permalink
fix jquery for joomla 25
Browse files Browse the repository at this point in the history
  • Loading branch information
Артем committed Jan 14, 2019
1 parent 5abeca9 commit 5a8e571
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions antispambycleantalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,28 @@ public function onBeforeCompileHead()
$user = JFactory::getUser();
$app = JFactory::getApplication();
$document = JFactory::getDocument();


// Version comparsion
if(!version_compare(JVERSION, '3', 'ge'))
{
$buf=$document->getHeadData();
$is_jquery=false;
foreach($buf['scripts'] as $key=>$value )
if(stripos($key,'jquery')!==false)
$is_jquery=true;
if(!$is_jquery)
$document->addScript(Juri::root()."plugins/system/antispambycleantalk/jquery-1.11.2.min.js");

$document->addScriptDeclaration("jQuery.noConflict();");
$document->addScriptDeclaration("var ct_joom25=true;");

}
else
{
JHtml::_('jquery.framework');
$document->addScriptDeclaration("var ct_joom25=false;");
}

if ($app->isSite())
{
$this->sfw_check();
Expand All @@ -702,27 +723,6 @@ public function onBeforeCompileHead()

if($user->get('isRoot'))
{
// Version comparsion
if(!version_compare(JVERSION, '3', 'ge'))
{

$buf=$document->getHeadData();
$is_jquery=false;
foreach($buf['scripts'] as $key=>$value )
if(stripos($key,'jquery')!==false)
$is_jquery=true;
if(!$is_jquery)
$document->addScript(Juri::root()."plugins/system/antispambycleantalk/jquery-1.11.2.min.js");

$document->addScriptDeclaration("jQuery.noConflict();");
$document->addScriptDeclaration("var ct_joom25=true;");

}
else
{
JHtml::_('jquery.framework');
$document->addScriptDeclaration("var ct_joom25=false;");
}
if($app->isAdmin())
{
$temp_config = $this->checkIsPaid($config['apikey']);
Expand Down

0 comments on commit 5a8e571

Please sign in to comment.