[TYPO3-dev] $TCA['fe_users']['columns'] question

Franz Holzinger franz at fholzinger.com
Mon Apr 24 08:07:36 CEST 2006


Hello Pieter,
> 
> for the back-end fe_user record, I would like to make a select box for
> the country instead of simply the country name in an input field.
> 
> My code looks like this:
> $tempColumns = Array (
>   'static_info_country' => Array (
>     'displayCond' => 'EXT:static_info_tables:LOADED:true',
>     'config' => Array (
>       'type' => 'select',
>       'items' => Array (
>         Array('',0),
>       ),
>       'foreign_table' => 'static_countries',
>       'foreign_table_where' => 'AND static_countries.pid=0 ORDER BY
> static_countries.cn_official_name_local',
>       'size' => 1,
>       'minitems' => 0,
>       'maxitems' => 1,
>     ),
> )
> t3lib_extMgm::addTCAcolumns('fe_users',$tempColumns,1);
> 
> This works but not as I would like it to.  The uid of the country is
> used in the fe_users table.  I would like to see the cn_iso_3 instead in
> the fe_users table.
> 
in t3lib/class.t3lib_tcemain.php you have the
Hook: processDatamap_postProcessFieldArray

There you can modify the $fieldArray for the fe_users record in a way
that you change the uid from the field country to the text string
generated from static_info_country.

So the following
$phShadowId = $this->insertDB($table,$id,$fieldArray,TRUE,0,TRUE);	//
When inserted, $this->substNEWwithIDs[$id] will be changed to the uid of
THIS version and so the interface will pick it up just nice!
would insert the corrected fieldArray.

Greets,

Franz




More information about the TYPO3-dev mailing list