Project

General

Profile

Bug #21594 » t3lib_befunc_getTCAtypes.patch

Administrator Admin, 2010-06-22 15:47

View differences:

class.t3lib_befunc.php (Arbeitskopie)
$typesConf = $TCA[$table]['types'][$fieldValue];
// Get fields list and traverse it
$fieldList = explode(',', $typesConf['showitem']);
$fieldList = t3lib_div::trimExplode(',', $typesConf['showitem'], 1);
$altFieldList = array();
// Change fields list by subtype
$fieldListAdd = array();
$fieldListRemove = array();
if(isset($typesConf['subtype_value_field'])) {
if(isset($typesConf['subtypes_addlist'][$rec[$typesConf['subtype_value_field']]])) {
$fieldListAdd = t3lib_div::trimExplode(',', $typesConf['subtypes_addlist'][$rec[$typesConf['subtype_value_field']]], 1);
if(count($fieldListAdd)) {
$fieldList = array_merge($fieldList, $fieldListAdd);
}
}
if(isset($typesConf['subtypes_excludelist'][$rec[$typesConf['subtype_value_field']]])) {
$fieldListRemove = t3lib_div::trimExplode(',', $typesConf['subtypes_excludelist'][$rec[$typesConf['subtype_value_field']]], 1);
if(count($fieldListRemove)) {
$fieldList = array_diff($fieldList, $fieldListRemove);
}
}
}
// Change fields list by bitmask
$fieldListRemove = array();
if(isset($typesConf['bitmask_value_field']) && is_array($typesConf['bitmask_excludelist_bits'])) {
$bitValue = t3lib_div::intInRange($rec[$typesConf['bitmask_value_field']], 0);
foreach($typesConf['bitmask_excludelist_bits'] as $bitKey => $excludeList) {
$sign=substr($bitKey,0,1);
$bit=substr($bitKey,1);
if (t3lib_div::testInt($bit)) {
$bit = t3lib_div::intInRange($bit, 0, 30);
if (($sign == '-' && !($$bitValue & pow(2, $bit))) || ($sign == '+' && ($$bitValue & pow(2, $bit)))) {
$fieldListRemove = array_merge($fieldListRemove, t3lib_div::trimExplode(',', $excludeList, 1));
}
}
}
if(count($fieldListRemove)) {
$fieldList = array_diff($fieldList, $fieldListRemove);
}
}
// Traverse fields in types config and parse the configuration into a nice array:
foreach($fieldList as $k => $v) {
list($pFieldName, $pAltTitle, $pPalette, $pSpec) = t3lib_div::trimExplode(';', $v);
(2-2/3)