[TASK] Cleanup EXT:frontend
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / ContentObjectArrayContentObject.php
1 <?php
2 namespace TYPO3\CMS\Frontend\ContentObject;
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
17 use TYPO3\CMS\Core\TimeTracker\TimeTracker;
18
19 /**
20 * Contains COA class object.
21 */
22 class ContentObjectArrayContentObject extends AbstractContentObject {
23
24 /**
25 * Rendering the cObject, COBJ_ARRAY / COA
26 *
27 * @param array $conf Array of TypoScript properties
28 * @return string Output
29 */
30 public function render($conf = array()) {
31 if (empty($conf)) {
32 $this->getTimeTracker()->setTSlogMessage('No elements in this content object array (COBJ_ARRAY, COA).', 2);
33 return '';
34 }
35 if (!empty($conf['if.']) && !$this->cObj->checkIf($conf['if.'])) {
36 return '';
37 }
38
39 $this->cObj->includeLibs($conf);
40 $content = $this->cObj->cObjGet($conf);
41 $wrap = isset($conf['wrap.']) ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap'];
42 if ($wrap) {
43 $content = $this->cObj->wrap($content, $wrap);
44 }
45 if (isset($conf['stdWrap.'])) {
46 $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
47 }
48 return $content;
49 }
50
51 /**
52 * @return TimeTracker
53 */
54 protected function getTimeTracker() {
55 return $GLOBALS['TT'];
56 }
57
58 }