2 namespace TYPO3\CMS\Frontend\View;
71 $typoScriptFrontend->forceTemplateParsing = $this->
extGetFeAdminValue(
'tsdebug',
'forceTemplateParsing');
72 $typoScriptFrontend->displayEditIcons = $this->
extGetFeAdminValue(
'edit',
'displayIcons');
73 $typoScriptFrontend->displayFieldEditIcons = $this->
extGetFeAdminValue(
'edit',
'displayFieldIcons');
82 $typoScriptFrontend->displayFieldEditIcons = 1;
86 $this->ext_forcePreview =
true;
90 $this->ext_forcePreview =
true;
92 if ($typoScriptFrontend->forceTemplateParsing) {
93 $typoScriptFrontend->set_no_cache(
'Admin Panel: Force template parsing',
true);
94 }
elseif ($typoScriptFrontend->displayEditIcons) {
95 $typoScriptFrontend->set_no_cache(
'Admin Panel: Display edit icons',
true);
96 }
elseif ($typoScriptFrontend->displayFieldEditIcons) {
97 $typoScriptFrontend->set_no_cache(
'Admin Panel: Display field edit icons',
true);
99 $typoScriptFrontend->set_no_cache(
'Admin Panel: Display preview',
true);
111 if (!empty(
$GLOBALS[
'TBE_STYLES'][
'stylesheets'][
'admPanel'])) {
113 $result =
'<link rel="stylesheet" type="text/css" href="' . htmlspecialchars($stylesheet) .
'" />';
128 if ($key ===
'preview' && $this->ext_forcePreview) {
148 if (is_array($input)) {
150 $beUser->uc[
'TSFE_adminConfig'] = array_merge(!is_array($beUser->uc[
'TSFE_adminConfig']) ? array() : $beUser->uc[
'TSFE_adminConfig'], $input);
151 unset($beUser->uc[
'TSFE_adminConfig'][
'action']);
154 $beUser->extPageInTreeInfo = array();
155 $theStartId = (int)$input[
'cache_clearCacheId'];
156 $this->
getTypoScriptFrontendController()->clearPageCacheContent_pidList($beUser->extGetTreeList($theStartId, $this->extGetFeAdminValue(
'cache',
'clearCacheLevels'), 0, $beUser->getPagePermsClause(1)) . $theStartId);
184 $sectionName ===
'edit' && (
185 $val ===
'displayIcons' && $beUser->extAdminConfig[
'module.'][
'edit.'][
'forceDisplayIcons'] ||
186 $val ===
'displayFieldIcons' && $beUser->extAdminConfig[
'module.'][
'edit.'][
'forceDisplayFieldIcons'] ||
187 $val ===
'editNoPopup' && $beUser->extAdminConfig[
'module.'][
'edit.'][
'forceNoPopup']
194 if ($val && isset($beUser->extAdminConfig[
'override.'][$sectionName .
'.'][$val])) {
195 return $beUser->extAdminConfig[
'override.'][$sectionName .
'.'][$val];
197 if (isset($beUser->extAdminConfig[
'override.'][$sectionName])) {
198 return $beUser->extAdminConfig[
'override.'][$sectionName];
201 $returnValue = $val ? $beUser->uc[
'TSFE_adminConfig'][$sectionName .
'_' . $val] : 1;
204 if ($sectionName ===
'preview' && $this->ext_forcePreview) {
205 return !$val ?
true : $returnValue;
219 $this->ext_forcePreview =
true;
230 return $this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_top'] && $this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_' . $key];
242 $moduleContent = $footer =
'';
244 if ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_top']) {
261 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tslib/class.tslib_adminpanel.php'][
'extendAdminPanel'])) {
262 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tslib/class.tslib_adminpanel.php'][
'extendAdminPanel'] as $classRef) {
265 throw new \UnexpectedValueException(
'$hookObject must implement interface TYPO3\\CMS\\Frontend\\View\\AdminPanelViewHookInterface', 1311942539);
267 $moduleContent .= $hookObject->extendAdminPanel($moduleContent, $this);
270 $row = $this->
extGetLL(
'adminPanelTitle') .
': <span class="typo3-adminPanel-beuser">' . htmlspecialchars($this->
getBackendUser()->user[
'username']) .
'</span>';
271 $isVisible = $this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_top'];
272 $cssClassName =
'typo3-adminPanel-panel-' . ($isVisible ?
'open' :
'closed');
273 $header =
'<div class="typo3-adminPanel-header">' .
'<div id="typo3-adminPanel-header" class="' . $cssClassName .
'">' .
'<span class="typo3-adminPanel-header-title">' . $row .
'</span>' . $this->
linkSectionHeader(
'top',
'<span class="typo3-adminPanel-header-button fa"></span>',
'typo3-adminPanel-header-buttonWrapper') .
'<input type="hidden" name="TSFE_ADMIN_PANEL[display_top]" value="' . $this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_top'] .
'" /></div>' .
'</div>';
274 if ($moduleContent && $this->extNeedUpdate) {
275 $footer =
'<div id="typo3-adminPanel-footer">
276 <input class="typo3-adminPanel-update btn btn-default" type="submit" value="' . $this->
extGetLL(
'update') .
'" />
283 $query .=
'<input type="hidden" name="TSFE_ADMIN_PANEL[DUMMY]" value="" />';
285 if ($key !=
'TSFE_ADMIN_PANEL') {
286 if (is_array($value)) {
289 $query .=
'<input type="hidden" name="' . htmlspecialchars($key) .
'" value="' . htmlspecialchars($value) .
'" />';
295 TYPO3 Admin panel start
297 <a id="TSFE_ADMIN_PANEL"></a>
298 <form id="TSFE_ADMIN_PANEL_FORM" name="TSFE_ADMIN_PANEL_FORM" action="' . htmlspecialchars(
GeneralUtility::getIndpEnv(
'TYPO3_REQUEST_SCRIPT')) .
'#TSFE_ADMIN_PANEL" method="get" onsubmit="document.forms.TSFE_ADMIN_PANEL_FORM[\'TSFE_ADMIN_PANEL[DUMMY]\'].value=Math.random().toString().substring(2,8)">' . $query .
'<div class="typo3-adminPanel">' . $header . $moduleContent . $footer .
'</div></form>';
299 if ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_top']) {
300 $out .=
'<script type="text/javascript" src="' . htmlspecialchars($this->
getTypoScriptFrontendController()->absRefPrefix) .
'typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js"></script>';
302 var evalFunc = new evalFunc();
303 // TSFEtypo3FormFieldSet()
304 function TSFEtypo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue) { //
305 var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
306 var theValue = document.TSFE_ADMIN_PANEL_FORM[theField].value;
307 if (checkbox && theValue==checkboxValue) {
308 document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value="";
310 document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"].checked = "";
312 document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value = evalFunc.outputObjValue(theFObj, theValue);
313 if (document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"]) {
314 document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"].checked = "on";
318 // TSFEtypo3FormFieldGet()
319 function TSFEtypo3FormFieldGet(theField, evallist, is_in, checkbox, checkboxValue, checkbox_off) { //
320 var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
322 document.TSFE_ADMIN_PANEL_FORM[theField].value=checkboxValue;
324 document.TSFE_ADMIN_PANEL_FORM[theField].value = evalFunc.evalObjValue(theFObj, document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value);
326 TSFEtypo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue);
327 }') .
'/*]]>*/</script><script language="javascript" type="text/javascript">' . $this->extJSCODE .
'</script>';
329 $out .=
'<script src="' .
GeneralUtility::locationHeaderUrl(
'typo3/sysext/frontend/Resources/Public/JavaScript/AdminPanel.js') .
'" type="text/javascript"></script><script type="text/javascript">/*<![CDATA[*/' .
'typo3AdminPanel = new TYPO3AdminPanel();typo3AdminPanel.init("typo3-adminPanel-header", "TSFE_ADMIN_PANEL_FORM");' .
'/*]]>*/</script>
331 TYPO3 admin panel end
349 foreach ($val as $k => $v) {
353 $out .=
'<input type="hidden" name="' . htmlspecialchars($key) .
'[' . htmlspecialchars($k) .
']" value="' . htmlspecialchars($v) .
'">' . LF;
371 if ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_preview']) {
372 $this->extNeedUpdate =
true;
373 $out .= $this->
extGetItem(
'preview_showHiddenPages',
'',
'<input type="hidden" name="TSFE_ADMIN_PANEL[preview_showHiddenPages]" value="0" /><input type="checkbox" id="preview_showHiddenPages" name="TSFE_ADMIN_PANEL[preview_showHiddenPages]" value="1"' . ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'preview_showHiddenPages'] ?
' checked="checked"' :
'') .
' />');
374 $out .= $this->
extGetItem(
'preview_showHiddenRecords',
'',
'<input type="hidden" name="TSFE_ADMIN_PANEL[preview_showHiddenRecords]" value="0" /><input type="checkbox" id="preview_showHiddenRecords" name="TSFE_ADMIN_PANEL[preview_showHiddenRecords]" value="1"' . ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'preview_showHiddenRecords'] ?
' checked="checked"' :
'') .
' />');
376 $out .= $this->
extGetItem(
'preview_simulateDate',
'<input type="text" id="preview_simulateDate" name="TSFE_ADMIN_PANEL[preview_simulateDate]_hr" onchange="TSFEtypo3FormFieldGet(\'TSFE_ADMIN_PANEL[preview_simulateDate]\', \'datetime\', \'\', 1,0);" /><input type="hidden" name="TSFE_ADMIN_PANEL[preview_simulateDate]" value="' . $this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'preview_simulateDate'] .
'" />');
377 $this->extJSCODE .=
'TSFEtypo3FormFieldSet("TSFE_ADMIN_PANEL[preview_simulateDate]", "datetime", "", 0, 0);';
383 'fe_groups.uid, fe_groups.title',
387 'fe_groups.title ASC'
390 $options .=
'<option value="' . $row[
'uid'] .
'"' . ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'preview_simulateUserGroup'] == $row[
'uid'] ?
' selected="selected"' :
'') .
'>' . htmlspecialchars(($row[
'title'] .
' [' . $row[
'uid'] .
']')) .
'</option>';
394 $options =
'<option value="0"> </option>' . $options;
395 $out .= $this->
extGetItem(
'preview_simulateUserGroup',
'<select id="preview_simulateUserGroup" name="TSFE_ADMIN_PANEL[preview_simulateUserGroup]">' . $options .
'</select>');
411 if ($beUser->uc[
'TSFE_adminConfig'][
'display_cache']) {
412 $this->extNeedUpdate =
true;
413 $out .= $this->
extGetItem(
'cache_noCache',
'',
'<input type="hidden" name="TSFE_ADMIN_PANEL[cache_noCache]" value="0" /><input id="cache_noCache" type="checkbox" name="TSFE_ADMIN_PANEL[cache_noCache]" value="1"' . ($beUser->uc[
'TSFE_adminConfig'][
'cache_noCache'] ?
' checked="checked"' :
'') .
' />');
414 $levels = $beUser->uc[
'TSFE_adminConfig'][
'cache_clearCacheLevels'];
416 $options .=
'<option value="0"' . ($levels == 0 ?
' selected="selected"' :
'') .
'>' . $this->
extGetLL(
'div_Levels_0') .
'</option>';
417 $options .=
'<option value="1"' . ($levels == 1 ?
' selected="selected"' :
'') .
'>' . $this->
extGetLL(
'div_Levels_1') .
'</option>';
418 $options .=
'<option value="2"' . ($levels == 2 ?
' selected="selected"' :
'') .
'>' . $this->
extGetLL(
'div_Levels_2') .
'</option>';
419 $out .= $this->
extGetItem(
'cache_clearLevels',
'<select id="cache_clearLevels" name="TSFE_ADMIN_PANEL[cache_clearCacheLevels]">' . $options .
'</select>' .
'<input type="hidden" name="TSFE_ADMIN_PANEL[cache_clearCacheId]" value="' .
$GLOBALS[
'TSFE']->
id .
'" /> <input class="btn btn-default" type="submit" value="' . $this->
extGetLL(
'update') .
'" />');
424 $beUser->extPageInTreeInfo = array();
425 $beUser->extPageInTreeInfo[] = array($tsfe->page[
'uid'], htmlspecialchars($tsfe->page[
'title']), $depth + 1);
426 $beUser->extGetTreeList($tsfe->id, $depth, 0, $beUser->getPagePermsClause(1));
427 foreach ($beUser->extPageInTreeInfo as $key => $row) {
428 $outTable .=
'<tr class="typo3-adminPanel-itemRow ' . ($key % 2 == 0 ?
'line-even' :
'line-odd') .
'">' .
'<td><span style="width: ' . ($depth + 1 - $row[2]) * 18 .
'px; height: 1px; display: inline-block;"></span>' . $this->iconFactory->getIcon(
'apps-pagetree-page-default',
Icon::SIZE_SMALL)->render() . htmlspecialchars($row[1]) .
'</td><td>' . $beUser->extGetNumberOfCachedPages($row[0]) .
'</td></tr>';
430 $outTable =
'<table class="typo3-adminPanel-table"><thead><tr><th colspan="2">' . $this->
extGetLL(
'cache_cacheEntries') .
'</th></tr></thead>' . $outTable .
'</table>';
431 $outTable .=
'<span class="fa fa-bolt clear-cache-icon"><!-- --></span><input class="btn btn-default clear-cache" type="submit" name="TSFE_ADMIN_PANEL[action][clearCache]" value="' . $this->
extGetLL(
'cache_doit') .
'" />';
433 $out .= $this->
extGetItem(
'', $outTable,
'',
'typo3-adminPanel-tableRow',
'typo3-adminPanel-table-wrapper');
447 if ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'display_edit']) {
449 $newPageModule = trim($this->
getBackendUser()->getTSConfigVal(
'options.overridePageModule'));
451 $this->extNeedUpdate =
true;
452 $out .= $this->
extGetItem(
'edit_displayFieldIcons',
'',
'<input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="0" /><input type="checkbox" id="edit_displayFieldIcons" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="1"' . ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'edit_displayFieldIcons'] ?
' checked="checked"' :
'') .
' />');
453 $out .= $this->
extGetItem(
'edit_displayIcons',
'',
'<input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="0" /><input type="checkbox" id="edit_displayIcons" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="1"' . ($this->
getBackendUser()->uc[
'TSFE_adminConfig'][
'edit_displayIcons'] ?
' checked="checked"' :
'') .
' />');
456 $out .= $this->
extGetItem(
'',
'<a class="btn btn-default" href="#" onclick="' . htmlspecialchars((
'
457 if (parent.opener && parent.opener.top && parent.opener.top.TS) {
459 if (parent.opener.top.content && parent.opener.top.content.nav_frame && parent.opener.top.content.nav_frame.refresh_nav) {
460 parent.opener.top.content.nav_frame.refresh_nav();
462 parent.opener.top.goToModule("' . $pageModule .
'");
463 parent.opener.top.focus();
469 ')) . '">' . $this->extGetLL('edit_openAB') . '</a>');
481 protected function getTSDebugModule()
483 $out = $this->extGetHead('tsdebug');
484 $beuser = $this->getBackendUser();
485 if ($beuser->uc['TSFE_adminConfig']['display_tsdebug']) {
486 $this->extNeedUpdate = true;
487 $out .= $this->extGetItem('tsdebug_tree', '', '<input type="hidden
" name="TSFE_ADMIN_PANEL[tsdebug_tree]
" value="0
" /><input type="checkbox
" id="tsdebug_tree
" name="TSFE_ADMIN_PANEL[tsdebug_tree]
" value="1
"' . ($beuser->uc['TSFE_adminConfig']['tsdebug_tree'] ? ' checked="checked
"' : '') . ' />');
488 $out .= $this->extGetItem('tsdebug_displayTimes', '', '<input type="hidden
" name="TSFE_ADMIN_PANEL[tsdebug_displayTimes]
" value="0
" /><input id="tsdebug_displayTimes
" type="checkbox
" name="TSFE_ADMIN_PANEL[tsdebug_displayTimes]
" value="1
"' . ($beuser->uc['TSFE_adminConfig']['tsdebug_displayTimes'] ? ' checked="checked
"' : '') . ' />');
489 $out .= $this->extGetItem('tsdebug_displayMessages', '', '<input type="hidden
" name="TSFE_ADMIN_PANEL[tsdebug_displayMessages]
" value="0
" /><input type="checkbox
" id="tsdebug_displayMessages
" name="TSFE_ADMIN_PANEL[tsdebug_displayMessages]
" value="1
"' . ($beuser->uc['TSFE_adminConfig']['tsdebug_displayMessages'] ? ' checked="checked
"' : '') . ' />');
490 $out .= $this->extGetItem('tsdebug_LR', '', '<input type="hidden
" name="TSFE_ADMIN_PANEL[tsdebug_LR]
" value="0
" /><input type="checkbox
" id="tsdebug_LR
" name="TSFE_ADMIN_PANEL[tsdebug_LR]
" value="1
"' . ($beuser->uc['TSFE_adminConfig']['tsdebug_LR'] ? ' checked="checked
"' : '') . ' />');
491 $out .= $this->extGetItem('tsdebug_displayContent', '', '<input type="hidden
" name="TSFE_ADMIN_PANEL[tsdebug_displayContent]
" value="0
" /><input type="checkbox
" id="tsdebug_displayContent
" name="TSFE_ADMIN_PANEL[tsdebug_displayContent]
" value="1
"' . ($beuser->uc['TSFE_adminConfig']['tsdebug_displayContent'] ? ' checked="checked
"' : '') . ' />');
492 $out .= $this->extGetItem('tsdebug_displayQueries', '', '<input type="hidden
" name="TSFE_ADMIN_PANEL[tsdebug_displayQueries]
" value="0
" /><input type="checkbox
" id="tsdebug_displayQueries
" name="TSFE_ADMIN_PANEL[tsdebug_displayQueries]
" value="1
"' . ($beuser->uc['TSFE_adminConfig']['tsdebug_displayQueries'] ? ' checked="checked
"' : '') . ' />');
493 $out .= $this->extGetItem('tsdebug_forceTemplateParsing', '', '<input type="hidden
" name="TSFE_ADMIN_PANEL[tsdebug_forceTemplateParsing]
" value="0
" /><input type="checkbox
" id="tsdebug_forceTemplateParsing
" name="TSFE_ADMIN_PANEL[tsdebug_forceTemplateParsing]
" value="1
"' . ($beuser->uc['TSFE_adminConfig']['tsdebug_forceTemplateParsing'] ? ' checked="checked
"' : '') . ' />');
494 $timeTracker = $this->getTimeTracker();
495 $timeTracker->printConf['flag_tree'] = $this->extGetFeAdminValue('tsdebug', 'tree');
496 $timeTracker->printConf['allTime'] = $this->extGetFeAdminValue('tsdebug', 'displayTimes');
497 $timeTracker->printConf['flag_messages'] = $this->extGetFeAdminValue('tsdebug', 'displayMessages');
498 $timeTracker->printConf['flag_content'] = $this->extGetFeAdminValue('tsdebug', 'displayContent');
499 $timeTracker->printConf['flag_queries'] = $this->extGetFeAdminValue('tsdebug', 'displayQueries');
500 $out .= $this->extGetItem('', $timeTracker->printTSlog(), '', 'typo3-adminPanel-tableRow', 'typo3-adminPanel-table-wrapper scroll-table');
511 protected function getInfoModule()
513 $head = $this->extGetHead('info');
515 $tsfe = $this->getTypoScriptFrontendController();
516 if ($this->getBackendUser()->uc['TSFE_adminConfig']['display_info']) {
518 if ($this->extGetFeAdminValue('cache', 'noCache')) {
521 if (!empty($tsfe->imagesOnPage)) {
522 $tableArr[] = array($this->extGetLL('info_imagesOnPage'), count($tsfe->imagesOnPage), true);
523 foreach ($GLOBALS['TSFE']->imagesOnPage as $file) {
524 $fs = @filesize($file);
525 $tableArr[] = array(TAB . $file, GeneralUtility::formatSize($fs));
531 $tableArr[] = array($this->extGetLL('info_imagesSize'), GeneralUtility::formatSize($theBytes), true);
532 $tableArr[] = array($this->extGetLL('info_DocumentSize'), GeneralUtility::formatSize(strlen($tsfe->content)), true);
533 $tableArr[] = array('', '');
535 $tableArr[] = array($this->extGetLL('info_id'), $tsfe->id);
536 $tableArr[] = array($this->extGetLL('info_type'), $tsfe->type);
537 $tableArr[] = array($this->extGetLL('info_groupList'), $tsfe->gr_list);
538 $tableArr[] = array($this->extGetLL('info_noCache'), $this->extGetLL('info_noCache_' . ($tsfe->no_cache ? 'no' : 'yes')));
539 $tableArr[] = array($this->extGetLL('info_countUserInt'), count($tsfe->config['INTincScript']));
541 if (!empty($tsfe->fe_user->user['uid'])) {
542 $tableArr[] = array($this->extGetLL('info_feuserName'), htmlspecialchars($tsfe->fe_user->user['username']));
543 $tableArr[] = array($this->extGetLL('info_feuserId'), htmlspecialchars($tsfe->fe_user->user['uid']));
545 $tableArr[] = array($this->extGetLL('info_totalParsetime'), $tsfe->scriptParseTime . ' ms', true);
547 foreach ($tableArr as $key => $arr) {
548 $label = (isset($arr[2]) ? '<strong>' . $arr[0] . '</strong>' : $arr[0]);
549 $value = (string)$arr[1] !== '' ? $arr[1] : '';
551 '<tr class="typo3-adminPanel-itemRow
' . ($key % 2 == 0 ? 'line-even
' : 'line-odd
') . '">
552 <td>' . $label . '</td>
553 <td>' . htmlspecialchars($value) . '</td>
557 $out = '<table class="typo3-adminPanel-table
">' . $out . '</table>';
558 $out = $this->extGetItem('', $out, '', 'typo3-adminPanel-tableRow', 'typo3-adminPanel-table-wrapper');
565 /*****************************************************
566 * Admin Panel Layout Helper functions
567 ****************************************************/
577 public function extGetHead($sectionSuffix)
579 $settingName = 'display_' . $sectionSuffix;
580 $isVisible = $this->getBackendUser()->uc['TSFE_adminConfig'][$settingName];
581 $cssClassName = 'typo3-adminPanel-section-' . ($isVisible ? 'open' : 'closed');
582 return '<div class="typo3-adminPanel-section-title
"><div class="wrapper
">' . $this->linkSectionHeader($sectionSuffix, $this->extGetLL($sectionSuffix), $cssClassName) . '<input type="hidden
" name="TSFE_ADMIN_PANEL[
' . $settingName . ']
" value="' . $isVisible . '" /></div></div>';
594 public function linkSectionHeader($sectionSuffix, $sectionTitle, $className = '')
596 $onclick = 'document.TSFE_ADMIN_PANEL_FORM[' . GeneralUtility::quoteJSvalue('TSFE_ADMIN_PANEL[display_' . $sectionSuffix . ']') . '].value=' . ($this->getBackendUser()->uc['TSFE_adminConfig']['display_' . $sectionSuffix] ? '0' : '1') . ';document.TSFE_ADMIN_PANEL_FORM.submit();return false;';
597 $content = '<div class="typo3-adminPanel-label
">
598 <a href="javascript:void(0)
" onclick="' . htmlspecialchars($onclick) . '"' . ($className ? ' class="fa
' . htmlspecialchars($className) . '"' : '') . '>'
617 public function extGetItem($title, $content = '', $checkbox = '', $outerDivClass = null, $innerDivClass = null)
619 $title = $title ? '<label for="' . htmlspecialchars($title) . '">' . $this->extGetLL($title) . '</label>' : '';
620 $outerDivClass === null ? $out = '<div class="typo3-adminPanel-itemRow
">' : $out = '<div class="' . $outerDivClass . '">';
621 $innerDivClass === null ? $out .= '<div class="typo3-adminPanel-section-content
">' : $out .= '<div class="' . $innerDivClass . '">';
622 $out .= $checkbox . $title . $content . '</div>
632 public function ext_makeToolBar()
634 $tsfe = $this->getTypoScriptFrontendController();
635 // If mod.newContentElementWizard.override is set, use that extension's create new content wizard instead:
636 $tsConfig = BackendUtility::getModTSconfig($tsfe->page['uid'], 'mod');
637 $moduleName = $tsConfig['properties']['newContentElementWizard.']['override'] ?: 'new_content_element';
638 $newContentWizScriptPath = BackendUtility::getModuleUrl($moduleName);
639 $perms = $this->getBackendUser()->calcPerms($tsfe->page);
640 $langAllowed = $this->getBackendUser()->checkLanguageAccess($tsfe->sys_language_uid);
642 $returnUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
644 $icon = $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render();
645 $link = BackendUtility::getModuleUrl('record_history', array('element' => 'pages:' . $id, 'returnUrl' => $returnUrl));
646 $toolBar = '<a class="t3-icon btn btn-
default" href="' . htmlspecialchars($link) . '#latest
" title="' . $this->extGetLL('edit_recordHistory
') . '">' . $icon . '</a>';
647 if ($perms & Permission::CONTENT_EDIT && $langAllowed) {
649 if ($tsfe->sys_language_uid) {
650 $params = '&sys_language_uid=' . $tsfe->sys_language_uid;
652 $icon = $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render();
653 $link = $newContentWizScriptPath . 'id=' . $id . $params . '&returnUrl=' . rawurlencode($returnUrl);
654 $toolBar .= '<a class="t3-icon btn btn-
default" href="' . htmlspecialchars($link) . '" title="' . $this->extGetLL('edit_newContentElement
') . '"">
' . $icon . '</a>
';
656 if ($perms & Permission::PAGE_EDIT) {
657 $icon = $this->iconFactory->getIcon('actions-document-move
', Icon::SIZE_SMALL)->render();
658 $link = BackendUtility::getModuleUrl('move_element
', ['table
' => 'pages
', 'uid
' => $id, 'returnUrl
' => $returnUrl]);
659 $toolBar .= '<a
class=
"t3-icon btn btn-default" href=
"' . htmlspecialchars($link) . '" title=
"' . $this->extGetLL('edit_move_page') . '">
' . $icon . '</a>
';
661 if ($perms & Permission::PAGE_NEW) {
662 $toolBar .= '<a
class=
"t3-icon btn btn-default" href=
"' . htmlspecialchars(BackendUtility::getModuleUrl('db_new', ['id' => $id, 'pagesOnly' => 1, 'returnUrl' => $returnUrl])) . '" title=
"' . $this->extGetLL('edit_newPage') . '">
'
663 . $this->iconFactory->getIcon('actions-page-
new', Icon::SIZE_SMALL)->render()
666 if ($perms & Permission::PAGE_EDIT) {
667 $icon = $this->iconFactory->getIcon('actions-document-open
', Icon::SIZE_SMALL)->render();
668 $url = BackendUtility::getModuleUrl('record_edit
', array(
669 'edit[pages][
' . $id . ']
' => 'edit
',
671 'returnUrl
' => $returnUrl
673 $toolBar .= '<a
class=
"t3-icon btn btn-default" href=
"' . htmlspecialchars($url) . '">
' . $icon . '</a>
';
674 if ($tsfe->sys_language_uid && $langAllowed) {
675 $row = $this->getDatabaseConnection()->exec_SELECTgetSingleRow(
676 'uid,pid,t3ver_state
',
677 'pages_language_overlay
',
679 ' AND sys_language_uid=
' . $tsfe->sys_language_uid .
680 $tsfe->sys_page->enableFields('pages_language_overlay
')
682 $tsfe->sys_page->versionOL('pages_language_overlay
', $row);
683 if (is_array($row)) {
684 $icon = '<span title=
"' . $this->extGetLL('edit_editPageOverlay', true) . '">
'
685 . $this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay
', Icon::SIZE_SMALL)->render() . '</span>
';
686 $url = BackendUtility::getModuleUrl('record_edit
', array(
687 'edit[pages_language_overlay][
' . $row['uid
'] . ']
' => 'edit
',
689 'returnUrl
' => $returnUrl
691 $toolBar .= '<a href=
"' . htmlspecialchars($url) . '">
' . $icon . '</a>
';
695 if ($this->getBackendUser()->check('modules
', 'web_list
')) {
698 'returnUrl
' => GeneralUtility::getIndpEnv('REQUEST_URI
')
700 $icon = '<span title=
"' . $this->extGetLL('edit_db_list', false) . '">
' . $this->iconFactory->getIcon('actions-system-list-open
', Icon::SIZE_SMALL)->render() . '</span>
';
701 $toolBar .= '<a
class=
"t3-icon btn btn-default" href=
"' . htmlspecialchars(BackendUtility::getModuleUrl('web_list', $urlParams)) . '">
' . $icon . '</a>
';
704 $toolBar = '<div
class=
"toolbar btn-group" role=
"group">
' . $toolBar . '</div>
';
715 protected function extGetLL($key, $convertWithHtmlspecialchars = true)
717 $labelStr = $this->getLanguageService()->getLL($key);
718 if ($convertWithHtmlspecialchars) {
719 $labelStr = htmlspecialchars($labelStr);
729 protected function getLanguageService()
731 return $GLOBALS['LANG
'];
739 protected function getBackendUser()
741 return $GLOBALS['BE_USER
'];
749 protected function getDatabaseConnection()
751 return $GLOBALS['TYPO3_DB
'];
757 protected function getTypoScriptFrontendController()
759 return $GLOBALS['TSFE
'];
765 protected function getTimeTracker()
767 return $GLOBALS['TT
'];