[TYPO3-irre] Inline Table new Translation problem
Christian Bruestle
christianb at gmx.at
Fri Feb 23 10:15:48 CET 2007
Hello
First thanks for this great Work on IRRE, sorry for my bad english and if
i'm wrong to post on this mailing-list.
I have teste IRRE and some problems with Translation.
Table 1
- Name
- Prices -> n:1 (Inline) -> Table_2
- ...... ( more fields)
Table 2
- Table_1_UID
- Name
- Price
- .....
when i make a Translation of one record the Table_1 fields sys_language_uid
and l18_parrent are correct ,
but on the inline-Table_2 sys_language_uid => -1 (ALL) and l18_parrent =>
NULL
I createt the EXT with Kickstarter and edit the files by hand (set
Table_1.prices to inline, ... )
Have you any hint what I miss or make wrong ?
Thanks
chris
----------------
ext_tables.php
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
t3lib_extMgm::allowTableOnStandardPages('tx_cbhotels_icons');
t3lib_extMgm::addToInsertRecords('tx_cbhotels_icons');
t3lib_extMgm::allowTableOnStandardPages('tx_cbhotels_hotels');
$TCA["tx_cbhotels_hotels"] = array (
"ctrl" => array (
'title' =>
'LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'languageField' =>
'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
'transOrigDiffSourceField' => 'l18n_diffsource',
'sortby' => 'sorting',
'delete' => 'deleted',
'enablecolumns' => array (
'disabled' => 'hidden',
),
'dynamicConfigFile' =>
t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' =>
t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_cbhotels_hotels.gif',
'dividers2tabs' => '1',
),
"feInterface" => array (
"fe_admin_fieldList" => "sys_language_uid, l18n_parent,
l18n_diffsource, hidden, name, address, shorttxt, 1pic, pics, content,
prices, icons",
)
);
t3lib_extMgm::allowTableOnStandardPages('tx_cbhotels_content');
t3lib_extMgm::allowTableOnStandardPages('tx_cbhotels_price');
$TCA["tx_cbhotels_price"] = array (
"ctrl" => array (
'title' =>
'LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_price',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'languageField' =>
'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
'transOrigDiffSourceField' => 'l18n_diffsource',
'sortby' => 'sorting',
'delete' => 'deleted',
'enablecolumns' => array (
'disabled' => 'hidden',
),
'dynamicConfigFile' =>
t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' =>
t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_cbhotels_price.gif',
),
"feInterface" => array (
"fe_admin_fieldList" => "sys_language_uid, l18n_parent,
l18n_diffsource, hidden, name, price",
)
);
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi1']='layout,select_key';
t3lib_extMgm::addPlugin(array('LLL:EXT:cbhotels/locallang_db.xml:tt_content.list_type_pi1',
$_EXTKEY.'_pi1'),'list_type');
t3lib_extMgm::addStaticFile($_EXTKEY,'pi1/static/','cbHotels');
if (TYPO3_MODE=="BE")
$TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_cbhotels_pi1_wizicon"]
= t3lib_extMgm::extPath($_EXTKEY).'pi1/class.tx_cbhotels_pi1_wizicon.php';
?>
----------------------------------------------------
tca.php
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA["tx_cbhotels_hotels"] = array (
"ctrl" => $TCA["tx_cbhotels_hotels"]["ctrl"],
"interface" => array (
"showRecordFieldList" =>
"sys_language_uid,l18n_parent,l18n_diffsource,hidden,name,address,shorttxt,1pic,pics,content,prices,icons"
),
"feInterface" => $TCA["tx_cbhotels_hotels"]["feInterface"],
"columns" => array (
'sys_language_uid' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.language',
'config' => array (
'type' =>
'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY
sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
)
)
),
'l18n_parent' => array (
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
'config' => array (
'type' => 'select',
'items' => array (
array('', 0),
),
'foreign_table' =>
'tx_cbhotels_hotels',
'foreign_table_where' => 'AND
tx_cbhotels_hotels.pid=###CURRENT_PID### AND
tx_cbhotels_hotels.sys_language_uid IN (-1,0)',
)
),
'l18n_diffsource' => array (
'config' => array (
'type' => 'passthrough'
)
),
'hidden' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
"name" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.name",
"config" => Array (
"type" => "input",
"size" => "30",
"eval" => "required",
)
),
"address" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.address",
"config" => Array (
"type" => "text",
"cols" => "30",
"rows" => "5",
)
),
"shorttxt" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.shorttxt",
"config" => Array (
"type" => "text",
"cols" => "30",
"rows" => "5",
"wizards" => Array(
"_PADDING" => 2,
"RTE" => array(
"notNewRecords" => 1,
"RTEonly" => 1,
"type" => "script",
"title" => "Full screen Rich Text
Editing|Formatteret redigering i hele vinduet",
"icon" => "wizard_rte2.gif",
"script" => "wizard_rte.php",
),
),
)
),
"1pic" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.1pic",
"config" => Array (
"type" => "group",
"internal_type" => "file",
"allowed" =>
$GLOBALS["TYPO3_CONF_VARS"]["GFX"]["imagefile_ext"],
"max_size" => 500,
"uploadfolder" => "uploads/tx_cbhotels",
"show_thumbs" => 1,
"size" => 1,
"minitems" => 0,
"maxitems" => 1,
)
),
"pics" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.pics",
"config" => Array (
"type" => "group",
"internal_type" => "file",
"allowed" =>
$GLOBALS["TYPO3_CONF_VARS"]["GFX"]["imagefile_ext"],
"max_size" => 500,
"uploadfolder" => "uploads/tx_cbhotels",
"show_thumbs" => 1,
"size" => 5,
"minitems" => 0,
"maxitems" => 5,
)
),
"content" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.content",
"config" => Array (
"type" => "inline",
"foreign_table" => "tx_cbhotels_content",
"size" => 1,
"minitems" => 0,
"maxitems" => 3,
'appearance' => Array(
'collapseAll' => 1,
'expandSingle' => 1,
),
)
),
"prices" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.prices",
"config" => Array (
"type" => "inline",
"foreign_table" => "tx_cbhotels_price",
"foreign_table_where" => "ORDER BY
tx_cbhotels_price.uid",
"size" => 5,
"minitems" => 0,
"maxitems" => 10,
'appearance' => Array(
'collapseAll' => 1,
'expandSingle' => 1,
),
)
),
"icons" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_hotels.icons",
"config" => Array (
"type" => "select",
"foreign_table" => "tx_cbhotels_icons",
"foreign_table_where" => "ORDER BY
tx_cbhotels_icons.uid",
"size" => 4,
"minitems" => 0,
"maxitems" => 30,
"wizards" => Array(
"_PADDING" => 2,
"_VERTICAL" => 1,
"add" => Array(
"type" => "script",
"title" => "Create new record",
"icon" => "add.gif",
"params" => Array(
"table"=>"tx_cbhotels_icons",
"pid" =>
"###CURRENT_PID###",
"setValue" => "prepend"
),
"script" => "wizard_add.php",
),
"list" => Array(
"type" => "script",
"title" => "List",
"icon" => "list.gif",
"params" => Array(
"table"=>"tx_cbhotels_icons",
"pid" =>
"###CURRENT_PID###",
),
"script" => "wizard_list.php",
),
"edit" => Array(
"type" => "popup",
"title" => "Edit",
"script" => "wizard_edit.php",
"popup_onlyOpenIfSelected" => 1,
"icon" => "edit2.gif",
"JSopenParams" =>
"height=350,width=580,status=0,menubar=0,scrollbars=1",
),
),
)
),
),
"types" => array (
"0" => array("showitem" => "sys_language_uid;;;;1-1-1,
l18n_parent, l18n_diffsource,hidden;;1, name, address,
shorttxt;;;richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|outdent|indent|link|image]:rte_transform[mode=ts],
1pic, pics,--div--;More, content, prices, icons")
),
"palettes" => array (
"1" => array("showitem" => "")
)
);
$TCA["tx_cbhotels_price"] = array (
"ctrl" => $TCA["tx_cbhotels_price"]["ctrl"],
"interface" => array (
"showRecordFieldList" =>
"sys_language_uid,l18n_parent,l18n_diffsource,hidden,name,price"
),
"feInterface" => $TCA["tx_cbhotels_price"]["feInterface"],
"columns" => array (
'sys_language_uid' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.language',
'config' => array (
'type' =>
'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY
sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0 ),
#0
#$TCA["tx_cbhotels_hotels"]["columns"]['sys_language_uid'])
)
)
),
'l18n_parent' => array (
#'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
'config' => array (
'type' => 'select',
'items' => array (
array('', 0),
),
'foreign_table' =>
'tx_cbhotels_price',
#'foreign_table_where' => 'AND
tx_cbhotels_price.pid=###CURRENT_PID### AND
tx_cbhotels_price.sys_language_uid IN (-1,0)',
)
),
'l18n_diffsource' => array (
'config' => array (
'type' => 'passthrough'
)
),
'hidden' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
"name" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_price.name",
"config" => Array (
"type" => "input",
"size" => "30",
)
),
"price" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:cbhotels/locallang_db.xml:tx_cbhotels_price.price",
"l10n_mode" => 'noCopy',
"config" => Array (
"type" => "input",
"size" => "30",
)
),
),
"types" => array (
"0" => array("showitem" => "sys_language_uid;;;;1-1-1,
l18n_parent, l18n_diffsource, hidden;;1, name, price")
),
"palettes" => array (
"1" => array("showitem" => "")
)
);
?>
More information about the TYPO3-project-irre
mailing list