CoreFiles by mySites.guru
helper.php71 lines, 1,486 bytes, from Joomla_3.7.0-Stable-Full_Package.zip
Raw History Compare with 3.6.5
md5
9bf4b27678a00f1d908183e358203abe
sha1
ee3b13c3cca0dd7bf463cc76e7bac959139acc4a
sha256
a3ff534672ef9e4da384b9d206e97c4cad11e81d9cad4cff354c3faaeaeada6f
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_wrapper
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Helper for mod_wrapper
 *
 * @package     Joomla.Site
 * @subpackage  mod_wrapper
 * @since       1.5
 */
class ModWrapperHelper
{
	/**
	 * Gets the parameters for the wrapper
	 *
	 * @param   mixed  &$params  The parameters set in the administrator section
	 *
	 * @return  mixed  &params  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://' . $_SERVER['HTTP_HOST'] . $url;
			}
			elseif (strpos($url, 'http') === false && strpos($url, 'https') === false)
			{
				$url = 'http://' . $url;
			}
		}

		// Auto height control
		if ($params->def('height_auto'))
		{
			$load = 'onload="iFrameHeight()"';
		}
		else
		{
			$load = '';
		}

		$params->set('load', $load);
		$params->set('url', $url);

		return $params;
	}
}

The same content is in 19 releases, Joomla 3.7.0-beta4 to 3.8.0-beta1. See them all, or every version of this file.