Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r2581 -r2615 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 2581) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 2615) @@ -1258,6 +1258,83 @@ if (!$list->Counted) $list->CountRecs(); return $list->RecordsCount; } + + /** + * Range filter field name + * + * @param Array $params + * @return string + */ + function RangeName($params) + { + $field = $this->SelectParam($params, 'field,name'); + return 'custom_filters['.$this->getPrefixSpecial().']['.$field.'_'.$params['type'].']'; + } + + /** + * Return range filter field value + * + * @param Array $params + * @return string + */ + function RangeValue($params) + { + $field = $this->SelectParam($params, 'field,name'); + + $var_name = $this->getPrefixSpecial(true).'_'.$field.'_'.$params['type']; + $ses_var_name = $this->getPrefixSpecial().'_'.$field.'_'.$params['type']; + + $value = $this->Application->GetVar($var_name); + + return $this->Application->GetLinkedVar($var_name, $ses_var_name, $value); + } + + function RangeFormat($params) + { + $field = $params['field']; + $object =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix.'_List', $params); + + $options = $object->GetFieldOptions($field); + + $formatter_class = getArrayValue($options,'formatter'); + if($formatter_class) + { + $formatter =& $this->Application->recallObject($formatter_class); + $human_format = getArrayValue($params,'human'); + $edit_size = getArrayValue($params,'edit_size'); + $sample = getArrayValue($params,'sample'); + if($sample) + { + return $formatter->GetSample($field, $options, $object); + } + elseif($human_format || $edit_size) + { + $format = $formatter->HumanFormat($options['format']); + return $edit_size ? strlen($format) : $format; + } + } + + return $options['format']; + } + + /** + * Returns error of range field + * + * @param unknown_type $params + * @return unknown + */ + function RangeError($params) + { + $field = $this->SelectParam($params, 'field,name'); + + $error_var_name = $this->getPrefixSpecial().'_'.$field.'_'.$params['type'].'_error'; + $error_msg = $this->Application->RecallVar($error_var_name); + if($error_msg) + { + $this->Application->StoreVar($error_var_name, ''); + } + return $error_msg; + } } ?> \ No newline at end of file