Feature #18194 » static_templates_2009_v3.patch
typo3/sysext/cms/ext_tables.php (working copy) | ||
---|---|---|
)
|
||
);
|
||
// ******************************************************************
|
||
// static_template
|
||
// ******************************************************************
|
||
$TCA['static_template'] = array (
|
||
'ctrl' => array (
|
||
'label' => 'title',
|
||
'tstamp' => 'tstamp',
|
||
'title' => 'LLL:EXT:cms/locallang_tca.xml:static_template',
|
||
'readOnly' => 1, // This should always be true, as it prevents the static templates from being altered
|
||
'adminOnly' => 1, // Only admin, if any
|
||
'rootLevel' => 1,
|
||
'is_static' => 1,
|
||
'default_sortby' => 'ORDER BY title',
|
||
'crdate' => 'crdate',
|
||
'iconfile' => 'template_standard.gif',
|
||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tbl_cms.php'
|
||
)
|
||
);
|
||
?>
|
||
?>
|
typo3/sysext/cms/locallang_tca.xml (working copy) | ||
---|---|---|
<label index="sys_template.constants">Constants:</label>
|
||
<label index="sys_template.resources">Resources:</label>
|
||
<label index="sys_template.nextLevel">Template on next level:</label>
|
||
<label index="sys_template.include_static">Include static:</label>
|
||
<label index="sys_template.include_static_file">Include static (from extensions):</label>
|
||
<label index="sys_template.basedOn">Include basis template:</label>
|
||
<label index="sys_template.includeStaticAfterBasedOn">Include static AFTER basedOn:</label>
|
||
... | ... | |
<label index="sys_template.tabs.options">Options</label>
|
||
<label index="sys_template.tabs.access">Access</label>
|
||
<label index="pages_language_overlay">Alternative Page Language</label>
|
||
<label index="static_template">Static templates</label>
|
||
</languageKey>
|
||
</data>
|
||
</T3locallang>
|
typo3/sysext/cms/ext_tables.sql (working copy) | ||
---|---|---|
#
|
||
# Table structure for table 'static_template'
|
||
#
|
||
CREATE TABLE static_template (
|
||
uid int(11) unsigned NOT NULL auto_increment,
|
||
pid int(11) unsigned DEFAULT '0' NOT NULL,
|
||
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
|
||
crdate int(11) unsigned DEFAULT '0' NOT NULL,
|
||
title varchar(255) DEFAULT '' NOT NULL,
|
||
include_static tinytext,
|
||
constants text,
|
||
config text,
|
||
editorcfg text,
|
||
description text,
|
||
PRIMARY KEY (uid),
|
||
KEY parent (pid)
|
||
);
|
||
#
|
||
# Table structure for table 'sys_domain'
|
||
#
|
||
CREATE TABLE sys_domain (
|
||
... | ... | |
endtime int(11) unsigned DEFAULT '0' NOT NULL,
|
||
root tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||
clear tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||
include_static tinytext,
|
||
include_static_file text,
|
||
constants text,
|
||
config text,
|
typo3/sysext/cms/tbl_cms.php (working copy) | ||
---|---|---|
$TCA['sys_template'] = array(
|
||
'ctrl' => $TCA['sys_template']['ctrl'],
|
||
'interface' => array(
|
||
'showRecordFieldList' => 'title,clear,root,include_static,basedOn,nextLevel,resources,sitetitle,description,hidden,starttime,endtime'
|
||
'showRecordFieldList' => 'title,clear,root,basedOn,nextLevel,resources,sitetitle,description,hidden,starttime,endtime'
|
||
),
|
||
'columns' => array(
|
||
'title' => array(
|
||
... | ... | |
),
|
||
)
|
||
),
|
||
'include_static' => array(
|
||
'label' => 'LLL:EXT:cms/locallang_tca.xml:sys_template.include_static',
|
||
'config' => array(
|
||
'type' => 'select',
|
||
'foreign_table' => 'static_template',
|
||
'foreign_table_where' => 'ORDER BY static_template.title DESC',
|
||
'size' => 10,
|
||
'maxitems' => 20,
|
||
'default' => '',
|
||
),
|
||
),
|
||
'include_static_file' => array(
|
||
'label' => 'LLL:EXT:cms/locallang_tca.xml:sys_template.include_static_file',
|
||
'config' => array(
|
||
... | ... | |
'1' => array('showitem' => '
|
||
hidden,title;;1;;2-2-2, sitetitle, constants;;;;3-3-3, config, description;;;;4-4-4,
|
||
--div--;LLL:EXT:cms/locallang_tca.xml:sys_template.tabs.options, clear, root, nextLevel, editorcfg;;;;5-5-5,
|
||
--div--;LLL:EXT:cms/locallang_tca.xml:sys_template.tabs.include, include_static,includeStaticAfterBasedOn,6-6-6, include_static_file, basedOn, static_file_mode,
|
||
--div--;LLL:EXT:cms/locallang_tca.xml:sys_template.tabs.include, includeStaticAfterBasedOn,6-6-6, include_static_file, basedOn, static_file_mode,
|
||
--div--;LLL:EXT:cms/locallang_tca.xml:sys_template.tabs.files, resources,
|
||
--div--;LLL:EXT:cms/locallang_tca.xml:sys_template.tabs.access, starttime, endtime'
|
||
)
|
||
... | ... | |
);
|
||
// ******************************************************************
|
||
// static_template
|
||
// ******************************************************************
|
||
$TCA['static_template'] = array(
|
||
'ctrl' => $TCA['static_template']['ctrl'],
|
||
'interface' => array(
|
||
'showRecordFieldList' => 'title,include_static,description'
|
||
),
|
||
'columns' => array(
|
||
'title' => array(
|
||
'label' => 'Template title:',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
'size' => '25',
|
||
'max' => '256',
|
||
'eval' => 'required'
|
||
)
|
||
),
|
||
'constants' => array(
|
||
'label' => 'Constants:',
|
||
'config' => array(
|
||
'type' => 'text',
|
||
'cols' => '48',
|
||
'rows' => '10',
|
||
'wrap' => 'OFF'
|
||
),
|
||
'defaultExtras' => 'fixed-font : enable-tab',
|
||
),
|
||
'include_static' => array(
|
||
'label' => 'Include static:',
|
||
'config' => array(
|
||
'type' => 'select',
|
||
'foreign_table' => 'static_template',
|
||
'foreign_table_where' => 'ORDER BY static_template.title',
|
||
'size' => 10,
|
||
'maxitems' => 20,
|
||
'default' => ''
|
||
)
|
||
),
|
||
'config' => array(
|
||
'label' => 'Setup:',
|
||
'config' => array(
|
||
'type' => 'text',
|
||
'rows' => 10,
|
||
'cols' => 48,
|
||
'wrap' => 'OFF'
|
||
),
|
||
'defaultExtras' => 'fixed-font : enable-tab',
|
||
),
|
||
'editorcfg' => array(
|
||
'label' => 'Backend Editor Configuration:',
|
||
'config' => array(
|
||
'type' => 'text',
|
||
'rows' => 4,
|
||
'cols' => 48,
|
||
'wrap' => 'OFF'
|
||
),
|
||
'defaultExtras' => 'fixed-font : enable-tab',
|
||
),
|
||
'description' => array(
|
||
'label' => 'Description:',
|
||
'config' => array(
|
||
'type' => 'text',
|
||
'rows' => 10,
|
||
'cols' => 48
|
||
)
|
||
)
|
||
),
|
||
'types' => array(
|
||
'1' => array('showitem' => 'title;;;;2-2-2, constants;;;;3-3-3, config, include_static;;;;5-5-5, description;;;;5-5-5, editorcfg')
|
||
)
|
||
);
|
||
?>
|
typo3/sysext/install/mod/class.tx_install.php (working copy) | ||
---|---|---|
require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_installversioning.php');
|
||
require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_installnewsysexts.php');
|
||
require_once(t3lib_extMgm::extPath('install') . 'mod/class.tx_install_session.php');
|
||
require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_statictemplates.php');
|
||
/**
|
||
* Install Tool module
|
typo3/sysext/install/updates/class.tx_coreupdates_statictemplates.php (revision 0) | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 1999-2008 Steffen Rutter (info@rs-websystems.de)
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||
* free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Contains the update class for old static templates. Used by the update wizard in the install tool.
|
||
*
|
||
* @author Steffen Ritter <info@rs-websystems.de>
|
||
*/
|
||
class tx_coreupdates_statictemplates {
|
||
var $versionNumber; // version number coming from t3lib_div::int_from_ver()
|
||
var $pObj; // parent object (tx_install)
|
||
var $userInput; // user input
|
||
/**
|
||
* checks if there are any references to static_templates.
|
||
*/
|
||
function checkForUpdate(&$description) {
|
||
$description = '<strong>Check dependencies / references to old TypoScript templates in table static_template.</strong><br />
|
||
This updater checks if you are using the old TypoScript static templates. These are extracted into its own extension "statictemplates". If you need them, this updater will install this extension.<br /><br />';
|
||
if ($this->versionNumber >= 4003000 && !t3lib_extMgm::isLoaded('statictemplates')) {
|
||
$rows = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||
'*',
|
||
'sys_refindex',
|
||
'ref_table = "static_template" AND tablename != "static_template" AND deleted=0'
|
||
);
|
||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($rows)) {
|
||
$description .= '<b style="color:#f00">Dependencies found! You MUST install the extenion "statictemplates"!</b>';
|
||
return true;
|
||
}
|
||
else {
|
||
$description .= 'No Dependencies found! You may use the COMPARE - Tool to delete the static_template table.';
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
/**
|
||
* second step: get user info
|
||
*
|
||
* @param string input prefix, all names of form fields have to start with this. Append custom name in [ ... ]
|
||
* @return string HTML output
|
||
*/
|
||
public function getUserInput($inputPrefix) {
|
||
$content = '<strong>Install the system extension</strong><br />You are about to install the extension "statictemplates". Make sure it is available in the TYPO3 source.';
|
||
return $content;
|
||
}
|
||
/**
|
||
* performs the action of the UpdateManager
|
||
*
|
||
* @param array &$dbQueries: queries done in this update
|
||
* @param mixed &$customMessages: custom messages
|
||
* @return bool whether everything went smoothly or not
|
||
*/
|
||
function performUpdate(&$dbQueries, &$customMessages) {
|
||
if ($this->versionNumber >= 4003000 && !t3lib_extMgm::isLoaded('statictemplates')) {
|
||
// check wether the table can be truncated or if sysext with tca has to be installed
|
||
if ($this->checkForUpdate($customMessages[])) {
|
||
$localconf = $this->pObj->writeToLocalconf_control();
|
||
$this->pObj->setValueInLocalconfFile($localconf, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] . ',statictemplates');
|
||
$message = $this->pObj->writeToLocalconf_control($localconf);
|
||
if ($message == 'continue') {
|
||
$customMessages[] = 'System Extension "statictemplates" was succesfully loaded, static templates are now supported.';
|
||
return true;
|
||
}
|
||
else {
|
||
return false; // something went wrong
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/install/ext_localconf.php (working copy) | ||
---|---|---|
// install versioning since TYPO3 4.3
|
||
$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['installVersioning'] = 'tx_coreupdates_installversioning';
|
||
// add static_template if needed (since TYPO3 4.3 this table is not standard)
|
||
// if needed, sysext statictables is loaded, which gives back functionality
|
||
$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['checkForStaticTypoScriptTemplates'] = 'tx_coreupdates_statictemplates';
|
||
?>
|