2 /***************************************************************
5 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
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.
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.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
28 * Contains class with layout/output function for TYPO3 Backend Scripts
31 * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
32 * XHTML-trans compliant
34 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
37 * [CLASS/FUNCTION INDEX of SCRIPT]
39 * 137: function fw($str)
43 * 216: function template()
45 * SECTION: EVALUATION FUNCTIONS
46 * 290: function wrapClickMenuOnIcon($str,$table,$uid='',$listFr=1,$addParams='',$enDisItems='', $returnOnClick=FALSE)
47 * 307: function viewPageIcon($id,$backPath,$addParams='hspace="3"')
48 * 333: function issueCommand($params,$rUrl='')
49 * 348: function isCMlayers()
50 * 358: function thisBlur()
51 * 368: function helpStyle()
52 * 385: function getHeader($table,$row,$path,$noViewPageIcon=0,$tWrap=array('',''))
53 * 411: function getFileheader($title,$path,$iconfile)
54 * 426: function makeShortcutIcon($gvList,$setList,$modName,$motherModName="")
55 * 459: function makeShortcutUrl($gvList,$setList)
56 * 480: function formWidth($size=48,$textarea=0,$styleOverride='')
57 * 505: function formWidthText($size=48,$styleOverride='',$wrap='')
58 * 522: function redirectUrls($thisLocation='')
59 * 546: function formatTime($tstamp,$type)
60 * 559: function parseTime()
62 * SECTION: PAGE BUILDING FUNCTIONS.
63 * 592: function startPage($title)
64 * 667: function endPage()
65 * 701: function header($text)
66 * 722: function section($label,$text,$nostrtoupper=FALSE,$sH=FALSE,$type=0,$allowHTMLinHeader=FALSE)
67 * 746: function divider($dist)
68 * 762: function spacer($dist)
69 * 781: function sectionHeader($label,$sH=FALSE,$addAttrib='')
70 * 798: function sectionBegin()
71 * 819: function sectionEnd()
72 * 839: function middle()
73 * 848: function endPageJS()
74 * 865: function docBodyTagBegin()
75 * 875: function docStyle()
76 * 917: function insertStylesAndJS($content)
77 * 937: function initCharset()
78 * 949: function generator()
80 * SECTION: OTHER ELEMENTS
81 * 982: function icons($type, $styleAttribValue='')
82 * 1011: function t3Button($onClick,$label)
83 * 1022: function dfw($string)
84 * 1032: function rfw($string)
85 * 1042: function wrapInCData($string)
86 * 1059: function wrapScriptTags($string, $linebreak=TRUE)
87 * 1097: function table($arr, $layout='')
88 * 1139: function menuTable($arr1,$arr2=array(), $arr3=array())
89 * 1172: function funcMenu($content,$menu)
90 * 1190: function clearCacheMenu($id,$addSaveOptions=0)
91 * 1226: function getContextMenuCode()
92 * 1413: function getTabMenu($mainParams,$elementName,$currentValue,$menuItems,$script='',$addparams='')
93 * 1443: function getTabMenuRaw($menuItems)
94 * 1512: function getDynTabMenu($menuItems,$identString,$toggle=0,$foldout=FALSE,$newRowCharLimit=50,$noWrap=1,$fullWidth=FALSE,$defaultTabIndex=1)
95 * 1637: function getDynTabMenuJScode()
96 * 1723: function getVersionSelector($id,$noAction=FALSE)
99 * 1797: class bigDoc extends template
102 * 1806: class noDoc extends template
105 * 1815: class smallDoc extends template
108 * 1824: class mediumDoc extends template
110 * TOTAL FUNCTIONS: 49
111 * (This index is automatically created/updated by the extension "extdeveval")
117 if (!defined('TYPO3_MODE')) die("Can't include this file directly.");
131 * Depreciated fontwrap function. Is just transparent now.
133 * @param string Input string
134 * @return string Output string (in the old days this was wrapped in <font> tags)
143 * TYPO3 Backend Template Class
145 * This class contains functions for starting and ending the HTML of backend modules
146 * It also contains methods for outputting sections of content.
147 * Further there are functions for making icons, links, setting form-field widths etc.
148 * Color scheme and stylesheet definitions are also available here.
149 * Finally this file includes the language class for TYPO3's backend.
151 * After this file $LANG and $TBE_TEMPLATE are global variables / instances of their respective classes.
152 * This file is typically included right after the init.php file,
153 * if language and layout is needed.
155 * Please refer to Inside TYPO3 for a discussion of how to use this API.
157 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
163 // Vars you typically might want to/should set from outside after making instance of this class:
164 var $backPath = ''; // 'backPath' pointing back to the PATH_typo3
165 var $form=''; // This can be set to the HTML-code for a formtag. Useful when you need a form to span the whole page; Inserted exactly after the body-tag.
166 var $JScode=''; // Additional header code (eg. a JavaScript section) could be accommulated in this var. It will be directly outputted in the header.
167 var $JScodeArray = array(); // Similar to $JScode but for use as array with associative keys to prevent double inclusion of JS code. a <script> tag is automatically wrapped around.
168 var $postCode=''; // Additional 'page-end' code could be accommulated in this var. It will be outputted at the end of page before </body> and some other internal page-end code.
169 var $docType = ''; // Doc-type used in the header. Default is HTML 4. You can also set it to 'strict', 'xhtml_trans', or 'xhtml_frames'.
171 // Other vars you can change, but less frequently used:
172 var $scriptID=''; // Script ID.
173 var $bodyTagId=''; // Id which can be set for the body tag. Default value is based on script ID
174 var $bodyTagAdditions=''; // You can add additional attributes to the body-tag through this variable.
175 var $inDocStyles=''; // Additional CSS styles which will be added to the <style> section in the header
176 var $inDocStylesArray=array(); // Like $inDocStyles but for use as array with associative keys to prevent double inclusion of css code
177 var $form_rowsToStylewidth = 9.58; // Multiplication factor for formWidth() input size (default is 48* this value).
178 var $form_largeComp = 1.33; // Compensation for large documents (used in class.t3lib_tceforms.php)
179 var $endJS=1; // If set, then a JavaScript section will be outputted in the bottom of page which will try and update the top.busy session expiry object.
181 // TYPO3 Colorscheme.
182 // If you want to change this, please do so through a skin using the global var $TBE_STYLES
183 var $bgColor = '#F7F3EF'; // Light background color
184 var $bgColor2 = '#9BA1A8'; // Steel-blue
185 var $bgColor3 = '#F6F2E6'; // dok.color
186 var $bgColor4 = '#D9D5C9'; // light tablerow background, brownish
187 var $bgColor5 = '#ABBBB4'; // light tablerow background, greenish
188 var $bgColor6 = '#E7DBA8'; // light tablerow background, yellowish, for section headers. Light.
189 var $hoverColor = '#254D7B';
190 var $styleSheetFile = 'stylesheet.css'; // Filename of stylesheet (relative to PATH_typo3)
191 var $styleSheetFile2 = ''; // Filename of stylesheet #2 - linked to right after the $this->styleSheetFile script (relative to PATH_typo3)
192 var $styleSheetFile_post = ''; // Filename of a post-stylesheet - included right after all inline styles.
193 var $backGroundImage = ''; // Background image of page (relative to PATH_typo3)
194 var $inDocStyles_TBEstyle = ''; // Inline css styling set from TBE_STYLES array
197 var $parseTimeFlag = 0; // Will output the parsetime of the scripts in milliseconds (for admin-users). Set this to false when releasing TYPO3. Only for dev.
200 var $charset = 'iso-8859-1'; // Default charset. see function initCharset()
202 var $sectionFlag=0; // Internal: Indicates if a <div>-output section is open
203 var $divClass = ''; // (Default) Class for wrapping <DIV>-tag of page. Is set in class extensions.
212 * Imports relevant parts from global $TBE_STYLES (colorscheme)
216 function template() {
219 // Setting default scriptID:
220 $this->scriptID
= ereg_replace('^.*\/(sysext|ext)\/','ext/',substr(PATH_thisScript
,strlen(PATH_site
)));
221 if (TYPO3_mainDir
!='typo3/' && substr($this->scriptID
,0,strlen(TYPO3_mainDir
)) == TYPO3_mainDir
) {
222 $this->scriptID
= 'typo3/'.substr($this->scriptID
,strlen(TYPO3_mainDir
)); // This fixes if TYPO3_mainDir has been changed so the script ids are STILL "typo3/..."
225 $this->bodyTagId
= ereg_replace('[^[:alnum:]-]','-',$this->scriptID
);
227 // Individual configuration per script? If so, make a recursive merge of the arrays:
228 if (is_array($TBE_STYLES['scriptIDindex'][$this->scriptID
])) {
229 $ovr = $TBE_STYLES['scriptIDindex'][$this->scriptID
]; // Make copy
230 $TBE_STYLES = t3lib_div
::array_merge_recursive_overrule($TBE_STYLES,$ovr); // merge styles.
231 unset($TBE_STYLES['scriptIDindex'][$this->scriptID
]); // Have to unset - otherwise the second instantiation will do it again!
235 if ($TBE_STYLES['mainColors']['bgColor']) $this->bgColor
=$TBE_STYLES['mainColors']['bgColor'];
236 if ($TBE_STYLES['mainColors']['bgColor1']) $this->bgColor1
=$TBE_STYLES['mainColors']['bgColor1'];
237 if ($TBE_STYLES['mainColors']['bgColor2']) $this->bgColor2
=$TBE_STYLES['mainColors']['bgColor2'];
238 if ($TBE_STYLES['mainColors']['bgColor3']) $this->bgColor3
=$TBE_STYLES['mainColors']['bgColor3'];
239 if ($TBE_STYLES['mainColors']['bgColor4']) $this->bgColor4
=$TBE_STYLES['mainColors']['bgColor4'];
240 if ($TBE_STYLES['mainColors']['bgColor5']) $this->bgColor5
=$TBE_STYLES['mainColors']['bgColor5'];
241 if ($TBE_STYLES['mainColors']['bgColor6']) $this->bgColor6
=$TBE_STYLES['mainColors']['bgColor6'];
242 if ($TBE_STYLES['mainColors']['hoverColor']) $this->hoverColor
=$TBE_STYLES['mainColors']['hoverColor'];
245 if ($TBE_STYLES['stylesheet']) $this->styleSheetFile
= $TBE_STYLES['stylesheet'];
246 if ($TBE_STYLES['stylesheet2']) $this->styleSheetFile2
= $TBE_STYLES['stylesheet2'];
247 if ($TBE_STYLES['styleSheetFile_post']) $this->styleSheetFile_post
= $TBE_STYLES['styleSheetFile_post'];
248 if ($TBE_STYLES['inDocStyles_TBEstyle']) $this->inDocStyles_TBEstyle
= $TBE_STYLES['inDocStyles_TBEstyle'];
251 if ($TBE_STYLES['background']) $this->backGroundImage
= $TBE_STYLES['background'];
269 /*****************************************
271 * EVALUATION FUNCTIONS
272 * Various centralized processing
274 *****************************************/
277 * Makes click menu link (context sensitive menu)
278 * Returns $str (possibly an <|img> tag/icon) wrapped in a link which will activate the context sensitive menu for the record ($table/$uid) or file ($table = file)
279 * The link will load the top frame with the parameter "&item" which is the table,uid and listFr arguments imploded by "|": rawurlencode($table.'|'.$uid.'|'.$listFr)
281 * @param string String to be wrapped in link, typ. image tag.
282 * @param string Table name/File path. If the icon is for a database record, enter the tablename from $TCA. If a file then enter the absolute filepath
283 * @param integer If icon is for database record this is the UID for the record from $table
284 * @param boolean Tells the top frame script that the link is coming from a "list" frame which means a frame from within the backend content frame.
285 * @param string Additional GET parameters for the link to alt_clickmenu.php
286 * @param string Enable / Disable click menu items. Example: "+new,view" will display ONLY these two items (and any spacers in between), "new,view" will display all BUT these two items.
287 * @param boolean If set, will return only the onclick JavaScript, not the whole link.
288 * @return string The link-wrapped input string.
290 function wrapClickMenuOnIcon($str,$table,$uid='',$listFr=1,$addParams='',$enDisItems='', $returnOnClick=FALSE
) {
291 $backPath = '&backPath='.rawurlencode($this->backPath
).'|'.t3lib_div
::shortMD5($this->backPath
.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']);
292 $onClick = 'top.loadTopMenu(\''.$this->backPath
.'alt_clickmenu.php?item='.rawurlencode($table.'|'.$uid.'|'.$listFr.'|'.$enDisItems).$backPath.$addParams.'\');'.$this->thisBlur().'return false;';
293 return $returnOnClick ?
$onClick : '<a href="#" onclick="'.htmlspecialchars($onClick).'"'.($GLOBALS['TYPO3_CONF_VARS']['BE']['useOnContextMenuHandler'] ?
' oncontextmenu="'.htmlspecialchars($onClick).'"' : '').'>'.$str.'</a>';
297 * Makes link to page $id in frontend (view page)
298 * Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id
299 * $id must be a page-uid
300 * If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url)
302 * @param integer The page id
303 * @param string The current "BACK_PATH" (the back relative to the typo3/ directory)
304 * @param string Additional parameters for the image tag(s)
305 * @return string HTML string with linked icon(s)
307 function viewPageIcon($id,$backPath,$addParams='hspace="3"') {
310 // If access to Web>List for user, then link to that module.
311 if ($BE_USER->check('modules','web_list')) {
312 $href=$backPath.'db_list.php?id='.$id.'&returnUrl='.rawurlencode(t3lib_div
::getIndpEnv('REQUEST_URI'));
313 $str.= '<a href="'.htmlspecialchars($href).'">'.
314 '<img'.t3lib_iconWorks
::skinImg($backPath,'gfx/list.gif','width="11" height="11"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList',1).'"'.($addParams?
' '.trim($addParams):'').' alt="" />'.
317 // Make link to view page
318 $str.= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc
::viewOnClick($id,$backPath,t3lib_BEfunc
::BEgetRootLine($id))).'">'.
319 '<img'.t3lib_iconWorks
::skinImg($backPath,'gfx/zoom.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage',1).'"'.($addParams?
' '.trim($addParams):"").' hspace="3" alt="" />'.
325 * Returns a URL with a command to TYPO3 Core Engine (tce_db.php)
326 * See description of the API elsewhere.
328 * @param string $params is a set of GET params to send to tce_db.php. Example: "&cmd[tt_content][123][move]=456" or "&data[tt_content][123][hidden]=1&data[tt_content][123][title]=Hello%20World"
329 * @param string Redirect URL if any other that t3lib_div::getIndpEnv('REQUEST_URI') is wished
330 * @return string URL to tce_db.php + parameters (backpath is taken from $this->backPath)
331 * @see t3lib_BEfunc::editOnClick()
333 function issueCommand($params,$rUrl='') {
334 $rUrl = $rUrl ?
$rUrl : t3lib_div
::getIndpEnv('REQUEST_URI');
335 return $this->backPath
.'tce_db.php?'.
337 '&redirect='.($rUrl==-1?
"'+T3_THIS_LOCATION+'":rawurlencode($rUrl)).
338 '&vC='.rawurlencode($GLOBALS['BE_USER']->veriCode()).
343 * Returns true if click-menu layers can be displayed for the current user/browser
344 * Use this to test if click-menus (context sensitive menus) can and should be displayed in the backend.
348 function isCMlayers() {
349 return !$GLOBALS['BE_USER']->uc
['disableCMlayers'] && $GLOBALS['CLIENT']['FORMSTYLE'] && !($GLOBALS['CLIENT']['SYSTEM']=='mac' && $GLOBALS['CLIENT']['BROWSER']=='Opera');
353 * Returns 'this.blur();' if the client supports CSS styles
354 * Use this in links to remove the underlining after being clicked
358 function thisBlur() {
359 return ($GLOBALS['CLIENT']['FORMSTYLE']?
'this.blur();':'');
363 * Returns ' style='cursor:help;'' if the client supports CSS styles
364 * Use for <a>-links to help texts
368 function helpStyle() {
369 return $GLOBALS['CLIENT']['FORMSTYLE'] ?
' style="cursor:help;"':'';
373 * Makes the header (icon+title) for a page (or other record). Used in most modules under Web>*
374 * $table and $row must be a tablename/record from that table
375 * $path will be shown as alt-text for the icon.
376 * The title will be truncated to 45 chars.
378 * @param string Table name
379 * @param array Record row
380 * @param string Alt text
381 * @param boolean Set $noViewPageIcon true if you don't want a magnifier-icon for viewing the page in the frontend
382 * @param array $tWrap is an array with indexes 0 and 1 each representing HTML-tags (start/end) which will wrap the title
383 * @return string HTML content
385 function getHeader($table,$row,$path,$noViewPageIcon=0,$tWrap=array('','')) {
387 if (is_array($row) && $row['uid']) {
388 $iconImgTag=t3lib_iconWorks
::getIconImage($table,$row,$this->backPath
,'title="'.htmlspecialchars($path).'"');
389 $title= strip_tags($row[$TCA[$table]['ctrl']['label']]);
390 $viewPage = $noViewPageIcon ?
'' : $this->viewPageIcon($row['uid'],$this->backPath
,'');
391 if ($table=='pages') $path.=' - '.t3lib_BEfunc
::titleAttribForPages($row,'',0);
393 $iconImgTag='<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/i/_icon_website.gif',$wHattribs='width="18" height="16"').' title="'.htmlspecialchars($path).'" alt="" />';
394 $title=$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
397 return '<span class="typo3-moduleHeader">'.$this->wrapClickMenuOnIcon($iconImgTag,$table,$row['uid']).
399 $tWrap[0].htmlspecialchars(t3lib_div
::fixed_lgd_cs($title,45)).$tWrap[1].'</span>';
403 * Like ->getHeader() but for files in the File>* main module/submodules
404 * Returns the file-icon with the path of the file set in the alt/title attribute. Shows the file-name after the icon.
406 * @param string Title string, expected to be the filepath
407 * @param string Alt text
408 * @param string The icon file (relative to TYPO3 dir)
409 * @return string HTML content
411 function getFileheader($title,$path,$iconfile) {
412 $fileInfo = t3lib_div
::split_fileref($title);
413 $title = htmlspecialchars(t3lib_div
::fixed_lgd_cs($fileInfo['path'],-35)).'<b>'.htmlspecialchars($fileInfo['file']).'</b>';
414 return '<span class="typo3-moduleHeader"><img'.t3lib_iconWorks
::skinImg($this->backPath
,$iconfile,'width="18" height="16"').' title="'.htmlspecialchars($path).'" alt="" />'.$title.'</span>';
418 * Returns a linked shortcut-icon which will call the shortcut frame and set a shortcut there back to the calling page/module
420 * @param string Is the list of GET variables to store (if any)
421 * @param string Is the list of SET[] variables to store (if any) - SET[] variables a stored in $GLOBALS["SOBE"]->MOD_SETTINGS for backend modules
422 * @param string Module name string
423 * @param string Is used to enter the "parent module name" if the module is a submodule under eg. Web>* or File>*. You can also set this value to "1" in which case the currentLoadedModule is sent to the shortcut script (so - not a fixed value!) - that is used in file_edit.php and wizard_rte.php scripts where those scripts are really running as a part of another module.
424 * @return string HTML content
426 function makeShortcutIcon($gvList,$setList,$modName,$motherModName="") {
427 $backPath=$this->backPath
;
428 $storeUrl=$this->makeShortcutUrl($gvList,$setList);
429 $pathInfo = parse_url(t3lib_div
::getIndpEnv('REQUEST_URI'));
431 if (!strcmp($motherModName,'1')) {
432 $mMN="&motherModName='+top.currentModuleLoaded+'";
433 } elseif ($motherModName) {
434 $mMN='&motherModName='.rawurlencode($motherModName);
437 $onClick = 'if (top.shortcutFrame && confirm('.
438 $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.makeShortcut')).
439 ')){top.shortcutFrame.document.location=\''.$backPath.'alt_shortcut.php?modName='.rawurlencode($modName).
440 '&URL='.rawurlencode($pathInfo['path']."?".$storeUrl).
444 $sIcon = '<a href="#" onclick="'.htmlspecialchars($onClick).'">
445 <img'.t3lib_iconWorks
::skinImg($backPath,'gfx/shortcut.gif','width="14" height="14"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.makeShortcut',1).'" alt="" /></a>';
450 * MAKE url for storing
453 * @param string Is the list of GET variables to store (if any)
454 * @param string Is the list of SET[] variables to store (if any) - SET[] variables a stored in $GLOBALS["SOBE"]->MOD_SETTINGS for backend modules
457 * @see makeShortcutIcon()
459 function makeShortcutUrl($gvList,$setList) {
460 $GET = t3lib_div
::_GET();
461 $storeArray = array_merge(
462 t3lib_div
::compileSelectedGetVarsFromArray($gvList,$GET),
463 array('SET'=>t3lib_div
::compileSelectedGetVarsFromArray($setList,$GLOBALS['SOBE']->MOD_SETTINGS
))
465 $storeUrl = t3lib_div
::implodeArrayForUrl('',$storeArray);
470 * Returns <input> attributes to set the width of an text-type input field.
471 * For client browsers with no CSS support the cols/size attribute is returned.
472 * For CSS compliant browsers (recommended) a ' style="width: ...px;"' is returned.
474 * @param integer A relative number which multiplied with approx. 10 will lead to the width in pixels
475 * @param boolean A flag you can set for textareas - DEPRECIATED, use ->formWidthText() for textareas!!!
476 * @param string A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled)
477 * @return string Tag attributes for an <input> tag (regarding width)
478 * @see formWidthText()
480 function formWidth($size=48,$textarea=0,$styleOverride='') {
481 $wAttrib = $textarea?
'cols':'size';
482 if (!$GLOBALS['CLIENT']['FORMSTYLE']) { // If not setting the width by style-attribute
484 $retVal = ' '.$wAttrib.'="'.$size.'"';
485 } else { // Setting width by style-attribute. 'cols' MUST be avoided with NN6+
486 $pixels = ceil($size*$this->form_rowsToStylewidth
);
487 $retVal = $styleOverride ?
' style="'.$styleOverride.'"' : ' style="width:'.$pixels.'px;"';
493 * This function is dedicated to textareas, which has the wrapping on/off option to observe.
495 * <textarea rows="10" wrap="off" '.$GLOBALS["TBE_TEMPLATE"]->formWidthText(48,"","off").'>
497 * <textarea rows="10" wrap="virtual" '.$GLOBALS["TBE_TEMPLATE"]->formWidthText(48,"","virtual").'>
499 * @param integer A relative number which multiplied with approx. 10 will lead to the width in pixels
500 * @param string A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled)
501 * @param string Pass on the wrap-attribute value you use in your <textarea>! This will be used to make sure that some browsers will detect wrapping alright.
502 * @return string Tag attributes for an <input> tag (regarding width)
505 function formWidthText($size=48,$styleOverride='',$wrap='') {
506 $wTags = $this->formWidth($size,1,$styleOverride);
507 // Netscape 6+/Mozilla seems to have this ODD problem where there WILL ALWAYS be wrapping with the cols-attribute set and NEVER without the col-attribute...
508 if (strtolower(trim($wrap))!='off' && $GLOBALS['CLIENT']['BROWSER']=='net' && $GLOBALS['CLIENT']['VERSION']>=5) {
509 $wTags.=' cols="'.$size.'"';
515 * Returns JavaScript variables setting the returnUrl and thisScript location for use by JavaScript on the page.
516 * Used in fx. db_list.php (Web>List)
518 * @param string URL to "this location" / current script
520 * @see typo3/db_list.php
522 function redirectUrls($thisLocation='') {
523 $thisLocation = $thisLocation?
$thisLocation:t3lib_div
::linkThisScript(
532 var T3_RETURN_URL = '".str_replace('%20','',rawurlencode(t3lib_div
::_GP('returnUrl')))."';
533 var T3_THIS_LOCATION = '".str_replace('%20','',rawurlencode($thisLocation))."';
539 * Returns a formatted string of $tstamp
540 * Uses $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] and $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] to format date and time
542 * @param integer UNIX timestamp, seconds since 1970
543 * @param integer How much data to show: $type = 1: hhmm, $type = 10: ddmmmyy
544 * @return string Formatted timestamp
546 function formatTime($tstamp,$type) {
548 case 1: return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'],$tstamp); break;
549 case 10: return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'],$tstamp); break;
554 * Returns script parsetime IF ->parseTimeFlag is set and user is "admin"
555 * Automatically outputted in page end
559 function parseTime() {
560 if ($this->parseTimeFlag
&& $GLOBALS['BE_USER']->isAdmin()) {
561 return '<p>(ParseTime: '.(t3lib_div
::milliseconds()-$GLOBALS['PARSETIME_START']).' ms</p>
562 <p>REQUEST_URI-length: '.strlen(t3lib_div
::getIndpEnv('REQUEST_URI')).')</p>';
577 /*****************************************
579 * PAGE BUILDING FUNCTIONS.
580 * Use this to build the HTML of your backend modules
582 *****************************************/
586 * This includes the proper header with charset, title, meta tag and beginning body-tag.
588 * @param string HTML Page title for the header
589 * @return string Returns the whole header section of a HTML-document based on settings in internal variables (like styles, javascript code, charset, generator and docType)
592 function startPage($title) {
593 // Get META tag containing the currently selected charset for backend output. The function sets $this->charSet.
594 $charSet = $this->initCharset();
595 $generator = $this->generator();
597 // For debugging: If this outputs "QuirksMode"/"BackCompat" (IE) the browser runs in quirks-mode. Otherwise the value is "CSS1Compat"
598 # $this->JScodeArray[]='alert(document.compatMode);';
600 // Send HTTP header for selected charset. Added by Robert Lemke 23.10.2003
601 header ('Content-Type:text/html;charset='.$this->charset
);
603 switch($this->docType
) {
605 $headerStart= '<!DOCTYPE html
606 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
607 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
608 <?xml version="1.0" encoding="'.$this->charset
.'"?>
609 <?xml-stylesheet href="#internalStyle" type="text/css"?>
613 $headerStart= '<!DOCTYPE html
614 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
615 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
616 <?xml version="1.0" encoding="'.$this->charset
.'"?>
617 <?xml-stylesheet href="#internalStyle" type="text/css"?>
621 $headerStart= '<!DOCTYPE html
622 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
623 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
624 <?xml version="1.0" encoding="'.$this->charset
.'"?>
628 $headerStart='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">';
633 if (!$BE_USER->uc
['disableTabInTextarea']) {
634 // This loads the tabulator-in-textarea feature. It automatically modifies every textarea which is found.
635 $tabJScode = '<script src="'.$this->backPath
.'typo3/tab.js" type="text/javascript"></script>';
638 // Construct page header.
639 $str = $headerStart.'
642 <!-- TYPO3 Script ID: '.htmlspecialchars($this->scriptID
).' -->
645 <title>'.htmlspecialchars($title).'</title>
646 '.$this->docStyle().'
649 '.$this->wrapScriptTags(implode("\n", $this->JScodeArray
)).'
650 <!--###POSTJSMARKER###-->
654 $this->JScodeArray
=array();
656 if ($this->docType
=='xhtml_frames') {
659 $str.=$this->docBodyTagBegin().
662 <!-- Wrapping DIV-section for whole page BEGIN -->
663 <div class="'.$this->divClass
.'">
664 ':'').trim($this->form
);
669 * Returns page end; This includes finishing form, div, body and html tags.
671 * @return string The HTML end of a page
675 $str = $this->sectionEnd().
678 t3lib_BEfunc
::getSetUpdateSignal().
683 if ($this->docType
!='xhtml_frames') {
685 $str .= ($this->divClass?
'
687 <!-- Wrapping DIV-section for whole page END -->
695 // Logging: Can't find better place to put it:
696 if (TYPO3_DLOG
) t3lib_div
::devLog('END of BACKEND session','',0,array('_FLUSH'=>TRUE
));
702 * Returns the header-bar in the top of most backend modules
703 * Closes section if open.
705 * @param string The text string for the header
706 * @return string HTML content
708 function header($text) {
711 <!-- MAIN Header in page top -->
712 <h2>'.htmlspecialchars($text).'</h2>
714 return $this->sectionEnd().$str;
718 * Begins an output section and sets header and content
720 * @param string The header
721 * @param string The HTML-content
722 * @param boolean A flag that will prevent the header from being converted to uppercase
723 * @param boolean Defines the type of header (if set, "<h3>" rather than the default "h4")
724 * @param integer The number of an icon to show with the header (see the icon-function). -1,1,2,3
725 * @param boolean If set, HTML tags are allowed in $label (otherwise this value is by default htmlspecialchars()'ed)
726 * @return string HTML content
727 * @see icons(), sectionHeader()
729 function section($label,$text,$nostrtoupper=FALSE
,$sH=FALSE
,$type=0,$allowHTMLinHeader=FALSE
) {
734 if (!$allowHTMLinHeader) $label = htmlspecialchars($label);
735 $str.=$this->sectionHeader($this->icons($type).$label, $sH, $nostrtoupper ?
'' : ' class="uppercase"');
740 <!-- Section content -->
743 return $this->sectionBegin().$str;
747 * Inserts a divider image
748 * Ends a section (if open) before inserting the image
750 * @param integer The margin-top/-bottom of the <hr> ruler.
751 * @return string HTML content
753 function divider($dist) {
754 $dist = intval($dist);
758 <hr style="margin-top: '.$dist.'px; margin-bottom: '.$dist.'px;" />
760 return $this->sectionEnd().$str;
764 * Returns a blank <div>-section with a height
766 * @param integer Padding-top for the div-section (should be margin-top but konqueror (3.1) doesn't like it :-(
767 * @return string HTML content
769 function spacer($dist) {
773 <!-- Spacer element -->
774 <div style="padding-top: '.intval($dist).'px;"></div>
780 * Make a section header.
781 * Begins a section if not already open.
783 * @param string The label between the <h3> or <h4> tags. (Allows HTML)
784 * @param boolean If set, <h3> is used, otherwise <h4>
785 * @param string Additional attributes to h-tag, eg. ' class=""'
786 * @return string HTML content
788 function sectionHeader($label,$sH=FALSE
,$addAttrib='') {
789 $tag = ($sH?
'h3':'h4');
792 <!-- Section header -->
793 <'.$tag.$addAttrib.'>'.$label.'</'.$tag.'>
795 return $this->sectionBegin().$str;
799 * Begins an output section.
800 * Returns the <div>-begin tag AND sets the ->sectionFlag true (if the ->sectionFlag is not already set!)
801 * You can call this function even if a section is already begun since the function will only return something if the sectionFlag is not already set!
803 * @return string HTML content
805 function sectionBegin() {
806 if (!$this->sectionFlag
) {
807 $this->sectionFlag
=1;
810 <!-- ***********************
811 Begin output section.
812 *********************** -->
820 * Ends and output section
821 * Returns the </div>-end tag AND clears the ->sectionFlag (but does so only IF the sectionFlag is set - that is a section is 'open')
822 * See sectionBegin() also.
824 * @return string HTML content
826 function sectionEnd() {
827 if ($this->sectionFlag
) {
828 $this->sectionFlag
=0;
831 <!-- *********************
833 ********************* -->
839 * Originally it printed a kind of divider.
840 * Depreciated. Just remove function calls to it or call the divider() function instead.
850 * If a form-tag is defined in ->form then and end-tag for that <form> element is outputted
851 * Further a JavaScript section is outputted which will update the top.busy session-expiry object (unless $this->endJS is set to false)
853 * @return string HTML content (<script> tag section)
855 function endPageJS() {
856 return ($this->endJS?
'
857 <script type="text/javascript">
859 if (top.busy && top.busy.loginRefreshed) {
860 top.busy.loginRefreshed();
867 * Creates the bodyTag.
868 * You can add to the bodyTag by $this->bodyTagAdditions
870 * @return string HTML body tag
872 function docBodyTagBegin() {
873 $bodyContent = 'body '.trim($this->bodyTagAdditions
.($this->bodyTagId ?
' id="'.$this->bodyTagId
.'"' : ''));
874 return '<'.trim($bodyContent).'>';
878 * Outputting document style
880 * @return string HTML style section/link tags
882 function docStyle() {
884 // Request background image:
885 if ($this->backGroundImage
) {
886 $this->inDocStylesArray
[]=' BODY { background-image: url('.$this->backPath
.$this->backGroundImage
.'); }';
889 // Add inDoc styles variables as well:
890 $this->inDocStylesArray
[] = $this->inDocStyles
;
891 $this->inDocStylesArray
[] = $this->inDocStyles_TBEstyle
;
894 $inDocStyles = implode('
895 ',$this->inDocStylesArray
);
897 // The default color scheme should also in full be represented in the stylesheet.
899 '.($this->styleSheetFile?
'<link rel="stylesheet" type="text/css" href="'.$this->backPath
.$this->styleSheetFile
.'" />':'').'
900 '.($this->styleSheetFile2?
'<link rel="stylesheet" type="text/css" href="'.$this->backPath
.$this->styleSheetFile2
.'" />':'').'
901 <style type="text/css" id="internalStyle">
903 '.trim($inDocStyles).'
904 /*###POSTCSSMARKER###*/
907 '.($this->styleSheetFile_post?
'<link rel="stylesheet" type="text/css" href="'.$this->backPath
.$this->styleSheetFile_post
.'" />':'')
910 $this->inDocStyles
='';
911 $this->inDocStylesArray
=array();
918 * Insert post rendering document style into already rendered content
919 * This is needed for extobjbase
921 * @param string style-content to insert.
922 * @return string content with inserted styles
924 function insertStylesAndJS($content) {
925 // insert accumulated CSS
926 $this->inDocStylesArray
[] = $this->inDocStyles
;
927 $styles = "\n".implode("\n", $this->inDocStylesArray
);
928 $content = str_replace('/*###POSTCSSMARKER###*/',$styles,$content);
930 // insert accumulated JS
931 $jscode = $this->JScode
."\n".$this->wrapScriptTags(implode("\n", $this->JScodeArray
));
932 $content = str_replace('<!--###POSTJSMARKER###-->',$jscode,$content);
938 * Initialize the charset.
939 * Sets the internal $this->charset variable to the charset defined in $GLOBALS["LANG"] (or the default as set in this class)
940 * Returns the meta-tag for the document header
942 * @return string <meta> tag with charset from $this->charset or $GLOBALS['LANG']->charSet
944 function initCharset() {
945 // Set charset to the charset provided by the current backend users language selection:
946 $this->charset
= $GLOBALS['LANG']->charSet ?
$GLOBALS['LANG']->charSet
: $this->charset
;
948 return '<meta http-equiv="Content-Type" content="text/html; charset='.$this->charset
.'" />';
952 * Returns generator meta tag
954 * @return string <meta> tag with name "GENERATOR"
956 function generator() {
957 $str = 'TYPO3 '.TYPO3_branch
.', http://typo3.com, © Kasper Skårhøj 1998-2005, extensions are copyright of their respective owners.';
958 return '<meta name="GENERATOR" content="'.$str .'" />';
968 /*****************************************
971 * Tables, buttons, formatting dimmed/red strings
973 ******************************************/
977 * Returns an image-tag with an 18x16 icon of the following types:
980 * -1: OK icon (Check-mark)
981 * 1: Notice (Speach-bubble)
982 * 2: Warning (Yellow triangle)
983 * 3: Fatal error (Red stop sign)
985 * @param integer See description
986 * @param string Value for style attribute
987 * @return string HTML image tag (if applicable)
989 function icons($type, $styleAttribValue='') {
992 $icon = 'gfx/icon_fatalerror.gif';
995 $icon = 'gfx/icon_warning.gif';
998 $icon = 'gfx/icon_note.gif';
1001 $icon = 'gfx/icon_ok.gif';
1007 return '<img'.t3lib_iconWorks
::skinImg($this->backPath
,$icon,'width="18" height="16"').' class="absmiddle"'.($styleAttribValue ?
' style="'.htmlspecialchars($styleAttribValue).'"' : '').' alt="" />';
1012 * Returns an <input> button with the $onClick action and $label
1014 * @param string The value of the onclick attribute of the input tag (submit type)
1015 * @param string The label for the button (which will be htmlspecialchar'ed)
1016 * @return string A <input> tag of the type "submit"
1018 function t3Button($onClick,$label) {
1019 $button = '<input type="submit" onclick="'.htmlspecialchars($onClick).'; return false;" value="'.htmlspecialchars($label).'" />';
1024 * dimmed-fontwrap. Returns the string wrapped in a <span>-tag defining the color to be gray/dimmed
1026 * @param string Input string
1027 * @return string Output string
1029 function dfw($string) {
1030 return '<span class="typo3-dimmed">'.$string.'</span>';
1034 * red-fontwrap. Returns the string wrapped in a <span>-tag defining the color to be red
1036 * @param string Input string
1037 * @return string Output string
1039 function rfw($string) {
1040 return '<span class="typo3-red">'.$string.'</span>';
1044 * Returns string wrapped in CDATA "tags" for XML / XHTML (wrap content of <script> and <style> sections in those!)
1046 * @param string Input string
1047 * @return string Output string
1049 function wrapInCData($string) {
1050 $string = '/*<![CDATA[*/'.
1058 * Wraps the input string in script tags.
1059 * Automatic re-identing of the JS code is done by using the first line as ident reference.
1060 * This is nice for identing JS code with PHP code on the same level.
1062 * @param string Input string
1063 * @param boolean Wrap script element in linebreaks? Default is TRUE.
1064 * @return string Output string
1066 function wrapScriptTags($string, $linebreak=TRUE
) {
1068 // <script wrapped in nl?
1069 $cr = $linebreak?
"\n" : '';
1071 // remove nl from the beginning
1072 $string = preg_replace ('/^\n+/', '', $string);
1073 // re-ident to one tab using the first line as reference
1074 if(preg_match('/^(\t+)/',$string,$match)) {
1075 $string = str_replace($match[1],"\t", $string);
1077 $string = $cr.'<script type="text/javascript">
1083 return trim($string);
1086 // These vars defines the layout for the table produced by the table() function.
1087 // You can override these values from outside if you like.
1088 var $tableLayout = Array (
1090 'defCol' => Array('<td valign="top">','</td>')
1093 var $table_TR = '<tr>';
1094 var $table_TABLE = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-tmpltable">';
1097 * Returns a table based on the input $arr
1099 * @param array Multidim array with first levels = rows, second levels = cells
1100 * @param array If set, then this provides an alternative layout array instead of $this->tableLayout
1101 * @return string The HTML table.
1104 function table($arr, $layout='') {
1105 if (is_array($arr)) {
1106 $tableLayout = (is_array($layout)) ?
$layout : $this->tableLayout
;
1111 while(list(,$val)=each($arr)) {
1113 $layout = is_array($tableLayout['defRowOdd']) ?
$tableLayout['defRowOdd'] : $tableLayout['defRow'];
1115 $layout = is_array($tableLayout['defRowEven']) ?
$tableLayout['defRowEven'] : $tableLayout['defRow'];
1117 $layoutRow = is_array($tableLayout[$rc]) ?
$tableLayout[$rc] : $layout;
1119 if (is_array($val)) {
1121 while(list(,$content)=each($val)) {
1122 $wrap= is_array($layoutRow[$cc]) ?
$layoutRow[$cc] : (is_array($layoutRow['defCol']) ?
$layoutRow['defCol'] : (is_array($layout[$cc]) ?
$layout[$cc] : $layout['defCol']));
1123 $code_td.=$wrap[0].$content.$wrap[1];
1127 $trWrap = is_array($layoutRow['tr']) ?
$layoutRow['tr'] : (is_array($layout['tr']) ?
$layout['tr'] : array($this->table_TR
, '</tr>'));
1128 $code.=$trWrap[0].$code_td.$trWrap[1];
1131 $tableWrap = is_array($tableLayout['table']) ?
$tableLayout['table'] : array($this->table_TABLE
, '</table>');
1132 $code=$tableWrap[0].$code.$tableWrap[1];
1138 * Constructs a table with content from the $arr1, $arr2 and $arr3.
1139 * Used in eg. ext/belog/mod/index.php - refer to that for examples
1141 * @param array Menu elements on first level
1142 * @param array Secondary items
1143 * @param array Third-level items
1144 * @return string HTML content, <table>...</table>
1146 function menuTable($arr1,$arr2=array(), $arr3=array()) {
1147 $rows = max(array(count($arr1),count($arr2),count($arr3)));
1150 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tablemenu">';
1151 for($a=0;$a<$rows;$a++
) {
1155 $cls[]='<td valign="'.$valign.'">'.$arr1[$a][0].'</td><td>'.$arr1[$a][1].'</td>';
1157 $cls[]='<td valign="'.$valign.'">'.$arr2[$a][0].'</td><td>'.$arr2[$a][1].'</td>';
1159 $cls[]='<td valign="'.$valign.'">'.$arr3[$a][0].'</td><td>'.$arr3[$a][1].'</td>';
1162 $menu.=implode($cls,'<td> </td>');
1172 * Returns a one-row/two-celled table with $content and $menu side by side.
1173 * The table is a 100% width table and each cell is aligned left / right
1175 * @param string Content cell content (left)
1176 * @param string Menu cell content (right)
1177 * @return string HTML output
1179 function funcMenu($content,$menu) {
1181 <table border="0" cellpadding="0" cellspacing="0" width="100%" id="typo3-funcmenu">
1183 <td valign="top" nowrap="nowrap">'.$content.'</td>
1184 <td valign="top" align="right" nowrap="nowrap">'.$menu.'</td>
1190 * Creates a selector box with clear-cache items.
1191 * Rather specialized functions - at least don't use it with $addSaveOptions unless you know what you do...
1193 * @param integer The page uid of the "current page" - the one that will be cleared as "clear cache for this page".
1194 * @param boolean If $addSaveOptions is set, then also the array of save-options for TCE_FORMS will appear.
1195 * @return string <select> tag with content - a selector box for clearing the cache
1197 function clearCacheMenu($id,$addSaveOptions=0) {
1200 if ($addSaveOptions) {
1201 $opt[]='<option value="">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.menu',1).'</option>';
1202 $opt[]='<option value="TBE_EDITOR_checkAndDoSubmit(1);">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc',1).'</option>';
1203 $opt[]='<option value="document.editform.closeDoc.value=-2; TBE_EDITOR_checkAndDoSubmit(1);">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc',1).'</option>';
1204 if ($BE_USER->uc
['allSaveFunctions']) $opt[]='<option value="document.editform.closeDoc.value=-3; TBE_EDITOR_checkAndDoSubmit(1);">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseAllDocs',1).'</option>';
1205 $opt[]='<option value="document.editform.closeDoc.value=2; document.editform.submit();">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc',1).'</option>';
1206 $opt[]='<option value="document.editform.closeDoc.value=3; document.editform.submit();">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeAllDocs',1).'</option>';
1207 $opt[]='<option value=""></option>';
1209 $opt[]='<option value="">[ '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.clearCache_clearCache',1).' ]</option>';
1210 if ($id) $opt[]='<option value="'.$id.'">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.clearCache_thisPage',1).'</option>';
1211 if ($BE_USER->isAdmin() ||
$BE_USER->getTSConfigVal('options.clearCache.pages')) $opt[]='<option value="pages">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.clearCache_pages',1).'</option>';
1212 if ($BE_USER->isAdmin() ||
$BE_USER->getTSConfigVal('options.clearCache.all')) $opt[]='<option value="all">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.clearCache_all',1).'</option>';
1214 $onChange = 'if (!this.options[this.selectedIndex].value) {
1215 this.selectedIndex=0;
1216 } else if (this.options[this.selectedIndex].value.indexOf(\';\')!=-1) {
1217 eval(this.options[this.selectedIndex].value);
1219 document.location=\''.$this->backPath
.'tce_db.php?vC='.$BE_USER->veriCode().'&redirect='.rawurlencode(t3lib_div
::getIndpEnv('REQUEST_URI')).'&cacheCmd=\'+this.options[this.selectedIndex].value;
1221 $af_content = '<select name="cacheCmd" onchange="'.htmlspecialchars($onChange).'">'.implode('',$opt).'</select>';
1223 if (count($opt)>2) {
1229 * Returns an array with parts (JavaScript, init-functions, <div>-layers) for use on pages which displays the clickmenu layers (context sensitive menus)
1231 * @return array If values are present: [0] = A <script> section for the HTML page header, [1] = onmousemove/onload handler for HTML tag or alike, [2] = Two empty <div> layers for the context menu
1233 function getContextMenuCode() {
1234 if ($this->isCMlayers()) {
1236 <script type="text/javascript">
1239 var GLV_curLayerX=new Array(0,0);
1240 var GLV_curLayerY=new Array(0,0);
1241 var GLV_curLayerWidth=new Array(0,0);
1242 var GLV_curLayerHeight=new Array(0,0);
1243 var GLV_isVisible=new Array(0,0);
1248 var layerObj=new Array();
1249 var layerObjCss=new Array();
1252 function GL_checkBrowser(){ //
1253 this.dom= (document.getElementById);
1254 this.op= (navigator.userAgent.indexOf("Opera")>-1);
1255 this.op7= this.op && (navigator.appVersion.indexOf("7")>-1); // check for Opera version 7
1256 this.konq= (navigator.userAgent.indexOf("Konq")>-1);
1257 this.ie4= (document.all && !this.dom && !this.op && !this.konq);
1258 this.ie5= (document.all && this.dom && !this.op && !this.konq);
1259 this.ns4= (document.layers && !this.dom && !this.konq);
1260 this.ns5= (!document.all && this.dom && !this.op && !this.konq);
1261 this.ns6= (this.ns5);
1262 this.bw= (this.ie4 || this.ie5 || this.ns4 || this.ns6 || this.op || this.konq);
1265 bw= new GL_checkBrowser();
1268 function GL_getObj(obj){ //
1270 this.el= (bw.ie4||bw.op7)?document.all[obj]:bw.ns4?eval(nest+"document."+obj):document.getElementById(obj);
1271 this.css= bw.ns4?this.el:this.el.style;
1272 this.ref= bw.ns4?this.el.document:document;
1273 this.x= (bw.ns4||bw.op)?this.css.left:this.el.offsetLeft;
1274 this.y= (bw.ns4||bw.op)?this.css.top:this.el.offsetTop;
1275 this.height= (bw.ie4||bw.dom)?this.el.offsetHeight:bw.ns4?this.ref.height:0;
1276 this.width= (bw.ie4||bw.dom)?this.el.offsetWidth:bw.ns4?this.ref.width:0;
1279 // GL_getObjCss(obj)
1280 function GL_getObjCss(obj){ //
1281 return bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;
1283 // GL_getMouse(event)
1284 function GL_getMouse(event) { //
1286 // GLV_x= (bw.ns4||bw.ns5)?event.pageX:(bw.ie4||bw.op)?event.clientX:(event.clientX-2)+document.body.scrollLeft;
1287 // GLV_y= (bw.ns4||bw.ns5)?event.pageY:(bw.ie4||bw.op)?event.clientY:(event.clientY-2)+document.body.scrollTop;
1288 // 17/12 2003: When documents run in XHTML standard compliance mode, the old scrollLeft/Top properties of document.body is gone - and for Opera/MSIE we have to use document.documentElement:
1290 GLV_xRel = event.clientX-2;
1291 GLV_yRel = event.clientY-2;
1292 GLV_x = GLV_xRel + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
1293 GLV_y = GLV_yRel + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
1295 // status = (GLV_x+GLV_gap-GLV_curLayerX[0]) + " | " + (GLV_y+GLV_gap-GLV_curLayerY[0]);
1296 if (GLV_isVisible[1]) {
1297 if (outsideLayer(1)) hideSpecific(1);
1298 } else if (GLV_isVisible[0]) {
1299 if (outsideLayer(0)) hideSpecific(0);
1303 // outsideLayer(level)
1304 function outsideLayer(level) { //
1305 return GLV_x+GLV_gap-GLV_curLayerX[level] <0 ||
1306 GLV_y+GLV_gap-GLV_curLayerY[level] <0 ||
1307 GLV_curLayerX[level]+GLV_curLayerWidth[level]+GLV_gap-GLV_x <0 ||
1308 GLV_curLayerY[level]+GLV_curLayerHeight[level]+GLV_gap-GLV_y <0;
1310 // setLayerObj(html,level)
1311 function setLayerObj(html,level) { //
1312 var winHeight = document.documentElement.clientHeight && !bw.op7 ? document.documentElement.clientHeight : document.body.clientHeight;
1313 var winWidth = document.documentElement.clientWidth && !bw.op7 ? document.documentElement.clientWidth : document.body.clientWidth;
1314 var tempLayerObj = GL_getObj("contentMenu"+level);
1315 var tempLayerObjCss = GL_getObjCss("contentMenu"+level);
1317 if (tempLayerObj && (level==0 || GLV_isVisible[level-1])) {
1318 tempLayerObj.el.innerHTML = html;
1319 tempLayerObj.width= (bw.ie4||bw.dom)?this.el.offsetWidth:bw.ns4?this.ref.width:0;
1320 tempLayerObj.height= (bw.ie4||bw.dom)?this.el.offsetHeight:bw.ns4?this.ref.height:0;
1322 // konqueror (3.2.2) workaround
1323 winHeight = (bw.konq)?window.innerHeight:winHeight;
1324 winWidth = (bw.konq)?window.innerWidth:winWidth;
1326 // Adjusting the Y-height of the layer to fit it into the window frame if it goes under the window frame in the bottom:
1327 if (winHeight-tempLayerObj.height < GLV_yRel) {
1328 if (GLV_yRel < tempLayerObj.height) {
1329 GLV_y+= (winHeight-tempLayerObj.height-GLV_yRel); // Setting it so bottom is just above window height.
1331 GLV_y-= tempLayerObj.height-8; // Showing the menu upwards
1334 // Adjusting the X position like Y above
1335 if (winWidth-tempLayerObj.width < GLV_xRel) {
1336 if (GLV_xRel < tempLayerObj.width) {
1337 GLV_x+= (winWidth-tempLayerObj.width-GLV_xRel);
1339 GLV_x-= tempLayerObj.width-8;
1342 GLV_x = Math.max(GLV_x,1);
1343 GLV_y = Math.max(GLV_y,1);
1345 GLV_curLayerX[level] = GLV_x;
1346 GLV_curLayerY[level] = GLV_y;
1347 tempLayerObjCss.left = GLV_x+"px";
1348 tempLayerObjCss.top = GLV_y+"px";
1349 tempLayerObjCss.visibility = "visible";
1350 if (bw.ie5) showHideSelectorBoxes("hidden");
1352 GLV_isVisible[level]=1;
1353 GLV_curLayerWidth[level] = tempLayerObj.width;
1354 GLV_curLayerHeight[level] = tempLayerObj.height;
1358 function hideEmpty() { //
1363 // hideSpecific(level)
1364 function hideSpecific(level) { //
1365 GL_getObjCss("contentMenu"+level).visibility = "hidden";
1366 GL_getObj("contentMenu"+level).el.innerHTML = "";
1367 GLV_isVisible[level]=0;
1369 if (bw.ie5 && level==0) showHideSelectorBoxes("visible");
1371 // debugObj(obj,name)
1372 function debugObj(obj,name) { //
1374 for (i in obj) {if (obj[i]) {acc+=i+": "+obj[i]+"\n";}}
1375 alert("Object: "+name+"\n\n"+acc);
1378 function initLayer(){ //
1380 window.onmousemove=GL_getMouse;
1382 layerObj = GL_getObj("contentMenu1");
1383 layerObjCss = GL_getObjCss("contentMenu1");
1385 function showHideSelectorBoxes(action) { // This function by Michiel van Leening
1386 for (i=0;i<document.forms.length;i++) {
1387 for (j=0;j<document.forms[i].elements.length;j++) {
1388 if(document.forms[i].elements[j].type=="select-one") {
1389 document.forms[i].elements[j].style.visibility=action;
1399 ' onmousemove="GL_getMouse(event);" onload="initLayer();"',
1400 '<div id="contentMenu0" style="z-index:1; position:absolute;visibility:hidden"></div><div id="contentMenu1" style="z-index:2; position:absolute;visibility:hidden"></div>'
1402 } else return array('','','');
1406 * Creates a tab menu from an array definition
1408 * Returns a tab menu for a module
1409 * Requires the JS function jumpToUrl() to be available
1411 * @param mixed $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
1412 * @param string $elementName it the form elements name, probably something like "SET[...]"
1413 * @param string $currentValue is the value to be selected currently.
1414 * @param array $menuItems is an array with the menu items for the selector box
1415 * @param string $script is the script to send the &id to, if empty it's automatically found
1416 * @param string $addParams is additional parameters to pass to the script.
1417 * @return string HTML code for tab menu
1418 * @author René Fritz <r.fritz@colorcube.de>
1420 function getTabMenu($mainParams,$elementName,$currentValue,$menuItems,$script='',$addparams='') {
1423 if (is_array($menuItems)) {
1424 if (!is_array($mainParams)) {
1425 $mainParams = array('id' => $mainParams);
1427 $mainParams = t3lib_div
::implodeArrayForUrl('',$mainParams);
1429 if (!$script) {$script=basename(PATH_thisScript
);}
1432 foreach($menuItems as $value => $label) {
1433 $menuDef[$value]['isActive'] = !strcmp($currentValue,$value);
1434 $menuDef[$value]['label'] = t3lib_div
::deHSCentities(htmlspecialchars($label));
1435 $menuDef[$value]['url'] = htmlspecialchars($script.'?'.$mainParams.$addparams.'&'.$elementName.'='.$value);
1437 $content = $this->getTabMenuRaw($menuDef);
1444 * Creates the HTML content for the tab menu
1446 * @param array Menu items for tabs
1447 * @return string Table HTML
1450 function getTabMenuRaw($menuItems) {
1453 if (is_array($menuItems)) {
1456 $count = count($menuItems);
1460 $widthRight = max (1,floor(30-pow($count,1.72)));
1461 $widthTabs = 100 - $widthRight - $widthLeft;
1462 $widthNo = floor(($widthTabs - $addToAct)/$count);
1463 $addToAct = max ($addToAct,$widthTabs-($widthNo*$count));
1464 $widthAct = $widthNo +
$addToAct;
1465 $widthRight = 100 - ($widthLeft +
($count*$widthNo) +
$addToAct);
1468 foreach($menuItems as $id => $def) {
1469 $isActive = $def['isActive'];
1470 $class = $isActive ?
'tabact' : 'tab';
1471 $width = $isActive ?
$widthAct : $widthNo;
1473 // @rene: Here you should probably wrap $label and $url in htmlspecialchars() in order to make sure its XHTML compatible! I did it for $url already since that is VERY likely to break.
1474 $label = $def['label'];
1475 $url = htmlspecialchars($def['url']);
1476 $params = $def['addParams'];
1480 <td width="'.$width.'%" class="'.$class.'" style="border-left: solid #000 1px;"><a href="'.$url.'" style="padding-left:5px;padding-right:2px;" '.$params.'>'.$label.'</a></td>';
1483 <td width="'.$width.'%" class="'.$class.'"><a href="'.$url.'" '.$params.'>'.$label.'</a></td>';
1491 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="typo3-tabmenu">
1493 <td width="'.$widthLeft.'%"> </td>
1495 <td width="'.$widthRight.'%"> </td>
1498 <div class="hr" style="margin:0px"></div>';
1506 * Creates a DYNAMIC tab-menu where the tabs are switched between with DHTML.
1507 * Should work in MSIE, Mozilla, Opera and Konqueror. On Konqueror I did find a serious problem: <textarea> fields loose their content when you switch tabs!
1509 * @param array Numeric array where each entry is an array in itself with associative keys: "label" contains the label for the TAB, "content" contains the HTML content that goes into the div-layer of the tabs content. "description" contains description text to be shown in the layer. "linkTitle" is short text for the title attribute of the tab-menu link (mouse-over text of tab). "stateIcon" indicates a standard status icon (see ->icon(), values: -1, 1, 2, 3). "icon" is an image tag placed before the text.
1510 * @param string Identification string. This should be unique for every instance of a dynamic menu!
1511 * @param integer If "1", then enabling one tab does not hide the others - they simply toggles each sheet on/off. This makes most sense together with the $foldout option. If "-1" then it acts normally where only one tab can be active at a time BUT you can click a tab and it will close so you have no active tabs.
1512 * @param boolean If set, the tabs are rendered as headers instead over each sheet. Effectively this means there is no tab menu, but rather a foldout/foldin menu. Make sure to set $toggle as well for this option.
1513 * @param integer Character limit for a new row.
1514 * @param boolean If set, tab table cells are not allowed to wrap their content
1515 * @param boolean If set, the tabs will span the full width of their position
1516 * @param integer Default tab to open (for toggle <=0). Value corresponds to integer-array index + 1 (index zero is "1", index "1" is 2 etc.). A value of zero (or something non-existing) will result in no default tab open.
1517 * @return string JavaScript section for the HTML header.
1519 function getDynTabMenu($menuItems,$identString,$toggle=0,$foldout=FALSE
,$newRowCharLimit=50,$noWrap=1,$fullWidth=FALSE
,$defaultTabIndex=1) {
1522 if (is_array($menuItems)) {
1525 $options = array(array());
1528 $id = 'DTM-'.t3lib_div
::shortMD5($identString);
1529 $noWrap = $noWrap ?
' nowrap="nowrap"' : '';
1531 // Traverse menu items
1535 foreach($menuItems as $index => $def) {
1536 $index+
=1; // Need to add one so checking for first index in JavaScript is different than if it is not set at all.
1538 // Switch to next tab row if needed
1539 if (!$foldout && $titleLenCount>$newRowCharLimit) { // 50 characters is probably a reasonable count of characters before switching to next row of tabs.
1542 $options[$tabRows] = array();
1546 $onclick = 'this.blur(); DTM_toggle("'.$id.'","'.$index.'"); return false;';
1548 $onclick = 'this.blur(); DTM_activate("'.$id.'","'.$index.'", '.($toggle<0?
1:0).'); return false;';
1551 $isActive = strcmp($def['content'],'');
1553 $mouseOverOut = 'onmouseover="DTM_mouseOver(this);" onmouseout="DTM_mouseOut(this);"';
1557 $options[$tabRows][] = '
1558 <td class="'.($isActive ?
'tab' : 'disabled').'" id="'.$id.'-'.$index.'-MENU"'.$noWrap.$mouseOverOut.'>'.
1559 ($isActive ?
'<a href="#" onclick="'.htmlspecialchars($onclick).'"'.($def['linkTitle'] ?
' title="'.htmlspecialchars($def['linkTitle']).'"':'').'>' : '').
1561 ($def['label'] ?
htmlspecialchars($def['label']) : ' ').
1562 $this->icons($def['stateIcon'],'margin-left: 10px;').
1563 ($isActive ?
'</a>' :'').
1565 $titleLenCount+
= strlen($def['label']);
1567 // Create DIV layer for content:
1569 <div class="'.($isActive ?
'tab' : 'disabled').'" id="'.$id.'-'.$index.'-MENU"'.$mouseOverOut.'>'.
1570 ($isActive ?
'<a href="#" onclick="'.htmlspecialchars($onclick).'"'.($def['linkTitle'] ?
' title="'.htmlspecialchars($def['linkTitle']).'"':'').'>' : '').
1572 ($def['label'] ?
htmlspecialchars($def['label']) : ' ').
1573 ($isActive ?
'</a>' : '').
1578 // Create DIV layer for content:
1580 <div style="display: none;" id="'.$id.'-'.$index.'-DIV" class="c-tablayer">'.
1581 ($def['description'] ?
'<p class="c-descr">'.nl2br(htmlspecialchars($def['description'])).'</p>' : '').
1584 // Create initialization string:
1586 DTM_array["'.$id.'"]['.$c.'] = "'.$id.'-'.$index.'";
1590 if (top.DTM_currentTabs["'.$id.'-'.$index.'"]) { DTM_toggle("'.$id.'","'.$index.'",1); }
1599 if (count($options)) {
1601 // Tab menu is compiled:
1604 for($a=0;$a<=$tabRows;$a++
) {
1608 <table cellpadding="0" cellspacing="0" border="0"'.($fullWidth ?
' width="100%"' : '').' class="typo3-dyntabmenu">
1610 '.implode('',$options[$a]).'
1614 $content.= '<div class="typo3-dyntabmenu-tabs">'.$tabContent.'</div>';
1617 // Div layers are added:
1619 <!-- Div layers for tab menu: -->
1620 <div class="typo3-dyntabmenu-divs'.($foldout?
'-foldout':'').'">
1621 '.implode('',$divs).'</div>';
1623 // Java Script section added:
1625 <!-- Initialization JavaScript for the menu -->
1626 <script type="text/javascript">
1627 DTM_array["'.$id.'"] = new Array();
1628 '.implode('',$JSinit).'
1629 '.($toggle<=0 ?
'DTM_activate("'.$id.'", top.DTM_currentTabs["'.$id.'"]?top.DTM_currentTabs["'.$id.'"]:'.intval($defaultTabIndex).', 0);' : '').'
1640 * Returns dynamic tab menu header JS code.
1642 * @return string JavaScript section for the HTML header.
1644 function getDynTabMenuJScode() {
1646 <script type="text/javascript">
1648 var DTM_array = new Array();
1649 var DTM_origClass = new String();
1651 function DTM_activate(idBase,index,doToogle) { //
1653 if (DTM_array[idBase]) {
1654 for(cnt = 0; cnt < DTM_array[idBase].length ; cnt++) {
1655 if (DTM_array[idBase][cnt] != idBase+"-"+index) {
1656 document.getElementById(DTM_array[idBase][cnt]+"-DIV").style.display = "none";
1657 document.getElementById(DTM_array[idBase][cnt]+"-MENU").attributes.getNamedItem("class").nodeValue = "tab";
1663 if (document.getElementById(idBase+"-"+index+"-DIV")) {
1664 if (doToogle && document.getElementById(idBase+"-"+index+"-DIV").style.display == "block") {
1665 document.getElementById(idBase+"-"+index+"-DIV").style.display = "none";
1666 if(DTM_origClass=="") {
1667 document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").nodeValue = "tab";
1669 DTM_origClass = "tab";
1671 top.DTM_currentTabs[idBase] = -1;
1673 document.getElementById(idBase+"-"+index+"-DIV").style.display = "block";
1674 if(DTM_origClass=="") {
1675 document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").nodeValue = "tabact";
1677 DTM_origClass = "tabact";
1679 top.DTM_currentTabs[idBase] = index;
1683 function DTM_toggle(idBase,index,isInit) { //
1685 if (document.getElementById(idBase+"-"+index+"-DIV")) {
1686 if (document.getElementById(idBase+"-"+index+"-DIV").style.display == "block") {
1687 document.getElementById(idBase+"-"+index+"-DIV").style.display = "none";
1689 document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").nodeValue = "tab";
1691 DTM_origClass = "tab";
1693 top.DTM_currentTabs[idBase+"-"+index] = 0;
1695 document.getElementById(idBase+"-"+index+"-DIV").style.display = "block";
1697 document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").nodeValue = "tabact";
1699 DTM_origClass = "tabact";
1701 top.DTM_currentTabs[idBase+"-"+index] = 1;
1706 function DTM_mouseOver(obj) { //
1707 DTM_origClass = obj.attributes.getNamedItem(\'class\').nodeValue;
1708 obj.attributes.getNamedItem(\'class\').nodeValue += "_over";
1711 function DTM_mouseOut(obj) { //
1712 obj.attributes.getNamedItem(\'class\').nodeValue = DTM_origClass;
1723 * Creates the version selector for the page id inputted.
1724 * Requires the core version management extension, "version" to be loaded.
1726 * @param integer Page id to create selector for.
1727 * @param boolean If set, there will be no button for swapping page.
1730 function getVersionSelector($id,$noAction=FALSE
) {
1732 if ($id>0 && t3lib_extMgm
::isLoaded('version') && $GLOBALS['BE_USER']->workspace
==0) {
1734 // Get Current page record:
1735 $curPage = t3lib_BEfunc
::getRecord('pages',$id);
1736 // If the selected page is not online, find the right ID
1737 $onlineId = ($curPage['pid']==-1 ?
$curPage['t3ver_oid'] : $id);
1738 // Select all versions of online version:
1739 $versions = t3lib_BEfunc
::selectVersionsOfRecord('pages', $onlineId, 'uid,pid,t3ver_label,t3ver_oid,t3ver_wsid,t3ver_id');
1741 // If more than one was found...:
1742 if (count($versions)>1) {
1744 // Create selector box entries:
1746 foreach($versions as $vRow) {
1747 $opt[] = '<option value="'.htmlspecialchars(t3lib_div
::linkThisScript(array('id'=>$vRow['uid']))).'"'.($id==$vRow['uid']?
' selected="selected"':'').'>'.
1748 htmlspecialchars($vRow['t3ver_label'].' [v#'.$vRow['t3ver_id'].', WS:'.$vRow['t3ver_wsid'].']'.($vRow['uid']==$onlineId ?
' =>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.online').'<=':'')).
1752 // Add management link:
1753 $opt[] = '<option value="'.htmlspecialchars(t3lib_div
::linkThisScript(array('id'=>$id))).'">---</option>';
1754 $opt[] = '<option value="'.htmlspecialchars($this->backPath
.t3lib_extMgm
::extRelPath('version').'cm1/index.php?table=pages&uid='.$onlineId).'">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.mgm',1).'</option>';
1756 // Create onchange handler:
1757 $onChange = "document.location=this.options[this.selectedIndex].value;";
1760 if ($id==$onlineId) {
1761 $controls = '<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/blinkarrow_left.gif','width="5" height="9"').' class="absmiddle" alt="" /> <b>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.online',1).'</b>';
1762 } elseif (!$noAction) {
1763 $controls = '<a href="'.$this->issueCommand('&cmd[pages]['.$onlineId.'][version][swapWith]='.$id.'&cmd[pages]['.$onlineId.'][version][action]=swap',t3lib_div
::linkThisScript(array('id'=>$onlineId))).'" class="nobr">'.
1764 '<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/insert1.gif','width="14" height="14"').' style="margin-right: 2px;" class="absmiddle" alt="" title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.swapPage',1).'" />'.
1765 '<b>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.swap',1).'</b></a>';
1768 // Write out HTML code:
1774 <table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
1776 <td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.selVer',1).'</td>
1778 <select onchange="'.htmlspecialchars($onChange).'">
1779 '.implode('',$opt).'
1781 <td>'.$controls.'</td>
1786 } elseif ($GLOBALS['BE_USER']->workspace
!==0) {
1788 if (t3lib_BEfunc
::isPidInVersionizedBranch($id)=='branchpoint') {
1789 // Write out HTML code:
1795 <table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
1797 <td>Workspace: "'.$GLOBALS['BE_USER']->workspaceRec
['title'].'"</td>
1798 <td><em>Inside branch, no further versioning possible</em></td>
1803 // Get Current page record:
1804 $curPage = t3lib_BEfunc
::getRecord('pages',$id);
1805 // If the selected page is not online, find the right ID
1806 $onlineId = ($curPage['pid']==-1 ?
$curPage['t3ver_oid'] : $id);
1807 // The version of page:
1808 $verPage = t3lib_BEfunc
::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace
, 'pages', $onlineId);
1811 $onClick = $this->issueCommand('&cmd[pages]['.$onlineId.'][version][action]=new&cmd[pages]['.$onlineId.'][version][treeLevel]=0',t3lib_div
::linkThisScript(array('id'=>$onlineId)));
1812 $onClick = 'document.location=\''.$onClick.'\'; return false;';
1813 // Write out HTML code:
1817 No version yet, create one?
1819 <table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
1821 <td>Workspace: "'.$GLOBALS['BE_USER']->workspaceRec
['title'].'"</td>
1823 <input type="submit" value="New version of page" name="_" onclick="'.htmlspecialchars($onClick).'" /></td>
1828 $onClick = $this->issueCommand('&cmd[pages]['.$onlineId.'][version][action]=swap&cmd[pages]['.$onlineId.'][version][swapWith]='.$verPage['uid'],t3lib_div
::linkThisScript(array('id'=>$onlineId)));
1829 $onClick = 'document.location=\''.$onClick.'\'; return false;';
1831 // Write out HTML code:
1837 <table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
1839 <td>Workspace: "'.$GLOBALS['BE_USER']->workspaceRec
['title'].'"</td>
1841 <input type="submit" value="Publish page" name="_" onclick="'.htmlspecialchars($onClick).'" /></td>
1853 // ******************************
1854 // Extension classes of the template class.
1855 // These are meant to provide backend screens with different widths.
1856 // They still do because of the different class-prefixes used for the <div>-sections
1857 // but obviously the final width is determined by the stylesheet used.
1858 // ******************************
1861 * Extension class for "template" - used for backend pages which are wide. Typically modules taking up all the space in the "content" frame of the backend
1862 * The class were more significant in the past than today.
1865 class bigDoc
extends template
{
1866 var $divClass = 'typo3-bigDoc';
1870 * Extension class for "template" - used for backend pages without the "document" background image
1871 * The class were more significant in the past than today.
1874 class noDoc
extends template
{
1875 var $divClass = 'typo3-noDoc';
1879 * Extension class for "template" - used for backend pages which were narrow (like the Web>List modules list frame. Or the "Show details" pop up box)
1880 * The class were more significant in the past than today.
1883 class smallDoc
extends template
{
1884 var $divClass = 'typo3-smallDoc';
1888 * Extension class for "template" - used for backend pages which were medium wide. Typically submodules to Web or File which were presented in the list-frame when the content frame were divided into a navigation and list frame.
1889 * The class were more significant in the past than today. But probably you should use this one for most modules you make.
1892 class mediumDoc
extends template
{
1893 var $divClass = 'typo3-mediumDoc';
1898 // Include extension to the template class?
1899 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/template.php']) {
1900 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/template.php']);
1905 // ******************************************************
1906 // The backend language engine is started (ext: "lang")
1907 // ******************************************************
1908 require_once(PATH_typo3
.'sysext/lang/lang.php');
1909 $LANG = t3lib_div
::makeInstance('language');
1910 $LANG->init($BE_USER->uc
['lang']);
1914 // ******************************
1915 // The template is loaded
1916 // ******************************
1917 $TBE_TEMPLATE = t3lib_div
::makeInstance('template');