Commit 702aa612 authored by Benni Mack's avatar Benni Mack Committed by Christian Kuhn
Browse files

[TASK] Remove unused arguments from ext_getObjTree()

ExtendedTemplateService->ext_getObjTree() has
unused properties. Since "ExtendedTemplateService"
is marked as internal, these methods can be removed.

Resolves: #96539
Releases: main
Change-Id: If5328a790ce167156750cb26a097c257cdb368cb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73017

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent ade1708c
......@@ -160,15 +160,8 @@ class ExtendedTemplateService extends TemplateService
*/
protected $javaScriptInstructions = [];
/**
* @var \TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser
*/
private $constantParser;
private ConstantConfigurationParser $constantParser;
/**
* @param Context|null $context
* @param \TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser $constantParser
*/
public function __construct(Context $context = null, ConstantConfigurationParser $constantParser = null)
{
parent::__construct($context);
......@@ -314,20 +307,17 @@ class ExtendedTemplateService extends TemplateService
* @param array $arr
* @param string $depth_in
* @param string $depthData
* @param string $parentType (unused)
* @param string $parentValue (unused)
* @param string $alphaSort sorts the array keys / tree by alphabet when set to 1
* @param bool $alphaSort sorts the array keys / tree by alphabet when set
* @return string
*/
public function ext_getObjTree($arr, $depth_in, $depthData, $parentType = '', $parentValue = '', $alphaSort = '0')
public function ext_getObjTree($arr, $depth_in, $depthData, bool $alphaSort = false)
{
$HTML = '';
if ($alphaSort == '1') {
if ($alphaSort) {
ksort($arr);
}
$keyArr_num = [];
$keyArr_alpha = [];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
foreach ($arr as $key => $value) {
// Don't do anything with comments / linenumber registrations...
......@@ -413,7 +403,7 @@ class ExtendedTemplateService extends TemplateService
}
$HTML .= '</span>';
if ($deeper) {
$HTML .= $this->ext_getObjTree($arr[$key . '.'] ?? [], $depth, $depthData, '', $arr[$key] ?? '', $alphaSort);
$HTML .= $this->ext_getObjTree($arr[$key . '.'] ?? [], $depth, $depthData, $alphaSort);
}
}
}
......
......@@ -214,7 +214,7 @@ class InfoPageTyposcriptConfigController
}
$this->view->assign('csh', BackendUtility::cshItem('_MOD_web_info', 'tsconfig_hierarchy', '', '|'));
$this->view->assign('tree', $tmpl->ext_getObjTree($pageTsConfig, '', '', '', '', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'] ?? '0'));
$this->view->assign('tree', $tmpl->ext_getObjTree($pageTsConfig, '', '', (bool)($this->pObj->MOD_SETTINGS['tsconf_alphaSort'] ?? false)));
}
$this->view->assign('alphaSort', BackendUtility::getFuncCheck($this->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'] ?? false, '', '', 'id="checkTsconf_alphaSort"'));
$this->view->assign('dropdownMenu', BackendUtility::getDropdownMenu($this->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']));
......
......@@ -288,7 +288,6 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController
$urlParameters = [
'id' => $this->id,
];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
$assigns['moduleUrl'] = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
......@@ -335,8 +334,8 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController
if (!$theKey || !str_replace('-', '', $theKey)) {
$theKey = '';
}
[$theSetup, $theSetupValue] = $this->templateService->ext_getSetup($theSetup, $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ?? '');
$tree = $this->templateService->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort'] ?? '');
[$theSetup] = $this->templateService->ext_getSetup($theSetup, $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ?? '');
$tree = $this->templateService->ext_getObjTree($theSetup, $theKey, '', (bool)($this->pObj->MOD_SETTINGS['ts_browser_alphaSort'] ?? false));
$tree = $this->templateService->substituteCMarkers($tree);
$urlParameters = [
'id' => $this->id,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment