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