‪TYPO3CMS  10.4
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 (// This field is not read only
57  !$parameterArray['fieldConf']['config']['readOnly']
58  // If RTE is generally enabled by user settings and RTE object registry can return something valid
59  && $backendUser->isRTE()
60  // If RTE is enabled for field
61  && isset($parameterArray['fieldConf']['config']['enableRichtext'])
62  && (bool)$parameterArray['fieldConf']['config']['enableRichtext'] === true
63  // If RTE config is found (prepared by TcaText data provider)
64  && isset($parameterArray['fieldConf']['config']['richtextConfiguration'])
65  && is_array($parameterArray['fieldConf']['config']['richtextConfiguration'])
66  // If RTE is not disabled on configuration level
67  && !$parameterArray['fieldConf']['config']['richtextConfiguration']['disabled']
68  ) {
69  return RichTextElement::class;
70  }
71  return null;
72  }
73 
77  protected function ‪getBackendUserAuthentication()
78  {
79  return ‪$GLOBALS['BE_USER'];
80  }
81 }
‪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:38
‪TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver\__construct
‪__construct(NodeFactory $nodeFactory, array $data)
Definition: RichTextNodeResolver.php:41
‪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:76
‪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:5
‪TYPO3\CMS\RteCKEditor\Form\Resolver\RichTextNodeResolver\resolve
‪string void resolve()
Definition: RichTextNodeResolver.php:51