Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion language/en-GB/en-GB.mod_wrapper.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ MOD_WRAPPER_FIELD_AUTOHEIGHT_DESC="The height will automatically be set to the s
MOD_WRAPPER_FIELD_AUTOHEIGHT_LABEL="Auto Height"
MOD_WRAPPER_FIELD_HEIGHT_DESC="Height of the iframe window."
MOD_WRAPPER_FIELD_HEIGHT_LABEL="Height"
MOD_WRAPPER_FIELD_MODE_DESC="HTML5 mode uses CSS to style the IFRAME tag. Legacy mode uses HTML 4.01 IFRAME attributes and is backwards compatible with old template overrides."
MOD_WRAPPER_FIELD_MODE_LABEL="Mode"
MOD_WRAPPER_FIELD_SCROLL_DESC="Show or hide horizontal & vertical scroll bars."
MOD_WRAPPER_FIELD_SCROLL_LABEL="Scroll Bars"
MOD_WRAPPER_FIELD_TARGET_DESC="Name of the iframe when used as target."
MOD_WRAPPER_FIELD_TARGET_LABEL="Target Name"
MOD_WRAPPER_FIELD_URL_DESC="URL to site/file you wish to display within the iframe."
MOD_WRAPPER_FIELD_URL_LABEL="URL"
MOD_WRAPPER_FIELD_VALUE_AUTO="Auto"
MOD_WRAPPER_FIELD_VALUE_HTML5="HTML5"
MOD_WRAPPER_FIELD_VALUE_LEGACY="Legacy (HTML4)"
MOD_WRAPPER_FIELD_WIDTH_DESC="Width of the iframe window. You can enter an absolute figure in pixels or a relative figure by adding a %."
MOD_WRAPPER_FIELD_WIDTH_LABEL="Width"
MOD_WRAPPER_NO_IFRAMES="No iframes"
MOD_WRAPPER_XML_DESCRIPTION="This module shows an iframe window to specified location."
MOD_WRAPPER_FIELD_FRAME_LABEL="Frame Border"
MOD_WRAPPER_FIELD_FRAME_DESC="Show frame border which wraps the iframe."
MOD_WRAPPER_FIELD_FRAME_DESC="Show frame border which wraps the iframe."
16 changes: 15 additions & 1 deletion modules/mod_wrapper/mod_wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@
$height = htmlspecialchars($params->get('height'), ENT_COMPAT, 'UTF-8');
$scroll = htmlspecialchars($params->get('scrolling'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$frameborder = htmlspecialchars($params->get('frameborder'), ENT_COMPAT, 'UTF-8');
$frameborder = htmlspecialchars($params->get('frameborder', 1), ENT_COMPAT, 'UTF-8');
$ititle = $module->title;
$id = $module->id;
$isHtml5 = $params->get('mode', 'legacy') === 'html5';

if ($isHtml5)
{
$overflow = $scroll;

if ($overflow !== 'auto')
{
$overflow = $overflow === 'no' ? 'hidden' : 'scroll';
}

$frameborder = !$frameborder ? 'none' : $frameborder . 'px solid #000';
$height = (int) $height . 'px';
}

require JModuleHelper::getLayoutPath('mod_wrapper', $params->get('layout', 'default'));
12 changes: 12 additions & 0 deletions modules/mod_wrapper/mod_wrapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
<config>
<fields name="params">
<fieldset name="basic">
<field
name="mode"
type="radio"
label="MOD_WRAPPER_FIELD_MODE_LABEL"
description="MOD_WRAPPER_FIELD_MODE_DESC"
class="btn-group"
default="legacy"
>
<option value="legacy">MOD_WRAPPER_FIELD_VALUE_LEGACY</option>
<option value="html5">MOD_WRAPPER_FIELD_VALUE_HTML5</option>
</field>

<field
name="url"
type="text"
Expand Down
18 changes: 14 additions & 4 deletions modules/mod_wrapper/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,26 @@

defined('_JEXEC') or die;

JHtml::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true));
if ($params->get('height_auto'))
{
JHtml::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true));
}
?>
<iframe <?php echo $load; ?>
id="blockrandom-<?php echo $id; ?>"
name="<?php echo $target; ?>"
src="<?php echo $url; ?>"
width="<?php echo $width; ?>"
height="<?php echo $height; ?>"
scrolling="<?php echo $scroll; ?>"
frameborder="<?php echo $frameborder; ?>"
<?php if ($isHtml5) : ?>
style="width: <?php echo $width; ?>;
height: <?php echo $height; ?>;
overflow: <?php echo $overflow; ?>;
border: <?php echo $frameborder; ?>"
<?php else : ?>
width="<?php echo $width; ?>"
height="<?php echo $height; ?>"
frameborder="<?php echo $frameborder; ?>"
<?php endif; ?>
title="<?php echo $ititle; ?>"
class="wrapper<?php echo $moduleclass_sfx; ?>" >
<?php echo JText::_('MOD_WRAPPER_NO_IFRAMES'); ?>
Expand Down