Index: branches/unlabeled/unlabeled-1.2.2/core/units/custom_fields/custom_fields_tag_processor.php =================================================================== diff -u -r4332 -r5727 --- branches/unlabeled/unlabeled-1.2.2/core/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 4332) +++ branches/unlabeled/unlabeled-1.2.2/core/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 5727) @@ -2,25 +2,47 @@ class CustomFieldsTagProcessor extends kDBTagProcessor { - function CustomField($params) + /** + * Return LEFT JOINed custom field name from main item config + * + * @param Array $params + * @return string + */ + function GetMainField($params) { $object =& $this->getObject($params); - $parent_item =& $this->Application->recallObject($params['SourcePrefix']); - - $field = $this->SelectParam($params, 'name,field'); - return $parent_item->GetField('cust_'.$object->GetField($field)); + $append = isset($params['append']) && $params['append'] ? $params['append'] : ''; + return 'cust_'.$object->GetDBField('FieldName').$append; } + function CustomField($params) + { + $params['name'] = $this->GetMainField($params); + $source_prefix = $this->Application->Parser->GetParam('SourcePrefix'); + return $this->Application->ProcessParsedTag($source_prefix, 'Field', $params); + } + + function CustomFormat($params) + { + $params['name'] = $this->GetMainField($params); + $source_prefix = $this->Application->Parser->GetParam('SourcePrefix'); + return $this->Application->ProcessParsedTag($source_prefix, 'Format', $params); + } + function CustomInputName($params) { - $object =& $this->getObject($params); + $params['name'] = $this->GetMainField($params); $source_prefix = $this->Application->Parser->GetParam('SourcePrefix'); - - $source_tp =& $this->Application->recallTagProcessor($source_prefix); - $params['name'] = 'cust_'.$object->GetDBField('FieldName'); - return $source_tp->InputName($params); + return $this->Application->ProcessParsedTag($source_prefix, 'InputName', $params); } + function CustomError($params) + { + $params['name'] = $this->GetMainField($params); + $source_prefix = $this->Application->Parser->GetParam('SourcePrefix'); + return $this->Application->ProcessParsedTag($source_prefix, 'Error', $params); + } + /** * Prints list content using block specified *