TYPO3 CMS  TYPO3_8-7
AdminPanelView.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
28 
33 {
39  protected $extNeedUpdate = false;
40 
46  protected $ext_forcePreview = false;
47 
51  protected $extJSCODE = '';
52 
56  protected $iconFactory;
57 
63  protected $extFeEditLoaded = false;
64 
68  public function __construct()
69  {
70  $this->initialize();
71  }
72 
76  public function initialize()
77  {
78  $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
79  $this->saveConfigOptions();
80  $typoScriptFrontend = $this->getTypoScriptFrontendController();
81  // Setting some values based on the admin panel
82  $this->extFeEditLoaded = ExtensionManagementUtility::isLoaded('feedit');
83  $typoScriptFrontend->forceTemplateParsing = $this->extGetFeAdminValue('tsdebug', 'forceTemplateParsing');
84  $typoScriptFrontend->displayEditIcons = $this->extGetFeAdminValue('edit', 'displayIcons');
85  $typoScriptFrontend->displayFieldEditIcons = $this->extGetFeAdminValue('edit', 'displayFieldIcons');
86  if (GeneralUtility::_GP('ADMCMD_editIcons')) {
87  $typoScriptFrontend->displayFieldEditIcons = 1;
88  }
89  if (GeneralUtility::_GP('ADMCMD_simUser')) {
90  $this->getBackendUser()->uc['TSFE_adminConfig']['preview_simulateUserGroup'] = (int)GeneralUtility::_GP('ADMCMD_simUser');
91  $this->ext_forcePreview = true;
92  }
93  if (GeneralUtility::_GP('ADMCMD_simTime')) {
94  $this->getBackendUser()->uc['TSFE_adminConfig']['preview_simulateDate'] = (int)GeneralUtility::_GP('ADMCMD_simTime');
95  $this->ext_forcePreview = true;
96  }
97  if ($typoScriptFrontend->forceTemplateParsing) {
98  $typoScriptFrontend->set_no_cache('Admin Panel: Force template parsing', true);
99  } elseif ($this->extFeEditLoaded && $typoScriptFrontend->displayEditIcons) {
100  $typoScriptFrontend->set_no_cache('Admin Panel: Display edit icons', true);
101  } elseif ($this->extFeEditLoaded && $typoScriptFrontend->displayFieldEditIcons) {
102  $typoScriptFrontend->set_no_cache('Admin Panel: Display field edit icons', true);
103  } elseif (GeneralUtility::_GP('ADMCMD_view')) {
104  $typoScriptFrontend->set_no_cache('Admin Panel: Display preview', true);
105  }
106  }
107 
113  public function getAdminPanelHeaderData()
114  {
115  $result = '';
116  if (!empty($GLOBALS['TBE_STYLES']['stylesheets']['admPanel'])) {
117  $stylesheet = GeneralUtility::locationHeaderUrl($GLOBALS['TBE_STYLES']['stylesheets']['admPanel']);
118  $result = '<link rel="stylesheet" type="text/css" href="' . htmlspecialchars($stylesheet) . '" />';
119  }
120  return $result;
121  }
122 
129  public function isAdminModuleEnabled($key)
130  {
131  $result = false;
132  // Returns TRUE if the module checked is "preview" and the forcePreview flag is set.
133  if ($key === 'preview' && $this->ext_forcePreview) {
134  $result = true;
135  } elseif (!empty($this->getBackendUser()->extAdminConfig['enable.']['all'])) {
136  $result = true;
137  } elseif (!empty($this->getBackendUser()->extAdminConfig['enable.'][$key])) {
138  $result = true;
139  }
140  return $result;
141  }
142 
147  public function saveConfigOptions()
148  {
149  $input = GeneralUtility::_GP('TSFE_ADMIN_PANEL');
150  $beUser = $this->getBackendUser();
151  if (is_array($input)) {
152  // Setting
153  $beUser->uc['TSFE_adminConfig'] = array_merge(!is_array($beUser->uc['TSFE_adminConfig']) ? [] : $beUser->uc['TSFE_adminConfig'], $input);
154  unset($beUser->uc['TSFE_adminConfig']['action']);
155  // Actions:
156  if (($input['action']['clearCache'] && $this->isAdminModuleEnabled('cache')) || isset($input['preview_showFluidDebug'])) {
157  $beUser->extPageInTreeInfo = [];
158  $theStartId = (int)$input['cache_clearCacheId'];
160  ->clearPageCacheContent_pidList(
161  $beUser->extGetTreeList(
162  $theStartId,
163  $this->extGetFeAdminValue(
164  'cache',
165  'clearCacheLevels'
166  ),
167  0,
168  $beUser->getPagePermsClause(1)
169  ) . $theStartId
170  );
171  }
172  // Saving
173  $beUser->writeUC();
174  // Flush fluid template cache
175  $cacheManager = new CacheManager();
176  $cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
177  $cacheManager->getCache('fluid_template')->flush();
178  }
179  $this->getTimeTracker()->LR = $this->extGetFeAdminValue('tsdebug', 'LR');
180  if ($this->extGetFeAdminValue('cache', 'noCache')) {
181  $this->getTypoScriptFrontendController()->set_no_cache('Admin Panel: No Caching', true);
182  }
183  }
184 
192  public function extGetFeAdminValue($sectionName, $val = '')
193  {
194  if (!$this->isAdminModuleEnabled($sectionName)) {
195  return null;
196  }
197 
198  $beUser = $this->getBackendUser();
199  // Exceptions where the values can be overridden (forced) from backend:
200  // deprecated
201  if (
202  $sectionName === 'edit' && (
203  $val === 'displayIcons' && $beUser->extAdminConfig['module.']['edit.']['forceDisplayIcons'] ||
204  $val === 'displayFieldIcons' && $beUser->extAdminConfig['module.']['edit.']['forceDisplayFieldIcons'] ||
205  $val === 'editNoPopup' && $beUser->extAdminConfig['module.']['edit.']['forceNoPopup']
206  )
207  ) {
208  return true;
209  }
210 
211  // Override all settings with user TSconfig
212  if ($val && isset($beUser->extAdminConfig['override.'][$sectionName . '.'][$val])) {
213  return $beUser->extAdminConfig['override.'][$sectionName . '.'][$val];
214  }
215  if (!$val && isset($beUser->extAdminConfig['override.'][$sectionName])) {
216  return $beUser->extAdminConfig['override.'][$sectionName];
217  }
218 
219  $returnValue = $val ? $beUser->uc['TSFE_adminConfig'][$sectionName . '_' . $val] : 1;
220 
221  // Exception for preview
222  if ($sectionName === 'preview' && $this->ext_forcePreview) {
223  return !$val ? true : $returnValue;
224  }
225 
226  // See if the menu is expanded!
227  return $this->isAdminModuleOpen($sectionName) ? $returnValue : null;
228  }
229 
233  public function forcePreview()
234  {
235  $this->ext_forcePreview = true;
236  }
237 
244  public function isAdminModuleOpen($key)
245  {
246  return $this->getBackendUser()->uc['TSFE_adminConfig']['display_top'] && $this->getBackendUser()->uc['TSFE_adminConfig']['display_' . $key];
247  }
248 
255  protected function getModule($key, $content)
256  {
257  $output = [];
258 
259  if ($this->getBackendUser()->uc['TSFE_adminConfig']['display_top'] && $this->isAdminModuleEnabled($key)) {
260  $output[] = '<div class="typo3-adminPanel-section typo3-adminPanel-section-' . ($this->isAdminModuleOpen($key) ? 'open' : 'closed') . '">';
261  $output[] = ' <div class="typo3-adminPanel-section-title">';
262  $output[] = ' ' . $this->linkSectionHeader($key, $this->extGetLL($key));
263  $output[] = ' </div>';
264  if ($this->isAdminModuleOpen($key)) {
265  $output[] = '<div class="typo3-adminPanel-section-body">';
266  $output[] = ' ' . $content;
267  $output[] = '</div>';
268  }
269  $output[] = '</div>';
270  }
271 
272  return implode('', $output);
273  }
274 
281  public function display()
282  {
283  $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_tsfe.xlf');
284 
285  $moduleContent = '';
286  $moduleContent .= $this->getModule('preview', $this->getPreviewModule());
287  $moduleContent .= $this->getModule('cache', $this->getCacheModule());
288  $moduleContent .= $this->getModule('edit', $this->getEditModule());
289  $moduleContent .= $this->getModule('tsdebug', $this->getTSDebugModule());
290  $moduleContent .= $this->getModule('info', $this->getInfoModule());
291 
292  if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'])) {
293  foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'] as $classRef) {
294  $hookObject = GeneralUtility::getUserObj($classRef);
295  if (!$hookObject instanceof AdminPanelViewHookInterface) {
296  throw new \UnexpectedValueException($classRef . ' must implement interface ' . AdminPanelViewHookInterface::class, 1311942539);
297  }
298  $content = $hookObject->extendAdminPanel($moduleContent, $this);
299  if ($content) {
300  $moduleContent .= '<div class="typo3-adminPanel-section typo3-adminPanel-section-open">';
301  $moduleContent .= ' <div class="typo3-adminPanel-section-body">';
302  $moduleContent .= ' ' . $content;
303  $moduleContent .= ' </div>';
304  $moduleContent .= '</div>';
305  }
306  }
307  }
308 
309  $output = [];
310  $output[] = '<!-- TYPO3 Admin panel start -->';
311  $output[] = '<a id="TSFE_ADMIN_PANEL"></a>';
312  $output[] = '<form id="TSFE_ADMIN_PANEL_FORM" name="TSFE_ADMIN_PANEL_FORM" style="display: none;" 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)">';
313  if (!GeneralUtility::_GET('id')) {
314  $output[] = '<input type="hidden" name="id" value="' . $this->getTypoScriptFrontendController()->id . '" />';
315  }
316  // The dummy field is needed for Firefox: to force a page reload on submit
317  // which must change the form value with JavaScript (see "onsubmit" attribute of the "form" element")
318  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[DUMMY]" value="" />';
319  foreach (GeneralUtility::_GET() as $key => $value) {
320  if ($key !== 'TSFE_ADMIN_PANEL') {
321  if (is_array($value)) {
322  $output[] = $this->getHiddenFields($key, $value);
323  } else {
324  $output[] = '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($value) . '" />';
325  }
326  }
327  }
328  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[display_top]" value="0" />';
329  $output[] = ' <input id="typo3AdminPanelEnable" type="checkbox" onchange="document.TSFE_ADMIN_PANEL_FORM.submit();" name="TSFE_ADMIN_PANEL[display_top]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['display_top'] ? ' checked="checked"' : '') . '/>';
330  $output[] = ' <input id="typo3AdminPanelCollapse" type="checkbox" value="1" />';
331  $output[] = ' <div class="typo3-adminPanel typo3-adminPanel-state-' . ($this->getBackendUser()->uc['TSFE_adminConfig']['display_top'] ? 'open' : 'closed') . '">';
332  $output[] = ' <div class="typo3-adminPanel-header">';
333  $output[] = ' <span class="typo3-adminPanel-header-title">' . $this->extGetLL('adminPanelTitle') . '</span>';
334  $output[] = ' <span class="typo3-adminPanel-header-user">' . htmlspecialchars($this->getBackendUser()->user['username']) . '</span>';
335  $output[] = ' <label for="typo3AdminPanelEnable" class="typo3-adminPanel-header-enable">';
336  $output[] = ' <span class="typo3-adminPanel-header-enable-enabled">';
337  $output[] = ' ' . $this->iconFactory->getIcon('actions-edit-hide', Icon::SIZE_SMALL)->render('inline');
338  $output[] = ' </span>';
339  $output[] = ' <span class="typo3-adminPanel-header-enable-disabled">';
340  $output[] = ' ' . $this->iconFactory->getIcon('actions-edit-unhide', Icon::SIZE_SMALL)->render('inline');
341  $output[] = ' </span>';
342  $output[] = ' </label>';
343  $output[] = ' <label for="typo3AdminPanelCollapse" class="typo3-adminPanel-header-collapse">';
344  $output[] = ' <span class="typo3-adminPanel-header-collapse-enabled">';
345  $output[] = ' ' . $this->iconFactory->getIcon('actions-view-list-collapse', Icon::SIZE_SMALL)->render('inline');
346  $output[] = ' </span>';
347  $output[] = ' <span class="typo3-adminPanel-header-collapse-disabled">';
348  $output[] = ' ' . $this->iconFactory->getIcon('actions-view-list-expand', Icon::SIZE_SMALL)->render('inline');
349  $output[] = ' </span>';
350  $output[] = ' </label>';
351  $output[] = ' </div>';
352  if ($moduleContent && $this->extNeedUpdate) {
353  $output[] = '<div class="typo3-adminPanel-actions">';
354  $output[] = ' <input class="typo3-adminPanel-btn typo3-adminPanel-btn-dark" type="submit" value="' . $this->extGetLL('update') . '" />';
355  $output[] = '</div>';
356  }
357  $output[] = ' <div class="typo3-adminPanel-body">';
358  $output[] = ' ' . $moduleContent;
359  $output[] = ' </div>';
360  $output[] = ' </div>';
361  $output[] = '</form>';
362  if ($this->getBackendUser()->uc['TSFE_adminConfig']['display_top']) {
363  $frontendPathExtBackend = htmlspecialchars($this->getTypoScriptFrontendController()->absRefPrefix) . ExtensionManagementUtility::siteRelPath('backend');
364  $output[] = '<script type="text/javascript" src="' . $frontendPathExtBackend . 'Resources/Public/JavaScript/jsfunc.evalfield.js"></script>';
365  $output[] = '<script type="text/javascript">/*<![CDATA[*/' . GeneralUtility::minifyJavaScript('
366  var evalFunc = new evalFunc();
367  // TSFEtypo3FormFieldSet()
368  function TSFEtypo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue) { //
369  var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
370  var theValue = document.TSFE_ADMIN_PANEL_FORM[theField].value;
371  if (checkbox && theValue==checkboxValue) {
372  document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value="";
373  alert(theField);
374  document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"].checked = "";
375  } else {
376  document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value = evalFunc.outputObjValue(theFObj, theValue);
377  if (document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"]) {
378  document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"].checked = "on";
379  }
380  }
381  }
382  // TSFEtypo3FormFieldGet()
383  function TSFEtypo3FormFieldGet(theField, evallist, is_in, checkbox, checkboxValue, checkbox_off) { //
384  var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
385  if (checkbox_off) {
386  document.TSFE_ADMIN_PANEL_FORM[theField].value=checkboxValue;
387  }else{
388  document.TSFE_ADMIN_PANEL_FORM[theField].value = evalFunc.evalObjValue(theFObj, document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value);
389  }
390  TSFEtypo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue);
391  }') . '/*]]>*/</script>';
392  $output[] = '<script language="javascript" type="text/javascript">' . $this->extJSCODE . '</script>';
393  }
394  $frontendPathExtFrontend = htmlspecialchars($this->getTypoScriptFrontendController()->absRefPrefix) . ExtensionManagementUtility::siteRelPath('frontend');
395  $output[] = '<link type="text/css" rel="stylesheet" href="' . $frontendPathExtFrontend . 'Resources/Public/Css/adminpanel.css" media="all" />';
396  $output[] = $this->getAdminPanelHeaderData();
397  $output[] = '<!-- TYPO3 admin panel end -->';
398 
399  return implode('', $output);
400  }
401 
411  protected function getHiddenFields($key, array $val)
412  {
413  $out = '';
414  foreach ($val as $k => $v) {
415  if (is_array($v)) {
416  $out .= $this->getHiddenFields($key . '[' . $k . ']', $v);
417  } else {
418  $out .= '<input type="hidden" name="' . htmlspecialchars($key) . '[' . htmlspecialchars($k) . ']" value="' . htmlspecialchars($v) . '">' . LF;
419  }
420  }
421  return $out;
422  }
423 
424  /*****************************************************
425  * Creating sections of the Admin Panel
426  ****************************************************/
433  protected function getPreviewModule()
434  {
435  $output = [];
436  if ($this->getBackendUser()->uc['TSFE_adminConfig']['display_preview']) {
437  $this->extNeedUpdate = true;
438 
439  $output[] = '<div class="typo3-adminPanel-form-group">';
440  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
441  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[preview_showHiddenPages]" value="0" />';
442  $output[] = ' <label for="preview_showHiddenPages">';
443  $output[] = ' <input type="checkbox" id="preview_showHiddenPages" name="TSFE_ADMIN_PANEL[preview_showHiddenPages]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['preview_showHiddenPages'] ? ' checked="checked"' : '') . ' />';
444  $output[] = ' ' . $this->extGetLL('preview_showHiddenPages');
445  $output[] = ' </label>';
446  $output[] = ' </div>';
447  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
448  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[preview_showHiddenRecords]" value="0" />';
449  $output[] = ' <label for="preview_showHiddenRecords">';
450  $output[] = ' <input type="checkbox" id="preview_showHiddenRecords" name="TSFE_ADMIN_PANEL[preview_showHiddenRecords]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['preview_showHiddenRecords'] ? ' checked="checked"' : '') . ' />';
451  $output[] = ' ' . $this->extGetLL('preview_showHiddenRecords');
452  $output[] = ' </label>';
453  $output[] = ' </div>';
454  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
455  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[preview_showFluidDebug]" value="0" />';
456  $output[] = ' <label for="preview_showFluidDebug">';
457  $output[] = ' <input type="checkbox" id="preview_showFluidDebug" name="TSFE_ADMIN_PANEL[preview_showFluidDebug]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['preview_showFluidDebug'] ? ' checked="checked"' : '') . ' />';
458  $output[] = ' ' . $this->extGetLL('preview_showFluidDebug');
459  $output[] = ' </label>';
460  $output[] = ' </div>';
461  $output[] = '</div>';
462 
463  // Simulate date
464  $output[] = '<div class="typo3-adminPanel-form-group">';
465  $output[] = ' <label for="preview_simulateDate">';
466  $output[] = ' ' . $this->extGetLL('preview_simulateDate');
467  $output[] = ' </label>';
468  $output[] = ' <input type="text" id="preview_simulateDate" name="TSFE_ADMIN_PANEL[preview_simulateDate]_hr" onchange="TSFEtypo3FormFieldGet(' . GeneralUtility::quoteJSvalue('TSFE_ADMIN_PANEL[preview_simulateDate]') . ', \'datetime\', \'\', 1,0);" />';
469  // the hidden field must be placed after the _hr field to avoid the timestamp being overridden by the date string
470  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[preview_simulateDate]" value="' . htmlspecialchars($this->getBackendUser()->uc['TSFE_adminConfig']['preview_simulateDate']) . '" />';
471  $output[] = '</div>';
472  $this->extJSCODE .= 'TSFEtypo3FormFieldSet("TSFE_ADMIN_PANEL[preview_simulateDate]", "datetime", "", 0, 0);';
473 
474  // Frontend Usergroups
475  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
476  ->getQueryBuilderForTable('fe_groups');
477  $queryBuilder->getRestrictions()
478  ->removeAll()
479  ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
480  $optionCount = $queryBuilder->count('fe_groups.uid')
481  ->from('fe_groups')
482  ->from('pages')
483  ->where(
484  $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')),
485  $this->getBackendUser()->getPagePermsClause(1)
486  )
487  ->execute()
488  ->fetchColumn(0);
489  if ($optionCount > 0) {
490  $result = $queryBuilder->select('fe_groups.uid', 'fe_groups.title')
491  ->from('fe_groups')
492  ->from('pages')
493  ->where(
494  $queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('fe_groups.pid')),
495  $this->getBackendUser()->getPagePermsClause(1)
496  )
497  ->orderBy('fe_groups.title')
498  ->execute();
499  $output[] = '<div class="typo3-adminPanel-form-group">';
500  $output[] = ' <label for="preview_simulateUserGroup">';
501  $output[] = ' ' . $this->extGetLL('preview_simulateUserGroup');
502  $output[] = ' </label>';
503  $output[] = ' <select id="preview_simulateUserGroup" name="TSFE_ADMIN_PANEL[preview_simulateUserGroup]">';
504  $output[] = ' <option value="0">&nbsp;</option>';
505  while ($row = $result->fetch()) {
506  $output[] = '<option value="' . $row['uid'] . '" ' . ($this->getBackendUser()->uc['TSFE_adminConfig']['preview_simulateUserGroup'] == $row['uid'] ? ' selected="selected"' : '') . '>';
507  $output[] = htmlspecialchars(($row['title'] . ' [' . $row['uid'] . ']'));
508  $output[] = '</option>';
509  }
510  $output[] = ' </select>';
511  $output[] = '</div>';
512  }
513  }
514  return implode('', $output);
515  }
516 
523  protected function getCacheModule()
524  {
525  $output = [];
526  $beUser = $this->getBackendUser();
527  if ($beUser->uc['TSFE_adminConfig']['display_cache']) {
528  $this->extNeedUpdate = true;
529 
530  $output[] = '<div class="typo3-adminPanel-form-group">';
531  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
532  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[cache_noCache]" value="0" />';
533  $output[] = ' <label for="cache_noCache">';
534  $output[] = ' <input type="checkbox" id="cache_noCache" name="TSFE_ADMIN_PANEL[cache_noCache]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['cache_noCache'] ? ' checked="checked"' : '') . ' />';
535  $output[] = ' ' . $this->extGetLL('cache_noCache');
536  $output[] = ' </label>';
537  $output[] = ' </div>';
538  $output[] = '</div>';
539 
540  $levels = $beUser->uc['TSFE_adminConfig']['cache_clearCacheLevels'];
541  $output[] = '<div class="typo3-adminPanel-form-group">';
542  $output[] = ' <label for="cache_clearCacheLevels">';
543  $output[] = ' ' . $this->extGetLL('cache_clearLevels');
544  $output[] = ' </label>';
545  $output[] = ' <select id="cache_clearCacheLevels" name="TSFE_ADMIN_PANEL[cache_clearCacheLevels]">';
546  $output[] = ' <option value="0"' . ($levels == 0 ? ' selected="selected"' : '') . '>';
547  $output[] = ' ' . $this->extGetLL('div_Levels_0');
548  $output[] = ' </option>';
549  $output[] = ' <option value="1"' . ($levels == 1 ? ' selected="selected"' : '') . '>';
550  $output[] = ' ' . $this->extGetLL('div_Levels_1');
551  $output[] = ' </option>';
552  $output[] = ' <option value="2"' . ($levels == 2 ? ' selected="selected"' : '') . '>';
553  $output[] = ' ' . $this->extGetLL('div_Levels_2');
554  $output[] = ' </option>';
555  $output[] = ' </select>';
556  $output[] = '</div>';
557 
558  $output[] = '<div class="typo3-adminPanel-form-group">';
559  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[cache_clearCacheId]" value="' . (int)$GLOBALS['TSFE']->id . '" />';
560  $output[] = ' <input class="typo3-adminPanel-btn typo3-adminPanel-btn-default" type="submit" value="' . $this->extGetLL('update') . '" />';
561  $output[] = '</div>';
562 
563  // Generating tree:
564  $depth = (int)$this->extGetFeAdminValue('cache', 'clearCacheLevels');
565  $outTable = '';
566  $tsfe = $this->getTypoScriptFrontendController();
567  $beUser->extPageInTreeInfo = [];
568  $beUser->extPageInTreeInfo[] = [
569  $tsfe->page['uid'],
570  htmlspecialchars($tsfe->page['title']),
571  $depth + 1
572  ];
573  $beUser->extGetTreeList(
574  $tsfe->id,
575  $depth,
576  0,
577  $beUser->getPagePermsClause(1)
578  );
579  $output[] = '<div class="typo3-adminPanel-table-overflow">';
580  $output[] = '<table class="typo3-adminPanel-table">';
581  $output[] = ' <thead>';
582  $output[] = ' <tr>';
583  $output[] = ' <th colspan="2">' . $this->extGetLL('cache_cacheEntries') . '</th>';
584  $output[] = ' </tr>';
585  $output[] = ' </thead>';
586  $output[] = ' <tbody>';
587  foreach ($beUser->extPageInTreeInfo as $key => $row) {
588  $output[] = '<tr>';
589  $output[] = ' <td>';
590  $output[] = ' <span style="width: ' . ($depth + 1 - $row[2]) * 5 . 'px; height: 1px; display: inline-block;"></span>';
591  $output[] = ' ' . $this->iconFactory->getIcon('apps-pagetree-page-default', Icon::SIZE_SMALL)->render() . htmlspecialchars($row[1]);
592  $output[] = ' </td>';
593  $output[] = ' <td>' . $beUser->extGetNumberOfCachedPages($row[0]) . '</td>';
594  $output[] = '</tr>';
595  }
596  $output[] = ' <tbody>';
597  $output[] = '</table>';
598  $output[] = '</div>';
599 
600  $output[] = '<div class="typo3-adminPanel-form-group">';
601  $output[] = ' <input class="typo3-adminPanel-btn typo3-adminPanel-btn-default" type="submit" name="TSFE_ADMIN_PANEL[action][clearCache]" value="' . $this->extGetLL('cache_doit') . '" />';
602  $output[] = '</div>';
603  }
604  return implode('', $output);
605  }
606 
613  protected function getEditModule()
614  {
615  $output = [];
616  if ($this->getBackendUser()->uc['TSFE_adminConfig']['display_edit']) {
617  $this->extNeedUpdate = true;
618 
619  // If another page module was specified, replace the default Page module with the new one
620  $newPageModule = trim($this->getBackendUser()->getTSConfigVal('options.overridePageModule'));
621  $pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
622 
623  if ($this->extFeEditLoaded) {
624  $output[] = '<div class="typo3-adminPanel-form-group">';
625  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
626  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="0" />';
627  $output[] = ' <label for="edit_displayFieldIcons">';
628  $output[] = ' <input type="checkbox" id="edit_displayFieldIcons" name="TSFE_ADMIN_PANEL[edit_displayFieldIcons]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['edit_displayFieldIcons'] ? ' checked="checked"' : '') . ' />';
629  $output[] = ' ' . $this->extGetLL('edit_displayFieldIcons');
630  $output[] = ' </label>';
631  $output[] = ' </div>';
632  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
633  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="0" />';
634  $output[] = ' <label for="edit_displayIcons">';
635  $output[] = ' <input type="checkbox" id="edit_displayIcons" name="TSFE_ADMIN_PANEL[edit_displayIcons]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['edit_displayIcons'] ? ' checked="checked"' : '') . ' />';
636  $output[] = ' ' . $this->extGetLL('edit_displayIcons');
637  $output[] = ' </label>';
638  $output[] = ' </div>';
639  $output[] = '</div>';
640  }
641 
642  $output[] = $this->ext_makeToolBar();
643 
644  if (!GeneralUtility::_GP('ADMCMD_view')) {
645  $onClick = '
646  if (parent.opener && parent.opener.top && parent.opener.top.TS) {
647  parent.opener.top.fsMod.recentIds["web"]=' . (int)$this->getTypoScriptFrontendController()->page['uid'] . ';
648  if (parent.opener.top && parent.opener.top.nav_frame && parent.opener.top.nav_frame.refresh_nav) {
649  parent.opener.top.nav_frame.refresh_nav();
650  }
651  parent.opener.top.goToModule("' . $pageModule . '");
652  parent.opener.top.focus();
653  } else {
654  vHWin=window.open(' . GeneralUtility::quoteJSvalue(BackendUtility::getBackendScript()) . ',' . GeneralUtility::quoteJSvalue(md5('Typo3Backend-' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'])) . ');
655  vHWin.focus();
656  }
657  return false;
658  ';
659  $output[] = '<div class="typo3-adminPanel-form-group">';
660  $output[] = ' <a class="typo3-adminPanel-btn typo3-adminPanel-btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '">';
661  $output[] = ' ' . $this->extGetLL('edit_openAB');
662  $output[] = ' </a>';
663  $output[] = '</div>';
664  }
665  }
666  return implode('', $output);
667  }
668 
675  protected function getTSDebugModule()
676  {
677  $output = [];
678  $beuser = $this->getBackendUser();
679  if ($beuser->uc['TSFE_adminConfig']['display_tsdebug']) {
680  $this->extNeedUpdate = true;
681 
682  $output[] = '<div class="typo3-adminPanel-form-group">';
683  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
684  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_tree]" value="0" />';
685  $output[] = ' <label for="tsdebug_tree">';
686  $output[] = ' <input type="checkbox" id="tsdebug_tree" name="TSFE_ADMIN_PANEL[tsdebug_tree]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['tsdebug_tree'] ? ' checked="checked"' : '') . ' />';
687  $output[] = ' ' . $this->extGetLL('tsdebug_tree');
688  $output[] = ' </label>';
689  $output[] = ' </div>';
690  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
691  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_displayTimes]" value="0" />';
692  $output[] = ' <label for="tsdebug_displayTimes">';
693  $output[] = ' <input type="checkbox" id="tsdebug_displayTimes" name="TSFE_ADMIN_PANEL[tsdebug_displayTimes]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['tsdebug_displayTimes'] ? ' checked="checked"' : '') . ' />';
694  $output[] = ' ' . $this->extGetLL('tsdebug_displayTimes');
695  $output[] = ' </label>';
696  $output[] = ' </div>';
697  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
698  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_displayMessages]" value="0" />';
699  $output[] = ' <label for="tsdebug_displayMessages">';
700  $output[] = ' <input type="checkbox" id="tsdebug_displayMessages" name="TSFE_ADMIN_PANEL[tsdebug_displayMessages]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['tsdebug_displayMessages'] ? ' checked="checked"' : '') . ' />';
701  $output[] = ' ' . $this->extGetLL('tsdebug_displayMessages');
702  $output[] = ' </label>';
703  $output[] = ' </div>';
704  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
705  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_LR]" value="0" />';
706  $output[] = ' <label for="tsdebug_LR">';
707  $output[] = ' <input type="checkbox" id="tsdebug_LR" name="TSFE_ADMIN_PANEL[tsdebug_LR]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['tsdebug_LR'] ? ' checked="checked"' : '') . ' />';
708  $output[] = ' ' . $this->extGetLL('tsdebug_LR');
709  $output[] = ' </label>';
710  $output[] = ' </div>';
711  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
712  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_displayContent]" value="0" />';
713  $output[] = ' <label for="tsdebug_displayContent">';
714  $output[] = ' <input type="checkbox" id="tsdebug_displayContent" name="TSFE_ADMIN_PANEL[tsdebug_displayContent]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['tsdebug_displayContent'] ? ' checked="checked"' : '') . ' />';
715  $output[] = ' ' . $this->extGetLL('tsdebug_displayContent');
716  $output[] = ' </label>';
717  $output[] = ' </div>';
718  $output[] = ' <div class="typo3-adminPanel-form-group-checkbox">';
719  $output[] = ' <input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_forceTemplateParsing]" value="0" />';
720  $output[] = ' <label for="tsdebug_forceTemplateParsing">';
721  $output[] = ' <input type="checkbox" id="tsdebug_forceTemplateParsing" name="TSFE_ADMIN_PANEL[tsdebug_forceTemplateParsing]" value="1"' . ($this->getBackendUser()->uc['TSFE_adminConfig']['tsdebug_forceTemplateParsing'] ? ' checked="checked"' : '') . ' />';
722  $output[] = ' ' . $this->extGetLL('tsdebug_forceTemplateParsing');
723  $output[] = ' </label>';
724  $output[] = ' </div>';
725  $output[] = '</div>';
726 
727  $timeTracker = $this->getTimeTracker();
728  $timeTracker->printConf['flag_tree'] = $this->extGetFeAdminValue('tsdebug', 'tree');
729  $timeTracker->printConf['allTime'] = $this->extGetFeAdminValue('tsdebug', 'displayTimes');
730  $timeTracker->printConf['flag_messages'] = $this->extGetFeAdminValue('tsdebug', 'displayMessages');
731  $timeTracker->printConf['flag_content'] = $this->extGetFeAdminValue('tsdebug', 'displayContent');
732  $output[] = $timeTracker->printTSlog();
733  }
734  return implode('', $output);
735  }
736 
743  protected function getInfoModule()
744  {
745  $output = [];
746  $tsfe = $this->getTypoScriptFrontendController();
747  if ($this->getBackendUser()->uc['TSFE_adminConfig']['display_info']) {
748  // rows stored in tableArr consist of these columns:
749  // 0: label (already html-escaped!)
750  // 1: value (already html-escaped!)
751  // 2: bool (default: false) whether to show column 0 in <strong>-tags
752  $tableArr = [];
753  if ($this->extGetFeAdminValue('cache', 'noCache')) {
754  $theBytes = 0;
755  $count = 0;
756  if (!empty($tsfe->imagesOnPage)) {
757  $tableArr[] = [$this->extGetLL('info_imagesOnPage'), count($tsfe->imagesOnPage), true];
758  foreach ($GLOBALS['TSFE']->imagesOnPage as $file) {
759  $fs = @filesize($file);
760  $tableArr[] = [TAB . htmlspecialchars($file), GeneralUtility::formatSize($fs)];
761  $theBytes += $fs;
762  $count++;
763  }
764  }
765  // Add an empty line
766  $tableArr[] = [$this->extGetLL('info_imagesSize'), GeneralUtility::formatSize($theBytes), true];
767  $tableArr[] = [$this->extGetLL('info_DocumentSize'), GeneralUtility::formatSize(strlen($tsfe->content)), true];
768  $tableArr[] = ['', ''];
769  }
770  $tableArr[] = [$this->extGetLL('info_id'), (int)$tsfe->id];
771  $tableArr[] = [$this->extGetLL('info_type'), (int)$tsfe->type];
772  $tableArr[] = [$this->extGetLL('info_groupList'), htmlspecialchars($tsfe->gr_list)];
773  $tableArr[] = [$this->extGetLL('info_noCache'), $this->extGetLL('info_noCache_' . ($tsfe->no_cache ? 'no' : 'yes'))];
774  $tableArr[] = [$this->extGetLL('info_countUserInt'), count($tsfe->config['INTincScript'] ?? [])];
775 
776  if (!empty($tsfe->fe_user->user['uid'])) {
777  $tableArr[] = [$this->extGetLL('info_feuserName'), htmlspecialchars($tsfe->fe_user->user['username'])];
778  $tableArr[] = [$this->extGetLL('info_feuserId'), htmlspecialchars($tsfe->fe_user->user['uid'])];
779  }
780 
781  $tableArr[] = [$this->extGetLL('info_totalParsetime'), htmlspecialchars($this->getTimeTracker()->getParseTime() . ' ms'), true];
782  $table = '';
783  foreach ($tableArr as $key => $arr) {
784  $label = !empty($arr[2]) ? '<strong>' . $arr[0] . '</strong>' : $arr[0];
785  $value = (string)$arr[1] !== '' ? $arr[1] : '';
786  // the "weird" construct here is intentional.
787  // reasoning: we ALWAYS encode when giving things to the view.
788  // But in this case $label and $value come in encoded, hence the double function call.
789  $table .= '
790  <tr>
791  <td>' . htmlspecialchars(htmlspecialchars_decode($label)) . '</td>
792  <td>' . htmlspecialchars(htmlspecialchars_decode($value)) . '</td>
793  </tr>';
794  }
795 
796  $output[] = '<div class="typo3-adminPanel-table-overflow">';
797  $output[] = ' <table class="typo3-adminPanel-table">';
798  $output[] = ' ' . $table;
799  $output[] = ' </table>';
800  $output[] = '</div>';
801  }
802 
803  return implode('', $output);
804  }
805 
806  /*****************************************************
807  * Admin Panel Layout Helper functions
808  ****************************************************/
818  public function extGetHead($sectionSuffix)
819  {
820  return $this->linkSectionHeader($sectionSuffix, $this->extGetLL($sectionSuffix));
821  }
822 
832  public function linkSectionHeader($sectionSuffix, $sectionTitle, $className = '')
833  {
834  $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;';
835 
836  $output = [];
837  $output[] = '<span class="typo3-adminPanel-section-title-identifier"></span>';
838  $output[] = '<a href="javascript:void(0)" onclick="' . htmlspecialchars($onclick) . '">';
839  $output[] = ' ' . $sectionTitle;
840  $output[] = '</a>';
841  $output[] = '<input type="hidden" name="TSFE_ADMIN_PANEL[display_' . $sectionSuffix . ']" value="' . (int)$this->isAdminModuleOpen($sectionSuffix) . '" />';
842 
843  return implode('', $output);
844  }
845 
858  public function extGetItem($title, $content = '', $checkbox = '', $outerDivClass = null, $innerDivClass = null)
859  {
860  $title = $title ? '<label for="' . htmlspecialchars($title) . '">' . $this->extGetLL($title) . '</label>' : '';
861  $out = '';
862  $out .= (string)$outerDivClass ? '<div class="' . htmlspecialchars($outerDivClass) . '">' : '<div>';
863  $out .= (string)$innerDivClass ? '<div class="' . htmlspecialchars($innerDivClass) . '">' : '<div>';
864  $out .= $checkbox . $title . $content . '</div></div>';
865  return $out;
866  }
867 
873  public function ext_makeToolBar()
874  {
875  $tsfe = $this->getTypoScriptFrontendController();
876  // If mod.newContentElementWizard.override is set, use that extension's create new content wizard instead:
877  $tsConfig = BackendUtility::getModTSconfig($tsfe->page['uid'], 'mod');
878  $moduleName = isset($tsConfig['properties']['newContentElementWizard.']['override'])
879  ? $tsConfig['properties']['newContentElementWizard.']['override']
880  : 'new_content_element';
881  $perms = $this->getBackendUser()->calcPerms($tsfe->page);
882  $langAllowed = $this->getBackendUser()->checkLanguageAccess($tsfe->sys_language_uid);
883  $id = $tsfe->id;
884  $returnUrl = GeneralUtility::getIndpEnv('REQUEST_URI');
885  $classes = 'typo3-adminPanel-btn typo3-adminPanel-btn-default';
886  $output = [];
887  $output[] = '<div class="typo3-adminPanel-form-group">';
888  $output[] = ' <div class="typo3-adminPanel-btn-group" role="group">';
889 
890  // History
891  $link = BackendUtility::getModuleUrl(
892  'record_history',
893  [
894  'element' => 'pages:' . $id,
895  'returnUrl' => $returnUrl
896  ]
897  );
898  $title = $this->extGetLL('edit_recordHistory');
899  $output[] = '<a class="' . $classes . '" href="' . htmlspecialchars($link) . '#latest" title="' . $title . '">';
900  $output[] = ' ' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render();
901  $output[] = '</a>';
902 
903  // New Content
904  if ($perms & Permission::CONTENT_EDIT && $langAllowed) {
905  $linkParameters = [
906  'id' => $id,
907  'returnUrl' => $returnUrl,
908  ];
909  if (!empty($tsfe->sys_language_uid)) {
910  $linkParameters['sys_language_uid'] = $tsfe->sys_language_uid;
911  }
912  $link = BackendUtility::getModuleUrl($moduleName, $linkParameters);
913  $icon = $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render();
914  $title = $this->extGetLL('edit_newContentElement');
915  $output[] = '<a class="' . $classes . '" href="' . htmlspecialchars($link) . '" title="' . $title . '">';
916  $output[] = ' ' . $icon;
917  $output[] = '</a>';
918  }
919 
920  // Move Page
921  if ($perms & Permission::PAGE_EDIT) {
922  $link = BackendUtility::getModuleUrl(
923  'move_element',
924  [
925  'table' => 'pages',
926  'uid' => $id,
927  'returnUrl' => $returnUrl
928  ]
929  );
930  $icon = $this->iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL)->render();
931  $title = $this->extGetLL('edit_move_page');
932  $output[] = '<a class="' . $classes . '" href="' . htmlspecialchars($link) . '" title="' . $title . '">';
933  $output[] = ' ' . $icon;
934  $output[] = '</a>';
935  }
936 
937  // New Page
938  if ($perms & Permission::PAGE_NEW) {
939  $link = BackendUtility::getModuleUrl(
940  'db_new',
941  [
942  'id' => $id,
943  'pagesOnly' => 1,
944  'returnUrl' => $returnUrl
945  ]
946  );
947  $icon = $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)->render();
948  $title = $this->extGetLL('edit_newPage');
949  $output[] = '<a class="' . $classes . '" href="' . htmlspecialchars($link) . '" title="' . $title . '">';
950  $output[] = ' ' . $icon;
951  $output[] = '</a>';
952  }
953 
954  // Edit Page
955  if ($perms & Permission::PAGE_EDIT) {
956  $link = BackendUtility::getModuleUrl(
957  'record_edit',
958  [
959  'edit[pages][' . $id . ']' => 'edit',
960  'noView' => 1,
961  'returnUrl' => $returnUrl
962  ]
963  );
964  $icon = $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render();
965  $title = $this->extGetLL('edit_editPageProperties');
966  $output[] = '<a class="' . $classes . '" href="' . htmlspecialchars($link) . '" title="' . $title . '">';
967  $output[] = ' ' . $icon;
968  $output[] = '</a>';
969  }
970 
971  // Edit Page Overlay
972  if ($perms & Permission::PAGE_EDIT && $tsfe->sys_language_uid && $langAllowed) {
973  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
974  ->getQueryBuilderForTable('pages_language_overlay');
975  $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
976  $row = $queryBuilder
977  ->select('uid', 'pid', 't3ver_state')
978  ->from('pages_language_overlay')
979  ->where(
980  $queryBuilder->expr()->eq(
981  'pid',
982  $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)
983  ),
984  $queryBuilder->expr()->eq(
985  'sys_language_uid',
986  $queryBuilder->createNamedParameter($tsfe->sys_language_uid, \PDO::PARAM_INT)
987  )
988  )
989  ->setMaxResults(1)
990  ->execute()
991  ->fetch();
992  $tsfe->sys_page->versionOL('pages_language_overlay', $row);
993  if (is_array($row)) {
994  $link = BackendUtility::getModuleUrl(
995  'record_edit',
996  [
997  'edit[pages_language_overlay][' . $row['uid'] . ']' => 'edit',
998  'noView' => 1,
999  'returnUrl' => $returnUrl
1000  ]
1001  );
1002  $icon = $this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL)->render();
1003  $title = $this->extGetLL('edit_editPageOverlay');
1004  $output[] = '<a class="' . $classes . '" href="' . htmlspecialchars($link) . '" title="' . $title . '">';
1005  $output[] = ' ' . $icon;
1006  $output[] = '</a>';
1007  }
1008  }
1009 
1010  // Open list view
1011  if ($this->getBackendUser()->check('modules', 'web_list')) {
1012  $link = BackendUtility::getModuleUrl(
1013  'web_list',
1014  [
1015  'id' => $id,
1016  'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
1017  ]
1018  );
1019  $icon = $this->iconFactory->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render();
1020  $title = $this->extGetLL('edit_db_list');
1021  $output[] = '<a class="' . $classes . '" href="' . htmlspecialchars($link) . '" title="' . $title . '">';
1022  $output[] = ' ' . $icon;
1023  $output[] = '</a>';
1024  }
1025 
1026  $output[] = ' </div>';
1027  $output[] = '</div>';
1028  return implode('', $output);
1029  }
1030 
1038  protected function extGetLL($key, $convertWithHtmlspecialchars = true)
1039  {
1040  $labelStr = $this->getLanguageService()->getLL($key);
1041  if ($convertWithHtmlspecialchars) {
1042  $labelStr = htmlspecialchars($labelStr);
1043  }
1044  return $labelStr;
1045  }
1046 
1052  protected function getLanguageService()
1053  {
1054  return $GLOBALS['LANG'];
1055  }
1056 
1062  protected function getBackendUser()
1063  {
1064  return $GLOBALS['BE_USER'];
1065  }
1066 
1070  protected function getTypoScriptFrontendController()
1071  {
1072  return $GLOBALS['TSFE'];
1073  }
1074 
1078  protected function getTimeTracker()
1079  {
1080  return GeneralUtility::makeInstance(TimeTracker::class);
1081  }
1082 }
extGetItem($title, $content='', $checkbox='', $outerDivClass=null, $innerDivClass=null)
static minifyJavaScript($script, &$error='')
linkSectionHeader($sectionSuffix, $sectionTitle, $className='')
extGetFeAdminValue($sectionName, $val='')
extGetLL($key, $convertWithHtmlspecialchars=true)
static makeInstance($className,... $constructorArguments)
static formatSize($sizeInBytes, $labels='', $base=0)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']