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