Commit 24f83ec5 authored by Nicole Cordes's avatar Nicole Cordes Committed by Anja Leichsenring
Browse files

[TASK] Cleanup ext:backend

Cleanup ext:backend with the following code changes:
* Make use of the "use" statement for GeneralUtility
* Make use of the "use" statement for BackendUtility
* Case in switch statements are tabbed with one more tab

Change-Id: I6549316dddc9575cab4e661b7c111ec947757cb8
Fixes: #47900
Releases: 6.2
Reviewed-on: https://review.typo3.org/20479
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
parent 723b023e
...@@ -26,11 +26,10 @@ namespace TYPO3\CMS\Backend\Configuration; ...@@ -26,11 +26,10 @@ namespace TYPO3\CMS\Backend\Configuration;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
/**
* Contains translation tools use TYPO3\CMS\Backend\Utility\BackendUtility;
* use TYPO3\CMS\Backend\Utility\IconUtility;
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
/** /**
* Contains translation tools * Contains translation tools
* *
...@@ -52,7 +51,7 @@ class TranslationConfigurationProvider { ...@@ -52,7 +51,7 @@ class TranslationConfigurationProvider {
* @todo Define visibility * @todo Define visibility
*/ */
public function getSystemLanguages($page_id = 0, $backPath = '') { public function getSystemLanguages($page_id = 0, $backPath = '') {
$modSharedTSconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getModTSconfig($page_id, 'mod.SHARED'); $modSharedTSconfig = BackendUtility::getModTSconfig($page_id, 'mod.SHARED');
$languageIconTitles = array(); $languageIconTitles = array();
// fallback "old iconstyles" // fallback "old iconstyles"
if (preg_match('/\\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) { if (preg_match('/\\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) {
...@@ -76,13 +75,13 @@ class TranslationConfigurationProvider { ...@@ -76,13 +75,13 @@ class TranslationConfigurationProvider {
foreach ($sys_languages as $row) { foreach ($sys_languages as $row) {
$languageIconTitles[$row['uid']] = $row; $languageIconTitles[$row['uid']] = $row;
if ($row['static_lang_isocode'] && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) { if ($row['static_lang_isocode'] && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) {
$staticLangRow = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2'); $staticLangRow = BackendUtility::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2');
if ($staticLangRow['lg_iso_2']) { if ($staticLangRow['lg_iso_2']) {
$languageIconTitles[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2']; $languageIconTitles[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2'];
} }
} }
if (strlen($row['flag'])) { if (strlen($row['flag'])) {
$languageIconTitles[$row['uid']]['flagIcon'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconName('sys_language', $row); $languageIconTitles[$row['uid']]['flagIcon'] = IconUtility::mapRecordTypeToSpriteIconName('sys_language', $row);
} }
} }
return $languageIconTitles; return $languageIconTitles;
...@@ -103,7 +102,7 @@ class TranslationConfigurationProvider { ...@@ -103,7 +102,7 @@ class TranslationConfigurationProvider {
public function translationInfo($table, $uid, $sys_language_uid = 0, $row = NULL, $selFieldList = '') { public function translationInfo($table, $uid, $sys_language_uid = 0, $row = NULL, $selFieldList = '') {
if ($GLOBALS['TCA'][$table] && $uid) { if ($GLOBALS['TCA'][$table] && $uid) {
if ($row === NULL) { if ($row === NULL) {
$row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($table, $uid); $row = BackendUtility::getRecordWSOL($table, $uid);
} }
if (is_array($row)) { if (is_array($row)) {
$trTable = $this->getTranslationTable($table); $trTable = $this->getTranslationTable($table);
...@@ -111,7 +110,7 @@ class TranslationConfigurationProvider { ...@@ -111,7 +110,7 @@ class TranslationConfigurationProvider {
if ($trTable !== $table || $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] <= 0) { if ($trTable !== $table || $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] <= 0) {
if ($trTable !== $table || $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] == 0) { if ($trTable !== $table || $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] == 0) {
// Look for translations of this record, index by language field value: // Look for translations of this record, index by language field value:
$translationsTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($selFieldList ? $selFieldList : 'uid,' . $GLOBALS['TCA'][$trTable]['ctrl']['languageField'], $trTable, $GLOBALS['TCA'][$trTable]['ctrl']['transOrigPointerField'] . '=' . intval($uid) . ' AND pid=' . intval(($table === 'pages' ? $row['uid'] : $row['pid'])) . ' AND ' . $GLOBALS['TCA'][$trTable]['ctrl']['languageField'] . (!$sys_language_uid ? '>0' : '=' . intval($sys_language_uid)) . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($trTable) . \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause($trTable)); $translationsTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($selFieldList ? $selFieldList : 'uid,' . $GLOBALS['TCA'][$trTable]['ctrl']['languageField'], $trTable, $GLOBALS['TCA'][$trTable]['ctrl']['transOrigPointerField'] . '=' . intval($uid) . ' AND pid=' . intval(($table === 'pages' ? $row['uid'] : $row['pid'])) . ' AND ' . $GLOBALS['TCA'][$trTable]['ctrl']['languageField'] . (!$sys_language_uid ? '>0' : '=' . intval($sys_language_uid)) . BackendUtility::deleteClause($trTable) . BackendUtility::versioningPlaceholderClause($trTable));
$translations = array(); $translations = array();
$translations_errors = array(); $translations_errors = array();
foreach ($translationsTemp as $r) { foreach ($translationsTemp as $r) {
...@@ -185,5 +184,4 @@ class TranslationConfigurationProvider { ...@@ -185,5 +184,4 @@ class TranslationConfigurationProvider {
} }
?> ?>
\ No newline at end of file
...@@ -27,6 +27,9 @@ namespace TYPO3\CMS\Backend\Configuration; ...@@ -27,6 +27,9 @@ namespace TYPO3\CMS\Backend\Configuration;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
/** /**
* A TS-Config parsing class which performs condition evaluation * A TS-Config parsing class which performs condition evaluation
* *
...@@ -35,7 +38,7 @@ namespace TYPO3\CMS\Backend\Configuration; ...@@ -35,7 +38,7 @@ namespace TYPO3\CMS\Backend\Configuration;
class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser { class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser {
/** /**
* @var array * @var array
*/ */
protected $rootLine = array(); protected $rootLine = array();
...@@ -53,7 +56,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser ...@@ -53,7 +56,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
$this->id = $id; $this->id = $id;
$this->rootLine = $rootLine; $this->rootLine = $rootLine;
$hash = md5($type . ':' . $TStext); $hash = md5($type . ':' . $TStext);
$cachedContent = \TYPO3\CMS\Backend\Utility\BackendUtility::getHash($hash, 0); $cachedContent = BackendUtility::getHash($hash);
if ($cachedContent) { if ($cachedContent) {
$storedData = unserialize($cachedContent); $storedData = unserialize($cachedContent);
$storedMD5 = substr($cachedContent, -strlen($hash)); $storedMD5 = substr($cachedContent, -strlen($hash));
...@@ -67,7 +70,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser ...@@ -67,7 +70,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
); );
} else { } else {
$shash = md5($checkMD5 . $hash); $shash = md5($checkMD5 . $hash);
$cachedSpec = \TYPO3\CMS\Backend\Utility\BackendUtility::getHash($shash, 0); $cachedSpec = BackendUtility::getHash($shash);
if ($cachedSpec) { if ($cachedSpec) {
$storedData = unserialize($cachedSpec); $storedData = unserialize($cachedSpec);
$res = array( $res = array(
...@@ -77,7 +80,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser ...@@ -77,7 +80,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
} else { } else {
$storeData = $this->parseWithConditions($TStext); $storeData = $this->parseWithConditions($TStext);
$serData = serialize($storeData); $serData = serialize($storeData);
\TYPO3\CMS\Backend\Utility\BackendUtility::storeHash($shash, $serData, $type . '_TSconfig'); BackendUtility::storeHash($shash, $serData, $type . '_TSconfig');
$res = array( $res = array(
'TSconfig' => $storeData['TSconfig'], 'TSconfig' => $storeData['TSconfig'],
'cached' => 0 'cached' => 0
...@@ -88,7 +91,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser ...@@ -88,7 +91,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
$storeData = $this->parseWithConditions($TStext); $storeData = $this->parseWithConditions($TStext);
$serData = serialize($storeData); $serData = serialize($storeData);
$md5 = md5($serData); $md5 = md5($serData);
\TYPO3\CMS\Backend\Utility\BackendUtility::storeHash($hash, $serData . $md5, $type . '_TSconfig'); BackendUtility::storeHash($hash, $serData . $md5, $type . '_TSconfig');
$res = array( $res = array(
'TSconfig' => $storeData['TSconfig'], 'TSconfig' => $storeData['TSconfig'],
'cached' => 0 'cached' => 0
......
...@@ -26,24 +26,24 @@ namespace TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching; ...@@ -26,24 +26,24 @@ namespace TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/** /**
* Matching TypoScript conditions for backend disposal. * Matching TypoScript conditions for backend disposal.
* *
* Used with the TypoScript parser. * Used with the TypoScript parser.
* Matches browserinfo, IPnumbers for use with templates * Matches browserinfo, IPnumbers for use with templates
* *
* @author Kasper Skårhøj <kasperYYYY@typo3.com> * @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/ */
class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractConditionMatcher { class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\ConditionMatching\AbstractConditionMatcher {
/** /**
* Constructor for this class * Constructor for this class
*
* @return void
*/ */
public function __construct() { public function __construct() {}
}
/** /**
* Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]" * Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
...@@ -53,54 +53,54 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio ...@@ -53,54 +53,54 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio
* @see \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::parse() * @see \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::parse()
*/ */
protected function evaluateCondition($string) { protected function evaluateCondition($string) {
list($key, $value) = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('=', $string, FALSE, 2); list($key, $value) = GeneralUtility::trimExplode('=', $string, FALSE, 2);
$result = parent::evaluateConditionCommon($key, $value); $result = parent::evaluateConditionCommon($key, $value);
if (is_bool($result)) { if (is_bool($result)) {
return $result; return $result;
} else { } else {
switch ($key) { switch ($key) {
case 'usergroup': case 'usergroup':
$groupList = $this->getGroupList(); $groupList = $this->getGroupList();
$values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE); $values = GeneralUtility::trimExplode(',', $value, TRUE);
foreach ($values as $test) { foreach ($values as $test) {
if ($test == '*' || \TYPO3\CMS\Core\Utility\GeneralUtility::inList($groupList, $test)) { if ($test == '*' || GeneralUtility::inList($groupList, $test)) {
return TRUE; return TRUE;
}
} }
} break;
break; case 'adminUser':
case 'adminUser': if ($this->isUserLoggedIn()) {
if ($this->isUserLoggedIn()) { $result = !((bool) $value xor $this->isAdminUser());
$result = !((bool) $value xor $this->isAdminUser()); return $result;
return $result; }
} break;
break; case 'treeLevel':
case 'treeLevel': $values = GeneralUtility::trimExplode(',', $value, TRUE);
$values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE); $treeLevel = count($this->rootline) - 1;
$treeLevel = count($this->rootline) - 1; // If a new page is being edited or saved the treeLevel is higher by one:
// If a new page is being edited or saved the treeLevel is higher by one: if ($this->isNewPageWithPageId($this->pageId)) {
if ($this->isNewPageWithPageId($this->pageId)) { $treeLevel++;
$treeLevel++;
}
foreach ($values as $test) {
if ($test == $treeLevel) {
return TRUE;
} }
}
break;
case 'PIDupinRootline':
case 'PIDinRootline':
$values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE);
if ($key == 'PIDinRootline' || !in_array($this->pageId, $values) || $this->isNewPageWithPageId($this->pageId)) {
foreach ($values as $test) { foreach ($values as $test) {
foreach ($this->rootline as $rl_dat) { if ($test == $treeLevel) {
if ($rl_dat['uid'] == $test) { return TRUE;
return TRUE; }
}
break;
case 'PIDupinRootline':
case 'PIDinRootline':
$values = GeneralUtility::trimExplode(',', $value, TRUE);
if ($key == 'PIDinRootline' || !in_array($this->pageId, $values) || $this->isNewPageWithPageId($this->pageId)) {
foreach ($values as $test) {
foreach ($this->rootline as $rl_dat) {
if ($rl_dat['uid'] == $test) {
return TRUE;
}
} }
} }
} }
} break;
break;
} }
} }
return FALSE; return FALSE;
...@@ -139,10 +139,10 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio ...@@ -139,10 +139,10 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio
*/ */
protected function determinePageId() { protected function determinePageId() {
$pageId = 0; $pageId = 0;
$editStatement = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('edit'); $editStatement = GeneralUtility::_GP('edit');
$commandStatement = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd'); $commandStatement = GeneralUtility::_GP('cmd');
// Determine id from module that was called with an id: // Determine id from module that was called with an id:
if ($id = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'))) { if ($id = intval(GeneralUtility::_GP('id'))) {
$pageId = $id; $pageId = $id;
} elseif (is_array($editStatement)) { } elseif (is_array($editStatement)) {
list($table, $uidAndAction) = each($editStatement); list($table, $uidAndAction) = each($editStatement);
...@@ -172,7 +172,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio ...@@ -172,7 +172,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio
*/ */
protected function getPage() { protected function getPage() {
$pageId = isset($this->pageId) ? $this->pageId : $this->determinePageId(); $pageId = isset($this->pageId) ? $this->pageId : $this->determinePageId();
return \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $pageId); return BackendUtility::getRecord('pages', $pageId);
} }
/** /**
...@@ -190,7 +190,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio ...@@ -190,7 +190,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio
if (($ignoreTable || $table === 'pages') && $id >= 0) { if (($ignoreTable || $table === 'pages') && $id >= 0) {
$pageId = $id; $pageId = $id;
} else { } else {
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($table, abs($id), '*', '', FALSE); $record = BackendUtility::getRecordWSOL($table, abs($id), '*', '', FALSE);
$pageId = $record['pid']; $pageId = $record['pid'];
} }
} }
...@@ -222,7 +222,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio ...@@ -222,7 +222,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio
foreach ($elementsData as $element) { foreach ($elementsData as $element) {
if ($element['cmd'] == 'new' && $element['table'] == 'pages') { if ($element['cmd'] == 'new' && $element['table'] == 'pages') {
if ($element['pid'] < 0) { if ($element['pid'] < 0) {
$pageRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', abs($element['pid']), 'pid'); $pageRecord = BackendUtility::getRecord('pages', abs($element['pid']), 'pid');
$element['pid'] = $pageRecord['pid']; $element['pid'] = $pageRecord['pid'];
} }
if ($element['pid'] == $pageId) { if ($element['pid'] == $pageId) {
...@@ -242,7 +242,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio ...@@ -242,7 +242,7 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio
*/ */
protected function determineRootline() { protected function determineRootline() {
$pageId = isset($this->pageId) ? $this->pageId : $this->determinePageId(); $pageId = isset($this->pageId) ? $this->pageId : $this->determinePageId();
$rootline = \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($pageId, '', TRUE); $rootline = BackendUtility::BEgetRootLine($pageId, '', TRUE);
return $rootline; return $rootline;
} }
...@@ -296,5 +296,4 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio ...@@ -296,5 +296,4 @@ class ConditionMatcher extends \TYPO3\CMS\Core\Configuration\TypoScript\Conditio
} }
?> ?>
\ No newline at end of file
...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu; ...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
/** /**
* Abstract Context Menu * Abstract Context Menu
* *
...@@ -65,5 +66,4 @@ abstract class AbstractContextMenu { ...@@ -65,5 +66,4 @@ abstract class AbstractContextMenu {
} }
?> ?>
\ No newline at end of file
...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu; ...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
/** /**
* Abstract Context Menu Data Provider * Abstract Context Menu Data Provider
* *
...@@ -212,5 +213,4 @@ abstract class AbstractContextMenuDataProvider { ...@@ -212,5 +213,4 @@ abstract class AbstractContextMenuDataProvider {
} }
?> ?>
\ No newline at end of file
...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu; ...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
/** /**
* Context Menu Action * Context Menu Action
* *
...@@ -273,5 +274,4 @@ class ContextMenuAction { ...@@ -273,5 +274,4 @@ class ContextMenuAction {
} }
?> ?>
\ No newline at end of file
...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu; ...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
/** /**
* Context Menu Action Collection * Context Menu Action Collection
* *
...@@ -50,5 +51,4 @@ class ContextMenuActionCollection extends \ArrayObject { ...@@ -50,5 +51,4 @@ class ContextMenuActionCollection extends \ArrayObject {
} }
?> ?>
\ No newline at end of file
...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu\Extdirect; ...@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Backend\ContextMenu\Extdirect;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
/** /**
* Abstract Context Menu for ExtDirect * Abstract Context Menu for ExtDirect
* *
...@@ -74,5 +75,4 @@ abstract class AbstractExtdirectContextMenu extends \TYPO3\CMS\Backend\ContextMe ...@@ -74,5 +75,4 @@ abstract class AbstractExtdirectContextMenu extends \TYPO3\CMS\Backend\ContextMe
} }
?> ?>
\ No newline at end of file
...@@ -26,6 +26,9 @@ namespace TYPO3\CMS\Backend\ContextMenu\Pagetree; ...@@ -26,6 +26,9 @@ namespace TYPO3\CMS\Backend\ContextMenu\Pagetree;
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/** /**
* Context Menu Data Provider for the Page Tree * Context Menu Data Provider for the Page Tree
* *
...@@ -55,12 +58,12 @@ class ContextMenuDataProvider extends \TYPO3\CMS\Backend\ContextMenu\AbstractCon ...@@ -55,12 +58,12 @@ class ContextMenuDataProvider extends \TYPO3\CMS\Backend\ContextMenu\AbstractCon
$tsConfig = $GLOBALS['BE_USER']->getTSConfig('options.contextMenu.' . $this->getContextMenuType() . '.disableItems'); $tsConfig = $GLOBALS['BE_USER']->getTSConfig('options.contextMenu.' . $this->getContextMenuType() . '.disableItems');
$disableItems = array(); $disableItems = array();
if (trim($tsConfig['value']) !== '') { if (trim($tsConfig['value']) !== '') {
$disableItems = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $tsConfig['value']); $disableItems = GeneralUtility::trimExplode(',', $tsConfig['value']);
} }
$tsConfig = $GLOBALS['BE_USER']->getTSConfig('options.contextMenu.pageTree.disableItems'); $tsConfig = $GLOBALS['BE_USER']->getTSConfig('options.contextMenu.pageTree.disableItems');
$oldDisableItems = array(); $oldDisableItems = array();
if (trim($tsConfig['value']) !== '') { if (trim($tsConfig['value']) !== '') {
$oldDisableItems = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $tsConfig['value']); $oldDisableItems = GeneralUtility::trimExplode(',', $tsConfig['value']);
} }
$additionalItems = array(); $additionalItems = array();
foreach ($oldDisableItems as $item) { foreach ($oldDisableItems as $item) {
...@@ -69,7 +72,7 @@ class ContextMenuDataProvider extends \TYPO3\CMS\Backend\ContextMenu\AbstractCon ...@@ -69,7 +72,7 @@ class ContextMenuDataProvider extends \TYPO3\CMS\Backend\ContextMenu\AbstractCon
continue; continue;
} }
if (strpos($this->legacyContextMenuMapping[$item], ',')) { if (strpos($this->legacyContextMenuMapping[$item], ',')) {
$actions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->legacyContextMenuMapping[$item]); $actions = GeneralUtility::trimExplode(',', $this->legacyContextMenuMapping[$item]);
$additionalItems = array_merge($additionalItems, $actions); $additionalItems = array_merge($additionalItems