Cleanup: Updated copyright comments
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / content / class.tslib_content_contenttable.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010-2011 Xavier Perseguers <typo3@perseguers.ch>
6 * (c) 2010-2011 Steffen Kamper <steffen@typo3.org>
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 * A copy is found in the textfile GPL.txt and important notices to the license
18 * from the author is found in LICENSE.txt distributed with these scripts.
19 *
20 *
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28
29 /**
30 * Contains CTABLE class object.
31 *
32 * $Id: class.tslib_content.php 7905 2010-06-13 14:42:33Z ohader $
33 * @author Xavier Perseguers <typo3@perseguers.ch>
34 * @author Steffen Kamper <steffen@typo3.org>
35 */
36 class tslib_content_ContentTable extends tslib_content_Abstract {
37
38 /**
39 * Rendering the cObject, CTABLE
40 *
41 * @param array Array of TypoScript properties
42 * @return string Output
43 */
44 public function render($conf = array()) {
45
46 $controlTable = t3lib_div::makeInstance('tslib_controlTable');
47
48 $tableParams = isset($conf['tableParams.'])
49 ? $this->cObj->stdWrap($conf['tableParams'],$conf['tableParams.'])
50 : $conf['tableParams'];
51 if ($tableParams) {
52 $controlTable->tableParams = $tableParams;
53 }
54 // loads the pagecontent
55 $conf['cWidth'] = isset($conf['cWidth.'])
56 ? $this->cObj->stdWrap($conf['cWidth'],$conf['cWidth.'])
57 : $conf['cWidth'];
58 $controlTable->contentW = $conf['cWidth'];
59
60 // loads the menues if any
61 if (is_array($conf['c.'])) {
62 $controlTable->content = $this->cObj->cObjGet($conf['c.'], 'c.');
63 $contentTDParams = isset($conf['c.']['TDParams.'])
64 ? $this->cObj->stdWrap($conf['c.']['TDParams'],$conf['c.']['TDParams.'])
65 : $conf['c.']['TDParams'];
66 $controlTable->contentTDparams = isset($contentTDParams)
67 ? $contentTDParams
68 : 'valign="top"';
69 }
70 if (is_array($conf['lm.'])) {
71 $controlTable->lm = $this->cObj->cObjGet($conf['lm.'], 'lm.');
72 $lmTDParams = isset($conf['lm.']['TDParams.'])
73 ? $this->cObj->stdWrap($conf['lm.']['TDParams'],$conf['lm.']['TDParams.'])
74 : $conf['lm.']['TDParams'];
75 $controlTable->lmTDparams = isset($lmTDParams)
76 ? $lmTDParams
77 : 'valign="top"';
78 }
79 if (is_array($conf['tm.'])) {
80 $controlTable->tm = $this->cObj->cObjGet($conf['tm.'], 'tm.');
81 $tmTDParams = isset($conf['tm.']['TDParams.'])
82 ? $this->cObj->stdWrap($conf['tm.']['TDParams'],$conf['tm.']['TDParams.'])
83 : $conf['tm.']['TDParams'];
84 $controlTable->tmTDparams = isset($tmTDParams)
85 ? $tmTDParams
86 : 'valign="top"';
87 }
88 if (is_array($conf['rm.'])) {
89 $controlTable->rm = $this->cObj->cObjGet($conf['rm.'], 'rm.');
90 $rmTDParams = isset($conf['rm.']['TDParams.'])
91 ? $this->cObj->stdWrap($conf['rm.']['TDParams'],$conf['rm.']['TDParams.'])
92 : $conf['rm.']['TDParams'];
93 $controlTable->rmTDparams = isset($rmTDParams)
94 ? $rmTDParams
95 : 'valign="top"';
96 }
97 if (is_array($conf['bm.'])) {
98 $controlTable->bm = $this->cObj->cObjGet($conf['bm.'], 'bm.');
99 $bmTDParams = isset($conf['bm.']['TDParams.'])
100 ? $this->cObj->stdWrap($conf['bm.']['TDParams'],$conf['bm.']['TDParams.'])
101 : $conf['bm.']['TDParams'];
102 $controlTable->bmTDparams = isset($bmTDParams)
103 ? $bmTDParams
104 : 'valign="top"';
105 }
106
107 $conf['offset'] = isset($conf['offset.'])
108 ? $this->cObj->stdWrap($conf['offset'],$conf['offset.'])
109 : $conf['offset'];
110
111 $conf['cMargins'] = isset($conf['cMargins.'])
112 ? $this->cObj->stdWrap($conf['cMargins'],$conf['cMargins.'])
113 : $conf['cMargins'];
114
115 $theValue = $controlTable->start($conf['offset'], $conf['cMargins']);
116
117 if (isset($conf['stdWrap.'])) {
118 $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
119 }
120
121 return $theValue;
122
123 }
124 }
125
126
127 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_contenttable.php'])) {
128 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_contenttable.php']);
129 }
130
131 ?>