Project

General

Profile

Feature #17759 » 20071106_new_page_doktype.diff

Administrator Admin, 2007-11-06 23:16

View differences:

typo3/sysext/cms/ext_tables.php (working copy)
'5' => Array(
'icon' => 'pages_notinmenu.gif'
),
'7' => Array(
'icon' => 'pages_mountpoint.gif'
),
'6' => Array(
'type' => 'web',
'icon' => 'be_users_section.gif',
'allowedTables' => '*'
),
'7' => Array(
'icon' => 'pages_mountpoint.gif'
),
'8' => Array(
'icon' => 'pages_container.gif'
),
'199' => Array( // TypoScript: Limit is 200. When the doktype is 200 or above, the page WILL NOT be regarded as a 'page' by TypoScript. Rather is it a system-type page
'type' => 'sys',
'icon' => 'spacer_icon.gif',
......
1,
0,
array(
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.0', '2', 'i/pages.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.3', '5', 'i/pages_notinmenu.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.4', '6', 'i/be_users_section.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.div.link', '--div--'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.2', '4', 'i/pages_shortcut.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.5', '7', 'i/pages_mountpoint.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.8', '3', 'i/pages_link.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.8', '3', 'i/pages_link.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.I.9', '8', 'i/pages.gif'),
array('LLL:EXT:cms/locallang_tca.php:pages.doktype.div.special', '--div--')
)
);
......
'endtime' => 'endtime',
'fe_group' => 'fe_group',
);
// Enable Tabs
$TCA['pages']['ctrl']['dividers2tabs'] = TRUE;
// Adding default value columns:
$TCA['pages']['ctrl']['useColumnsForDefaultValues'].=',fe_group,hidden';
$TCA['pages']['ctrl']['transForeignTable'] = 'pages_language_overlay';
......
// Totally overriding all type-settings:
$TCA['pages']['types'] = Array (
'1' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg'),
'2' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module, content_from_pid'),
'1' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--;LLL:EXT:cms/locallang_tca.php:tabs.metadata, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.php:tabs.options, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module'),
'3' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, subtitle, nav_hide, url;;;;3-3-3, urltype, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg'),
'4' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, subtitle, nav_hide, shortcut;;;;3-3-3, shortcut_mode, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg'),
'5' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module, content_from_pid'),
'7' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, mount_pid;;;;3-3-3, mount_pid_ol, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module, content_from_pid'),
'5' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_title, --div--;LLL:EXT:cms/locallang_tca.php:tabs.metadata, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.php:tabs.options, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module'),
'7' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--;LLL:EXT:cms/locallang_tca.php:tabs.mount, mount_pid;;;;3-3-3, mount_pid_ol, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.php:tabs.options, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module, content_from_pid'),
'8' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, nav_hide, nav_title, content_from_pid'),
'199' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;;;2-2-2, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'254' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;LLL:EXT:lang/locallang_general.php:LGL.title;;;2-2-2, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module'),
'254' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;LLL:EXT:lang/locallang_general.php:LGL.title;;;2-2-2, --div--;LLL:EXT:cms/locallang_tca.php:tabs.options, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module'),
'255' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;;;2-2-2')
);
// Merging palette settings:
typo3/sysext/cms/locallang_tca.xml (working copy)
<label index="pages.doktype.I.5">Mount Point</label>
<label index="pages.doktype.I.7">Visual menu separator</label>
<label index="pages.doktype.I.8">Link to external URL</label>
<label index="pages.doktype.I.9">Container page</label>
<label index="pages.doktype.div.page">Page</label>
<label index="pages.doktype.div.link">Link</label>
<label index="pages.doktype.div.special">Special</label>
......
<label index="pages.l18n_cfg.I.1">Hide default translation of page</label>
<label index="pages.l18n_cfg.I.2">Hide page if no translation for current language exists</label>
<label index="pages.l18n_cfg.I.2a">Show page even if no translation exists</label>
<label index="tabs.metadata">Metadata</label>
<label index="tabs.options">Options</label>
<label index="tabs.mount">Mount Options</label>
<label index="tt_content">Pagecontent</label>
<label index="fe_users">Website user</label>
<label index="fe_users.username">Username:</label>
......
<label index="pages.fe_login_mode.enable">Enable</label>
</languageKey>
</data>
</T3locallang>
</T3locallang>
typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy)
* @return void
*/
function pagegenInit() {
if ($GLOBALS['TSFE']->page['content_from_pid']>0) {
//page doktypes ignores content_from_pid
$ignoreContentFromPidDoktypes = Array(1,3,4,7);
if ($GLOBALS['TSFE']->page['content_from_pid']>0 && !in_array($GLOBALS['TSFE']->page['doktype'],$ignoreContentFromPidDoktypes)) {
$temp_copy_TSFE = clone($GLOBALS['TSFE']); // make REAL copy of TSFE object - not reference!
$temp_copy_TSFE->id = $GLOBALS['TSFE']->page['content_from_pid']; // Set ->id to the content_from_pid value - we are going to evaluate this pid as was it a given id for a page-display!
$temp_copy_TSFE->getPageAndRootlineWithDomain($GLOBALS['TSFE']->config['config']['content_from_pid_allowOutsideDomain']?0:$GLOBALS['TSFE']->domainStartPage);
typo3/sysext/install/ext_localconf.php (working copy)
// not used yet
//require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_notinmenu.php');
//$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['notInMenu_doctype_conversion'] = 'tx_coreupdates_notinmenu';
require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_advancedpage.php');
$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['advanced_doctype_conversion'] = 'tx_coreupdates_advancedpage';
?>
?>
typo3/sysext/install/updates/class.tx_coreupdates_advancedpage.php (revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2006 Sebastian Kurfuerst (sebastian@garbage-group.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 advanced pages. Used by the update wizard in the install tool.
*
* @author Sebastian Kurfuerst <sebastian@garbage-group.de
*/
class tx_coreupdates_advancedpage {
var $versionNumber; // version number coming from t3lib_div::int_from_ver()
/**
* parent object
*
* @var tx_install
*/
var $pObj;
var $userInput; // user input
function checkForUpdate(&$description) {
$description = 'Removes the doctype "Advanced" which is deprecated and sets the successing page flag "Standard" instead.';
if ($this->versionNumber >= 4002000) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid','pages','doktype=2');
if($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
return 1;
}
}
return 0;
}
/**
* [Describe function...]
*
* @param [type] $$dbQueries: ...
* @param [type] $customMessages: ...
* @return [type] ...
*/
function performUpdate(&$dbQueries, &$customMessages) {
if($this->versionNumber >= 4002000) {
$updateArray = array(
'doktype' => 1,
);
$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('pages', 'doktype=2', $updateArray);
$dbQueries[] = str_replace(chr(10), ' ', $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);
if ($GLOBALS['TYPO3_DB']->sql_error()) {
return 0; // something went wrong
}
return 1;
}
}
}
?>
(2-2/4)