[Typo3] Flexform in tca.php file
Richard
news at oberon-inf.com
Fri May 13 18:48:19 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"],
"feusers_pid", "sDEF"));
}
_______________________________________________________________________
Question: $this->pi_initPIflexForm() not load
$this->cObj->data['pi_flexform'] WHY ?
------------------------------------------------------------------------------------------------------------------------------
my flexform_ds.xml
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheettitle>Piece1</sheettitle>
</TCEforms>
<type>array</type>
<el>
<feusers_pid>
<TCEforms>
<label>12</label>
<config>
<type>input</type>
<size>5</size>
</config>
</TCEforms>
</feusers_pid>
</el>
</ROOT>
</sDEF>
<s_profiles>
<ROOT>
<TCEforms>
<sheetTitle>piece2</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<disable_profile>
<TCEforms>
<label>test1</label>
<config>
<type>input</type>
<size>10</size>
</config>
</TCEforms>
</disable_profile>
</el>
</ROOT>
</s_profiles>
</sheets>
</T3DataStructure>
More information about the TYPO3-english
mailing list