[TASK] Separate ext:statictemplates code from core
[Packages/TYPO3.CMS.git] / typo3 / sysext / statictemplates / ext_tables.php
1 <?php
2 if (!defined('TYPO3_MODE')) {
3 die('Access denied.');
4 }
5 // static_template
6 $TCA['static_template'] = array(
7 'ctrl' => array(
8 'label' => 'title',
9 'tstamp' => 'tstamp',
10 'title' => 'LLL:EXT:statictemplates/locallang_tca.xml:static_template',
11 'readOnly' => 1,
12 // This should always be TRUE, as it prevents the static templates from being altered
13 'adminOnly' => 1,
14 // Only admin, if any
15 'rootLevel' => 1,
16 'is_static' => 1,
17 'default_sortby' => 'ORDER BY title',
18 'crdate' => 'crdate',
19 'iconfile' => 'template_standard.gif',
20 'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'tca.php'
21 )
22 );
23 $tempField = array(
24 'include_static' => array(
25 'label' => 'LLL:EXT:statictemplates/locallang_tca.xml:include_static',
26 'config' => array(
27 'type' => 'select',
28 'foreign_table' => 'static_template',
29 'foreign_table_where' => 'ORDER BY static_template.title DESC',
30 'size' => 10,
31 'maxitems' => 20,
32 'default' => ''
33 )
34 )
35 );
36 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_template', $tempField, 1);
37 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_template', 'include_static;;2;;5-5-5', '', 'before:includeStaticAfterBasedOn');
38
39 if (TYPO3_MODE === 'BE') {
40 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController']['newStandardTemplateView'] =
41 'TYPO3\\CMS\\Statictemplates\\TypoScriptTemplateModuleControllerHook->render';
42 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController']['newStandardTemplateHandler'] =
43 'TYPO3\\CMS\\Statictemplates\\TypoScriptTemplateModuleControllerHook->handle';
44 }
45
46 ?>