‪TYPO3CMS  11.5
RichTextNodeResolver.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
22 
28 {
34  protected ‪$data;
35 
42  public function ‪__construct(‪NodeFactory $nodeFactory, array ‪$data)
43  {
44  $this->data = ‪$data;
45  }
46 
52  public function ‪resolve()
53  {
54  $parameterArray = $this->data['parameterArray'];
55  $backendUser = $this->‪getBackendUserAuthentication();
56  if (// If RTE is generally enabled by user settings and RTE object registry can return something valid
57  $backendUser->isRTE()
58  // If RTE is enabled for field
59  && (bool)($parameterArray['fieldConf']['config']['enableRichtext'] ?? false) === true
60  // If RTE config is found (prepared by TcaText data provider)
61  && is_array($parameterArray['fieldConf']['config']['richtextConfiguration'] ?? null)
62  // If RTE is not disabled on configuration level
63  && !($parameterArray['fieldConf']['config']['richtextConfiguration']['disabled'] ?? false)
64  ) {
65  return RichTextElement::class;
66  }
67  return null;
68  }
69 
73  protected function ‪getBackendUserAuthentication()
74  {
75  return ‪$GLOBALS['BE_USER'];
76  }
77 }
‪TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver
Definition: RichTextNodeResolver.php:28
‪TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver\$data
‪array $data
Definition: RichTextNodeResolver.php:33
‪TYPO3\CMS\RteCKEditor\Form\Element\RichTextElement
Definition: RichTextElement.php:39
‪TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver\__construct
‪__construct(NodeFactory $nodeFactory, array $data)
Definition: RichTextNodeResolver.php:41
‪TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver\resolve
‪string null resolve()
Definition: RichTextNodeResolver.php:51
‪TYPO3\CMS\RteCKEditor\Form\Resolver
Definition: RichTextNodeResolver.php:16
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver\getBackendUserAuthentication
‪BackendUserAuthentication getBackendUserAuthentication()
Definition: RichTextNodeResolver.php:72
‪TYPO3\CMS\Backend\Form\NodeFactory
Definition: NodeFactory.php:37
‪TYPO3\CMS\Backend\Form\NodeResolverInterface
Definition: NodeResolverInterface.php:22
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25