[-FEATURE] Remove restricted class prefixes
[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 * Statictemplates
30 *
31 * @author Kasper Skårhøj (kasperYYYY@typo3.com)
32 * @author Benjamin Mack (benn@typo3.org)
33 */
34 class tx_statictemplates {
35
36 /**
37 * Includes static template records from static_template table, loaded through a hook
38 *
39 * @param array $params
40 * @param object $pObj
41 * @return void
42 */
43 public function includeStaticTypoScriptSources(&$params, &$pObj) {
44 // Static Template Records (static_template): include_static is a
45 // list of static templates to include
46 if (trim($params['row']['include_static'])) {
47 $includeStaticArr = t3lib_div::intExplode(',', $params['row']['include_static']);
48 // traversing list
49 foreach ($includeStaticArr as $id) {
50 // if $id is not already included ...
51 if (!t3lib_div::inList($params['idList'], 'static_' . $id)) {
52 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'static_template', 'uid = ' . intval($id));
53 // there was a template, then we fetch that
54 if ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
55 $subrow = $pObj->prependStaticExtra($subrow);
56 $pObj->processTemplate($subrow, $params['idList'] . ',static_' . $id, $params['pid'], 'static_' . $id, $params['templateId']);
57 }
58 $GLOBALS['TYPO3_DB']->sql_free_result($res);
59 }
60 }
61 }
62 }
63 }
64
65 ?>