diff -ru typo3_src_old/t3lib/config_default.php typo3_src/t3lib/config_default.php --- typo3_src_old/t3lib/config_default.php 2009-02-10 10:36:25.000000000 +0100 +++ typo3_src/t3lib/config_default.php 2009-05-07 14:02:59.000000000 +0200 @@ -248,7 +248,7 @@ 'get_url_id_token' => '#get_URL_ID_TOK#', // This is the token, which is substituted in the output code in order to keep a GET-based session going. Normally the GET-session-id is 5 chars ('&ftu=') + hash_length (norm. 10) 'content_doktypes' => '1,2,5,7', // List of pages.doktype values which can contain content (so shortcut pages and external url pages are excluded, but all pages below doktype 199 should be included. doktype=6 is not either (backend users only...). For doktypes going into menus see class.tslib_menu.php, line 494 (search for 'doktype')) 'enable_mount_pids' => 1, // If set to "1", the mount_pid feature allowing 'symlinks' in the page tree (for frontend operation) is allowed. - 'pageOverlayFields' => 'uid,title,subtitle,nav_title,media,keywords,description,abstract,author,author_email', // List of fields from the table "pages_language_overlay" which should be overlaid on page records. See t3lib_page::getPageOverlay() + 'pageOverlayFields' => 'uid,title,subtitle,nav_title,media,keywords,description,abstract,author,author_email,url,urltype,shortcut,shortcut_mode', // List of fields from the table "pages_language_overlay" which should be overlaid on page records. See t3lib_page::getPageOverlay() 'hidePagesIfNotTranslatedByDefault' => FALSE, // If TRUE, pages that has no translation will be hidden by default. Basically this will inverse the effect of the page localization setting "Hide page if no translation for current language exists" to "Show page even if no translation exists" 'eID_include' => array(), // Array of key/value pairs where key is "tx_[ext]_[optional suffix]" and value is relative filename of class to include. Key is used as "?eID=" for index_ts.php to include the code file which renders the page from that point. (Useful for functionality that requires a low initialization footprint, eg. frontend ajax applications) 'pageCacheToExternalFiles' => FALSE, // If set, page cache entries will be stored in typo3temp/cache_pages/ab/ instead of the database. Still, "cache_pages" will be filled in database but the "HTML" field will be empty. When the cache is flushed the files in cache_pages/ab/ will not be flush - you will have to garbage clean manually once in a while. diff -ru typo3_src_old/typo3/class.db_list_extra.inc typo3_src/typo3/class.db_list_extra.inc --- typo3_src_old/typo3/class.db_list_extra.inc 2009-02-10 10:37:06.000000000 +0100 +++ typo3_src/typo3/class.db_list_extra.inc 2009-05-07 14:38:36.000000000 +0200 @@ -808,6 +808,9 @@ } else { $params = '&edit['.$table.']['.$this->id.']=new'; + if ($table == 'pages_language_overlay') { + $params .= '&overrideVals[pages_language_overlay][doktype]=' . (int) $this->pageRow['doktype']; + } $icon = ''. 'backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width="'.($table=='pages'?13:11).'" height="12"').' title="'.$LANG->getLL('new',1).'" alt="" />'. ''; diff -ru typo3_src_old/typo3/db_new.php typo3_src/typo3/db_new.php --- typo3_src_old/typo3/db_new.php 2009-02-10 10:37:06.000000000 +0100 +++ typo3_src/typo3/db_new.php 2009-05-07 14:17:11.000000000 +0200 @@ -479,9 +479,10 @@ // Create link to new page after $t = 'pages'; $v = $TCA[$t]; - $rowContent = $this->linkWrap( - t3lib_iconWorks::getIconImage($t,array(),$BACK_PATH,''). - $LANG->sL($v['ctrl']['title'],1).' ('.$LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.after',1).')', + $rowContent = ''. + $this->linkWrap( + t3lib_iconWorks::getIconImage($t,array(),$BACK_PATH,''). + $LANG->sL($v['ctrl']['title'],1).' ('.$LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.after',1).')', 'pages', -$this->id ); @@ -524,22 +525,28 @@ * Links the string $code to a create-new form for a record in $table created on page $pid * * @param string Link string + * @param string Link text * @param string Table name (in which to create new record) * @param integer PID value for the "&edit['.$table.']['.$pid.']=new" command (positive/negative) * @param boolean If $addContentTable is set, then a new contentTable record is created together with pages * @return string The link. */ - function linkWrap($code,$table,$pid,$addContentTable=0) { - $params = '&edit['.$table.']['.$pid.']=new'. - ($table=='pages' - && $GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable'] - && isset($GLOBALS['TCA'][$GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable']]) - && $addContentTable ? - '&edit['.$GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable'].'][prev]=new&returnNewPageId=1' : - '' - ); - $onClick = t3lib_BEfunc::editOnClick($params,'',$this->returnUrl); - return ''.$code.''; + function linkWrap($linkText, $table, $pid, $addContentTable = false) { + $parameters = '&edit[' . $table . '][' . $pid . ']=new'; + + if ($table == 'pages' + && $GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable'] + && isset($GLOBALS['TCA'][$GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable']]) + && $addContentTable) { + $parameters .= '&edit['.$GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable'].'][prev]=new&returnNewPageId=1'; + } elseif ($table == 'pages_language_overlay') { + $parameters .= '&overrideVals[pages_language_overlay][doktype]=' + . (int) $this->pageinfo['doktype']; + } + + $onClick = t3lib_BEfunc::editOnClick($parameters, '', $this->returnUrl); + + return '' . $linkText . ''; } /** diff -ru typo3_src_old/typo3/sysext/cms/ext_tables.php typo3_src/typo3/sysext/cms/ext_tables.php --- typo3_src_old/typo3/sysext/cms/ext_tables.php 2009-02-10 10:36:51.000000000 +0100 +++ typo3_src/typo3/sysext/cms/ext_tables.php 2009-05-07 14:21:23.000000000 +0200 @@ -745,27 +745,29 @@ // ****************************************************************** $TCA['pages_language_overlay'] = array ( 'ctrl' => array ( - 'label' => 'title', - 'tstamp' => 'tstamp', - 'title' => 'LLL:EXT:cms/locallang_tca.xml:pages_language_overlay', - 'versioningWS' => true, - 'versioning_followPages' => true, - 'origUid' => 't3_origuid', - 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', - 'delete' => 'deleted', - 'enablecolumns' => array ( - 'disabled' => 'hidden', - 'starttime' => 'starttime', - 'endtime' => 'endtime' + 'label' => 'title', + 'tstamp' => 'tstamp', + 'title' => 'LLL:EXT:cms/locallang_tca.xml:pages_language_overlay', + 'versioningWS' => true, + 'versioning_followPages' => true, + 'origUid' => 't3_origuid', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'delete' => 'deleted', + 'enablecolumns' => array ( + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime' ), - 'transOrigPointerField' => 'pid', - 'transOrigPointerTable' => 'pages', - 'transOrigDiffSourceField' => 'l18n_diffsource', + 'transOrigPointerField' => 'pid', + 'transOrigPointerTable' => 'pages', + 'transOrigDiffSourceField' => 'l18n_diffsource', 'shadowColumnsForNewPlaceholders' => 'title', - 'languageField' => 'sys_language_uid', - 'mainpalette' => 1, - 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tbl_cms.php' + 'languageField' => 'sys_language_uid', + 'mainpalette' => 1, + 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tbl_cms.php', + 'type' => 'doktype', + 'dividers2tabs' => true ) ); diff -ru typo3_src_old/typo3/sysext/cms/ext_tables.sql typo3_src/typo3/sysext/cms/ext_tables.sql --- typo3_src_old/typo3/sysext/cms/ext_tables.sql 2009-02-10 10:36:51.000000000 +0100 +++ typo3_src/typo3/sysext/cms/ext_tables.sql 2009-05-07 14:29:30.000000000 +0200 @@ -167,6 +167,7 @@ CREATE TABLE pages_language_overlay ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, + doktype tinyint(3) unsigned DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, @@ -195,6 +196,10 @@ author_email varchar(80) DEFAULT '' NOT NULL, tx_impexp_origuid int(11) DEFAULT '0' NOT NULL, l18n_diffsource mediumblob, + url varchar(255) DEFAULT '' NOT NULL, + urltype tinyint(4) unsigned DEFAULT '0' NOT NULL, + shortcut int(10) unsigned DEFAULT '0' NOT NULL, + shortcut_mode int(10) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (uid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), diff -ru typo3_src_old/typo3/sysext/cms/layout/class.tx_cms_layout.php typo3_src/typo3/sysext/cms/layout/class.tx_cms_layout.php --- typo3_src_old/typo3/sysext/cms/layout/class.tx_cms_layout.php 2009-02-10 10:36:47.000000000 +0100 +++ typo3_src/typo3/sysext/cms/layout/class.tx_cms_layout.php 2009-05-07 14:30:57.000000000 +0200 @@ -2005,7 +2005,7 @@ // If any languages are left, make selector: if (count($langSelItems)>1) { - $onChangeContent = 'window.location.href=\''.$this->backPath.'alt_doc.php?&edit[pages_language_overlay]['.$id.']=new&overrideVals[pages_language_overlay][sys_language_uid]=\'+this.options[this.selectedIndex].value+\'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).'\''; + $onChangeContent = 'window.location.href=\''.$this->backPath.'alt_doc.php?&edit[pages_language_overlay]['.$id.']=new&overrideVals[pages_language_overlay][doktype]=' . (int) $this->pageRecord['doktype'] . '&overrideVals[pages_language_overlay][sys_language_uid]=\'+this.options[this.selectedIndex].value+\'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).'\''; return $GLOBALS['LANG']->getLL('new_language',1).':

'; diff -ru typo3_src_old/typo3/sysext/cms/tbl_cms.php typo3_src/typo3/sysext/cms/tbl_cms.php --- typo3_src_old/typo3/sysext/cms/tbl_cms.php 2009-02-10 10:36:51.000000000 +0100 +++ typo3_src/typo3/sysext/cms/tbl_cms.php 2009-05-07 15:12:59.000000000 +0200 @@ -450,9 +450,10 @@ 'showRecordFieldList' => 'title,hidden,starttime,endtime,keywords,description,abstract' ), 'columns' => Array ( + 'doktype' => $TCA['pages']['columns']['doktype'], 'hidden' => Array ( 'exclude' => 1, - 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.hidden', + 'label' => 'LLL:EXT:cms/locallang_tca.xml:pages.hidden', 'config' => Array ( 'type' => 'check', 'default' => '0' @@ -581,6 +582,46 @@ 'minitems' => '0' ) ), + 'url' => array( + 'exclude' => 1, + 'label' => 'LLL:EXT:cms/locallang_tca.php:pages.url', + 'config' => array( + 'type' => 'input', + 'size' => '25', + 'max' => '255', + 'eval' => 'trim' + ) + ), + 'urltype' => array( + 'exclude' => 1, + 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.type', + 'config' => array( + 'type' => 'select', + 'items' => $TCA['pages']['columns']['urltype']['config']['items'], + 'default' => '1' + ) + ), + 'shortcut' => array ( + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.shortcut_page', + 'config' => array ( + 'type' => 'group', + 'internal_type' => 'db', + 'allowed' => 'pages', + 'size' => '3', + 'maxitems' => '1', + 'minitems' => '0', + 'show_thumbs' => '1' + ) + ), + 'shortcut_mode' => array ( + 'exclude' => 1, + 'label' => 'LLL:EXT:cms/locallang_tca.xml:pages.shortcut_mode', + 'config' => array ( + 'type' => 'select', + 'items' => $TCA['pages']['columns']['shortcut_mode']['config']['items'], + 'default' => '0' + ) + ), 'sys_language_uid' => Array ( 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.language', 'config' => Array ( @@ -604,11 +645,29 @@ ), ), 'types' => Array ( - '0' => Array('showitem' => 'hidden;;;;1-1-1, sys_language_uid, title;;;;2-2-2, subtitle, nav_title, --div--, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4') + // Standard + '1' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, nav_title, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.metadata, --palette--;LLL:EXT:lang/locallang_general.xml:LGL.author;5;;3-3-3, abstract, keywords, description, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'), + + // External URL - URL and URL type can be different for the translated page + '3' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.url, url;;;;3-3-3, urltype, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'), + + // Shortcut - shortcut and shortcut mode can be different for the translated page + '4' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.shortcut, shortcut;;;;3-3-3, shortcut_mode, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'), + + // Mount Point - mount point options can _NOT_ be different for the translated page + '7' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, nav_title, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'), + + // Separator + '199' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2'), + + // Sysfolder + '254' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;LLL:EXT:lang/locallang_general.xml:LGL.title;;;2-2-2'), + + // Recycler + '255' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2') ), 'palettes' => Array ( - '1' => Array('showitem' => 'starttime,endtime'), - '5' => Array('showitem' => 'author,author_email') + '5' => array('showitem' => 'author,author_email', 'canNotCollapse' => true) ) ); diff -ru typo3_src_old/typo3/sysext/cms/tslib/class.tslib_fe.php typo3_src/typo3/sysext/cms/tslib/class.tslib_fe.php --- typo3_src_old/typo3/sysext/cms/tslib/class.tslib_fe.php 2009-02-10 10:36:51.000000000 +0100 +++ typo3_src/typo3/sysext/cms/tslib/class.tslib_fe.php 2009-05-07 14:27:59.000000000 +0200 @@ -224,7 +224,8 @@ var $rootLine=''; // The rootLine (all the way to tree root, not only the current site!) (array) var $page=''; // The pagerecord (array) var $contentPid=0; // This will normally point to the same value as id, but can be changed to point to another page from which content will then be displayed instead. - + protected $originalShortcutPage = null; // gets set when we are processing a page of type shortcut in the early stages opf init.php when we do not know about languages yet, used later in init.php to determine the correct shortcut in case a translation changes the shortcut target (array) + /** * sys_page-object, pagefunctions * @@ -1040,6 +1041,13 @@ // Is the ID a link to another page?? if ($this->page['doktype']==4) { $this->MP = ''; // We need to clear MP if the page is a shortcut. Reason is if the short cut goes to another page, then we LEAVE the rootline which the MP expects. + + // saving the page so that we can check later - when we know + // about languages - whether we took the correct shortcut or + // whether a translation of the page overwrites the shortcut + // target and we need to follow the new target + $this->originalShortcutPage = $this->page; + $this->page = $this->getPageShortcut($this->page['shortcut'],$this->page['shortcut_mode'],$this->page['uid']); $this->id = $this->page['uid']; } @@ -2238,6 +2246,12 @@ // If sys_language_uid is set to another language than default: if ($this->sys_language_uid>0) { + + // check whether a shortcut is overwritten by a translated page + // we can only do this now, as this is the place where we get + // to know about translations + $this->checkTranslatedShortcut(); + // Request the overlay record for the sys_language_uid: $olRec = $this->sys_page->getPageOverlay($this->id, $this->sys_language_uid); if (!count($olRec)) { @@ -2350,6 +2364,41 @@ $this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']); } } + + /** + * checks whether a translated shortcut page has a different shortcut + * target than the original language page. + * If that is the case, things get corrected to follow that alternative + * shortcut + * + * @return void + * @author Ingo Renner + */ + protected function checkTranslatedShortcut() { + + if (!is_null($this->originalShortcutPage)) { + $originalShortcutPageOverlay = $this->sys_page->getPageOverlay($this->originalShortcutPage['uid'], $this->sys_language_uid); + + if (!empty($originalShortcutPageOverlay['shortcut']) && $originalShortcutPageOverlay['shortcut'] != $this->id) { + // the translation of the original shortcut page has a different shortcut target! + // set the correct page and id + + $shortcut = $this->getPageShortcut( + $originalShortcutPageOverlay['shortcut'], + $originalShortcutPageOverlay['shortcut_mode'], + $originalShortcutPageOverlay['uid'] + ); + + $this->id = $this->contentPid = $shortcut['uid']; + $this->page = $this->sys_page->getPage($this->id); + + // fix various effects on things like menus f.e. + $this->fetch_the_id(); + $this->tmpl->rootLine = array_reverse($this->rootLine); + } + } + } + /** * Checks if any email-submissions or submission via the fe_tce