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