[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/modules/mod_wrapper/ -> helper.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: helper.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla
   5  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   6  * @license        GNU/GPL, see LICENSE.php
   7  * Joomla! is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.php for copyright notices and details.
  12  */
  13  
  14  // no direct access
  15  defined('_JEXEC') or die('Restricted access');
  16  
  17  class modWrapperHelper
  18  {
  19  	function getParams(&$params)
  20      {
  21          $params->def('url', '');
  22          $params->def('scrolling', 'auto');
  23          $params->def('height', '200');
  24          $params->def('height_auto', '0');
  25          $params->def('width', '100%');
  26          $params->def('add', '1');
  27          $params->def('name', 'wrapper');
  28  
  29          $url = $params->get('url');
  30  
  31          if ($params->get('add'))
  32          {
  33              // adds 'http://' if none is set
  34              if (substr($url, 0, 1) == '/') {
  35                  // relative url in component. use server http_host.
  36                  $url = 'http://'.$_SERVER['HTTP_HOST'].$url;
  37              }
  38              elseif (!strstr($url, 'http') && !strstr($url, 'https')) {
  39                  $url = 'http://'.$url;
  40              }
  41              else {
  42                  $url = $url;
  43              }
  44          }
  45  
  46          // auto height control
  47          if ($params->def('height_auto')) {
  48              $load = 'onload="iFrameHeight()"';
  49          }
  50          else {
  51              $load = '';
  52          }
  53  
  54          $params->set( 'load', $load );
  55          $params->set( 'url', $url );
  56  
  57          return $params;
  58      }
  59  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1