[TASK] Remove deprecated parts marked for removal
[Packages/TYPO3.CMS.git] / typo3 / sysext / statictemplates / class.tx_statictemplates.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
6 * (c) 2009-2011 Benjamin Mack (benn@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 class tx_statictemplates {
30
31
32 /**
33 * Includes static template records from static_template table, loaded through a hook
34 *
35 * @param string A list of already processed template ids including the current; The list is on the form "[prefix]_[uid]" where [prefix] is "sys" for "sys_template" records, "static" for "static_template" records and "ext_" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.
36 * @param string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
37 * @param array The PID of the input template record
38 * @param array A full TypoScript template record
39 * @return void
40 */
41 public function includeStaticTypoScriptSources(&$params, &$pObj) {
42 // Static Template Records (static_template): include_static is a
43 // list of static templates to include
44 if (trim($params['row']['include_static'])) {
45 $includeStaticArr = t3lib_div::intExplode(',', $params['row']['include_static']);
46 // traversing list
47 foreach ($includeStaticArr as $id) {
48 // if $id is not already included ...
49 if (!t3lib_div::inList($params['idList'], 'static_' . $id)) {
50 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'static_template', 'uid = ' . intval($id));
51 // there was a template, then we fetch that
52 if ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
53 $subrow = $pObj->prependStaticExtra($subrow);
54 $pObj->processTemplate($subrow, $params['idList'] . ',static_' . $id, $params['pid'], 'static_' . $id, $params['templateId']);
55 }
56 $GLOBALS['TYPO3_DB']->sql_free_result($res);
57 }
58 }
59 }
60 }
61 }
62
63 ?>