Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

alt_mod_frameset.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00050 require ('init.php');
00051 require ('template.php');
00052 
00053 
00054 
00055 
00063 class SC_alt_mod_frameset {
00064 
00065       // Internal, static:
00066    var $defaultWidth = 245;      // Default width of the navigation frame. Can be overridden from $TBE_STYLES['dims']['navFrameWidth'] (alternative default value) AND from User TSconfig
00067    var $resizable = TRUE;        // If true, the frame can be resized.
00068 
00069       // Internal, dynamic:
00070    var $content;              // Content accumulation.
00071 
00072       // GPvars:
00073    var $exScript='';          // Script to load in list frame.
00074    var $id='';                // ID of page
00075    var $fW='';                // Framewidth
00076 
00077 
00078 
00079 
00080 
00081 
00082 
00088    function main()   {
00089       global $BE_USER,$TBE_TEMPLATE,$TBE_STYLES;
00090 
00091          // GPvars:
00092       $this->exScript = t3lib_div::_GP('exScript');
00093       $this->id = t3lib_div::_GP('id');
00094       $this->fW = t3lib_div::_GP('fW');
00095 
00096          // Setting resizing flag:
00097       $this->resizable = $BE_USER->uc['navFrameResizable'] ? TRUE : FALSE;
00098 
00099          // Setting frame width:
00100       if (intval($this->fW) && $this->resizable)   {  // Framewidth from stored value, last one.
00101          $width = t3lib_div::intInRange($this->fW,100,1000)+10;   // +10 to compensate for width of scrollbar. However, width is always INSIDE scrollbars, so potentially it will jump a little forth/back...
00102       } else { // Framewidth from configuration;
00103          $width = $BE_USER->uc['navFrameWidth'];
00104          $width = intval($width)?intval($width):($TBE_STYLES['dims']['navFrameWidth'] ? intval($TBE_STYLES['dims']['navFrameWidth']) : $this->defaultWidth);
00105       }
00106 
00107          // Navigation frame URL:
00108       $script = t3lib_div::_GP('script');
00109       $nav = t3lib_div::_GP('nav');
00110       $URL_nav = htmlspecialchars($nav.'?currentSubScript='.rawurlencode($script));
00111 
00112          // List frame URL:
00113       $URL_list = htmlspecialchars($this->exScript?$this->exScript:($script.($this->id?'?id='.rawurlencode($this->id):'')));
00114 
00115          // Start page output
00116       $TBE_TEMPLATE->docType='xhtml_frames';
00117       $this->content = $TBE_TEMPLATE->startPage('Frameset');
00118 
00119          // THis onload handler is a bug-fix for a possible bug in Safari browser for Mac. Posted by Jack COLE. Should not influence other browsers negatively.
00120       $onLoadHandler = ' onload="if(top.content.nav_frame.location.href.length == 1) {top.content.nav_frame.location=\''.$URL_nav.'\';};"';
00121 
00122       if ($this->resizable)   {
00123          $this->content.= '
00124    <frameset cols="'.$width.',*"'.$onLoadHandler.'>
00125       <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" scrolling="auto" />
00126       <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" scrolling="auto" />
00127    </frameset>
00128 
00129 </html>
00130 ';
00131       } else {
00132          $this->content.= '
00133 
00134    <frameset cols="'.$width.',8,*" framespacing="0" frameborder="0" border="0"'.$onLoadHandler.'>
00135       <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
00136       <frame name="border_frame" src="border.html" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
00137       <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
00138    </frameset>
00139 
00140 </html>
00141 ';
00142       }
00143    }
00144 
00150    function printContent() {
00151       echo $this->content;
00152    }
00153 }
00154 
00155 // Include extension?
00156 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php']) {
00157    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php']);
00158 }
00159 
00160 
00161 
00162 
00163 
00164 
00165 
00166 
00167 
00168 
00169 
00170 // ******************************
00171 // Starting document output
00172 // ******************************
00173 
00174 // Make instance:
00175 $SOBE = t3lib_div::makeInstance('SC_alt_mod_frameset');
00176 $SOBE->main();
00177 $SOBE->printContent();
00178 ?>

Generated on Sun Oct 3 01:05:53 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913