/src/typo3_src-4.2.0alpha1/typo3/alt_main_new.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00055 die(); // Disabled until Kasper finishes this feature.
00056 
00057 require ('init.php');
00058 require ('template.php');
00059 require_once (PATH_t3lib.'class.t3lib_loadmodules.php');
00060 require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
00061 require_once ('class.alt_menu_functions.inc');
00062 $LANG->includeLLFile('EXT:lang/locallang_misc.xml');
00063 
00064 
00065 
00066 
00074 class SC_alt_main {
00075 
00076                 // Internal, dynamic:
00077         var $content;
00078         var $mainJScode;
00079 
00085         var $loadModules;
00086 
00092         var $alt_menuObj;
00093 
00094                 // Internal, static:
00095         var $leftMenuFrameW = 130;
00096         var $selMenuFrame = 130;
00097         var $topFrameH = 32;
00098         var $shortcutFrameH = 30;
00099         
00100         
00101         var $topMenu = 21;
00102         var $topIcons = 40;
00103 
00109         function init() {
00110                 global $TBE_MODULES,$TBE_STYLES;
00111 
00112                         // Initializes the backend modules structure for use later.
00113                 $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
00114                 $this->loadModules->load($TBE_MODULES);
00115 
00116                         // Instantiates thee menu object which will generate some JavaScript for the goToModule() JS function in this frameset.
00117                 $this->alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
00118 
00119                         // Check for distances defined in the styles array:
00120                 if ($TBE_STYLES['dims']['leftMenuFrameW'])              $this->leftMenuFrameW = $TBE_STYLES['dims']['leftMenuFrameW'];
00121                 if ($TBE_STYLES['dims']['topFrameH'])           $this->topFrameH = $TBE_STYLES['dims']['topFrameH'];
00122                 if ($TBE_STYLES['dims']['shortcutFrameH'])              $this->shortcutFrameH = $TBE_STYLES['dims']['shortcutFrameH'];
00123                 if ($TBE_STYLES['dims']['selMenuFrame'])                $this->selMenuFrame = $TBE_STYLES['dims']['selMenuFrame'];
00124         }
00125 
00131         function generateJScode()       {
00132                 global $BE_USER,$LANG;
00133 
00134                 $pt3 = t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')).'/';
00135                 $goToModule_switch = $this->alt_menuObj->topMenu($this->loadModules->modules,0,"",4);
00136                 $fsMod = implode(chr(10),$this->alt_menuObj->fsMod);
00137 
00138                         // If another page module was specified, replace the default Page module with the new one
00139                 $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
00140                 $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
00141 
00142                 $this->mainJScode='
00143         
00147         function resize_Iframe() {
00148                 var container = document.getElementById("content");
00149                 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)
00150                 container.style.height = (document.body.clientHeight-menuHeight)+"px";
00151         }
00152         window.onload = resize_Iframe;
00153         window.onresize = resize_Iframe;        
00154                 
00158         function rawurlencode(str)      {       //
00159                 var output = escape(str);
00160                 output = str_replace("*","%2A", output);
00161                 output = str_replace("+","%2B", output);
00162                 output = str_replace("/","%2F", output);
00163                 output = str_replace("@","%40", output);
00164                 return output;
00165         }
00166 
00170         function str_replace(match,replace,string)      {       //
00171                 var input = ""+string;
00172                 var matchStr = ""+match;
00173                 if (!matchStr)  {return string;}
00174                 var output = "";
00175                 var pointer=0;
00176                 var pos = input.indexOf(matchStr);
00177                 while (pos!=-1) {
00178                         output+=""+input.substr(pointer, pos-pointer)+replace;
00179                         pointer=pos+matchStr.length;
00180                         pos = input.indexOf(match,pos+1);
00181                 }
00182                 output+=""+input.substr(pointer);
00183                 return output;
00184         }
00185 
00189         function typoSetup()    {       //
00190                 this.PATH_typo3 = "'.$pt3.'";
00191                 this.PATH_typo3_enc = "'.rawurlencode($pt3).'";
00192                 this.username = "'.$BE_USER->user['username'].'";
00193                 this.uniqueID = "'.t3lib_div::shortMD5(uniqid('')).'";
00194                 this.navFrameWidth = 0;
00195         }
00196         var TS = new typoSetup();
00197 
00201         function busy() {       //
00202                 this.loginRefreshed = busy_loginRefreshed;
00203                 this.checkLoginTimeout = busy_checkLoginTimeout;
00204                 this.openRefreshWindow = busy_OpenRefreshWindow;
00205                 this.busyloadTime=0;
00206                 this.openRefreshW=0;
00207                 this.reloginCancelled=0;
00208         }
00209         function busy_loginRefreshed()  {       //
00210                 var date = new Date();
00211                 this.busyloadTime = Math.floor(date.getTime()/1000);
00212                 this.openRefreshW=0;
00213         }
00214         function busy_checkLoginTimeout()       {       //
00215                 var date = new Date();
00216                 var theTime = Math.floor(date.getTime()/1000);
00217                 if (theTime > this.busyloadTime+'.intval($BE_USER->auth_timeout_field).'-30)    {
00218                         return true;
00219                 }
00220         }
00221         function busy_OpenRefreshWindow()       {       //
00222                 vHWin=window.open("login_frameset.php","relogin_"+TS.uniqueID,"height=350,width=700,status=0,menubar=0,location=1");
00223                 vHWin.focus();
00224                 this.openRefreshW=1;
00225         }
00226         function busy_checkLoginTimeout_timer() {       //
00227                 if (busy.checkLoginTimeout() && !busy.reloginCancelled && !busy.openRefreshW)   {
00228                         if (confirm('.$GLOBALS['LANG']->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.refresh_login')).')) {
00229                                 busy.openRefreshWindow();
00230                         } else  {
00231                                 busy.reloginCancelled = 1;
00232                         }
00233                 }
00234                 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())
00235 
00236                         // 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!)
00237                 if (top && top.content && top.content.nav_frame && top.content.nav_frame.document && top.content.nav_frame.document.body)       {
00238                         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;
00239                 }
00240         }
00241 
00245         function launchView(table,uid,bP)       {       //
00246                 var backPath= bP ? bP : "";
00247                 var thePreviewWindow="";
00248                 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");
00249                 if (thePreviewWindow && thePreviewWindow.focus) {
00250                         thePreviewWindow.focus();
00251                 }
00252         }
00253 
00257         function openUrlInWindow(url,windowName)        {       //
00258                 regularWindow = window.open(url,windowName,"status=1,menubar=1,resizable=1,location=1,directories=0,scrollbars=1,toolbar=1");
00259                 regularWindow.focus();
00260                 return false;
00261         }
00262 
00266         function loadTopMenu(url)       {       //
00267                 top.topmenuFrame.location = url;
00268         }
00269 
00273         function loadEditId(id,addGetVars)      {       //
00274                 top.fsMod.recentIds["web"]=id;
00275                 top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_0";         // For highlighting
00276 
00277                 if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav)  {
00278                         top.content.nav_frame.refresh_nav();
00279                 }
00280 
00281                 top.goToModule("'.$pageModule.'", 0, addGetVars?addGetVars:"");
00282         }
00283 
00288         var nextLoadModuleUrl="";
00289         function getModuleUrl(inUrl)    {       //
00290                 var nMU;
00291                 if (top.nextLoadModuleUrl)      {
00292                         nMU=top.nextLoadModuleUrl;
00293                         top.nextLoadModuleUrl="";
00294                         return nMU;
00295                 } else {
00296                         return inUrl;
00297                 }
00298         }
00299 
00303         function debugObj(obj,name,printEach)   {       //
00304                 var acc;
00305                 for (i in obj) {
00306                         if (obj[i])     {
00307                                 if (printEach)  {
00308                                         alert(i+":  "+obj[i]);
00309                                 } else {
00310                                         acc+=i+":  "+obj[i]+"\n";
00311                                 }
00312                         }
00313                 }
00314                 if (!printEach) alert("Object: "+name+"\n\n"+acc);
00315         }
00316 
00320         var busy = new busy();
00321         busy.loginRefreshed();
00322         busy_checkLoginTimeout_timer();
00323 
00324 
00328         var currentlyHighLightedId = "";
00329         var currentlyHighLighted_restoreValue = "";
00330         var currentlyHighLightedMain = "";
00331         function highlightModuleMenuItem(trId, mainModule)      {       //
00332                 currentlyHighLightedMain = mainModule;
00333                         // Get document object:
00334                 if (top.menu && top.menu.document)      {
00335                         var docObj = top.menu.document;
00336                         var HLclass = mainModule ? "c-mainitem-HL" : "c-subitem-row-HL";
00337                 } else if (top.topmenuFrame && top.topmenuFrame.document)       {
00338                         var docObj = top.topmenuFrame.document;
00339                         var HLclass = mainModule ? "c-mainitem-HL" : "c-subitem-HL";
00340                 }
00341 
00342                 if (docObj)     {
00343                                 // Reset old:
00344                         if (currentlyHighLightedId && docObj.getElementById(currentlyHighLightedId))    {
00345                                 docObj.getElementById(currentlyHighLightedId).attributes.getNamedItem("class").nodeValue = currentlyHighLighted_restoreValue;
00346                         }
00347                                 // Set new:
00348                         currentlyHighLightedId = trId;
00349                         if (currentlyHighLightedId && docObj.getElementById(currentlyHighLightedId))    {
00350                                 var classAttribObject = docObj.getElementById(currentlyHighLightedId).attributes.getNamedItem("class");
00351                                 currentlyHighLighted_restoreValue = classAttribObject.nodeValue;
00352                                 classAttribObject.nodeValue = HLclass;
00353                         }
00354                 }
00355         }
00356 
00360         function restoreHighlightedModuleMenuItem() {   //
00361                 if (currentlyHighLightedId) {
00362                         highlightModuleMenuItem(currentlyHighLightedId,currentlyHighLightedMain);
00363                 }
00364         }
00365 
00369         var currentModuleLoaded = "";
00370         function goToModule(modName,cMR_flag,addGetVars)        {       //
00371                 var additionalGetVariables = "";
00372                 if (addGetVars) additionalGetVariables = addGetVars;
00373 
00374                 var cMR = 0;
00375                 if (cMR_flag)   cMR = 1;
00376 
00377                 currentModuleLoaded = modName;
00378 
00379                 switch(modName) {'.$goToModule_switch.'
00380                 }
00381         }
00382 
00391         function fsModules()    {       //
00392                 this.recentIds=new Array();                                     // used by frameset modules to track the most recent used id for list frame.
00393                 this.navFrameHighlightedID=new Array();         // used by navigation frames to track which row id was highlighted last time
00394                 this.currentMainLoaded="";
00395                 this.currentBank="0";
00396         }
00397         var fsMod = new fsModules();
00398         '.$fsMod.'
00399 
00400                 // Used by Frameset Modules
00401         var condensedMode = '.($BE_USER->uc['condensedMode']?1:0).';
00402         var currentSubScript = "";
00403         var currentSubNavScript = "";
00404 
00405                 // Used for tab-panels:
00406         var DTM_currentTabs = new Array();
00407                 ';
00408 
00409                         // Check editing of page:
00410                 $this->editPageHandling();
00411                 $this->startModule();
00412         }
00413 
00420         function editPageHandling()     {
00421                 global $BE_USER;
00422 
00423                 if (!t3lib_extMgm::isLoaded('cms'))     return;
00424 
00425                         // EDIT page:
00426                 $editId = preg_replace('/[^[:alnum:]_]/','',t3lib_div::_GET('edit'));
00427                 $theEditRec = '';
00428 
00429                 if ($editId)    {
00430 
00431                                 // Looking up the page to edit, checking permissions:
00432                         $where = ' AND ('.$BE_USER->getPagePermsClause(2).' OR '.$BE_USER->getPagePermsClause(16).')';
00433                         if (t3lib_div::testInt($editId))        {
00434                                 $theEditRec = t3lib_BEfunc::getRecordWSOL('pages',$editId,'*',$where);
00435                         } else {
00436                                 $records = t3lib_BEfunc::getRecordsByField('pages','alias',$editId,$where);
00437                                 if (is_array($records)) {
00438                                         reset($records);
00439                                         $theEditRec = current($records);
00440                                         t3lib_BEfunc::workspaceOL('pages', $theEditRec);
00441                                 }
00442                         }
00443 
00444                                 // If the page was accessible, then let the user edit it.
00445                         if (is_array($theEditRec) && $BE_USER->isInWebMount($theEditRec['uid']))        {
00446                                         // Setting JS code to open editing:
00447                                 $this->mainJScode.='
00448                 // Load page to edit:
00449         window.setTimeout("top.loadEditId('.intval($theEditRec['uid']).');",500);
00450                         ';
00451                                         // Checking page edit parameter:
00452                                 if(!$BE_USER->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree')) {
00453 
00454                                                 // Expanding page tree:
00455                                         t3lib_BEfunc::openPageTree(intval($theEditRec['pid']),!$BE_USER->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded'));
00456                                 }
00457                         } else {
00458                                 $this->mainJScode.='
00459                 // Warning about page editing:
00460         alert('.$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->getLL('noEditPage'),$editId)).');
00461                         ';
00462                         }
00463                 }
00464         }
00465 
00471         function startModule() {
00472                 global $BE_USER;
00473                 $module = preg_replace('/[^[:alnum:]_]/','',t3lib_div::_GET('module'));
00474                 if (!$module && $BE_USER->uc['startInTaskCenter']) {
00475                         $module = 'user_task';
00476                 }
00477 
00478                 $params = t3lib_div::_GET('modParams');
00479                 if ($module) {
00480                         $this->mainJScode.='
00481                 // open in module:
00482         window.setTimeout("top.goToModule(\''.$module.'\',false,\''.$params.'\');",500);
00483                         ';
00484                 }
00485         }
00486 
00487 
00493         function main() {
00494                 global $BE_USER,$TYPO3_CONF_VARS;
00495 
00496                         // Set doktype:
00497                 $GLOBALS['TBE_TEMPLATE']->docType='xhtml_frames';
00498 
00499                         // Make JS:
00500                 $this->generateJScode();
00501                 $GLOBALS['TBE_TEMPLATE']->JScode= '
00502                         <script type="text/javascript" src="md5.js"></script>
00503                         <script type="text/javascript" src="../t3lib/jsfunc.evalfield.js"></script>
00504                         ';
00505                 $GLOBALS['TBE_TEMPLATE']->JScode.=$GLOBALS['TBE_TEMPLATE']->wrapScriptTags($this->mainJScode);
00506 
00507                         // Title:
00508                 $title = $TYPO3_CONF_VARS['SYS']['sitename'] ? $TYPO3_CONF_VARS['SYS']['sitename'].' [TYPO3 '.TYPO3_version.']' : 'TYPO3 '.TYPO3_version;
00509 
00510                 //Add styles
00511                 $this->content.='
00512                 
00513                 <script src="contrib/prototype/prototype.js" language="JavaScript" type="text/javascript"></script>
00514                 <script src="contrib/scriptaculous/scriptaculous.js" language="JavaScript" type="text/javascript"></script>
00515                 <script type="text/javascript" language="JavaScript">
00516                         function getElementContent(placeholderId, frequency, url) {
00517                                 if (!url)       {
00518                                         if (placeholderId=="_logoMenu") {
00519                                                 var url = "logomenu.php?cmd=menuitem";
00520                                         } else {
00521                                                 var url = "mod.php?M="+placeholderId+"&cmd=menuitem";
00522                                         }
00523                                 }
00524                                 var pars = "";
00525                                 
00526                                 if (frequency)  {
00527                                         var myAjax = new Ajax.PeriodicalUpdater(
00528                                                 placeholderId, 
00529                                                 url, 
00530                                                 {
00531                                                         method: "get", 
00532                                                         parameters: pars,
00533                                                         evalScripts: true,
00534                                                         frequency: frequency
00535                                                 });
00536                                 } else {
00537                                         var myAjax = new Ajax.Updater(
00538                                                 placeholderId, 
00539                                                 url, 
00540                                                 {
00541                                                         method: "get", 
00542                                                         parameters: pars,
00543                                                         evalScripts: true
00544                                                 });
00545                                 }
00546                         }                       
00547                         
00548                         
00549                         var menuActive = "";
00550                         var menuItemObjects = new Array();
00551                         
00552                         function menuToggleState(ID) {
00553                                 if (menuActive) {
00554                                         menuReset();
00555                                 } else {
00556                                         menuSet(ID);
00557                                 }
00558                         }
00559                         function menuMouseOver(ID) {
00560                                 if (menuActive) {
00561                                         menuSet(ID);
00562                                 }
00563                         }
00564                         function menuMouseOut(ID)       {
00565                                 return;
00566                                 if (menuActive) {
00567                                         hideOpenLayerStack();
00568                                         Element.removeClassName(menuActive, "menu-hilight");
00569                                         Element.addClassName(menuActive, "menu-normal");
00570                                 }
00571                         }
00572                         
00573                         function menuSet(ID) {
00574                                 if (menuActive != ID)   {
00575                                         hideOpenLayerStack();
00576                                         if (menuActive) {
00577                                                 Element.removeClassName(menuActive, "menu-hilight");
00578                                                 Element.addClassName(menuActive, "menu-normal");
00579                                         }
00580                                         menuActive = ID;
00581 
00582                                         Element.addClassName(menuActive, "menu-hilight");
00583                                         Element.removeClassName(menuActive, "menu-normal");
00584 
00585                                                 // Show layer below
00586                                         var nodes = $A($(ID).childNodes);
00587                                         nodes.each(function(node){
00588                                                 if (node.nodeType==1)   {       // This type seems to represent tags, not CDATA (which for some reason stops JS execution!)
00589                                                         if (Element.hasClassName(node,"menulayer"))     {
00590                                                                 menuShowLayer(node, ID);
00591                                                         }
00592                                                 }
00593                                         });
00594 
00595                                         if (menuItemObjects[ID])        menuItemObjects[ID].onActivate();
00596                                 }
00597                         }
00598                         function menuReset() {
00599                                 hideOpenLayerStack();
00600                                 Element.removeClassName(menuActive, "menu-hilight");
00601                                 Element.addClassName(menuActive, "menu-normal");
00602                                 menuActive = "";
00603                         }
00604                         
00605                         function hideOpenLayerStack() {
00606                                 var layersToHide = document.getElementsByClassName("menulayer", "menu");
00607                                 var nodes = $A(layersToHide);
00608                                 nodes.each(function(node){
00609                                         Element.hide(node);
00610 //                                      Effect.Fade(node,{duration: 0.4});
00611                                 });                             
00612                         }
00613                         function menuShowLayer(menyLayerObj, alignWithID)       {
00614 //                              Element.show(menyLayerObj);
00615 
00616                                 var rightEdgeOfLayer = $(alignWithID).offsetLeft + Element.getDimensions(menyLayerObj).width;
00617                                 if (rightEdgeOfLayer>document.body.clientWidth) {
00618                                         Element.setStyle(menyLayerObj,{left: ($(alignWithID).offsetLeft + Element.getDimensions(alignWithID).width - Element.getDimensions(menyLayerObj).width)+\'px\'}); 
00619                                 } else {
00620                                         Element.setStyle(menyLayerObj,{left: ($(alignWithID).offsetLeft)+\'px\'}); 
00621                                 }
00622                                 Element.setStyle(menyLayerObj,{top: \''.$this->topMenu.'px\'}); 
00623                                 
00624                                 Effect.Appear(menyLayerObj,{duration: 0.2});
00625                         }       
00626                         
00627                         function menuOpenSub(el)        {
00628 
00629                                         // First, show node:
00630                                 var nodes = $A(el.childNodes);
00631                                 nodes.each(function(node){
00632                                         if (node.nodeType==1)   {       // This type seems to represent tags, not CDATA (which for some reason stops JS execution!)
00633                                                 //debugObj(node);
00634                                                 if (Element.hasClassName(node,"menulayer") && !Element.visible(node))   {
00635                                                         Effect.Appear(node,{duration: 0.2});
00636                                                         Element.setStyle(node,{left: ($(el).offsetLeft + Element.getDimensions(el).width - 5) +\'px\'}); 
00637                                                         
00638                                                         if (el.id && menuItemObjects[""+el.id]) {
00639                                                                 menuItemObjects[""+el.id].onActivate();
00640                                                         }
00641                                                 }
00642                                         }
00643                                 });
00644 
00645                                         // Hide everyone except this:
00646                                 var siblings = $A(el.parentNode.childNodes);
00647                                 siblings.each(function(sibling){
00648                                         if (sibling.nodeType==1)        {
00649                                                 var equal =  sibling==el;
00650                                                 if (!equal)     {
00651                                                         var layersToHide = document.getElementsByClassName("menulayer", sibling);
00652                                                         var nodes = $A(layersToHide);
00653                                                         nodes.each(function(node){
00654                                                                 Element.hide(node);
00655                                                         });
00656                                                 }
00657                                         }
00658                                 });
00659                         }               
00660                         
00661                         
00662                                 
00663                 </script>               
00664                 
00665                 
00666                 <style type="text/css" id="internalStyle">
00667                                 /*<![CDATA[*/
00668                                         
00669 <!--
00670 
00671 body, html {
00672         width: 100%;
00673         height: 100%;
00674         margin: 0;
00675         padding: 0;
00676 }
00677 
00678 #menu {
00679         position: absolute;
00680         top: 0px;
00681         left: 0px;
00682         height: '.$this->topMenu.'px;
00683         z-index: 99;
00684         border-bottom: 1px solid #666666;
00685         border-top: 1px solid black;
00686         width: 100%;
00687         background-image: url("gfx/x_menubackground.gif");
00688 }
00689 
00690 #icons {
00691         position: absolute;
00692         top: '.$this->topMenu.'px;
00693         left: 0px;
00694         height: '.$this->topIcons.'px;
00695         z-index: 98;
00696         background-color: #eeeeee;
00697         border-bottom: 1px solid #666666;
00698         width: 100%;
00699 }
00700 
00701 #content {
00702         position: absolute;
00703         top: '.(is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['icons']) ? $this->topIcons+$this->topMenu : $this->topMenu).'px;
00704         left: 0px;
00705         width: 100%;
00706         height: 100%;
00707         border: 0px; 
00708         z-index: 1;
00709 }
00710 
00711 .menu-hilight {
00712         background-color: #d0e7b1;
00713         padding-left: 0px; 
00714         padding-right: 0px;
00715         border-left: 1px solid #999999;
00716         border-right: 1px solid #999999;
00717 }
00718 .menu-normal {
00719         padding-left: 1px; 
00720         padding-right: 1px;
00721 }
00722 .menuItems {
00723         height: '.($this->topMenu-1).'px;
00724         cursor: hand;
00725         padding-top:2px;
00726         font-size: 12px;
00727 }
00728 .menulayer {
00729         position: absolute;
00730         border: 1px solid #aaaaaa;
00731         background-image : url("gfx/x_menulayerbg.png");
00732 }
00733 
00734 .menulayer DIV.menuLayerItem {
00735         cursor: hand;
00736         width: 100%; 
00737         height: 16px;
00738         white-space: nowrap;
00739         padding-top: 3px;
00740         padding-bottom: 3px;
00741         font-size: 11px;
00742 }
00743 .menulayerItemIcon      {
00744         vertical-align: middle;
00745         padding-right: 3px;
00746 }
00747 
00748 .menulayer DIV.menuLayerItem_divider {
00749         background-image : url("gfx/x_dividerbg.png");
00750         width: 100%;
00751         height: 7px;
00752 }
00753 .menulayer DIV.menuLayerItem:hover {
00754         background-color: #d0e7b1;
00755 }
00756 
00757 html {
00758         /*for IE6*/
00759         _overflow: hidden; 
00760 }
00761 
00762 body { 
00763  overflow: hidden; 
00764 }
00765 
00766 
00767 
00768 /* Specific for applications: (TODO: Move this into general API:) */
00769 
00770 .dashboard-col {
00771         float: left;
00772         border: 1px solid red;
00773 }
00774 .dashboard-dock {
00775         border: 1px solid yellow;
00776         float: none;
00777 }
00778 .dashboard-item {
00779         background-color: white;
00780         border: 1px solid blue;
00781         margin: 10 10 10 10;
00782 }
00783 .dashboard-dock .dashboard-item {
00784         background-color: yellow;
00785 }
00786 .dashboard-dock .dashboard-item .dashboard-icon {
00787         display: visible;
00788 }
00789 .dashboard-dock .dashboard-item .dashboard-content {
00790         display: none
00791 }
00792 .dashboard-col .dashboard-item .dashboard-icon {
00793         display: none;
00794 }
00795 
00796 .dashboard-item-hover {
00797         border: 3px solid green;
00798 }
00799 
00800 -->
00801                                 /*]]>*/
00802 
00803 </style>
00804                 ';
00805                 
00806                 
00807                 
00808                         // Start page header:
00809                 $this->content.=$GLOBALS['TBE_TEMPLATE']->startPage($title);
00810 /*
00811                         // Creates frameset
00812                 $fr_content = '<frame name="content" src="alt_intro.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />';
00813                 $fr_toplogo = '<frame name="toplogo" src="alt_toplogo.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';
00814                 $fr_topmenu = '<frame name="topmenuFrame" src="alt_topmenu_dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';
00815 
00816                 $shortcutFrame=array();
00817                 if ($BE_USER->getTSConfigVal('options.shortcutFrame'))  {
00818                         $shortcutFrame['rowH']=','.$this->shortcutFrameH;
00819                         $shortcutFrame['frameDef']='<frame name="shortcutFrame" src="alt_shortcut.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />';
00820                 }
00821 
00822                         // 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?
00823                 if ($GLOBALS['BE_USER']->uc['noMenuMode'])      {
00824                         $this->content.= '
00825                         <frameset rows="'.$this->topFrameH.',*'.$shortcutFrame['rowH'].'" framespacing="0" frameborder="0" border="0">
00826                                 '.(!strcmp($BE_USER->uc['noMenuMode'],'icons') ? '
00827                                 <frameset cols="'.$this->leftMenuFrameW.',*" framespacing="0" frameborder="0" border="0">
00828                                         '.$fr_toplogo.'
00829                                         '.$fr_topmenu.'
00830                                 </frameset>' : '
00831                                 <frameset cols="'.$this->leftMenuFrameW.','.$this->selMenuFrame.',*" framespacing="0" frameborder="0" border="0">
00832                                         '.$fr_toplogo.'
00833                                         <frame name="menu" src="alt_menu_sel.php" scrolling="no" noresize="noresize" />
00834                                         '.$fr_topmenu.'
00835                                 </frameset>').'
00836                                 '.$fr_content.'
00837                                 '.$shortcutFrame['frameDef'].'
00838                         </frameset>
00839                         ';
00840                 } else {
00841                         $this->content.='
00842                         <frameset rows="'.$this->topFrameH.',*'.$shortcutFrame['rowH'].'" framespacing="0" frameborder="0" border="0">
00843                                 <frameset cols="'.$this->leftMenuFrameW.',*" framespacing="0" frameborder="0" border="0">
00844                                         '.$fr_toplogo.'
00845                                         '.$fr_topmenu.'
00846                                 </frameset>
00847                                 <frameset cols="'.$this->leftMenuFrameW.',*" framespacing="0" frameborder="0" border="0">
00848                                         <frame name="menu" src="alt_menu.php" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" />
00849                                         '.$fr_content.'
00850                                 </frameset>
00851                                 '.$shortcutFrame['frameDef'].'
00852                         </frameset>
00853                         ';
00854                 }
00855                 $this->content.='
00856 
00857 </html>';
00858 */
00859 
00860 
00861 
00862 $c_menu = '';
00863 $c_icons = '';
00864 $populate = '';
00865 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu']))  {
00866         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu'] = array();
00867 }
00868 $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']);
00869 
00870 foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['menu'] as $modName => $options) {
00871         $align = $options['leftAlign'];
00872         $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>';
00873         $populate.= '
00874                                 getElementContent("'.$modName.'");';
00875 }
00876 
00877 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['icons']))  {
00878         foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['topApps']['icons'] as $modName => $options)        {
00879                 $align = $options['leftAlign'];
00880                 $c_icons.='<div id="'.$modName.'" style="float: '.($align?'left':'right').';"></div>';
00881                 $populate.= '
00882                                         getElementContent("'.$modName.'");';
00883         }
00884 }
00885 
00886 $this->content.= ('<body>
00887                         <div id="menu">'.$c_menu.'</div>
00888                         '.($c_icons ? '<div id="icons">'.$c_icons.'</div>' : '').'
00889                         <iframe src="./alt_intro.php" id="content" name="content"></iframe>
00890                         
00891 
00892                         <script type="text/javascript" language="JavaScript">
00893                                 '.$populate.'
00894                         </script>               
00895                         
00896                         
00897 </body>');
00898 
00899 $this->content.= ('</html>');
00900         }
00901 
00907         function printContent() {
00908                 echo $this->content;
00909         }
00910 }
00911 
00912 // Include extension?
00913 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_main.php'])      {
00914         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_main.php']);
00915 }
00916 
00917 
00918 
00919 
00920 
00921 
00922 
00923 // ******************************
00924 // Starting document output
00925 // ******************************
00926 
00927 // Make instance:
00928 $SOBE = t3lib_div::makeInstance('SC_alt_main');
00929 $SOBE->init();
00930 $SOBE->main();
00931 $SOBE->printContent();
00932 
00933 ?>

This documentation has been generated automatically from TYPO3 source code using Doxygen and is provided as is by Cast Iron Coding as a courtesy to other TYPO3 developers and users. Please consider Cast Iron Coding — a full-service web development agency in Portland, Oregon specializing in TYPO3 extension development — for all of your TYPO3 development and consulting needs!