[Typo3] flex form with tca
Richard
news at oberon-inf.com
Fri May 13 16:41:04 CEST 2005
Hi :)
I create a flexform field in my tca.php
"pi_flexform" => Array (
"exclude" => 1,
"label" => "plexi",
"config" => Array (
"type" => "flex",
"ds_pointerField" => "list_type",
"ds" => array(
"default" => "FILE:EXT:user_immobilier/flexform_ds.xml",
)
)
),
I put pi_flexform inside types
"types" => Array (
"0" => Array("showitem" => "pi_flexform"),
In backend I see this inside my item
pi_flexform is record on my database is ok
inside ext-tables.sql i add pi_flexform field
pi_flexform text NOT NULL,
in my ext_tables.php at the end I have:
t3lib_div::loadTCA("tt_content");
$TCA["tt_content"]["types"]["list"]["subtypes_excludelist"][$_EXTKEY."_pi1"]="layout,select_key";
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY.'_pi1']='pi_flexform';
t3lib_extMgm::addPlugin(Array("LLL:EXT:user_immobilier/locallang_db.php:tt_content.list_type_pi1",
$_EXTKEY."_pi1"),"list_type");
t3lib_extMgm::addPiFlexFormValue($_EXTKEY.'_pi1',
'FILE:EXT:user_immobilier/flexform_ds.xml');
t3lib_extMgm::addStaticFile($_EXTKEY,"pi1/static/","Immobilier");
if
(TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["user_immobilier_pi1_wizicon"]
=
t3lib_extMgm::extPath($_EXTKEY)."pi1/class.user_immobilier_pi1_wizicon.php";
in my ext file class.user_immobilier_pi1.php
I want to retrieve field, I create a new function
function init(){
$this->pi_initPIflexForm(); // Init and get the flexform data of the
plugin
$this->lConf = array(); // Setup our storage array...
$piFlexForm = $this->cObj->data['pi_flexform'];
debug(array( $this->cObj->data["pi_flexform"]));
debug($this->pi_getFFvalue($this->cObj->data["pi_flexform"], "titre",
"piece1"));
}
_______________________________________________________________________
Question: $this->pi_initPIflexForm() not load
$this->cObj->data['pi_flexform'] WHY ?
------------------------------------------------------------------------------------------------------------------------------
my flexform_ds.xml
<T3DataStructure>
<sheets>
<piece1>
<ROOT>
<TCEforms>
<sheetTitle>1</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<titre>
<TCEforms>
<label>Piece Numero 1</label>
<config>
<type>none</type>
<size>0</size>
</config>
</TCEforms>
</titre>
<piece_1>
<TCEforms>
<label>Nom de la piece</label>
<config>
<type>input</type>
<size>10</size>
</config>
</TCEforms>
</piece_1>
<dim_1>
<TCEforms>
<label>Dimmension</label>
<config>
<type>input</type>
<size>10</size>
</config>
</TCEforms>
</dim_1>
<niv_1>
<TCEforms>
<label>Nivaux</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Sous-Sole</numIndex>
<numIndex index="1">asc</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Nivaux 1</numIndex>
<numIndex index="1">alpha_asc</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">Nivaux2</numIndex>
<numIndex index="1">alpha_desc</numIndex>
</numIndex>
</items>
<size>1</size>
<minitems>0</minitems>
</config>
</TCEforms>
</niv_1>
</el>
</ROOT>
</piece1>
</sheets>
</T3DataStructure>
More information about the TYPO3-english
mailing list