You've already forked joomla_test
first commit
This commit is contained in:
65
modules/mod_wrapper/helper.php
Normal file
65
modules/mod_wrapper/helper.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_wrapper
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Helper for mod_wrapper
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_wrapper
|
||||
* @since 1.5
|
||||
*/
|
||||
class ModWrapperHelper
|
||||
{
|
||||
public static function getParams(&$params)
|
||||
{
|
||||
$params->def('url', '');
|
||||
$params->def('scrolling', 'auto');
|
||||
$params->def('height', '200');
|
||||
$params->def('height_auto', '0');
|
||||
$params->def('width', '100%');
|
||||
$params->def('add', '1');
|
||||
$params->def('name', 'wrapper');
|
||||
|
||||
$url = $params->get('url');
|
||||
|
||||
if ($params->get('add'))
|
||||
{
|
||||
// adds 'http://' if none is set
|
||||
if (substr($url, 0, 1) == '/')
|
||||
{
|
||||
// relative url in component. use server http_host.
|
||||
$url = 'http://'.$_SERVER['HTTP_HOST'].$url;
|
||||
}
|
||||
elseif (!strstr($url, 'http') && !strstr($url, 'https'))
|
||||
{
|
||||
$url = 'http://'.$url;
|
||||
}
|
||||
else {
|
||||
$url = $url;
|
||||
}
|
||||
}
|
||||
|
||||
// auto height control
|
||||
if ($params->def('height_auto'))
|
||||
{
|
||||
$load = 'onload="iFrameHeight()"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$load = '';
|
||||
}
|
||||
|
||||
$params->set('load', $load);
|
||||
$params->set('url', $url);
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
1
modules/mod_wrapper/index.html
Normal file
1
modules/mod_wrapper/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
26
modules/mod_wrapper/mod_wrapper.php
Normal file
26
modules/mod_wrapper/mod_wrapper.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_wrapper
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Include the syndicate functions only once
|
||||
require_once __DIR__ . '/helper.php';
|
||||
|
||||
$params = ModWrapperHelper::getParams($params);
|
||||
|
||||
$load = $params->get('load');
|
||||
$url = htmlspecialchars($params->get('url'));
|
||||
$target = htmlspecialchars($params->get('target'));
|
||||
$width = htmlspecialchars($params->get('width'));
|
||||
$height = htmlspecialchars($params->get('height'));
|
||||
$scroll = htmlspecialchars($params->get('scrolling'));
|
||||
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
|
||||
$frameborder = htmlspecialchars($params->get('frameborder'));
|
||||
|
||||
require JModuleHelper::getLayoutPath('mod_wrapper', $params->get('layout', 'default'));
|
146
modules/mod_wrapper/mod_wrapper.xml
Normal file
146
modules/mod_wrapper/mod_wrapper.xml
Normal file
@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension
|
||||
type="module"
|
||||
version="3.1"
|
||||
client="site"
|
||||
method="upgrade">
|
||||
<name>mod_wrapper</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>October 2004</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>MOD_WRAPPER_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_wrapper">mod_wrapper.php</filename>
|
||||
<folder>tmpl</folder>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">en-GB.mod_wrapper.ini</language>
|
||||
<language tag="en-GB">en-GB.mod_wrapper.sys.ini</language>
|
||||
</languages>
|
||||
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_WRAPPER" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field
|
||||
name="url"
|
||||
type="text"
|
||||
size="30"
|
||||
label="MOD_WRAPPER_FIELD_URL_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_URL_DESC"
|
||||
required="true" />
|
||||
<field
|
||||
name="add"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="1"
|
||||
label="MOD_WRAPPER_FIELD_ADD_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_ADD_DESC">
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="scrolling"
|
||||
type="list"
|
||||
default="auto"
|
||||
label="MOD_WRAPPER_FIELD_SCROLL_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_SCROLL_DESC">
|
||||
<option
|
||||
value="auto">MOD_WRAPPER_FIELD_VALUE_AUTO</option>
|
||||
<option
|
||||
value="no">JNO</option>
|
||||
<option
|
||||
value="yes">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="width"
|
||||
type="text"
|
||||
size="5"
|
||||
default="100%"
|
||||
label="MOD_WRAPPER_FIELD_WIDTH_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_WIDTH_DESC" />
|
||||
<field
|
||||
name="height"
|
||||
type="text"
|
||||
size="5"
|
||||
default="200"
|
||||
label="MOD_WRAPPER_FIELD_HEIGHT_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_HEIGHT_DESC" />
|
||||
<field
|
||||
name="height_auto"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="1"
|
||||
label="MOD_WRAPPER_FIELD_AUTOHEIGHT_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_AUTOHEIGHT_DESC">
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="frameborder"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="1"
|
||||
label="MOD_WRAPPER_FIELD_FRAME_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_FRAME_DESC">
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="target"
|
||||
type="text"
|
||||
size="30"
|
||||
label="MOD_WRAPPER_FIELD_TARGET_LABEL"
|
||||
description="MOD_WRAPPER_FIELD_TARGET_DESC" />
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="advanced">
|
||||
<field
|
||||
name="layout"
|
||||
type="modulelayout"
|
||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||
description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||
<field
|
||||
name="moduleclass_sfx"
|
||||
type="textarea" rows="3"
|
||||
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
||||
<field
|
||||
name="cache"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHING_DESC">
|
||||
<option
|
||||
value="1">JGLOBAL_USE_GLOBAL</option>
|
||||
<option
|
||||
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||
</field>
|
||||
<field
|
||||
name="cache_time"
|
||||
type="text"
|
||||
default="900"
|
||||
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
||||
<field
|
||||
name="cachemode"
|
||||
type="hidden"
|
||||
default="static">
|
||||
<option
|
||||
value="static"></option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
38
modules/mod_wrapper/tmpl/default.php
Normal file
38
modules/mod_wrapper/tmpl/default.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_wrapper
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function iFrameHeight()
|
||||
{
|
||||
var h = 0;
|
||||
if (!document.all)
|
||||
{
|
||||
h = document.getElementById('blockrandom').contentDocument.height;
|
||||
document.getElementById('blockrandom').style.height = h + 60 + 'px';
|
||||
} else if (document.all)
|
||||
{
|
||||
h = document.frames('blockrandom').document.body.scrollHeight;
|
||||
document.all.blockrandom.style.height = h + 20 + 'px';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<iframe <?php echo $load; ?>
|
||||
id="blockrandom"
|
||||
name="<?php echo $target ?>"
|
||||
src="<?php echo $url; ?>"
|
||||
width="<?php echo $width ?>"
|
||||
height="<?php echo $height ?>"
|
||||
scrolling="<?php echo $scroll ?>"
|
||||
frameborder="<?php echo $frameborder?>"
|
||||
class="wrapper<?php echo $moduleclass_sfx ?>" >
|
||||
<?php echo JText::_('MOD_WRAPPER_NO_IFRAMES'); ?>
|
||||
</iframe>
|
1
modules/mod_wrapper/tmpl/index.html
Normal file
1
modules/mod_wrapper/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user