alt_mod_frameset.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2008 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 ***************************************************************/
00027 /**
00028  * Creates the frameset for 'Frameset modules' like Web>* and File>*
00029  *
00030  * $Id: alt_mod_frameset.php 4570 2008-12-18 18:37:14Z steffenk $
00031  * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
00032  * XHTML compliant content (with exception of a few attributes for the <frameset> tags)
00033  *
00034  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00035  */
00036 /**
00037  * [CLASS/FUNCTION INDEX of SCRIPT]
00038  *
00039  *
00040  *
00041  *   63: class SC_alt_mod_frameset
00042  *   88:     function main()
00043  *  150:     function printContent()
00044  *
00045  * TOTAL FUNCTIONS: 2
00046  * (This index is automatically created/updated by the extension "extdeveval")
00047  *
00048  */
00049 
00050 require ('init.php');
00051 require ('template.php');
00052 
00053 
00054 /**
00055  * Script Class for rendering the frameset which keeps the navigation and list frames together for socalled "Frameset modules"
00056  *
00057  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00058  * @package TYPO3
00059  * @subpackage core
00060  */
00061 class SC_alt_mod_frameset {
00062 
00063         // Internal, static:
00064     var $defaultWidth = 245;        // Default width of the navigation frame. Can be overridden from $TBE_STYLES['dims']['navFrameWidth'] (alternative default value) AND from User TSconfig
00065     var $resizable = TRUE;          // If true, the frame can be resized.
00066 
00067         // Internal, dynamic:
00068     var $content;                   // Content accumulation.
00069 
00070         // GPvars:
00071     var $exScript='';               // Script to load in list frame.
00072     var $id='';                     // ID of page
00073     var $fW='';                     // Framewidth
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081     /**
00082      * Creates the header and frameset for the module/submodules
00083      *
00084      * @return  void
00085      */
00086     function main() {
00087         global $BE_USER,$TBE_TEMPLATE,$TBE_STYLES;
00088 
00089             // GPvars:
00090         $this->exScript = t3lib_div::_GP('exScript');
00091         $this->id = t3lib_div::_GP('id');
00092         $this->fW = t3lib_div::_GP('fW');
00093 
00094             // Setting resizing flag:
00095         $this->resizable = $BE_USER->uc['navFrameResizable'] ? TRUE : FALSE;
00096 
00097             // Setting frame width:
00098         if (intval($this->fW) && $this->resizable)  {   // Framewidth from stored value, last one.
00099             $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...
00100         } else {    //  Framewidth from configuration;
00101             $width = $BE_USER->uc['navFrameWidth'];
00102             $width = intval($width)?intval($width):($TBE_STYLES['dims']['navFrameWidth'] ? intval($TBE_STYLES['dims']['navFrameWidth']) : $this->defaultWidth);
00103         }
00104 
00105             // Navigation frame URL:
00106         $script = t3lib_div::_GP('script');
00107         $nav = t3lib_div::_GP('nav');
00108         $URL_nav = htmlspecialchars($nav.'&currentSubScript='.rawurlencode($script));
00109 
00110             // List frame URL:
00111         $URL_list = htmlspecialchars($this->exScript ? $this->exScript : ($script . ($this->id ? (strpos($script, '?') ? '&' : '?' ) . 'id=' . rawurlencode($this->id) : '')));
00112             
00113             // Start page output
00114         $TBE_TEMPLATE->docType='xhtml_frames';
00115         $this->content = $TBE_TEMPLATE->startPage('Frameset');
00116 
00117             // 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.
00118         $onLoadHandler = ' onload="if(top.content.nav_frame.location.href.length == 1) {top.content.nav_frame.location=\''.$URL_nav.'\';};"';
00119 
00120         if ($this->resizable)   {
00121             $this->content.= '
00122     <frameset id="typo3-content-frameset" cols="'.$width.',*"'.$onLoadHandler.'>
00123         <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" scrolling="auto" />
00124         <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" scrolling="auto" />
00125     </frameset>
00126 
00127 </html>
00128 ';
00129         } else {
00130             $this->content.= '
00131 
00132     <frameset id="typo3-content-frameset" cols="'.$width.',8,*" framespacing="0" frameborder="0" border="0"'.$onLoadHandler.'>
00133         <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
00134         <frame name="border_frame" src="'.(isset($GLOBALS['TBE_STYLES']['border']) ? $GLOBALS['TBE_STYLES']['border'] : 'border.html').'" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
00135         <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
00136     </frameset>
00137 
00138 </html>
00139 ';
00140         }
00141     }
00142 
00143     /**
00144      * Outputting the accumulated content to screen
00145      *
00146      * @return  void
00147      */
00148     function printContent() {
00149         echo $this->content;
00150     }
00151 }
00152 
00153 
00154 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php'])  {
00155     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php']);
00156 }
00157 
00158 
00159 
00160 // ******************************
00161 // Starting document output
00162 // ******************************
00163 
00164 // Make instance:
00165 $SOBE = t3lib_div::makeInstance('SC_alt_mod_frameset');
00166 $SOBE->main();
00167 $SOBE->printContent();
00168 
00169 ?>

Generated on Sat Jan 3 04:23:28 2009 for TYPO3 API by  doxygen 1.4.7