[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/modules/ -> mod_wrapper.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @author Mambo Foundation Inc see README.php
   5  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   6  * See COPYRIGHT.php for copyright notices and details.
   7  * @license GNU/GPL Version 2, see LICENSE.php
   8  *
   9  * Redistributions of files must retain the above copyright notice.
  10  *
  11  * Mambo is free software; you can redistribute it and/or
  12  * modify it under the terms of the GNU General Public License
  13  * as published by the Free Software Foundation; version 2 of the License.
  14  */
  15  
  16  /** ensure this file is being included by a parent file */
  17  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  18  
  19  global $_CONFIG, $_LANG;
  20  
  21  $params->def( 'url', 'http://www.mambo-foundation.org' );
  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  
  28  $url = $params->get( 'url' );
  29  if ( $params->get( 'add' ) ) {
  30      // adds "http://" if none is set
  31      if ( !strstr( $url, 'http' ) && !strstr( $url, 'https' ) ) {
  32          $url = 'http://'. $url;
  33      }
  34  }
  35  
  36  // auto height control
  37  if ( $params->get( 'height_auto' ) ) {
  38      $load = "window.onload = iFrameHeight;\n";
  39  } else {
  40      $load = '';
  41  }
  42  
  43  ?>
  44  <script type="text/javascript">
  45  <?php echo $load; ?>
  46  function iFrameHeight() {
  47      var h = 0;
  48      if ( !document.all ) {
  49          h = document.getElementById('blockrandom').contentDocument.height;
  50          document.getElementById('blockrandom').style.height = h + 60 + 'px';
  51      } else if( document.all ) {
  52          h = document.frames('blockrandom').document.body.scrollHeight;
  53          document.all.blockrandom.style.height = h + 20 + 'px';
  54      }
  55  }
  56  </script>
  57  <iframe   
  58  id="blockrandom"
  59  src="<?php echo $url; ?>" 
  60  width="<?php echo $params->get( 'width' ); ?>" 
  61  height="<?php echo $params->get( 'height' ); ?>" 
  62  scrolling="<?php echo $params->get( 'scrolling' ); ?>" 
  63  align="top"
  64  frameborder="0"
  65  class="wrapper<?php echo $params->get( 'pageclass_sfx' ); ?>">
  66  </iframe>