Index: trunk/core/units/general/cat_dbitem.php =================================================================== diff -u -r3787 -r4043 --- trunk/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 3787) +++ trunk/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 4043) @@ -2,8 +2,6 @@ class kCatDBItem extends kDBItem { - var $CustomFields = Array(); - /** * Category path, needed for import * @@ -18,15 +16,6 @@ */ var $useFilenames = true; - function Init($prefix, $special, $event_params = null) - { - parent::Init($prefix, $special, $event_params); - - $item_type = $this->Application->getUnitOption($this->Prefix, 'ItemType'); - $sql = 'SELECT CustomFieldId, FieldName FROM '.TABLE_PREFIX.'CustomField WHERE Type = '.$item_type; - $this->CustomFields = $this->Conn->GetCol($sql, 'FieldName'); - } - function Create($force_id=false, $system_create=false) { if (!$this->Validate()) return false; @@ -199,23 +188,6 @@ } } - function SetCustomField($field, $value) - { - $cf_id = getArrayValue($this->CustomFields, $field); - if(!$cf_id) return false; - - $data_table = TABLE_PREFIX.'CustomMetaData'; - - $sql = 'SELECT CustomDataId FROM '.$data_table.' WHERE CustomFieldId = %s AND ResourceId = %s'; - $data_id = (int)$this->Conn->GetOne( sprintf($sql, $cf_id, $this->GetDBField('ResourceId') ) ); - - $lang_id = $this->Application->GetVar('lang.current_id'); - - $sql = 'REPLACE INTO '.$data_table.'(CustomDataId,ResourceId,CustomFieldId,Value,l'.$lang_id.'_Value) VALUES (%1$s,%2$s,%3$s,%4$s,%4$s)'; - - $this->Conn->Query( sprintf($sql, $data_id, $this->GetDBField('ResourceId'), $cf_id, $this->Conn->qstr($value) ) ); - } - /** * replace not allowed symbols with "_" chars + remove duplicate "_" chars in result *