[BUGFIX] Fix several typos in php comments
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Form / Element / UserElement.php
1 <?php
2 declare(strict_types = 1);
3 namespace TYPO3\CMS\Backend\Form\Element;
4
5 /*
6 * This file is part of the TYPO3 CMS project.
7 *
8 * It is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, either version 2
10 * of the License, or any later version.
11 *
12 * For the full copyright and license information, please read the
13 * LICENSE.txt file that was distributed with this source code.
14 *
15 * The TYPO3 project - inspiring people to share!
16 */
17
18 /**
19 * Generation of elements of the type "user". This is a dummy implementation.
20 *
21 * type="user" elements should be combined with a custom renderType to create custom output.
22 * This implementation registered for type="user" kicks in if no renderType is given and is just
23 * a fallback implementation to hint developers that the TCA registration is incomplete.
24 */
25 class UserElement extends AbstractFormElement
26 {
27 /**
28 * User defined field type
29 *
30 * @return array As defined in initializeResultArray() of AbstractNode
31 */
32 public function render()
33 {
34 // Render some dummy output to explain this element should usually not be called at all.
35 $resultArray = $this->initializeResultArray();
36 $resultArray['html'] = '<div class="alert alert-warning">';
37 $resultArray['html'] .= 'This is dummy output: Field <code>' . htmlspecialchars($this->data['fieldName']) . '</code>';
38 $resultArray['html'] .= 'of table <code>' . htmlspecialchars($this->data['tableName']) . '</code>';
39 $resultArray['html'] .= ' is registered as type="user" element without a specific renderType.';
40 $resultArray['html'] .= ' Please look up details in TCA reference documentation for type="user".';
41 $resultArray['html'] .= '</div>';
42 return $resultArray;
43 }
44 }