Changed error message if browser is too old for running a TYPO3 backend
[Packages/TYPO3.CMS.git] / typo3 / alt_mod_frameset.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Creates the frameset for 'Frameset modules' like Web>* and File>*
29 *
30 * $Id$
31 * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
32 * XHTML compliant content (with exception of a few attributes for the <frameset> tags)
33 *
34 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
35 */
36 /**
37 * [CLASS/FUNCTION INDEX of SCRIPT]
38 *
39 *
40 *
41 * 63: class SC_alt_mod_frameset
42 * 88: function main()
43 * 150: function printContent()
44 *
45 * TOTAL FUNCTIONS: 2
46 * (This index is automatically created/updated by the extension "extdeveval")
47 *
48 */
49
50 require ('init.php');
51 require ('template.php');
52
53
54
55
56 /**
57 * Script Class for rendering the frameset which keeps the navigation and list frames together for socalled "Frameset modules"
58 *
59 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
60 * @package TYPO3
61 * @subpackage core
62 */
63 class SC_alt_mod_frameset {
64
65 // Internal, static:
66 var $defaultWidth = 245; // Default width of the navigation frame. Can be overridden from $TBE_STYLES['dims']['navFrameWidth'] (alternative default value) AND from User TSconfig
67 var $resizable = TRUE; // If true, the frame can be resized.
68
69 // Internal, dynamic:
70 var $content; // Content accumulation.
71
72 // GPvars:
73 var $exScript=''; // Script to load in list frame.
74 var $id=''; // ID of page
75 var $fW=''; // Framewidth
76
77
78
79
80
81
82
83 /**
84 * Creates the header and frameset for the module/submodules
85 *
86 * @return void
87 */
88 function main() {
89 global $BE_USER,$TBE_TEMPLATE,$TBE_STYLES;
90
91 // GPvars:
92 $this->exScript = t3lib_div::_GP('exScript');
93 $this->id = t3lib_div::_GP('id');
94 $this->fW = t3lib_div::_GP('fW');
95
96 // Setting resizing flag:
97 $this->resizable = $BE_USER->uc['navFrameResizable'] ? TRUE : FALSE;
98
99 // Setting frame width:
100 if (intval($this->fW) && $this->resizable) { // Framewidth from stored value, last one.
101 $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...
102 } else { // Framewidth from configuration;
103 $width = $BE_USER->uc['navFrameWidth'];
104 $width = intval($width)?intval($width):($TBE_STYLES['dims']['navFrameWidth'] ? intval($TBE_STYLES['dims']['navFrameWidth']) : $this->defaultWidth);
105 }
106
107 // Navigation frame URL:
108 $script = t3lib_div::_GP('script');
109 $nav = t3lib_div::_GP('nav');
110 $URL_nav = htmlspecialchars($nav.'?currentSubScript='.rawurlencode($script));
111
112 // List frame URL:
113 $URL_list = htmlspecialchars($this->exScript?$this->exScript:($script.($this->id?'?id='.rawurlencode($this->id):'')));
114
115 // Start page output
116 $TBE_TEMPLATE->docType='xhtml_frames';
117 $this->content = $TBE_TEMPLATE->startPage('Frameset');
118
119 // 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.
120 $onLoadHandler = ' onload="if(top.content.nav_frame.location.href.length == 1) {top.content.nav_frame.location=\''.$URL_nav.'\';};"';
121
122 if ($this->resizable) {
123 $this->content.= '
124 <frameset cols="'.$width.',*"'.$onLoadHandler.'>
125 <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" scrolling="auto" />
126 <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" scrolling="auto" />
127 </frameset>
128
129 </html>
130 ';
131 } else {
132 $this->content.= '
133
134 <frameset cols="'.$width.',8,*" framespacing="0" frameborder="0" border="0"'.$onLoadHandler.'>
135 <frame name="nav_frame" src="'.$URL_nav.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
136 <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" />
137 <frame name="list_frame" src="'.$URL_list.'" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
138 </frameset>
139
140 </html>
141 ';
142 }
143 }
144
145 /**
146 * Outputting the accumulated content to screen
147 *
148 * @return void
149 */
150 function printContent() {
151 echo $this->content;
152 }
153 }
154
155 // Include extension?
156 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php']) {
157 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_mod_frameset.php']);
158 }
159
160
161
162
163
164
165
166
167
168
169
170 // ******************************
171 // Starting document output
172 // ******************************
173
174 // Make instance:
175 $SOBE = t3lib_div::makeInstance('SC_alt_mod_frameset');
176 $SOBE->main();
177 $SOBE->printContent();
178 ?>