Source for file mod_wrapper.php

Documentation is available at mod_wrapper.php

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

Documentation generated on Mon, 05 May 2008 16:21:24 +0400 by phpDocumentor 1.4.0