Source for file helper.php

Documentation is available at helper.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Site
  4.  * @subpackage  mod_wrapper
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Helper for mod_wrapper
  14.  *
  15.  * @package     Joomla.Site
  16.  * @subpackage  mod_wrapper
  17.  * @since       1.5
  18.  */
  19. {
  20.     /**
  21.      * Gets the parameters for the wrapper
  22.      *
  23.      * @param   mixed  &$params  The parameters set in the administrator section
  24.      *
  25.      * @return  mixed  &params  The modified parameters
  26.      *
  27.      * @since   1.5
  28.      */
  29.     public static function getParams(&$params)
  30.     {
  31.         $params->def('url''');
  32.         $params->def('scrolling''auto');
  33.         $params->def('height''200');
  34.         $params->def('height_auto''0');
  35.         $params->def('width''100%');
  36.         $params->def('add''1');
  37.         $params->def('name''wrapper');
  38.  
  39.         $url $params->get('url');
  40.  
  41.         if ($params->get('add'))
  42.         {
  43.             // Adds 'http://' if none is set
  44.             if (substr($url01== '/')
  45.             {
  46.                 // Relative url in component. use server http_host.
  47.                 $url 'http://' $_SERVER['HTTP_HOST'$url;
  48.             }
  49.             elseif (!strstr($url'http'&& !strstr($url'https'))
  50.             {
  51.                 $url 'http://' $url;
  52.             }
  53.             else
  54.             {
  55.                 $url $url;
  56.             }
  57.         }
  58.  
  59.         // Auto height control
  60.         if ($params->def('height_auto'))
  61.         {
  62.             $load 'onload="iFrameHeight()"';
  63.         }
  64.         else
  65.         {
  66.             $load '';
  67.         }
  68.  
  69.         $params->set('load'$load);
  70.         $params->set('url'$url);
  71.  
  72.         return $params;
  73.     }
  74. }

Documentation generated on Tue, 19 Nov 2013 15:04:22 +0100 by phpDocumentor 1.4.3