79 function jumpToUrl(URL) { 80 window.location.href = URL; 239 'structure' =>
'sysext/backend/Resources/Public/Css/structure/',
240 'visual' =>
'sysext/backend/Resources/Public/Css/visual/',
241 'generatedSprites' =>
'../typo3temp/sprites/' 246 'structure' =>
'Resources/Public/Css/structure/',
247 'visual' =>
'Resources/Public/Css/visual/' 264 'modernizr' =>
'contrib/modernizr/modernizr.min.js' 336 $this->scriptID = preg_replace(
'/^.*\\/(sysext|ext)\\//',
'ext/',
$GLOBALS[
'TBE_MODULES'][
'_PATHS'][$temp_M] .
'index.php');
338 $this->scriptID = preg_replace(
'/^.*\\/(sysext|ext)\\//',
'ext/', \
TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(PATH_thisScript));
340 if (TYPO3_mainDir !=
'typo3/' && substr($this->scriptID, 0, strlen(TYPO3_mainDir)) == TYPO3_mainDir) {
342 $this->scriptID =
'typo3/' . substr($this->scriptID, strlen(TYPO3_mainDir));
344 $this->bodyTagId = preg_replace(
'/[^A-Za-z0-9-]/',
'-', $this->scriptID);
346 if (is_array(
$GLOBALS[
'TBE_STYLES'][
'scriptIDindex'][$this->scriptID])) {
352 unset(
$GLOBALS[
'TBE_STYLES'][
'scriptIDindex'][$this->scriptID]);
355 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor']) {
356 $this->bgColor =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor'];
358 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor1']) {
359 $this->bgColor1 =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor1'];
361 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor2']) {
362 $this->bgColor2 =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor2'];
364 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor3']) {
365 $this->bgColor3 =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor3'];
367 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor4']) {
368 $this->bgColor4 =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor4'];
370 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor5']) {
371 $this->bgColor5 =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor5'];
373 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor6']) {
374 $this->bgColor6 =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'bgColor6'];
376 if (
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'hoverColor']) {
377 $this->hoverColor =
$GLOBALS[
'TBE_STYLES'][
'mainColors'][
'hoverColor'];
380 if (
$GLOBALS[
'TBE_STYLES'][
'stylesheet']) {
381 $this->styleSheetFile =
$GLOBALS[
'TBE_STYLES'][
'stylesheet'];
383 if (
$GLOBALS[
'TBE_STYLES'][
'stylesheet2']) {
384 $this->styleSheetFile2 =
$GLOBALS[
'TBE_STYLES'][
'stylesheet2'];
386 if (
$GLOBALS[
'TBE_STYLES'][
'styleSheetFile_post']) {
387 $this->styleSheetFile_post =
$GLOBALS[
'TBE_STYLES'][
'styleSheetFile_post'];
389 if (
$GLOBALS[
'TBE_STYLES'][
'inDocStyles_TBEstyle']) {
390 $this->inDocStyles_TBEstyle =
$GLOBALS[
'TBE_STYLES'][
'inDocStyles_TBEstyle'];
394 $this->addStylesheetDirectory($stylesheetDirectory);
397 if (
$GLOBALS[
'TBE_STYLES'][
'background']) {
398 $this->backGroundImage =
$GLOBALS[
'TBE_STYLES'][
'background'];
408 if (!isset($this->pageRenderer)) {
410 $this->pageRenderer->setLanguage(
$GLOBALS[
'LANG']->lang);
411 $this->pageRenderer->addCssLibrary(
$GLOBALS[
'BACK_PATH'] .
'contrib/normalize/normalize.css',
'stylesheet',
'all',
'', TRUE, TRUE);
412 $this->pageRenderer->enableConcatenateFiles();
413 $this->pageRenderer->enableCompressCss();
414 $this->pageRenderer->enableCompressJavascript();
416 foreach ($this->jsFilesNoConcatenation as $file) {
417 $this->pageRenderer->addJsFile(
427 foreach ($this->jsFiles as $file) {
428 $this->pageRenderer->addJsFile(
$GLOBALS[
'BACK_PATH'] . $file);
431 if ((
int)
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'debug'] === 1) {
432 $this->pageRenderer->enableDebugMode();
443 $this->extDirectStateProvider = TRUE;
467 public function wrapClickMenuOnIcon($str, $table,
$uid = 0, $listFr = TRUE, $addParams =
'', $enDisItems =
'', $returnOnClick = FALSE) {
469 $onClick =
'Clickmenu.show("' . $table .
'","' . (
$uid !== 0 ?
$uid :
'') .
'","' . strval($listFr) .
'","' . str_replace(
'+',
'%2B', $enDisItems) .
'","' . str_replace(
'&',
'&', addcslashes(
$backPath,
'"')) .
'","' . str_replace(
'&',
'&', addcslashes($addParams,
'"')) .
'");return false;';
470 return $returnOnClick ? $onClick :
'<a href="#" onclick="' . htmlspecialchars($onClick) .
'" oncontextmenu="this.click();return false;">' . $str .
'</a>';
490 ),
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.showList'));
508 $commandUrl = $this->backPath .
'tce_db.php?' . $params .
'&redirect=' . ($redirectUrl == -1 ?
'\'+T3_THIS_LOCATION+\
'' : rawurlencode($redirectUrl)) .
'&vC=' . rawurlencode(
$GLOBALS[
'BE_USER']->veriCode()) .
BackendUtility::getUrlToken(
'tceAction') .
'&prErr=1&uPT=1';
522 return !
$GLOBALS[
'BE_USER']->uc[
'disableCMlayers'] && !(
$GLOBALS[
'CLIENT'][
'SYSTEM'] ==
'mac' &&
$GLOBALS[
'CLIENT'][
'BROWSER'] ==
'Opera');
540 public function getHeader($table, $row, $path, $noViewPageIcon = FALSE, $tWrap = array(
'',
''), $enableClickMenu = TRUE) {
542 if (is_array($row) && $row[
'uid']) {
545 $viewPage = $noViewPageIcon ?
'' : $this->
viewPageIcon($row[
'uid'], $this->backPath,
'');
546 if ($table ==
'pages') {
551 $title =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'];
554 if ($enableClickMenu) {
558 return '<span class="typo3-moduleHeader">' . $iconImgTag . $viewPage . $tWrap[0] . htmlspecialchars(
GeneralUtility::fixed_lgd_cs($title, 45)) . $tWrap[1] .
'</span>';
570 public function getResourceHeader(\
TYPO3\CMS\Core\Resource\ResourceInterface $resource, $tWrap = array(
'',
''), $enableClickMenu = TRUE) {
572 $path = $resource->getStorage()->getName() . $resource->getParentFolder()->getIdentifier();
574 }
catch (\
TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException $e) {
578 if ($enableClickMenu && ($resource instanceof \
TYPO3\CMS\Core\Resource\File)) {
579 $metaData = $resource->_getMetaData();
580 $iconImgTag = $this->
wrapClickMenuOnIcon($iconImgTag,
'sys_file_metadata', $metaData[
'uid']);
583 return '<span class="typo3-moduleHeader">' . $iconImgTag . $tWrap[0] . htmlspecialchars(
GeneralUtility::fixed_lgd_cs($resource->getName(), 45)) . $tWrap[1] .
'</span>';
599 $title = htmlspecialchars(
GeneralUtility::fixed_lgd_cs($fileInfo[
'path'], -35)) .
'<strong>' . htmlspecialchars($fileInfo[
'file']) .
'</strong>';
600 return '<span class="typo3-moduleHeader"><img' .
IconUtility::skinImg($this->backPath, $iconfile,
'width="18" height="16"') .
' title="' . htmlspecialchars($path) .
'" alt="" />' . $title .
'</span>';
618 if (preg_match(
'/typo3\\/mod\\.php$/', $pathInfo[
'path']) && isset(
$GLOBALS[
'TBE_MODULES'][
'_PATHS'][$modName])) {
619 $storeUrl =
'&M=' . $modName . $storeUrl;
621 if ((
int)$motherModName === 1) {
622 $mMN =
'&motherModName=\'+top.currentModuleLoaded+\'';
623 } elseif ($motherModName) {
624 $mMN =
'&motherModName=' . rawurlencode($motherModName);
628 $onClick =
'top.ShortcutManager.createShortcut(' 633 $sIcon =
'<a href="#" onclick="' . htmlspecialchars($onClick) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.makeBookmark', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-system-shortcut-new') .
'</a>';
666 public function formWidth($size = 48, $textarea = FALSE, $styleOverride =
'') {
667 return ' style="' . ($styleOverride ?:
'width:' . ceil($size * 9.58) .
'px;') .
'"';
685 public function formWidthText($size = 48, $styleOverride =
'', $wrap =
'') {
687 return $this->
formWidth($size, TRUE, $styleOverride);
708 var T3_THIS_LOCATION = \
'' . str_replace(
'%20',
'', rawurlencode($thisLocation)) .
'\';
722 public function formatTime($tstamp, $type) { 726 $dateStr = date($GLOBALS['TYPO3_CONF_VARS
']['SYS
']['hhmm
'], $tstamp); 729 $dateStr = date($GLOBALS['TYPO3_CONF_VARS
']['SYS
']['ddmmyy
'], $tstamp); 742 public function parseTime() { 743 if ($this->parseTimeFlag && $GLOBALS['BE_USER
']->isAdmin()) { 744 return '<p>(ParseTime:
' . (GeneralUtility::milliseconds() - $GLOBALS['PARSETIME_START
']) . ' ms</p>
745 <p>REQUEST_URI-length:
' . strlen(GeneralUtility::getIndpEnv('REQUEST_URI
')) . ')</p>
'; 755 public function useCompatibilityTag($useCompatibilityTag = TRUE) { 756 $this->useCompatibilityTag = (bool) $useCompatibilityTag; 759 /***************************************** 761 * PAGE BUILDING FUNCTIONS. 762 * Use this to build the HTML of your backend modules 764 *****************************************/ 775 public function startPage($title, $includeCsh = TRUE) { 776 // hook pre start page 777 if (isset($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['typo3/
template.php
']['preStartPageHook
'])) { 778 $preStartPageHook = &$GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['typo3/
template.php
']['preStartPageHook
']; 779 if (is_array($preStartPageHook)) { 780 $hookParameters = array( 783 foreach ($preStartPageHook as $hookFunction) { 784 GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this); 788 $this->pageRenderer->backPath = $this->backPath; 789 // alternative template for Header and Footer 790 if ($this->pageHeaderFooterTemplateFile) { 791 $file = GeneralUtility::getFileAbsFileName($this->pageHeaderFooterTemplateFile, TRUE); 793 $this->pageRenderer->setTemplateFile($file); 796 // Send HTTP header for selected charset. Added by Robert Lemke 23.10.2003 797 header('Content-Type:text/html;charset=
' . $this->charset); 799 $htmlTag = '<html xmlns=
"http://www.w3.org/1999/xhtml">
'; 800 switch ($this->docType) { 802 $headerStart = '<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2 Final//EN">
'; 804 // Disable rendering of XHTML tags 805 $this->pageRenderer->setRenderXhtml(FALSE); 808 $headerStart = '<!DOCTYPE html
809 PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" 810 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
'; 813 $headerStart = '<!DOCTYPE html
814 PUBLIC
"-//W3C//DTD XHTML 1.0 Frameset//EN" 815 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
'; 818 $headerStart = '<!DOCTYPE html
819 PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" 820 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
'; 825 // The fallthrough is intended as HTML5, as this is the default for the BE since TYPO3 4.5 826 $headerStart = '<!DOCTYPE html>
' . LF; 828 // Disable rendering of XHTML tags 829 $this->pageRenderer->setRenderXhtml(FALSE); 831 $this->pageRenderer->setHtmlTag($htmlTag); 832 // This loads the tabulator-in-textarea feature. It automatically modifies 833 // every textarea which is found. 834 if (!$GLOBALS['BE_USER
']->uc['disableTabInTextarea
']) { 835 $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/tab.js
'); 837 // Include the JS for the Context Sensitive Help 839 $this->loadCshJavascript(); 841 // Get the browser info 842 $browserInfo = \TYPO3\CMS\Core\Utility\ClientUtility::getBrowserInfo(GeneralUtility::getIndpEnv('HTTP_USER_AGENT
')); 843 // Set the XML prologue 844 $xmlPrologue = '<?xml version=
"1.0" encoding=
"' . $this->charset . '"?>
'; 845 // Set the XML stylesheet 846 $xmlStylesheet = '<?xml-stylesheet href=
"#internalStyle" type=
"text/css"?>
'; 847 // Add the XML prologue for XHTML doctypes 848 if (strpos($this->docType, 'xhtml
') !== FALSE) { 849 // Put the XML prologue before or after the doctype declaration according to browser 850 if ($browserInfo['browser
'] === 'msie
' && $browserInfo['version
'] < 7) { 851 $headerStart = $headerStart . LF . $xmlPrologue; 853 $headerStart = $xmlPrologue . LF . $headerStart; 855 // Add the xml stylesheet according to doctype 856 if ($this->docType !== 'xhtml_frames
') { 857 $headerStart = $headerStart . LF . $xmlStylesheet; 860 $this->pageRenderer->setXmlPrologAndDocType($headerStart); 861 $this->pageRenderer->setHeadTag('<head>
' . LF . '<!--
TYPO3 Script ID:
' . htmlspecialchars($this->scriptID) . ' -->
'); 862 $this->pageRenderer->setCharSet($this->charset); 863 $this->pageRenderer->addMetaTag($this->generator()); 864 $this->pageRenderer->addMetaTag('<meta name=
"robots" content=
"noindex,follow" />
'); 865 $this->pageRenderer->setFavIcon($this->getBackendFavicon()); 866 if ($this->useCompatibilityTag) { 867 $this->pageRenderer->addMetaTag($this->xUaCompatible($this->xUaCompatibilityVersion)); 869 $this->pageRenderer->setTitle($title); 872 if ($this->extDirectStateProvider) { 873 $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/ExtDirect.StateProvider.js
'); 875 // Add jsCode for overriding the console with a debug panel connection 876 $this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel
', 'if (typeof top.Ext ===
"object") {
877 top.Ext.onReady(
function() {
878 if (typeof console ===
"undefined") {
879 if (top && top.TYPO3 && top.TYPO3.Backend && top.TYPO3.Backend.DebugConsole) {
880 console = top.TYPO3.Backend.DebugConsole;
893 $this->pageRenderer->addHeaderData($this->JScode); 894 foreach ($this->JScodeArray as $name => $code) { 895 $this->pageRenderer->addJsInlineCode($name, $code, FALSE); 897 if (count($this->JScodeLibArray)) { 898 foreach ($this->JScodeLibArray as $library) { 899 $this->pageRenderer->addHeaderData($library); 902 if ($this->extJScode) { 903 $this->pageRenderer->addExtOnReadyCode($this->extJScode); 905 // hook for additional headerData 906 if (isset($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['typo3/
template.php
']['preHeaderRenderHook
'])) { 907 $preHeaderRenderHook = &$GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['typo3/
template.php
']['preHeaderRenderHook
']; 908 if (is_array($preHeaderRenderHook)) { 909 $hookParameters = array( 910 'pageRenderer
' => &$this->pageRenderer 912 foreach ($preHeaderRenderHook as $hookFunction) { 913 GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this); 917 // Construct page header. 918 $str = $this->pageRenderer->render(PageRenderer::PART_HEADER); 919 $this->JScodeLibArray = array(); 920 $this->JScode = ($this->extJScode = ''); 921 $this->JScodeArray = array(); 922 $this->endOfPageJsBlock = $this->pageRenderer->render(PageRenderer::PART_FOOTER); 923 if ($this->docType == 'xhtml_frames
') { 926 $str .= $this->docBodyTagBegin() . ($this->divClass ? ' 928 <!-- Wrapping DIV-
section for whole page BEGIN -->
929 <div
class=
"' . $this->divClass . '">
930 ' : '') . trim($this->form); 942 public function endPage() { 943 $str = $this->sectionEnd() . $this->postCode . $this->endPageJS() . $this->wrapScriptTags(BackendUtility::getUpdateSignalCode()) . $this->parseTime() . ($this->form ? ' 945 // If something is in buffer like debug, put it to end of page 946 if (ob_get_contents()) { 947 $str .= ob_get_clean(); 948 if (!headers_sent()) { 949 header('Content-Encoding: None
'); 952 if ($this->docType !== 'xhtml_frames
') { 953 $str .= ($this->divClass ? ' 955 <!-- Wrapping DIV-
section for whole page END -->
956 </div>
' : '') . $this->endOfPageJsBlock; 958 // Logging: Can't find better place to put it:
960 GeneralUtility::devLog(
'END of BACKEND session',
'TYPO3\\CMS\\Backend\\Template\\DocumentTemplate', 0, array(
'_FLUSH' => TRUE));
973 public function render($title, $content, $includeCsh = TRUE) {
974 $pageContent = $this->
startPage($title, $includeCsh);
975 $pageContent .= $content;
976 $pageContent .= $this->
endPage();
991 <!-- MAIN Header in page top --> 992 <h1>' . htmlspecialchars($text) .
'</h1> 1010 public function section($label, $text, $nostrtoupper = FALSE, $sH = FALSE, $type = 0, $allowHTMLinHeader = FALSE) {
1014 if (!$allowHTMLinHeader) {
1015 $label = htmlspecialchars($label);
1017 $str .= $this->
sectionHeader($this->
icons($type) . $label, $sH, $nostrtoupper ?
'' :
' class="uppercase"');
1022 <!-- Section content --> 1040 <hr style="margin-top: ' . $dist .
'px; margin-bottom: ' . $dist .
'px;" /> 1056 <!-- Spacer element --> 1057 <div style="padding-top: ' . (int)$dist .
'px;"></div> 1073 $tag = $sH ?
'h2' :
'h3';
1074 if ($addAttrib && $addAttrib[0] !==
' ') {
1075 $addAttrib =
' ' . $addAttrib;
1079 <!-- Section header --> 1080 <' . $tag . $addAttrib .
'>' . $label .
'</' . $tag .
'> 1094 if (!$this->sectionFlag) {
1095 $this->sectionFlag = 1;
1098 <!-- *********************** 1099 Begin output section. 1100 *********************** --> 1118 if ($this->sectionFlag) {
1119 $this->sectionFlag = 0;
1122 <!-- ********************* 1124 ********************* --> 1139 return $this->endJS ?
' 1140 <script type="text/javascript"> 1142 if (top.busy && top.busy.loginRefreshed) { 1143 top.busy.loginRefreshed(); 1157 $bodyContent =
'body onclick="if (top.menuReset) top.menuReset();" ' . trim(($this->bodyTagAdditions . ($this->bodyTagId ?
' id="' . $this->bodyTagId .
'"' :
'')));
1158 return '<' . trim($bodyContent) .
'>';
1169 if ($this->backGroundImage) {
1170 $this->inDocStylesArray[] =
' BODY { background-image: url(' . $this->backPath . $this->backGroundImage .
'); }';
1179 $this->inDocStylesArray = array();
1180 $this->inDocStyles =
'';
1181 $this->inDocStyles_TBEstyle =
'';
1183 if ($this->styleSheetFile) {
1184 $this->pageRenderer->addCssFile($this->backPath . $this->styleSheetFile);
1186 if ($this->styleSheetFile2) {
1187 $this->pageRenderer->addCssFile($this->backPath . $this->styleSheetFile2);
1189 $this->pageRenderer->addCssInlineBlock(
'inDocStyles',
$inDocStyles . LF .
'/*###POSTCSSMARKER###*/');
1190 if ($this->styleSheetFile_post) {
1191 $this->pageRenderer->addCssFile($this->backPath . $this->styleSheetFile_post);
1205 public function addStyleSheet($key, $href, $title =
'', $relation =
'stylesheet') {
1206 if (strpos($href,
'://') !== FALSE || $href[0] ===
'/') {
1209 $file = $this->backPath . $href;
1211 $this->pageRenderer->addCssFile($file, $relation,
'screen', $title);
1229 foreach ($files as $file) {
1230 $this->pageRenderer->addCssFile(
$GLOBALS[
'BACK_PATH'] . $path . $file,
'stylesheet',
'all');
1244 if (!empty($this->inDocStyles)) {
1247 $styles = LF . implode(LF, $this->inDocStylesArray);
1248 $content = str_replace(
'/*###POSTCSSMARKER###*/', $styles, $content);
1251 $jscode = $this->JScode . LF . $this->
wrapScriptTags(implode(LF, $this->JScodeArray));
1252 $content = str_replace(
'<!--###POSTJSMARKER###-->', $jscode, $content);
1262 $stylesheetDirectories = array();
1264 foreach ($this->stylesheetsCore as $stylesheetDir) {
1265 $stylesheetDirectories[] = $stylesheetDir;
1269 if (is_array(
$GLOBALS[
'TBE_STYLES'][
'skins'])) {
1271 foreach (
$GLOBALS[
'TBE_STYLES'][
'skins'] as $skinExtKey => $skin) {
1275 if (is_array($skin[
'stylesheetDirectories'])) {
1276 $skinStylesheetDirs = array_merge($skinStylesheetDirs, $skin[
'stylesheetDirectories']);
1279 foreach ($skinStylesheetDirs as $stylesheetDir) {
1281 if (substr($stylesheetDir, 0, 4) ===
'EXT:') {
1282 list($extKey, $path) = explode(
'/', substr($stylesheetDir, 4), 2);
1293 return $stylesheetDirectories;
1303 $str =
'TYPO3 CMS, ' . TYPO3_URL_GENERAL .
', © Kasper Skårhøj ' . TYPO3_copyright_year .
', extensions are copyright of their respective owners.';
1304 return '<meta name="generator" content="' . $str .
'" />';
1314 return '<meta http-equiv="X-UA-Compatible" content="' . $content .
'" />';
1337 public function icons($type, $styleAttribValue =
'') {
1339 case self::STATUS_ICON_ERROR:
1340 $icon =
'status-dialog-error';
1342 case self::STATUS_ICON_WARNING:
1343 $icon =
'status-dialog-warning';
1345 case self::STATUS_ICON_NOTIFICATION:
1346 $icon =
'status-dialog-notification';
1348 case self::STATUS_ICON_OK:
1349 $icon =
'status-dialog-ok';
1368 $button =
'<input type="submit" onclick="' . htmlspecialchars($onClick) .
'; return false;" value="' . htmlspecialchars($label) .
'" />';
1379 public function dfw($string) {
1380 return '<span class="typo3-dimmed">' . $string .
'</span>';
1390 public function rfw($string) {
1391 return '<span class="typo3-red">' . $string .
'</span>';
1402 $string =
'/*<![CDATA[*/' . $string .
'/*]]>*/';
1417 if (trim($string)) {
1419 $cr = $linebreak ? LF :
'';
1421 $string = preg_replace(
'/^\\n+/',
'', $string);
1424 if (preg_match(
'/^(\\t+)/', $string, $match)) {
1425 $string = str_replace($match[1], TAB, $string);
1427 $string = $cr .
'<script type="text/javascript"> 1433 return trim($string);
1443 'defCol' => array(
'<td valign="top">',
'</td>')
1455 public $table_TABLE =
'<table border="0" cellspacing="0" cellpadding="0" class="typo3-dblist" id="typo3-tmpltable">';
1466 public function table($data, $layout = NULL) {
1468 if (is_array($data)) {
1471 foreach ($data as $tableRow) {
1472 if ($rowCount % 2) {
1479 if (is_array($tableRow)) {
1481 foreach ($tableRow as $tableCell) {
1482 $cellWrap = is_array($layout[$cellCount]) ? $layout[$cellCount] : $layout[
'defCol'];
1483 $cellWrap = is_array($rowLayout[
'defCol']) ? $rowLayout[
'defCol'] : $cellWrap;
1484 $cellWrap = is_array($rowLayout[$cellCount]) ? $rowLayout[$cellCount] : $cellWrap;
1485 $rowResult .= $cellWrap[0] . $tableCell . $cellWrap[1];
1489 $rowWrap = is_array($layout[
'tr']) ? $layout[
'tr'] : array($this->table_TR,
'</tr>');
1490 $rowWrap = is_array($rowLayout[
'tr']) ? $rowLayout[
'tr'] : $rowWrap;
1491 $result .= $rowWrap[0] . $rowResult . $rowWrap[1];
1510 public function menuTable($arr1, $arr2 = array(), $arr3 = array()) {
1511 $rows = max(array(count($arr1), count($arr2), count($arr3)));
1513 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tablemenu">';
1514 for ($a = 0; $a < $rows; $a++) {
1518 $cls[] =
'<td valign="' . $valign .
'">' . $arr1[$a][0] .
'</td><td>' . $arr1[$a][1] .
'</td>';
1520 $cls[] =
'<td valign="' . $valign .
'">' . $arr2[$a][0] .
'</td><td>' . $arr2[$a][1] .
'</td>';
1522 $cls[] =
'<td valign="' . $valign .
'">' . $arr3[$a][0] .
'</td><td>' . $arr3[$a][1] .
'</td>';
1525 $menu .= implode($cls,
'<td> </td>');
1545 <table border="0" cellpadding="0" cellspacing="0" width="100%" id="typo3-funcmenu"> 1547 <td valign="top" nowrap="nowrap">' . $content .
'</td> 1548 <td valign="top" align="right" nowrap="nowrap">' . $menu .
'</td> 1562 $this->pageRenderer->addJsFile($this->backPath . $lib);
1572 $this->pageRenderer->loadPrototype();
1573 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/clickmenu.js');
1574 $this->JScodeArray[
'clickmenu'] =
' 1575 Clickmenu.clickURL = "' . $this->backPath .
'alt_clickmenu.php"; 1576 Clickmenu.ajax = true;';
1588 $this->pageRenderer->loadPrototype();
1589 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/common.js');
1592 $this->JScodeArray[
'dragdrop'] =
' 1593 DragDrop.changeURL = "' . $this->backPath .
'alt_clickmenu.php"; 1595 DragDrop.table = "' . $table .
'"; 1605 $this->pageRenderer->loadExtJS();
1606 $this->pageRenderer->addJsFile($this->backPath .
'sysext/backend/Resources/Public/JavaScript/contexthelp.js');
1607 $this->pageRenderer->addExtDirectCode();
1625 public function getTabMenu($mainParams, $elementName, $currentValue, $menuItems, $script =
'', $addparams =
'') {
1627 if (is_array($menuItems)) {
1628 if (!is_array($mainParams)) {
1629 $mainParams = array(
'id' => $mainParams);
1633 $script = basename(PATH_thisScript);
1636 foreach ($menuItems as $value => $label) {
1637 $menuDef[$value][
'isActive'] = (string)$currentValue === (
string)$value;
1638 $menuDef[$value][
'label'] = htmlspecialchars($label, ENT_COMPAT,
'UTF-8', FALSE);
1639 $menuDef[$value][
'url'] = $script .
'?' . $mainParams . $addparams .
'&' . $elementName .
'=' . $value;
1656 if (is_array($menuItems)) {
1658 $count = count($menuItems);
1661 $widthRight = max(1, floor(30 - pow($count, 1.72)));
1662 $widthTabs = 100 - $widthRight - $widthLeft;
1663 $widthNo = floor(($widthTabs - $addToAct) / $count);
1664 $addToAct = max($addToAct, $widthTabs - $widthNo * $count);
1665 $widthAct = $widthNo + $addToAct;
1666 $widthRight = 100 - ($widthLeft + $count * $widthNo + $addToAct);
1667 foreach ($menuItems as $id => $def) {
1668 $isActive = $def[
'isActive'];
1669 $class = $isActive ?
'tabact' :
'tab';
1670 $width = $isActive ? $widthAct : $widthNo;
1672 $label = $def[
'label'];
1673 $url = htmlspecialchars($def[
'url']);
1674 $params = $def[
'addParams'];
1675 $options .=
'<td width="' . $width .
'%" class="' . $class .
'"><a href="' . $url .
'" ' . $params .
'>' . $label .
'</a></td>';
1680 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="typo3-tabmenu"> 1682 <td width="' . $widthLeft .
'%"> </td> 1684 <td width="' . $widthRight .
'%"> </td> 1687 <div class="hr" style="margin:0px"></div>';
1707 public function getDynTabMenu($menuItems, $identString, $toggle = 0, $foldout = FALSE, $noWrap = TRUE, $fullWidth = FALSE, $defaultTabIndex = 1, $dividers2tabs = 2) {
1709 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/tabmenu.js');
1711 if (is_array($menuItems)) {
1713 $options = array(array());
1717 $noWrap = $noWrap ?
' nowrap="nowrap"' :
'';
1722 foreach ($menuItems as $index => $def) {
1727 if (!$foldout && ($def[
'newline'] === TRUE && $titleLenCount > 0)) {
1730 $options[$tabRows] = array();
1733 $onclick =
'this.blur(); DTM_toggle("' . $id .
'","' . $index .
'"); return false;';
1735 $onclick =
'this.blur(); DTM_activate("' . $id .
'","' . $index .
'", ' . ($toggle < 0 ? 1 : 0) .
'); return false;';
1737 $isEmpty = trim($def[
'content']) ===
'' && trim($def[
'icon']) ===
'';
1739 if ($isEmpty && $dividers2tabs == 1) {
1742 $requiredIcon =
'<img name="' . $id .
'-' . $index .
'-REQ" src="' .
$GLOBALS[
'BACK_PATH'] .
'gfx/clear.gif" class="t3-TCEforms-reqTabImg" alt="" />';
1745 $options[$tabRows][] =
' 1746 <td class="' . ($isEmpty ?
'disabled' :
'tab') .
'" id="' . $id .
'-' . $index .
'-MENU"' . $noWrap .
'>' . ($isEmpty ?
'' :
'<a href="#" onclick="' . htmlspecialchars($onclick) .
'"' . ($def[
'linkTitle'] ?
' title="' . htmlspecialchars($def[
'linkTitle']) .
'"' :
'') .
'>') . $def[
'icon'] . ($def[
'label'] ? htmlspecialchars($def[
'label']) :
' ') . $requiredIcon . $this->
icons($def[
'stateIcon'],
'margin-left: 10px;') . ($isEmpty ?
'' :
'</a>') .
'</td>';
1747 $titleLenCount += strlen($def[
'label']);
1751 <div class="' . ($isEmpty ?
'disabled' :
'tab') .
'" id="' . $id .
'-' . $index .
'-MENU">' . ($isEmpty ?
'' :
'<a href="#" onclick="' . htmlspecialchars($onclick) .
'"' . ($def[
'linkTitle'] ?
' title="' . htmlspecialchars($def[
'linkTitle']) .
'"' :
'') .
'>') . $def[
'icon'] . ($def[
'label'] ? htmlspecialchars($def[
'label']) :
' ') . $requiredIcon . ($isEmpty ?
'' :
'</a>') .
'</div>';
1755 <div style="display: none;" id="' . $id .
'-' . $index .
'-DIV" class="c-tablayer">' . ($def[
'description'] ?
'<p class="c-descr">' . nl2br(htmlspecialchars($def[
'description'])) .
'</p>' :
'') . $def[
'content'] .
'</div>';
1758 DTM_array["' . $id .
'"][' . $c .
'] = "' . $id .
'-' . $index .
'"; 1761 if ($toggle == 1 && !$isEmpty) {
1763 if (top.DTM_currentTabs["' . $id .
'-' . $index .
'"]) { DTM_toggle("' . $id .
'","' . $index .
'",1); } 1769 if (count($options)) {
1773 for ($a = 0; $a <= $tabRows; $a++) {
1777 <table cellpadding="0" cellspacing="0" border="0"' . ($fullWidth ?
' width="100%"' :
'') .
' class="typo3-dyntabmenu"> 1779 ' . implode(
'', $options[$a]) .
' 1783 $content .=
'<div class="typo3-dyntabmenu-tabs">' . $tabContent .
'</div>';
1787 <!-- Div layers for tab menu: --> 1788 <div class="typo3-dyntabmenu-divs' . ($foldout ?
'-foldout' :
'') .
'"> 1789 ' . implode(
'', $divs) .
'</div>';
1792 <!-- Initialization JavaScript for the menu --> 1793 <script type="text/javascript"> 1794 DTM_array["' . $id .
'"] = new Array(); 1795 ' . implode(
'', $JSinit) .
' 1796 ' . ($toggle <= 0 ?
'DTM_activate("' . $id .
'", top.DTM_currentTabs["' . $id .
'"]?top.DTM_currentTabs["' . $id .
'"]:' . (int)$defaultTabIndex .
', 0);' :
'') .
' 1831 return $versionGuiObj->getVersionSelector($id, $noAction);
1845 $this->moduleTemplateFilename = $filename;
1846 if (
$GLOBALS[
'TBE_STYLES'][
'htmlTemplates'][$filename]) {
1847 $filename =
$GLOBALS[
'TBE_STYLES'][
'htmlTemplates'][$filename];
1857 if ($filename !==
'') {
1860 return $htmlTemplate;
1871 $this->pageRenderer->loadPrototype();
1872 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/iecompatibility.js');
1886 public function moduleBody($pageRecord = array(), $buttons = array(), $markerArray = array(), $subpartArray = array()) {
1890 $this->inDocStylesArray[] =
'html { overflow: hidden; }';
1892 $markerArray[
'PAGEPATH'] = $this->
getPagePath($pageRecord);
1894 $markerArray[
'PAGEINFO'] = $this->
getPageInfo($pageRecord);
1898 $markerArray = array_merge($markerArray, $docHeaderButtons);
1900 foreach ($subpartArray as $marker => $content) {
1904 if ($this->showFlashMessages) {
1905 $flashMessages = $this->getFlashMessages();
1906 if (!empty($flashMessages)) {
1907 $markerArray[
'FLASHMESSAGES'] = $flashMessages;
1910 if (strpos($moduleBody,
'###FLASHMESSAGES###') === FALSE) {
1911 $moduleBody = str_replace(
'###CONTENT###',
'###FLASHMESSAGES######CONTENT###', $moduleBody);
1916 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/template.php'][
'moduleBodyPostProcess'])) {
1918 'moduleTemplateFilename' => &$this->moduleTemplateFilename,
1919 'moduleTemplate' => &$this->moduleTemplate,
1920 'moduleBody' => &$moduleBody,
1921 'markers' => &$markerArray,
1922 'parentObject' => &$this
1924 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/template.php'][
'moduleBodyPostProcess'] as $funcRef) {
1937 public function getFlashMessages() {
1941 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
1942 $flashMessages = $defaultFlashMessageQueue->renderFlashMessages();
1943 if (!empty($flashMessages)) {
1944 $flashMessages =
'<div id="typo3-messages">' . $flashMessages .
'</div>';
1946 return $flashMessages;
1957 $ajaxObj->addContent(
'result', $this->getFlashMessages());
1958 $ajaxObj->setContentFormat(
'html');
1970 $floats = array(
'left',
'right');
1971 foreach ($floats as $key) {
1973 $buttonTemplate =
HtmlParser::getSubpart($this->moduleTemplate,
'###BUTTON_GROUPS_' . strtoupper($key) .
'###');
1979 for ($groupNumber = 1; $groupNumber < 6; $groupNumber++) {
1980 $buttonMarker =
'###BUTTON_GROUP' . $groupNumber .
'###';
1982 if (trim($buttonGroup)) {
1990 $markers[
'BUTTONLIST_' . strtoupper($key)] = str_replace(LF,
'', $buttonTemplate);
1993 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/template.php'][
'docHeaderButtonsHook'])) {
1995 'buttons' => $buttons,
1996 'markers' => &$markers,
1999 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/template.php'][
'docHeaderButtonsHook'] as $funcRef) {
2014 if (is_array($pageRecord) && $pageRecord[
'uid']) {
2015 $title = substr($pageRecord[
'_thePathFull'], 0, -1);
2017 $pos = strrpos($title, $pageRecord[
'title']);
2018 if ($pos !== FALSE) {
2019 $title = substr($title, 0, $pos);
2025 $pagePath =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.path', TRUE) .
': <span class="typo3-docheader-pagePath">';
2027 $cropLength = empty(
$GLOBALS[
'BE_USER']->uc[
'titleLen']) ? 50 :
$GLOBALS[
'BE_USER']->uc[
'titleLen'];
2029 if ($croppedTitle !== $title) {
2030 $pagePath .=
'<abbr title="' . htmlspecialchars($title) .
'">' . htmlspecialchars($croppedTitle) .
'</abbr>';
2032 $pagePath .= htmlspecialchars($title);
2034 $pagePath .=
'</span>';
2047 if (is_array($pageRecord) && $pageRecord[
'uid']) {
2051 $theIcon =
$GLOBALS[
'SOBE']->doc->wrapClickMenuOnIcon($iconImg,
'pages', $pageRecord[
'uid']);
2052 $uid = $pageRecord[
'uid'];
2058 if (
$GLOBALS[
'BE_USER']->user[
'admin']) {
2059 $theIcon =
$GLOBALS[
'SOBE']->doc->wrapClickMenuOnIcon($iconImg,
'pages', 0);
2061 $theIcon = $iconImg;
2064 $title =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'];
2067 $pageInfo = $theIcon .
'<strong>' . htmlspecialchars($title) .
' [' .
$uid .
']</strong>';
2080 public function collapseableSection($title, $html, $id, $saveStatePointer =
'') {
2081 $hasSave = $saveStatePointer ? TRUE : FALSE;
2082 $collapsedStyle = ($collapsedClass =
'');
2086 $value = $settings->get($saveStatePointer .
'.' . $id);
2088 $collapsedStyle =
' style="display: none"';
2089 $collapsedClass =
' collapsed';
2091 $collapsedStyle =
'';
2092 $collapsedClass =
' expanded';
2095 $this->pageRenderer->loadExtJS();
2096 $this->pageRenderer->addExtOnReadyCode(
' 2097 Ext.select("h2.section-header").each(function(element){ 2098 element.on("click", function(event, tag) { 2101 div = el.next("div"), 2102 saveKey = el.getAttribute("rel"); 2103 if (el.hasClass("collapsed")) { 2104 el.removeClass("collapsed").addClass("expanded"); 2110 el.removeClass("expanded").addClass("collapsed"); 2121 top.TYPO3.BackendUserSettings.ExtDirect.set(saveKey + "." + tag.id, state, function(response) {}); 2128 <h2 id="' . $id .
'" class="section-header' . $collapsedClass .
'" rel="' . $saveStatePointer .
'"> ' . $title .
'</h2> 2129 <div' . $collapsedStyle .
'>' . $html .
'</div>
getFileheader($title, $path, $iconfile)
getTabMenuRaw($menuItems)
moduleBody($pageRecord=array(), $buttons=array(), $markerArray=array(), $subpartArray=array())
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
icons($type, $styleAttribValue='')
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static isAllowedAbsPath($path)
addStyleSheetDirectory($path)
addStyleSheet($key, $href, $title='', $relation='stylesheet')
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
insertStylesAndJS($content)
setExtDirectStateProvider()
static devLog($msg, $extKey, $severity=0, $dataVar=FALSE)
static isFirstPartOfStr($str, $partStr)
static getSpriteIconForResource(\TYPO3\CMS\Core\Resource\ResourceInterface $resource, array $options=array(), array $overlays=array())
wrapScriptTags($string, $linebreak=TRUE)
startPage($title, $includeCsh=TRUE)
t3Button($onClick, $label)
static quoteJSvalue($value)
static getIndpEnv($getEnvName)
render($title, $content, $includeCsh=TRUE)
$pageHeaderFooterTemplateFile
funcMenu($content, $menu)
formWidthText($size=48, $styleOverride='', $wrap='')
const STATUS_ICON_WARNING
static logDeprecatedFunction()
static getUrlToken($formName='securityToken', $tokenName='formToken')
static makeInstance($className)
static shortMD5($input, $len=10)
getSkinStylesheetDirectories()
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
xUaCompatible($content='IE=8')
getVersionSelector($id, $noAction=FALSE)
getDynTabMenu($menuItems, $identString, $toggle=0, $foldout=FALSE, $noWrap=TRUE, $fullWidth=FALSE, $defaultTabIndex=1, $dividers2tabs=2)
sectionHeader($label, $sH=FALSE, $addAttrib='')
static viewOnClick($pageUid, $backPath='', $rootLine='', $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=TRUE)
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static getSpriteIconForRecord($table, array $row, array $options=array())
getTabMenu($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
static split_fileref($fileNameWithPath)
issueCommand($params, $redirectUrl='')
getResourceHeader(\TYPO3\CMS\Core\Resource\ResourceInterface $resource, $tWrap=array('', ''), $enableClickMenu=TRUE)
static linkThisScript(array $getParams=array())
static substituteMarker($content, $marker, $markContent)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
static compileSelectedGetVarsFromArray($varList, array $getArray, $GPvarAlt=TRUE)
const STATUS_ICON_NOTIFICATION
static getUrl($url, $includeHeader=0, $requestHeaders=FALSE, &$report=NULL)
viewPageIcon($id, $backPath, $addParams='hspace="3"')
static titleAttribForPages($row, $perms_clause='', $includeAttrib=1)
static isLoaded($key, $exitOnError=FALSE)
static getSubpart($content, $marker)
static substituteMarkerArray($content, $markContentArray, $wrap='', $uppercase=FALSE, $deleteUnused=FALSE)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
section($label, $text, $nostrtoupper=FALSE, $sH=FALSE, $type=0, $allowHTMLinHeader=FALSE)
static substituteSubpart($content, $marker, $subpartContent, $recursive=TRUE, $keepMarker=FALSE)
redirectUrls($thisLocation='')
setModuleTemplate($filename)
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
table($data, $layout=NULL)
static getFilesInDir($path, $extensionList='', $prependPath=FALSE, $order='', $excludePattern='')
static getRecordIconAltText($row, $table='pages')
static fixed_lgd_cs($string, $chars, $appendString='...')
makeShortcutIcon($gvList, $setList, $modName, $motherModName='')
menuTable($arr1, $arr2=array(), $arr3=array())
getHeader($table, $row, $path, $noViewPageIcon=FALSE, $tWrap=array('', ''), $enableClickMenu=TRUE)
static sanitizeLocalUrl($url='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
wrapClickMenuOnIcon($str, $table, $uid=0, $listFr=TRUE, $addParams='', $enDisItems='', $returnOnClick=FALSE)
formWidth($size=48, $textarea=FALSE, $styleOverride='')
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
makeShortcutUrl($gvList, $setList)
getDynTabMenuId($identString)
if($ajaxRegistryEntry !==NULL) $ajaxObj
static resolveBackPath($pathStr)
getHtmlTemplate($filename)
renderFlashMessages(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj)
static getListViewLink($urlParameters=array(), $linkTitle='', $linkText='')
getDocHeaderButtons($buttons)