Index: trunk/core/kernel/kbase.php =================================================================== diff -u -r1560 -r2011 --- trunk/core/kernel/kbase.php (.../kbase.php) (revision 1560) +++ trunk/core/kernel/kbase.php (.../kbase.php) (revision 2011) @@ -259,6 +259,17 @@ } /** + * Adds calculated field declaration to object. + * + * @param string $name + * @param string $sql_clause + */ + function addCalculatedField($name, $sql_clause) + { + $this->CalculatedFields[$name] = $sql_clause; + } + + /** * Sets ID Field name used as primary key for loading items * * @access public @@ -316,7 +327,13 @@ function SetDefaultValues() { - + foreach($this->Fields as $field => $options) + { + if($options['default'] == '#NOW#') + { + $this->Fields[$field]['default'] = mktime(); + } + } } function SetFieldOptions($field, $options) @@ -381,7 +398,7 @@ $options_hash = getArrayValue($field_options,'options'); if($options_hash === false) $options_hash = Array(); - + $dynamic_options = $this->Conn->GetCol($sql, $field_options['option_key_field']); $field_options['options'] = array_merge_recursive2($options_hash, $dynamic_options);