feat(deployed): add ExtBlank 1.0 (no-source, vetted live)
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
This commit is contained in:
parent
6c8a2cdefe
commit
9595120d38
53
deployed/extblank/plugins/system/extblank/extblank.php
Normal file
53
deployed/extblank/plugins/system/extblank/extblank.php
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<?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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
deployed/extblank/plugins/system/extblank/extblank.xml
Normal file
34
deployed/extblank/plugins/system/extblank/extblank.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension version="1.5" type="plugin" group="system">
|
||||||
|
<name>System - Open external links in new window</name>
|
||||||
|
<author>Convergence Services</author>
|
||||||
|
<creationDate>Month 2011</creationDate>
|
||||||
|
<copyright>Copyright (C) 2012. All rights reserved.</copyright>
|
||||||
|
<license>GNU General Public License</license>
|
||||||
|
<authorEmail>info@convergenceservices.in</authorEmail>
|
||||||
|
<authorUrl>www.convergenceservices.in</authorUrl>
|
||||||
|
<version>1.0</version>
|
||||||
|
<description><![CDATA[This plugin makes all the external links open in a new window on your joomla website. <a target="_blank" href="index.php?option=com_plugins&search=Open%20external%20links%20in%20new%20window&filter_search=Open%20external%20links%20in%20new%20window">Please Enable the plugin and configure it</a>.]]></description>
|
||||||
|
<files>
|
||||||
|
<filename plugin="extblank">extblank.php</filename>
|
||||||
|
<filename>index.html</filename>
|
||||||
|
</files>
|
||||||
|
<config>
|
||||||
|
<fields name="params"><fieldset name="basic" label="Plugin Parameters">
|
||||||
|
<field name="use_backend" type="radio" default="0" label="Enable in Backend" description="Enable the plugin in joomla admin section as well">
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
<option value="0">No</option>
|
||||||
|
</field>
|
||||||
|
<field name="include_jquery" type="radio" default="0" label="Load jQuery" description="You should select yes if you have not already loaded jquery in your website, if you have already loaded jquery then set this to no">
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
<option value="0">No</option>
|
||||||
|
</field>
|
||||||
|
<field name="replace_hash" type="radio" default="0" label="Replace # tags" description="If set to yes, the plugin shall replace all a tags with href=# to href=javascript:void(0);">
|
||||||
|
<option value="1">Yes</option>
|
||||||
|
<option value="0">No</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</config>
|
||||||
|
</extension>
|
||||||
|
|
||||||
1
deployed/extblank/plugins/system/extblank/index.html
Normal file
1
deployed/extblank/plugins/system/extblank/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE html><title></title>
|
||||||
Loading…
Reference in New Issue
Block a user