You've already forked joomla_test
first commit
This commit is contained in:
1
components/com_wrapper/views/wrapper/index.html
Normal file
1
components/com_wrapper/views/wrapper/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
6
components/com_wrapper/views/wrapper/metadata.xml
Normal file
6
components/com_wrapper/views/wrapper/metadata.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<view title="COM_WRAPPER">
|
||||
<message><![CDATA[COM_WRAPPER_XML_DESCRIPTION]]></message>
|
||||
</view>
|
||||
</metadata>
|
48
components/com_wrapper/views/wrapper/tmpl/default.php
Normal file
48
components/com_wrapper/views/wrapper/tmpl/default.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_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>
|
||||
<div class="contentpane<?php echo $this->pageclass_sfx; ?>">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<h1>
|
||||
<?php if ($this->escape($this->params->get('page_heading'))) :?>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
<?php else : ?>
|
||||
<?php echo $this->escape($this->params->get('page_title')); ?>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
<iframe <?php echo $this->wrapper->load; ?>
|
||||
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)); ?>"
|
||||
class="wrapper<?php echo $this->pageclass_sfx; ?>">
|
||||
<?php echo JText::_('COM_WRAPPER_NO_IFRAMES'); ?>
|
||||
</iframe>
|
||||
</div>
|
91
components/com_wrapper/views/wrapper/tmpl/default.xml
Normal file
91
components/com_wrapper/views/wrapper/tmpl/default.xml
Normal file
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_WRAPPER_WRAPPER_VIEW_DEFAULT_TITLE" option="COM_WRAPPER_WRAPPER_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key="JHELP_MENUS_MENU_ITEM_WRAPPER"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_WRAPPER_WRAPPER_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
<fields name="params">
|
||||
<fieldset name="request" label="COM_MENUS_BASIC_FIELDSET_LABEL">
|
||||
|
||||
<field name="url" type="text"
|
||||
description="COM_WRAPPER_FIELD_URL_DESC"
|
||||
label="COM_WRAPPER_FIELD_URL_LABEL"
|
||||
size="30"
|
||||
required="true"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
|
||||
<!-- Scroll. -->
|
||||
<fieldset name="basic" label="COM_WRAPPER_FIELD_LABEL_SCROLLBARSPARAMS">
|
||||
|
||||
<field name="scrolling" type="list"
|
||||
default="auto"
|
||||
description="COM_WRAPPER_FIELD_SCROLLBARS_DESC"
|
||||
label="COM_WRAPPER_FIELD_SCROLLBARS_LABEL"
|
||||
>
|
||||
<option value="no">JNO</option>
|
||||
<option value="yes">JYES</option>
|
||||
<option value="auto">COM_WRAPPER_FIELD_VALUE_AUTO</option>
|
||||
</field>
|
||||
|
||||
<field name="width" type="text"
|
||||
default="100%"
|
||||
description="COM_WRAPPER_FIELD_WIDTH_DESC"
|
||||
label="JGLOBAL_WIDTH"
|
||||
size="5"
|
||||
/>
|
||||
|
||||
<field name="height" type="text"
|
||||
default="500"
|
||||
description="COM_WRAPPER_FIELD_HEIGHT_DESC"
|
||||
label="COM_WRAPPER_FIELD_HEIGHT_LABEL"
|
||||
size="5"
|
||||
/>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<!-- Advanced options. -->
|
||||
<fieldset name="advanced">
|
||||
|
||||
<field name="height_auto" type="radio"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
description="COM_WRAPPER_FIELD_HEIGHTAUTO_DESC"
|
||||
label="COM_WRAPPER_FIELD_HEIGHTAUTO_LABEL"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="add_scheme"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="1"
|
||||
description="COM_WRAPPER_FIELD_ADD_DESC"
|
||||
label="COM_WRAPPER_FIELD_ADD_LABEL"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="frameborder"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="1"
|
||||
label="COM_WRAPPER_FIELD_FRAME_LABEL"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
1
components/com_wrapper/views/wrapper/tmpl/index.html
Normal file
1
components/com_wrapper/views/wrapper/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
101
components/com_wrapper/views/wrapper/view.html.php
Normal file
101
components/com_wrapper/views/wrapper/view.html.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_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;
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_wrapper
|
||||
* @since 1.5
|
||||
*/
|
||||
class WrapperViewWrapper extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* @since 1.5
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
$params = $app->getParams();
|
||||
|
||||
// because the application sets a default page title, we need to get it
|
||||
// right from the menu item itself
|
||||
$title = $params->get('page_title', '');
|
||||
if (empty($title))
|
||||
{
|
||||
$title = $app->getCfg('sitename');
|
||||
}
|
||||
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
|
||||
{
|
||||
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
|
||||
}
|
||||
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
|
||||
{
|
||||
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
|
||||
}
|
||||
$this->document->setTitle($title);
|
||||
|
||||
if ($params->get('menu-meta_description'))
|
||||
{
|
||||
$this->document->setDescription($params->get('menu-meta_description'));
|
||||
}
|
||||
|
||||
if ($params->get('menu-meta_keywords'))
|
||||
{
|
||||
$this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
|
||||
}
|
||||
|
||||
if ($params->get('robots'))
|
||||
{
|
||||
$this->document->setMetadata('robots', $params->get('robots'));
|
||||
}
|
||||
|
||||
$wrapper = new stdClass;
|
||||
// auto height control
|
||||
if ($params->def('height_auto'))
|
||||
{
|
||||
$wrapper->load = 'onload="iFrameHeight()"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$wrapper->load = '';
|
||||
}
|
||||
|
||||
$url = $params->def('url', '');
|
||||
if ($params->def('add_scheme', 1))
|
||||
{
|
||||
// adds 'http://' if none is set
|
||||
if (substr($url, 0, 1) == '/')
|
||||
{
|
||||
// relative url in component. use server http_host.
|
||||
$wrapper->url = 'http://'. $_SERVER['HTTP_HOST'] . $url;
|
||||
}
|
||||
elseif (!strstr($url, 'http') && !strstr($url, 'https'))
|
||||
{
|
||||
$wrapper->url = 'http://'. $url;
|
||||
}
|
||||
else {
|
||||
$wrapper->url = $url;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$wrapper->url = $url;
|
||||
}
|
||||
|
||||
//Escape strings for HTML output
|
||||
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
|
||||
|
||||
$this->params = &$params;
|
||||
$this->wrapper = &$wrapper;
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user