Продвинутый
Регистрация: 27.03.2006
Адрес: Ukraine, Crimea, Simferopol
Сообщений: 79
|
FlexForms + TCA
У меня есть tca.php в котором описаны свойства таблицы "PRINTERS_TABLE".
Вот сам tca.php:
PHP код:
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA["PRINTERS_TABLE"] = array (
"ctrl" => $TCA["PRINTERS_TABLE"]["ctrl"],
"interface" => array (
"showRecordFieldList" => "hidden,starttime,endtime,fe_group,items,settings"
),
"feInterface" => $TCA["PRINTERS_TABLE"]["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'))
)
)
),
"items" => Array (
"exclude" => 1,
"label" => "LLL:EXT:printers/locallang_db.xml:ce.title",
"config" => Array (
"type" => "flex",
"ds_pointerField" => "list_type",
"ds" => Array (
"default" => 'FILE:EXT:printers/flexforms_ds_pi1.xml',
)
)
),
"settings" => Array (
"exclude" => 1,
"label" => "LLL:EXT:printers/locallang_db.xml:settings.title",
"config" => Array (
"type" => "flex",
"ds_pointerField" => "list_type",
"ds" => Array (
"default" => 'FILE:EXT:printers/flexforms_settings_pi1.xml',
)
)
),
),
"types" => array (
// "0" => array("showitem" => "hidden;;1;;1-1-1, items, settings")
"0" => array("showitem" => "hidden;;1;;1-1-1, items")
),
"palettes" => array (
"1" => array("showitem" => "starttime, endtime")
)
);
?>
и есть ext_tables.php в котором регистрируется FE plug-in.
Вот ext_tables.php:
PHP код:
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
/**
* Add PRINTERS Element
*/
$TCA["PRINTERS_TABLE"] = array(
"ctrl" => array(
'title' => 'LLL:EXT:printers/locallang_db.xml:record_title',
'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',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'ext_icon.gif',
),
"feInterface" => array(
"fe_admin_fieldList" => "hidden, starttime, endtime, settings",
)
);
t3lib_extMgm::allowTableOnStandardPages("PRINTERS_TABLE");
t3lib_extMgm::addToInsertRecords("PRINTERS_TABLE");
/**
* Add PRINTERS as Frontend Plug-in
*/
$tempColumns = Array (
"settings" => Array (
"exclude" => 1,
"label" => "LLL:EXT:printers/locallang_db.xml:settings.title",
"config" => Array (
"type" => "flex",
"ds_pointerField" => "list_type",
"ds" => Array (
"default" => 'FILE:EXT:printers/flexforms_settings_pi1.xml',
)
)
),
);
t3lib_div::loadTCA('tt_content');
t3lib_extMgm::addTCAcolumns("tt_content",$tempColumns);
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_settings_pi1']='layout,select_key,pages,recursive,colPos,spaceBefore,spaceAfter,section_frame,sectionIndex,linkToTop,header_position,header_link,header_layout,sys_language_uid,date';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY.'_settings_pi1']='settings';
t3lib_extMgm::addPlugin(array('LLL:EXT:printers/locallang_db.xml:tt_content.list_type_pi1', $_EXTKEY.'_settings_pi1'),'list_type');
t3lib_extMgm::addStaticFile($_EXTKEY, "pi1/static/","PRINTERS"); // need to be debuged... array $conf
if (TYPO3_MODE=='BE') {
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_21torrprinters_pi1_wizicon'] = t3lib_extMgm::extPath($_EXTKEY).'class.tx_printers_pi1_wizicon.php';
}
?>
Задача:
Как седлать так, чтобы когда я добавляю FE plug-in у меня показывалась flexforms форма и когда я сохраняю данные они у меня сохранялись не в tt_content, а в поле " settings" таблицы " PRINTERS_TABLE" ??
|