Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions administrator/language/en-GB/en-GB.com_wrapper.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ COM_WRAPPER_FIELD_HEIGHT_LABEL="Height"
COM_WRAPPER_FIELD_HEIGHTAUTO_DESC="If height is set to auto, the height will automatically be set to the size of the external page. This will only work for pages on your own domain. If you see a JavaScript error, make sure this parameter is disabled. This will break XHTML compatibility for this page."
COM_WRAPPER_FIELD_HEIGHTAUTO_LABEL="Auto Height"
COM_WRAPPER_FIELD_LABEL_SCROLLBARSPARAMS="Scroll Bar Parameters"
COM_WRAPPER_FIELD_MODE_LABEL="Mode"
COM_WRAPPER_FIELD_MODE_DESCRIPTION="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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to COM_WRAPPER_FIELD_MODE_DESC

COM_WRAPPER_FIELD_SCROLLBARS_DESC="Show or hide the horizontal & vertical scrollbars. If you choose 'Auto', make sure the Auto advanced parameter is set."
COM_WRAPPER_FIELD_SCROLLBARS_LABEL="Scroll Bars"
COM_WRAPPER_FIELD_URL_DESC="URL to site/file you wish to display within the iframe."
COM_WRAPPER_FIELD_URL_LABEL="URL"
COM_WRAPPER_FIELD_VALUE_AUTO="Auto"
COM_WRAPPER_FIELD_VALUE_HTML5="HTML5"
COM_WRAPPER_FIELD_VALUE_LEGACY="Legacy (HTML4)"
COM_WRAPPER_FIELD_WIDTH_DESC="Width of the iframe window. You may enter an absolute figure in pixels or a relative figure by adding a %."
COM_WRAPPER_XML_DESCRIPTION="Displays an iframe to wrap an external page or site into Joomla!"
35 changes: 30 additions & 5 deletions components/com_wrapper/views/wrapper/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,26 @@

defined('_JEXEC') or die;

JHtml::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true));
if ($this->params->get('height_auto', 0))
{
JHtml::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true));
}

$isHtml5 = $this->params->get('mode', 'legacy') === 'html5';
$width = $this->escape($this->params->get('width', '100%'));
$height = $this->escape($this->params->get('height', '500')) . ($isHtml5 ? 'px' : '');
$scrolling = $this->escape($this->params->get('scrolling', 'auto'));
$frameborder = $this->escape($this->params->get('frameborder', 1));

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

$frameborder = !$frameborder ? 'none' : $frameborder . 'px solid #000';
}
?>
<div class="contentpane<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
Expand All @@ -28,10 +46,17 @@
id="blockrandom"
name="iframe"
src="<?php echo $this->escape($this->wrapper->url); ?>"
width="<?php echo $this->escape($this->params->get('width')); ?>"
height="<?php echo $this->escape($this->params->get('height')); ?>"
scrolling="<?php echo $this->escape($this->params->get('scrolling')); ?>"
frameborder="<?php echo $this->escape($this->params->get('frameborder', 1)); ?>"
<?php if ($isHtml5) : ?>
style="width: <?php echo $width; ?>;
height: <?php echo $height; ?>;
overflow: <?php echo $scrolling; ?>;
border: <?php echo $frameborder; ?>"
<?php else : ?>
width="<?php echo $width; ?>"
height="<?php echo $height; ?>"
scrolling="<?php echo $scrolling; ?>"
frameborder="<?php echo $frameborder; ?>"
<?php endif; ?>
<?php if ($this->escape($this->params->get('page_heading'))) : ?>
title="<?php echo $this->escape($this->params->get('page_heading')); ?>"
<?php else : ?>
Expand Down
12 changes: 12 additions & 0 deletions components/com_wrapper/views/wrapper/tmpl/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@
<!-- Advanced options. -->
<fieldset name="advanced">

<field
name="mode"
type="radio"
label="COM_WRAPPER_FIELD_MODE_LABEL"
description="COM_WRAPPER_FIELD_MODE_DESC"
class="btn-group"
default="legacy"
>
<option value="legacy">COM_WRAPPER_FIELD_VALUE_LEGACY</option>
<option value="html5">COM_WRAPPER_FIELD_VALUE_HTML5</option>
</field>

<field
name="height_auto"
type="radio"
Expand Down