You've already forked joomla_test
first commit
This commit is contained in:
40
components/com_wrapper/controller.php
Normal file
40
components/com_wrapper/controller.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Content Component Controller
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_wrapper
|
||||
* @since 1.5
|
||||
*/
|
||||
class WrapperController extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Method to display a view.
|
||||
*
|
||||
* @param boolean If true, the view output will be cached
|
||||
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return JControllerLegacy This object to support chaining.
|
||||
* @since 1.5
|
||||
*/
|
||||
public function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
$cachable = true;
|
||||
|
||||
// Set the default view name and format from the Request.
|
||||
$vName = $this->input->get('view', 'wrapper');
|
||||
$this->input->set('view', $vName);
|
||||
|
||||
return parent::display($cachable, array('Itemid' => 'INT'));
|
||||
}
|
||||
}
|
1
components/com_wrapper/index.html
Normal file
1
components/com_wrapper/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
3
components/com_wrapper/metadata.xml
Normal file
3
components/com_wrapper/metadata.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
</metadata>
|
39
components/com_wrapper/router.php
Normal file
39
components/com_wrapper/router.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* @param array
|
||||
* @return array
|
||||
*/
|
||||
function WrapperBuildRoute(&$query)
|
||||
{
|
||||
$segments = array();
|
||||
|
||||
if (isset($query['view']))
|
||||
{
|
||||
unset($query['view']);
|
||||
}
|
||||
|
||||
return $segments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array
|
||||
* @return array
|
||||
*/
|
||||
function WrapperParseRoute($segments)
|
||||
{
|
||||
$vars = array();
|
||||
|
||||
$vars['view'] = 'wrapper';
|
||||
|
||||
return $vars;
|
||||
}
|
1
components/com_wrapper/views/index.html
Normal file
1
components/com_wrapper/views/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
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);
|
||||
}
|
||||
}
|
14
components/com_wrapper/wrapper.php
Normal file
14
components/com_wrapper/wrapper.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?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;
|
||||
|
||||
$controller = JControllerLegacy::getInstance('Wrapper');
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
$controller->redirect();
|
34
components/com_wrapper/wrapper.xml
Normal file
34
components/com_wrapper/wrapper.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.1" method="upgrade">
|
||||
<name>com_wrapper</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>April 2006</creationDate>
|
||||
<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>COM_WRAPPER_XML_DESCRIPTION</description>
|
||||
<files folder="site">
|
||||
<filename>controller.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>metadata.xml</filename>
|
||||
<filename>router.php</filename>
|
||||
<filename>wrapper.php</filename>
|
||||
<folder>views</folder>
|
||||
</files>
|
||||
<languages folder="site">
|
||||
<language tag="en-GB">language/en-GB.com_wrapper.ini</language>
|
||||
</languages>
|
||||
<administration>
|
||||
<files folder="admin">
|
||||
<filename>index.html</filename>
|
||||
</files>
|
||||
<languages folder="admin">
|
||||
<language tag="en-GB">language/en-GB.com_wrapper.ini</language>
|
||||
<language tag="en-GB">language/en-GB.com_wrapper.sys.ini</language>
|
||||
</languages>
|
||||
</administration>
|
||||
</extension>
|
Reference in New Issue
Block a user