diff --git a/administrator/language/en-GB/en-GB.com_wrapper.ini b/administrator/language/en-GB/en-GB.com_wrapper.ini index b223cbf68260d..fd5caeff2826d 100644 --- a/administrator/language/en-GB/en-GB.com_wrapper.ini +++ b/administrator/language/en-GB/en-GB.com_wrapper.ini @@ -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_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." 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!" diff --git a/components/com_wrapper/views/wrapper/tmpl/default.php b/components/com_wrapper/views/wrapper/tmpl/default.php index e6703af18a0d1..84a41b0728957 100644 --- a/components/com_wrapper/views/wrapper/tmpl/default.php +++ b/components/com_wrapper/views/wrapper/tmpl/default.php @@ -9,8 +9,30 @@ 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)); + +// Most current browsers don't support CSS rule "overflow" for scrollbars display +// of IFRAME tags but support HTML4 attribute "scrolling" in HTML5 context. +$scrollingFallback = $scrolling; + +if ($isHtml5) +{ + if ($scrolling !== 'auto') + { + $scrolling = $scrolling === 'no' ? 'hidden' : 'scroll'; + } + + $frameborder = !$frameborder ? 'none' : $frameborder . 'px solid #000'; +} ?>
params->get('show_page_heading')) : ?> @@ -28,10 +50,17 @@ id="blockrandom" name="iframe" src="escape($this->wrapper->url); ?>" - width="escape($this->params->get('width')); ?>" - height="escape($this->params->get('height')); ?>" - scrolling="escape($this->params->get('scrolling')); ?>" - frameborder="escape($this->params->get('frameborder', 1)); ?>" + scrolling="" + + style="width: ; + height: ; + overflow: ; + border: " + + width="" + height="" + frameborder="" + escape($this->params->get('page_heading'))) : ?> title="escape($this->params->get('page_heading')); ?>" diff --git a/components/com_wrapper/views/wrapper/tmpl/default.xml b/components/com_wrapper/views/wrapper/tmpl/default.xml index f0c1e350de42e..f11e8bd1aae58 100644 --- a/components/com_wrapper/views/wrapper/tmpl/default.xml +++ b/components/com_wrapper/views/wrapper/tmpl/default.xml @@ -63,6 +63,18 @@
+ + + + +