git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1771 709f56b5-9817-0410-a4d7...
[Packages/TYPO3.CMS.git] / typo3 / alt_main_new.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 * Main frameset of the TYPO3 backend
29 * Sending the GET var "alt_main.php?edit=[page id]" will load the page id in the editing module configured.
30 *
31 * $Id: alt_main.php 1421 2006-04-10 09:27:15Z mundaun $
32 * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
33 * XHTML Compliant (almost)
34 *
35 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
36 */
37 /**
38 * [CLASS/FUNCTION INDEX of SCRIPT]
39 *
40 *
41 *
42 * 72: class SC_alt_main
43 * 91: function init()
44 * 113: function generateJScode()
45 * 386: function editPageHandling()
46 * 437: function startModule()
47 * 459: function main()
48 * 533: function printContent()
49 *
50 * TOTAL FUNCTIONS: 6
51 * (This index is automatically created/updated by the extension "extdeveval")
52 *
53 */
54
55 require ('init.php');
56 require ('template.php');
57 require_once (PATH_t3lib.'class.t3lib_loadmodules.php');
58 require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
59 require_once ('class.alt_menu_functions.inc');
60 $LANG->includeLLFile('EXT:lang/locallang_misc.xml');
61
62
63
64
65 /**
66 * Script Class for rendering of the main frameset for the TYPO3 backend.
67 *
68 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
69 * @package TYPO3
70 * @subpackage core
71 */
72 class SC_alt_main {
73
74 // Internal, dynamic:
75 var $content;
76 var $mainJScode;
77 var $loadModules; // Load modules-object
78 var $alt_menuObj; // Menu functions object.
79
80 // Internal, static:
81 var $leftMenuFrameW = 130;
82 var $selMenuFrame = 130;
83 var $topFrameH = 32;
84 var $shortcutFrameH = 30;
85
86
87 var $topMenu = 21;
88 var $topIcons = 40;
89
90 /**
91 * Initialization of the script class
92 *
93 * @return void
94 */
95 function init() {
96 global $TBE_MODULES,$TBE_STYLES;
97
98 // Initializes the backend modules structure for use later.
99 $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
100 $this->loadModules->load($TBE_MODULES);
101
102 // Instantiates thee menu object which will generate some JavaScript for the goToModule() JS function in this frameset.
103 $this->alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
104
105 // Check for distances defined in the styles array:
106 if ($TBE_STYLES['dims']['leftMenuFrameW']) $this->leftMenuFrameW = $TBE_STYLES['dims']['leftMenuFrameW'];
107 if ($TBE_STYLES['dims']['topFrameH']) $this->topFrameH = $TBE_STYLES['dims']['topFrameH'];
108 if ($TBE_STYLES['dims']['shortcutFrameH']) $this->shortcutFrameH = $TBE_STYLES['dims']['shortcutFrameH'];
109 if ($TBE_STYLES['dims']['selMenuFrame']) $this->selMenuFrame = $TBE_STYLES['dims']['selMenuFrame'];
110 }
111
112 /**
113 * Generates the JavaScript code for the frameset.
114 *
115 * @return void
116 */
117 function generateJScode() {
118 global $BE_USER,$LANG;
119
120 $pt3 = t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')).'/';
121 $goToModule_switch = $this->alt_menuObj->topMenu($this->loadModules->modules,0,"",4);
122 $fsMod = implode(chr(10),$this->alt_menuObj->fsMod);
123
124 // If another page module was specified, replace the default Page module with the new one
125 $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
126 $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
127
128 $this->mainJScode='
129
130 /**
131 * "Content" Iframe resize function
132 */
133 function resize_Iframe() {
134 var container = document.getElementById("content");
135 var menuHeight = '.(is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['icons']) ? $this->topIcons+$this->topMenu : $this->topMenu).'; //taille du menu (a définir dynamiquement)
136 container.style.height = (document.body.clientHeight-menuHeight)+"px";
137 }
138 window.onload = resize_Iframe;
139 window.onresize = resize_Iframe;
140
141 /**
142 * Function similar to PHPs rawurlencode();
143 */
144 function rawurlencode(str) { //
145 var output = escape(str);
146 output = str_replace("*","%2A", output);
147 output = str_replace("+","%2B", output);
148 output = str_replace("/","%2F", output);
149 output = str_replace("@","%40", output);
150 return output;
151 }
152
153 /**
154 * String-replace function
155 */
156 function str_replace(match,replace,string) { //
157 var input = ""+string;
158 var matchStr = ""+match;
159 if (!matchStr) {return string;}
160 var output = "";
161 var pointer=0;
162 var pos = input.indexOf(matchStr);
163 while (pos!=-1) {
164 output+=""+input.substr(pointer, pos-pointer)+replace;
165 pointer=pos+matchStr.length;
166 pos = input.indexOf(match,pos+1);
167 }
168 output+=""+input.substr(pointer);
169 return output;
170 }
171
172 /**
173 * TypoSetup object.
174 */
175 function typoSetup() { //
176 this.PATH_typo3 = "'.$pt3.'";
177 this.PATH_typo3_enc = "'.rawurlencode($pt3).'";
178 this.username = "'.$BE_USER->user['username'].'";
179 this.uniqueID = "'.t3lib_div::shortMD5(uniqid('')).'";
180 this.navFrameWidth = 0;
181 }
182 var TS = new typoSetup();
183
184 /**
185 * Functions for session-expiry detection:
186 */
187 function busy() { //
188 this.loginRefreshed = busy_loginRefreshed;
189 this.checkLoginTimeout = busy_checkLoginTimeout;
190 this.openRefreshWindow = busy_OpenRefreshWindow;
191 this.busyloadTime=0;
192 this.openRefreshW=0;
193 this.reloginCancelled=0;
194 }
195 function busy_loginRefreshed() { //
196 var date = new Date();
197 this.busyloadTime = Math.floor(date.getTime()/1000);
198 this.openRefreshW=0;
199 }
200 function busy_checkLoginTimeout() { //
201 var date = new Date();
202 var theTime = Math.floor(date.getTime()/1000);
203 if (theTime > this.busyloadTime+'.intval($BE_USER->auth_timeout_field).'-30) {
204 return true;
205 }
206 }
207 function busy_OpenRefreshWindow() { //
208 vHWin=window.open("login_frameset.php","relogin_"+TS.uniqueID,"height=350,width=700,status=0,menubar=0,location=1");
209 vHWin.focus();
210 this.openRefreshW=1;
211 }
212 function busy_checkLoginTimeout_timer() { //
213 if (busy.checkLoginTimeout() && !busy.reloginCancelled && !busy.openRefreshW) {
214 if (confirm('.$GLOBALS['LANG']->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.refresh_login')).')) {
215 busy.openRefreshWindow();
216 } else {
217 busy.reloginCancelled = 1;
218 }
219 }
220 window.setTimeout("busy_checkLoginTimeout_timer();",2*1000); // Each 2nd second is enough for checking. The popup will be triggered 10 seconds before the login expires (see above, busy_checkLoginTimeout())
221
222 // Detecting the frameset module navigation frame widths (do this AFTER setting new timeout so that any errors in the code below does not prevent another time to be set!)
223 if (top && top.content && top.content.nav_frame && top.content.nav_frame.document && top.content.nav_frame.document.body) {
224 TS.navFrameWidth = (top.content.nav_frame.document.documentElement && top.content.nav_frame.document.documentElement.clientWidth) ? top.content.nav_frame.document.documentElement.clientWidth : top.content.nav_frame.document.body.clientWidth;
225 }
226 }
227
228 /**
229 * Launcing information window for records/files (fileref as "table" argument)
230 */
231 function launchView(table,uid,bP) { //
232 var backPath= bP ? bP : "";
233 var thePreviewWindow="";
234 thePreviewWindow = window.open(TS.PATH_typo3+"show_item.php?table="+escape(table)+"&uid="+escape(uid),"ShowItem"+TS.uniqueID,"height=300,width=550,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
235 if (thePreviewWindow && thePreviewWindow.focus) {
236 thePreviewWindow.focus();
237 }
238 }
239
240 /**
241 * Opens plain window with url
242 */
243 function openUrlInWindow(url,windowName) { //
244 regularWindow = window.open(url,windowName,"status=1,menubar=1,resizable=1,location=1,directories=0,scrollbars=1,toolbar=1");
245 regularWindow.focus();
246 return false;
247 }
248
249 /**
250 * Loads a URL in the topmenuFrame
251 */
252 function loadTopMenu(url) { //
253 top.topmenuFrame.location = url;
254 }
255
256 /**
257 * Loads a page id for editing in the page edit module:
258 */
259 function loadEditId(id,addGetVars) { //
260 top.fsMod.recentIds["web"]=id;
261 top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_0"; // For highlighting
262
263 if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
264 top.content.nav_frame.refresh_nav();
265 }
266
267 top.goToModule("'.$pageModule.'", 0, addGetVars?addGetVars:"");
268 }
269
270 /**
271 * Returns incoming URL (to a module) unless nextLoadModuleUrl is set. If that is the case nextLoadModuleUrl is returned (and cleared)
272 * Used by the shortcut frame to set a "intermediate URL"
273 */
274 var nextLoadModuleUrl="";
275 function getModuleUrl(inUrl) { //
276 var nMU;
277 if (top.nextLoadModuleUrl) {
278 nMU=top.nextLoadModuleUrl;
279 top.nextLoadModuleUrl="";
280 return nMU;
281 } else {
282 return inUrl;
283 }
284 }
285
286 /**
287 * Print properties of an object
288 */
289 function debugObj(obj,name,printEach) { //
290 var acc;
291 for (i in obj) {
292 if (obj[i]) {
293 if (printEach) {
294 alert(i+": "+obj[i]);
295 } else {
296 acc+=i+": "+obj[i]+"\n";
297 }
298 }
299 }
300 if (!printEach) alert("Object: "+name+"\n\n"+acc);
301 }
302
303 /**
304 * Initialize login expiration warning object
305 */
306 var busy = new busy();
307 busy.loginRefreshed();
308 busy_checkLoginTimeout_timer();
309
310
311 /**
312 * Highlight module:
313 */
314 var currentlyHighLightedId = "";
315 var currentlyHighLighted_restoreValue = "";
316 var currentlyHighLightedMain = "";
317 function highlightModuleMenuItem(trId, mainModule) { //
318 currentlyHighLightedMain = mainModule;
319 // Get document object:
320 if (top.menu && top.menu.document) {
321 var docObj = top.menu.document;
322 var HLclass = mainModule ? "c-mainitem-HL" : "c-subitem-row-HL";
323 } else if (top.topmenuFrame && top.topmenuFrame.document) {
324 var docObj = top.topmenuFrame.document;
325 var HLclass = mainModule ? "c-mainitem-HL" : "c-subitem-HL";
326 }
327
328 if (docObj) {
329 // Reset old:
330 if (currentlyHighLightedId && docObj.getElementById(currentlyHighLightedId)) {
331 docObj.getElementById(currentlyHighLightedId).attributes.getNamedItem("class").nodeValue = currentlyHighLighted_restoreValue;
332 }
333 // Set new:
334 currentlyHighLightedId = trId;
335 if (currentlyHighLightedId && docObj.getElementById(currentlyHighLightedId)) {
336 var classAttribObject = docObj.getElementById(currentlyHighLightedId).attributes.getNamedItem("class");
337 currentlyHighLighted_restoreValue = classAttribObject.nodeValue;
338 classAttribObject.nodeValue = HLclass;
339 }
340 }
341 }
342
343 /**
344 * Function restoring previous selection in left menu after clearing cache
345 */
346 function restoreHighlightedModuleMenuItem() { //
347 if (currentlyHighLightedId) {
348 highlightModuleMenuItem(currentlyHighLightedId,currentlyHighLightedMain);
349 }
350 }
351
352 /**
353 * Function used to switch switch module.
354 */
355 var currentModuleLoaded = "";
356 function goToModule(modName,cMR_flag,addGetVars) { //
357 var additionalGetVariables = "";
358 if (addGetVars) additionalGetVariables = addGetVars;
359
360 var cMR = 0;
361 if (cMR_flag) cMR = 1;
362
363 currentModuleLoaded = modName;
364
365 switch(modName) {'.$goToModule_switch.'
366 }
367 }
368
369 /**
370 * Frameset Module object
371 *
372 * Used in main modules with a frameset for submodules to keep the ID between modules
373 * Typically that is set by something like this in a Web>* sub module:
374 * if (top.fsMod) top.fsMod.recentIds["web"] = "\'.intval($this->id).\'";
375 * if (top.fsMod) top.fsMod.recentIds["file"] = "...(file reference/string)...";
376 */
377 function fsModules() { //
378 this.recentIds=new Array(); // used by frameset modules to track the most recent used id for list frame.
379 this.navFrameHighlightedID=new Array(); // used by navigation frames to track which row id was highlighted last time
380 this.currentMainLoaded="";
381 this.currentBank="0";
382 }
383 var fsMod = new fsModules();
384 '.$fsMod.'
385
386 // Used by Frameset Modules
387 var condensedMode = '.($BE_USER->uc['condensedMode']?1:0).';
388 var currentSubScript = "";
389 var currentSubNavScript = "";
390
391 // Used for tab-panels:
392 var DTM_currentTabs = new Array();
393 ';
394
395 // Check editing of page:
396 $this->editPageHandling();
397 $this->startModule();
398 }
399
400 /**
401 * Checking if the "&edit" variable was sent so we can open for editing the page.
402 * Code based on code from "alt_shortcut.php"
403 *
404 * @return void
405 */
406 function editPageHandling() {
407 global $BE_USER;
408
409 if (!t3lib_extMgm::isLoaded('cms')) return;
410
411 // EDIT page:
412 $editId = preg_replace('/[^[:alnum:]_]/','',t3lib_div::_GET('edit'));
413 $theEditRec = '';
414
415 if ($editId) {
416
417 // Looking up the page to edit, checking permissions:
418 $where = ' AND ('.$BE_USER->getPagePermsClause(2).' OR '.$BE_USER->getPagePermsClause(16).')';
419 if (t3lib_div::testInt($editId)) {
420 $theEditRec = t3lib_BEfunc::getRecordWSOL('pages',$editId,'*',$where);
421 } else {
422 $records = t3lib_BEfunc::getRecordsByField('pages','alias',$editId,$where);
423 if (is_array($records)) {
424 reset($records);
425 $theEditRec = current($records);
426 t3lib_BEfunc::workspaceOL('pages', $theEditRec);
427 }
428 }
429
430 // If the page was accessible, then let the user edit it.
431 if (is_array($theEditRec) && $BE_USER->isInWebMount($theEditRec['uid'])) {
432 // Setting JS code to open editing:
433 $this->mainJScode.='
434 // Load page to edit:
435 window.setTimeout("top.loadEditId('.intval($theEditRec['uid']).');",500);
436 ';
437 // Checking page edit parameter:
438 if(!$BE_USER->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree')) {
439
440 // Expanding page tree:
441 t3lib_BEfunc::openPageTree(intval($theEditRec['pid']),!$BE_USER->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded'));
442 }
443 } else {
444 $this->mainJScode.='
445 // Warning about page editing:
446 alert('.$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->getLL('noEditPage'),$editId)).');
447 ';
448 }
449 }
450 }
451
452 /**
453 * Sets the startup module from either GETvars module and mpdParams or user configuration.
454 *
455 * @return void
456 */
457 function startModule() {
458 global $BE_USER;
459 $module = preg_replace('/[^[:alnum:]_]/','',t3lib_div::_GET('module'));
460 if (!$module && $BE_USER->uc['startInTaskCenter']) {
461 $module = 'user_task';
462 }
463
464 $params = t3lib_div::_GET('modParams');
465 if ($module) {
466 $this->mainJScode.='
467 // open in module:
468 window.setTimeout("top.goToModule(\''.$module.'\',false,\''.$params.'\');",500);
469 ';
470 }
471 }
472
473
474 /**
475 * Creates the header and frameset of the backend interface
476 *
477 * @return void
478 */
479 function main() {
480 global $BE_USER,$TYPO3_CONF_VARS;
481
482 // Set doktype:
483 $GLOBALS['TBE_TEMPLATE']->docType='xhtml_frames';
484
485 // Make JS:
486 $this->generateJScode();
487 $GLOBALS['TBE_TEMPLATE']->JScode= '
488 <script type="text/javascript" src="md5.js"></script>
489 <script type="text/javascript" src="../t3lib/jsfunc.evalfield.js"></script>
490 ';
491 $GLOBALS['TBE_TEMPLATE']->JScode.=$GLOBALS['TBE_TEMPLATE']->wrapScriptTags($this->mainJScode);
492
493 // Title:
494 $title = $TYPO3_CONF_VARS['SYS']['sitename'] ? $TYPO3_CONF_VARS['SYS']['sitename'].' [TYPO3 '.TYPO3_version.']' : 'TYPO3 '.TYPO3_version;
495
496 //Add styles
497 $this->content.='
498
499 <script src="prototype.js" language="JavaScript" type="text/javascript"></script>
500 <script src="scriptaculous/scriptaculous.js" language="JavaScript" type="text/javascript"></script>
501 <script type="text/javascript" language="JavaScript">
502 function getElementContent(placeholderId, frequency, url) {
503 if (!url) {
504 if (placeholderId=="_logoMenu") {
505 var url = "logomenu.php?cmd=menuitem";
506 } else {
507 var url = "mod.php?M="+placeholderId+"&cmd=menuitem";
508 }
509 }
510 var pars = "";
511
512 if (frequency) {
513 var myAjax = new Ajax.PeriodicalUpdater(
514 placeholderId,
515 url,
516 {
517 method: "get",
518 parameters: pars,
519 evalScripts: true,
520 frequency: frequency
521 });
522 } else {
523 var myAjax = new Ajax.Updater(
524 placeholderId,
525 url,
526 {
527 method: "get",
528 parameters: pars,
529 evalScripts: true
530 });
531 }
532 }
533
534
535 var menuActive = "";
536 var menuItemObjects = new Array();
537
538 function menuToggleState(ID) {
539 if (menuActive) {
540 menuReset();
541 } else {
542 menuSet(ID);
543 }
544 }
545 function menuMouseOver(ID) {
546 if (menuActive) {
547 menuSet(ID);
548 }
549 }
550 function menuMouseOut(ID) {
551 return;
552 if (menuActive) {
553 hideOpenLayerStack();
554 Element.removeClassName(menuActive, "menu-hilight");
555 Element.addClassName(menuActive, "menu-normal");
556 }
557 }
558
559 function menuSet(ID) {
560 if (menuActive != ID) {
561 hideOpenLayerStack();
562 if (menuActive) {
563 Element.removeClassName(menuActive, "menu-hilight");
564 Element.addClassName(menuActive, "menu-normal");
565 }
566 menuActive = ID;
567
568 Element.addClassName(menuActive, "menu-hilight");
569 Element.removeClassName(menuActive, "menu-normal");
570
571 // Show layer below
572 var nodes = $A($(ID).childNodes);
573 nodes.each(function(node){
574 if (node.nodeType==1) { // This type seems to represent tags, not CDATA (which for some reason stops JS execution!)
575 if (Element.hasClassName(node,"menulayer")) {
576 menuShowLayer(node, ID);
577 }
578 }
579 });
580
581 if (menuItemObjects[ID]) menuItemObjects[ID].onActivate();
582 }
583 }
584 function menuReset() {
585 hideOpenLayerStack();
586 Element.removeClassName(menuActive, "menu-hilight");
587 Element.addClassName(menuActive, "menu-normal");
588 menuActive = "";
589 }
590
591 function hideOpenLayerStack() {
592 var layersToHide = document.getElementsByClassName("menulayer", "menu");
593 var nodes = $A(layersToHide);
594 nodes.each(function(node){
595 Element.hide(node);
596 // Effect.Fade(node,{duration: 0.4});
597 });
598 }
599 function menuShowLayer(menyLayerObj, alignWithID) {
600 // Element.show(menyLayerObj);
601
602 var rightEdgeOfLayer = $(alignWithID).offsetLeft + Element.getDimensions(menyLayerObj).width;
603 if (rightEdgeOfLayer>document.body.clientWidth) {
604 Element.setStyle(menyLayerObj,{left: ($(alignWithID).offsetLeft + Element.getDimensions(alignWithID).width - Element.getDimensions(menyLayerObj).width)+\'px\'});
605 } else {
606 Element.setStyle(menyLayerObj,{left: ($(alignWithID).offsetLeft)+\'px\'});
607 }
608 Element.setStyle(menyLayerObj,{top: \''.$this->topMenu.'px\'});
609
610 Effect.Appear(menyLayerObj,{duration: 0.4});
611 }
612
613 function menuOpenSub(el) {
614
615 // First, show node:
616 var nodes = $A(el.childNodes);
617 nodes.each(function(node){
618 if (node.nodeType==1) { // This type seems to represent tags, not CDATA (which for some reason stops JS execution!)
619 //debugObj(node);
620 if (Element.hasClassName(node,"menulayer") && !Element.visible(node)) {
621 Effect.Appear(node,{duration: 0.4});
622 Element.setStyle(node,{left: ($(el).offsetLeft + Element.getDimensions(el).width - 5) +\'px\'});
623
624 if (el.id && menuItemObjects[""+el.id]) {
625 menuItemObjects[""+el.id].onActivate();
626 }
627 }
628 }
629 });
630
631 // Hide everyone except this:
632 var siblings = $A(el.parentNode.childNodes);
633 siblings.each(function(sibling){
634 if (sibling.nodeType==1) {
635 var equal = sibling==el;
636 if (!equal) {
637 var layersToHide = document.getElementsByClassName("menulayer", sibling);
638 var nodes = $A(layersToHide);
639 nodes.each(function(node){
640 Element.hide(node);
641 });
642 }
643 }
644 });
645 }
646
647
648
649 </script>
650
651
652 <style type="text/css" id="internalStyle">
653 /*<![CDATA[*/
654
655 <!--
656
657 body, html {
658 width: 100%;
659 height: 100%;
660 margin: 0;
661 padding: 0;
662 }
663
664 #menu {
665 position: absolute;
666 top: 0px;
667 left: 0px;
668 height: '.$this->topMenu.'px;
669 z-index: 99;
670 border-bottom: 1px solid #666666;
671 border-top: 1px solid black;
672 width: 100%;
673 background-image: url("gfx/x_menubackground.gif");
674 }
675
676 #icons {
677 position: absolute;
678 top: '.$this->topMenu.'px;
679 left: 0px;
680 height: '.$this->topIcons.'px;
681 z-index: 98;
682 background-color: #eeeeee;
683 border-bottom: 1px solid #666666;
684 width: 100%;
685 }
686
687 #content {
688 position: absolute;
689 top: '.(is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['icons']) ? $this->topIcons+$this->topMenu : $this->topMenu).'px;
690 left: 0px;
691 width: 100%;
692 height: 100%;
693 border: 0px;
694 z-index: 1;
695 }
696
697 .menu-hilight {
698 background-color: #d0e7b1;
699 padding-left: 0px;
700 padding-right: 0px;
701 border-left: 1px solid #999999;
702 border-right: 1px solid #999999;
703 }
704 .menu-normal {
705 padding-left: 1px;
706 padding-right: 1px;
707 }
708 .menuItems {
709 height: '.($this->topMenu-1).'px;
710 cursor: hand;
711 padding-top:2px;
712 font-size: 12px;
713 }
714 .menulayer {
715 position: absolute;
716 border: 1px solid #aaaaaa;
717 background-image : url("gfx/x_menulayerbg.png");
718 }
719
720 .menulayer DIV.menuLayerItem {
721 cursor: hand;
722 width: 100%;
723 height: 16px;
724 white-space: nowrap;
725 padding-top: 3px;
726 padding-bottom: 3px;
727 font-size: 11px;
728 }
729 .menulayerItemIcon {
730 vertical-align: middle;
731 padding-right: 3px;
732 }
733
734 .menulayer DIV.menuLayerItem_divider {
735 background-image : url("gfx/x_dividerbg.png");
736 width: 100%;
737 height: 7px;
738 }
739 .menulayer DIV.menuLayerItem:hover {
740 background-color: #d0e7b1;
741 }
742
743 html {
744 /*for IE6*/
745 _overflow: hidden;
746 }
747
748 body {
749 overflow: hidden;
750 }
751
752
753
754 /* Specific for applications: (TODO: Move this into general API:) */
755
756 .dashboard-col {
757 float: left;
758 border: 1px solid red;
759 }
760 .dashboard-dock {
761 border: 1px solid yellow;
762 float: none;
763 }
764 .dashboard-item {
765 background-color: white;
766 border: 1px solid blue;
767 margin: 10 10 10 10;
768 }
769 .dashboard-dock .dashboard-item {
770 background-color: yellow;
771 }
772 .dashboard-dock .dashboard-item .dashboard-icon {
773 display: visible;
774 }
775 .dashboard-dock .dashboard-item .dashboard-content {
776 display: none
777 }
778 .dashboard-col .dashboard-item .dashboard-icon {
779 display: none;
780 }
781
782 .dashboard-item-hover {
783 border: 3px solid green;
784 }
785
786 -->
787 /*]]>*/
788
789 </style>
790 ';
791
792
793
794 // Start page header:
795 $this->content.=$GLOBALS['TBE_TEMPLATE']->startPage($title);
796 /*
797 // Creates frameset
798 $fr_content = '<frame name="content" src="alt_intro.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />';
799 $fr_toplogo = '<frame name="toplogo" src="alt_toplogo.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';
800 $fr_topmenu = '<frame name="topmenuFrame" src="alt_topmenu_dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';
801
802 $shortcutFrame=array();
803 if ($BE_USER->getTSConfigVal('options.shortcutFrame')) {
804 $shortcutFrame['rowH']=','.$this->shortcutFrameH;
805 $shortcutFrame['frameDef']='<frame name="shortcutFrame" src="alt_shortcut.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';
806 }
807
808 // XHTML notice: ' framespacing="0" frameborder="0" border="0"' in FRAMESET elements breaks compatibility with XHTML-frames, but HOW ELSE can I control the visual appearance?
809 if ($GLOBALS['BE_USER']->uc['noMenuMode']) {
810 $this->content.= '
811 <frameset rows="'.$this->topFrameH.',*'.$shortcutFrame['rowH'].'" framespacing="0" frameborder="0" border="0">
812 '.(!strcmp($BE_USER->uc['noMenuMode'],'icons') ? '
813 <frameset cols="'.$this->leftMenuFrameW.',*" framespacing="0" frameborder="0" border="0">
814 '.$fr_toplogo.'
815 '.$fr_topmenu.'
816 </frameset>' : '
817 <frameset cols="'.$this->leftMenuFrameW.','.$this->selMenuFrame.',*" framespacing="0" frameborder="0" border="0">
818 '.$fr_toplogo.'
819 <frame name="menu" src="alt_menu_sel.php" scrolling="no" noresize="noresize" />
820 '.$fr_topmenu.'
821 </frameset>').'
822 '.$fr_content.'
823 '.$shortcutFrame['frameDef'].'
824 </frameset>
825 ';
826 } else {
827 $this->content.='
828 <frameset rows="'.$this->topFrameH.',*'.$shortcutFrame['rowH'].'" framespacing="0" frameborder="0" border="0">
829 <frameset cols="'.$this->leftMenuFrameW.',*" framespacing="0" frameborder="0" border="0">
830 '.$fr_toplogo.'
831 '.$fr_topmenu.'
832 </frameset>
833 <frameset cols="'.$this->leftMenuFrameW.',*" framespacing="0" frameborder="0" border="0">
834 <frame name="menu" src="alt_menu.php" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" />
835 '.$fr_content.'
836 </frameset>
837 '.$shortcutFrame['frameDef'].'
838 </frameset>
839 ';
840 }
841 $this->content.='
842
843 </html>';
844 */
845
846
847
848 $c_menu = '';
849 $c_icons = '';
850 $populate = '';
851 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu'])) {
852 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu'] = array();
853 }
854 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu'] = array_merge(array('_logoMenu' => array('leftAlign'=>TRUE)), $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu']);
855
856 foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu'] as $modName => $options) {
857 $align = $options['leftAlign'];
858 $c_menu.='<div id="'.$modName.'"'.(!$options['simpleContainer'] ? ' class="menuItems menu-normal"' : '').' style="float: '.($align?'left':'right').';"'.(!$options['simpleContainer'] ? ' onclick="menuToggleState(\''.$modName.'\');" onmouseover="menuMouseOver(\''.$modName.'\');" onmouseout="menuMouseOut(\''.$modName.'\');"':'').'></div>';
859 $populate.= '
860 getElementContent("'.$modName.'");';
861 }
862
863 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['icons'])) {
864 foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['icons'] as $modName => $options) {
865 $align = $options['leftAlign'];
866 $c_icons.='<div id="'.$modName.'" style="float: '.($align?'left':'right').';"></div>';
867 $populate.= '
868 getElementContent("'.$modName.'");';
869 }
870 }
871
872 $this->content.= ('<body>
873 <div id="menu">'.$c_menu.'</div>
874 '.($c_icons ? '<div id="icons">'.$c_icons.'</div>' : '').'
875 <iframe src="./alt_intro.php" id="content" name="content"></iframe>
876
877
878 <script type="text/javascript" language="JavaScript">
879 '.$populate.'
880 </script>
881
882
883 </body>');
884
885 $this->content.= ('</html>');
886 }
887
888 /**
889 * Outputting the accumulated content to screen
890 *
891 * @return void
892 */
893 function printContent() {
894 echo $this->content;
895 }
896 }
897
898 // Include extension?
899 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_main.php']) {
900 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_main.php']);
901 }
902
903
904
905
906
907
908
909 // ******************************
910 // Starting document output
911 // ******************************
912
913 // Make instance:
914 $SOBE = t3lib_div::makeInstance('SC_alt_main');
915 $SOBE->init();
916 $SOBE->main();
917 $SOBE->printContent();
918
919 ?>