ExtBlank system plugin (Convergence Services); unmapped -> deployed files. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
54 lines
1.5 KiB
PHP
54 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* @version $Id: extblank.php 1.0 $
|
|
* @copyright Copyright (C) 2005 - 2012 Convergence Services, Inc. All rights reserved.
|
|
* @license GNU General Public License version 2 or later;
|
|
*/
|
|
|
|
// no direct access
|
|
defined('_JEXEC') or die;
|
|
jimport( 'joomla.plugin.plugin' );
|
|
class plgSystemExtblank extends JPlugin
|
|
{
|
|
function plgSystemExtblank(& $subject, $config)
|
|
{
|
|
parent::__construct($subject, $config);
|
|
}
|
|
function onAfterRoute()
|
|
{
|
|
$params = $this->params;
|
|
$document = JFactory::getDocument();
|
|
$app = JFactory::getApplication();
|
|
$isadmin = $app->isAdmin();
|
|
$load_in_admin = $params->get('use_backend');
|
|
$load = true;
|
|
//var_dump($isadmin);
|
|
//var_dump($load_in_admin);
|
|
|
|
if($isadmin)
|
|
{
|
|
if($load_in_admin==0)
|
|
$load = false;
|
|
}
|
|
if($load)
|
|
{
|
|
if($params->get('include_jquery'))
|
|
{
|
|
$document->addScript('http://code.jquery.com/jquery-latest.js');
|
|
}
|
|
$script = '
|
|
$conv_ = jQuery;
|
|
$conv_(document).ready(function() {
|
|
$conv_("a[href^=\'http:\']:not([href*=\'" + window.location.host + "\']), a[href^=\'https:\']:not([href*=\'" + window.location.host + "\'])").each(function() {
|
|
if($conv_(this).attr("target")!="_parent"){
|
|
$conv_(this).attr("target", "_blank");
|
|
}});
|
|
'.($params->get('replace_hash',0) ? '$conv_("a[href$=\'#\']").each(function(){$conv_(this).attr("href","javascript:void(0);")});' : '').'
|
|
});';
|
|
$document->addScriptDeclaration($script);
|
|
//echo 'after script';//exit;
|
|
}
|
|
}
|
|
|
|
}
|