alt_mod_frameset.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2010 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 8156 2010-07-11 12:42:05Z psychomieze $
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::sanitizeLocalUrl(t3lib_div::_GP('exScript'));
00091         $this->id = intval(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::sanitizeLocalUrl(t3lib_div::_GP('script'));
00107         $nav = t3lib_div::sanitizeLocalUrl(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         if ($this->resizable)   {
00118             $this->content.= '
00119     <frameset id="typo3-content-frameset" cols="'.$width.',*">
00120         <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" scrolling="auto" />
00121         <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" scrolling="auto" />
00122     </frameset>
00123 
00124 </html>
00125 ';
00126         } else {
00127             $this->content.= '
00128 
00129     <frameset id="typo3-content-frameset" cols="'.$width.',8,*" framespacing="0" frameborder="0" border="0">
00130         <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
00131         <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" />
00132         <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
00133     </frameset>
00134 
00135 </html>
00136 ';
00137         }
00138     }
00139 
00140     /**
00141      * Outputting the accumulated content to screen
00142      *
00143      * @return  void
00144      */
00145     function printContent() {
00146         echo $this->content;
00147     }
00148 }
00149 
00150 
00151 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php'])  {
00152     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php']);
00153 }
00154 
00155 
00156 
00157 // ******************************
00158 // Starting document output
00159 // ******************************
00160 
00161 // Make instance:
00162 $SOBE = t3lib_div::makeInstance('SC_alt_mod_frameset');
00163 $SOBE->main();
00164 $SOBE->printContent();
00165 
00166 ?>

Generated on Sat Jul 24 04:17:28 2010 for TYPO3 API by  doxygen 1.4.7