Skip to content

Commit

Permalink
[TASK] Hide category field in TYPO3 v10
Browse files Browse the repository at this point in the history
  • Loading branch information
nhovratov committed Mar 25, 2022
1 parent 1a022dc commit f381fa0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Classes/Controller/AjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,17 @@ protected function getElementCount($elementKey)
public function fieldTypes(ServerRequestInterface $request): Response
{
$json = [];
$availability = [
FieldType::CATEGORY => 11,
];
$typo3Version = new Typo3Version();
$defaults = $this->configurationLoader->loadDefaults();
$grouping = $this->configurationLoader->loadFieldGroups();
foreach (FieldType::getConstants() as $type) {
if (isset($availability[$type]) && $typo3Version->getMajorVersion() < $availability[$type]) {
continue;
}

$config = [
'name' => $type,
'icon' => $this->iconFactory->getIcon('mask-fieldtype-' . $type)->getMarkup(),
Expand Down Expand Up @@ -754,8 +762,15 @@ public function cTypes(ServerRequestInterface $request): Response

public function tabs(ServerRequestInterface $request): Response
{
$availability = [
FieldType::CATEGORY => 11,
];
$typo3Version = new Typo3Version();
$tabs = [];
foreach (FieldType::getConstants() as $type) {
if (isset($availability[$type]) && $typo3Version->getMajorVersion() < $availability[$type]) {
continue;
}
$tabs[$type] = $this->configurationLoader->loadTab($type);
}
return new JsonResponse($tabs);
Expand Down

0 comments on commit f381fa0

Please sign in to comment.