- md5
- 8c8415ad0951dfba4f9cd30923cbb55d
- sha1
- a121ccac121bd59a97c0f3b2793cac1363905482
- sha256
- 48677152be8623fec2c536733a36117f33af58b629d743b553da086776354722
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
<?php
/**
* @package Joomla.Site
* @subpackage mod_wrapper
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\Wrapper\Site\Helper;
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
/**
* Helper for mod_wrapper
*
* @since 1.5
*/
class WrapperHelper
{
/**
* Gets the parameters for the wrapper
*
* @param mixed &$params The parameters set in the administrator section
*
* @return mixed ¶ms The modified parameters
*
* @since 1.5
*/
public static function getParams(&$params)
{
$params->def('url', '');
$params->def('scrolling', 'auto');
$params->def('height', '200');
$params->def('height_auto', 0);
$params->def('width', '100%');
$params->def('add', 1);
$params->def('name', 'wrapper');
$url = $params->get('url');
if ($params->get('add'))
{
// Adds 'http://' if none is set
if (strpos($url, '/') === 0)
{
// Relative URL in component. use server http_host.
$url = 'http://' . Factory::getApplication()->input->server->get('HTTP_HOST') . $url;
}
elseif (strpos($url, 'http') === false && strpos($url, 'https') === false)
{
$url = 'http://' . $url;
}
}
$load = '';
// Auto height control
if ($params->def('height_auto'))
{
$load = 'onload="iFrameHeight(this)"';
}
$params->set('load', $load);
$params->set('url', $url);
return $params;
}
}
The same content is in 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.