‪TYPO3CMS  10.4
UserContentObject.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 
20 
25 {
32  public function ‪render($conf = [])
33  {
34  if (!is_array($conf) || empty($conf)) {
35  $this->‪getTimeTracker()->‪setTSlogMessage('USER without configuration.', 2);
36  return '';
37  }
38  $content = '';
39  if ($this->cObj->getUserObjectType() === false) {
40  // Come here only if we are not called from $TSFE->processNonCacheableContentPartsAndSubstituteContentMarkers()!
41  $this->cObj->setUserObjectType(‪ContentObjectRenderer::OBJECTTYPE_USER);
42  }
43  $tempContent = $this->cObj->callUserFunction($conf['userFunc'], $conf, '');
44  if ($this->cObj->doConvertToUserIntObject) {
45  $this->cObj->doConvertToUserIntObject = false;
46  $content = $this->cObj->cObjGetSingle('USER_INT', $conf);
47  } else {
48  $content .= $tempContent;
49  // Only executed when the element is not converted to USER_INT
50  if (isset($conf['stdWrap.'])) {
51  $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
52  }
53  }
54  $this->cObj->setUserObjectType(false);
55  return $content;
56  }
57 
61  protected function ‪getTimeTracker()
62  {
63  return GeneralUtility::makeInstance(TimeTracker::class);
64  }
65 }
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\OBJECTTYPE_USER
‪const OBJECTTYPE_USER
Definition: ContentObjectRenderer.php:436
‪TYPO3\CMS\Frontend\ContentObject
Definition: AbstractContentObject.php:16
‪TYPO3\CMS\Frontend\ContentObject\UserContentObject\render
‪string render($conf=[])
Definition: UserContentObject.php:32
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\setTSlogMessage
‪setTSlogMessage($content, $num=0)
Definition: TimeTracker.php:215
‪TYPO3\CMS\Frontend\ContentObject\UserContentObject
Definition: UserContentObject.php:25
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
Definition: AbstractContentObject.php:25
‪TYPO3\CMS\Frontend\ContentObject\UserContentObject\getTimeTracker
‪TimeTracker getTimeTracker()
Definition: UserContentObject.php:61
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\TimeTracker\TimeTracker
Definition: TimeTracker.php:30