[TYPO3-english] sr feuser register: fields translation ?
Gregory Loichot
gloichot at cross-systems.ch
Wed Aug 8 10:36:17 CEST 2012
Hi,
Thanks for your answer, but that's not what I would (if I understood
you). Now, in my BE, when I list content from
tx_crossferegister_institutions_type (by editing a FE user), TYPO3 list
all content, from ALL languages. But I want only current BE language data.
This is an example (that will be more concrete):
SQL definition:
CREATE TABLE tx_crossferegister_institutions_type (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumtext,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
name tinytext,
PRIMARY KEY (uid),
KEY parent (pid)
);
In my ext_table.php:
$tempColumns = array (
'tx_crossferegister_institution_type' => array (
'exclude' => 0,
'label' =>
'LLL:EXT:crossferegister/locallang_db.xml:fe_users.tx_crossferegister_institution_type',
'config' => array (
'type' => 'select',
'foreign_table' => 'tx_crossferegister_institutions_type',
'foreign_table_where' => 'ORDER BY
tx_crossferegister_institutions_type.uid',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'wizards' => array(
'_PADDING' => 2,
'_VERTICAL' => 1,
'add' => array(
'type' => 'script',
'title' => 'Create new record',
'icon' => 'add.gif',
'params' => array(
'table' => 'tx_crossferegister_institutions_type',
'pid' => '###CURRENT_PID###',
'setValue' => 'prepend'
),
'script' => 'wizard_add.php',
),
'list' => array(
'type' => 'script',
'title' => 'List',
'icon' => 'list.gif',
'params' => array(
'table' => 'tx_crossferegister_institutions_type',
'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',
),
),
)
)...
t3lib_extMgm::addTCAcolumns('fe_users',$tempColumns,1);
The tca.php definition:
$TCA['tx_crossferegister_institutions_type'] = array (
'ctrl' => $TCA['tx_crossferegister_institutions_type']['ctrl'],
'interface' => array (
'showRecordFieldList' =>
'sys_language_uid,l10n_parent,l10n_diffsource,hidden,name'
),
'feInterface' =>
$TCA['tx_crossferegister_institutions_type']['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)
)
)
),
'l10n_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_crossferegister_institutions_type',
'foreign_table_where' => 'AND
tx_crossferegister_institutions_type.pid=###CURRENT_PID### AND
tx_crossferegister_institutions_type.sys_language_uid IN (-1,0)',
)
),
'l10n_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' => 0,
'label' =>
'LLL:EXT:crossferegister/locallang_db.xml:tx_crossferegister_institutions_type.name',
'config' => array (
'type' => 'input',
'size' => '30',
)
),
),
'types' => array (
'0' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent,
l10n_diffsource, hidden;;1, name')
),
'palettes' => array (
'1' => array('showitem' => '')
)
);
Thanks for all
Le 03.08.2012 20:21, Viktor Livakivskyi a écrit :
> Hi, Gregory.
>
>> So I followed wiki
>> (http://wiki.typo3.org/Adding_fields_to_sr_feuser_register_registration_form)
>> and extended feusers table with a field "competence" (type "database
>> relation" on table "competences" which is localized !). So a select
>> box is displayed on my register form, containing ALL data in table
>> "competences" and NOT only data in the current languages (same problem
>> in BE, when editing a FE user)... big problem!
>>
>> Do you have an idea how can I solve this problem? "Competence" data
>> have to be editable in BE.
>
> Take a look at your ext_tables.php and TCA reference [1]
> 'foreign_table_where' - you can put 'sys_language_uid in (0,-1)' there.
> Then oanly default and "all" records will be displayed.
>
>
> [1]:
> http://typo3.org/documentation/document-library/core-documentation/doc_core_tca/4.7.1/view/1/3/#id584692
>
More information about the TYPO3-english
mailing list