Bug #17814 ยป ds_altSrcPointer_perType.patch
t3lib/class.t3lib_befunc.php (working copy) | ||
---|---|---|
// Get pointer field etc from TCA-config:
|
||
$ds_pointerField = $conf['ds_pointerField'];
|
||
$ds_altSrcPointer_perType = $conf['ds_altSrcPointer_perType']; // Enables to specify alternative ds pointers per type field value (type fields as configured at [table][ctrl][type]).
|
||
$ds_array = $conf['ds'];
|
||
$ds_tableField = $conf['ds_tableField'];
|
||
$ds_searchParentField = $conf['ds_pointerField_searchParent'];
|
||
... | ... | |
// Find source value:
|
||
$dataStructArray='';
|
||
if (is_array($ds_array)) { // If there is a data source array, that takes precedence
|
||
// If a pointer field is set, take the value from that field in the $row array and use as key.
|
||
if ($ds_pointerField) {
|
||
// If a DS source pointer per type field (e.g. CType) is configured, use that
|
||
if (is_array($ds_altSrcPointer_perType) && $ds_altSrcPointer_perType[$row[$GLOBALS['TCA'][$table]['ctrl']['type']]]) {
|
||
$srcPointer = $ds_altSrcPointer_perType[$row[$GLOBALS['TCA'][$table]['ctrl']['type']]];
|
||
} elseif ($ds_pointerField) { // If a pointer field is set, take the value from that field in the $row array and use as key.
|
||
$srcPointer = $row[$ds_pointerField];
|
||
$srcPointer = isset($ds_array[$srcPointer]) ? $srcPointer : 'default';
|
||
} else $srcPointer='default';
|
||
} else {
|
||
$srcPointer='default';
|
||
}
|
||
$srcPointer = isset($ds_array[$srcPointer]) ? $srcPointer : 'default';
|
||
// Get Data Source: Detect if it's a file reference and in that case read the file and parse as XML. Otherwise the value is expected to be XML.
|
||
if (substr($ds_array[$srcPointer],0,5)=='FILE:') {
|
typo3/sysext/css_styled_content/ext_tables.php (working copy) | ||
---|---|---|
if (!defined ('TYPO3_MODE')) die ('Access denied.');
|
||
// add flexform
|
||
t3lib_extMgm::addPiFlexFormValue('default', 'FILE:EXT:css_styled_content/flexform_ds.xml');
|
||
t3lib_div::loadTCA('tt_content');
|
||
$TCA['tt_content']['columns']['pi_flexform']['config']['ds_altSrcPointer_perType']['table'] = 'CType:table';
|
||
$TCA['tt_content']['columns']['pi_flexform']['config']['ds']['CType:table'] = 'FILE:EXT:'.$_EXTKEY.'/flexform_ds.xml';
|
||
t3lib_extMgm::addToAllTCAtypes('tt_content','pi_flexform;;;;1-1-1','table');
|
||
t3lib_extMgm::addStaticFile($_EXTKEY,'static/','CSS Styled Content');
|