[TYPO3-german] DynaFlex zum laufen bringen
Fabian Mielke
fm at medienmacher.de
Wed Oct 10 12:31:22 CEST 2007
Einen schönen guten Tag,
momentan arbeite ich die Doku und das Tutorial für DynaFlex durch und wollte
meine eigene Extension schreiben mit der ich dynamisch Felder im Backend
nachladen kann. Leider komm ich nicht so richtig klar und das Ding will
einfach nicht laufen.
Im Backendformular bekomm ich die Meldung Data Structure ERROR: No ROOT
element found for sheet "sDEF", die gleiche Meldung wie im Tutorial vor dem
Speichern des Datensatzes, nur im Gegensatz zum Tutorial bleibt bei mir
diese Fehlermeldung nach dem Speichern. Es werden auch keine FlexForms in
der Datenbank gespeichert, die Flexforms spalte bleibt einfach leer.
Erzeugt hab ich die Extension mit Kickstarter und habe die
Konfigurationsdateien entsprechend von Hand geändert.
Meine Konfiguration hab ich unten angehängt und besteht zum großen Teil aus
der Konfiguration des Dynaflex Tutorials:
Dynamic Flexforms 1.11.0, Typo 4.1.2
Hoffe daß mir irgendjemand weiterhelfen kann und meinen Denkfehler sieht.
Grüße
Fabian
------------------------------------TCA-----------------------------------
--
$TCA["tx_mmproducttemplate_product"] = array (
"ctrl" => $TCA["tx_mmproducttemplate_product"]["ctrl"],
"interface" => array (
"showRecordFieldList" =>
"hidden,starttime,endtime,fe_group,name,prize,tax,template, flexdata"
),
"feInterface" =>
$TCA["tx_mmproducttemplate_product"]["feInterface"],
"columns" => array (
'hidden' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
'starttime' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
'config' => array (
'type' => 'input',
'size' => '8',
'max' => '20',
'eval' => 'date',
'default' => '0',
'checkbox' => '0'
)
),
'endtime' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
'config' => array (
'type' => 'input',
'size' => '8',
'max' => '20',
'eval' => 'date',
'checkbox' => '0',
'default' => '0',
'range' => array (
'upper' => mktime(0, 0, 0,
12, 31, 2020),
'lower' => mktime(0, 0, 0,
date('m')-1, date('d'), date('Y'))
)
)
),
'fe_group' => array (
'exclude' => 1,
'label' =>
'LLL:EXT:lang/locallang_general.xml:LGL.fe_group',
'config' => array (
'type' => 'select',
'items' => array (
array('', 0),
array('LLL:EXT:lang/locallang_general.xml:LGL.hide_at_login', -1),
array('LLL:EXT:lang/locallang_general.xml:LGL.any_login', -2),
array('LLL:EXT:lang/locallang_general.xml:LGL.usergroups', '--div--')
),
'foreign_table' => 'fe_groups'
)
),
"name" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:mm_producttemplate/locallang_db.xml:tx_mmproducttemplate_product.na
me",
"config" => Array (
"type" => "input",
"size" => "30",
"eval" => "required",
)
),
"prize" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:mm_producttemplate/locallang_db.xml:tx_mmproducttemplate_product.pr
ize",
"config" => Array (
"type" => "input",
"size" => "30",
"eval" => "required",
)
),
"tax" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:mm_producttemplate/locallang_db.xml:tx_mmproducttemplate_product.ta
x",
"config" => Array (
"type" => "input",
"size" => "30",
"eval" => "required",
)
),
"template" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:mm_producttemplate/locallang_db.xml:tx_mmproducttemplate_product.te
mplate",
"config" => Array (
"type" => "select",
"foreign_table" =>
"tx_mmproducttemplate_product_templates",
"foreign_table_where" => "ORDER BY
tx_mmproducttemplate_product_templates.uid",
"size" => 1,
"minitems" => 0,
"maxitems" => 1,
"MM" =>
"tx_mmproducttemplate_product_template_mm",
"wizards" => Array(
"_PADDING" => 2,
"_VERTICAL" => 1,
"add" => Array(
"type" => "script",
"title" => "Create
new record",
"icon" => "add.gif",
"params" => Array(
"table"=>"tx_mmproducttemplate_product_templates",
"pid" =>
"###CURRENT_PID###",
"setValue"
=> "prepend"
),
"script" =>
"wizard_add.php",
),
"list" => Array(
"type" => "script",
"title" => "List",
"icon" =>
"list.gif",
"params" => Array(
"table"=>"tx_mmproducttemplate_product_templates",
"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",
),
),
)
),
"flexdata" => Array (
"exclude" => 1,
"label" => "Flexdata",
"config" => Array (
"type" => "flex",
"ds" => array (
"default" =>
"<T3DataStructure>" .
"
<meta>" .
"
<langDisable>1</langDisable>" .
"
</meta>
<ROOT>" .
"
<type>array</type>" .
"
<el>" .
"
" .
"
</el>" .
"
</ROOT>".
"</T3DataStructure>"
),
),
),
),
"types" => array (
"0" => array("showitem" => "hidden;;1;;1-1-1, name,
prize, tax, template, flexdata")
),
"palettes" => array (
"1" => array("showitem" => "starttime, endtime,
fe_group")
)
);
-------------------------
Class.mm_producttemplate_dfconfig.php-------------------------------
<?php
class mm_producttemplate_dfconfig {
var $DCA = array (
0 => array (
// set the basic path! This is the
field inside the TCA where everything is performed in
'path' =>
'tx_mmproducttemplate_product/columns/flexdata/config/ds/default',
// moifications
'modifications' => array (
// at first we create a
simple field on root level
array (
'method' => 'add',
// add something
'path' => 'ROOT/el',
// on root level
'type' => 'field',
// with type "field"
'field_config' => array (
// a field that has the the config
'name' =>
'df_field_0', // it has the
name "df_field_0"
'label' =>
'myfirstdynaflexfield', // and is labeled with this
'config' => array (
'type' =>
'input' // it has the TYPO3
fieldtype "input"
)
)
),
)
)
);
var $cleanUpField = 'flexdata';
}
?>
----------------------- Ext_localconf.php --------------------------------
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
// instead of managing the call by ourself we let DynaFlex make all
the calls.
// All we do is to register a class that contains the DCA for our
table. This class can also contain some
// hooks. This is not really needed for our on extension. But by
using hooks, we can alter the DCA of any other
// table that is modified by DynaFlex.
$GLOBALS['T3_VAR']['ext']['dynaflex']['tx_mmproducttemplate_product'][] =
'EXT:mm_producttemplate/class.mm_producttemplate_dfconfig.php:mm_producttemp
late_dfconfig';
?>
----------------------- Ext_tables.php --------------------------------
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA["tx_mmproducttemplate_product"] = array (
"ctrl" => array (
'title' =>
'LLL:EXT:mm_producttemplate/locallang_db.xml:tx_mmproducttemplate_product',
'label' => 'uid',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => "ORDER BY crdate",
'delete' => 'deleted',
'enablecolumns' => array (
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
'fe_group' => 'fe_group',
),
'dynamicConfigFile' =>
t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' =>
t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_mmproducttemplate_product.gif',
),
"feInterface" => array (
"fe_admin_fieldList" => "hidden, starttime, endtime,
fe_group, name, prize, tax, template, flexdata",
)
);
if (TYPO3_MODE == 'BE') {
t3lib_extMgm::addModule('web','txmmproducttemplateM1','',t3lib_extMgm::extPa
th($_EXTKEY).'mod1/');
}
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:mm_producttemplate/locallang_db.xml:t
t_content.list_type_pi1', $_EXTKEY.'_pi1'),'list_type');
//t3lib_extMgm::addStaticFile($_EXTKEY,"pi1/static/","Product Template");
t3lib_extMgm::addPlugin(array('Product Template',
$_EXTKEY.'_pi1'),'list_type');
t3lib_extMgm::addPiFlexFormValue($_EXTKEY.'_pi1',
'FILE:EXT:mm_producttemplate/flexform_pi1_ds.xml');
?>
More information about the TYPO3-german
mailing list