Index: trunk/kernel/include/category.php =================================================================== diff -u -N -r4120 -r4121 --- trunk/kernel/include/category.php (.../category.php) (revision 4120) +++ trunk/kernel/include/category.php (.../category.php) (revision 4121) @@ -2071,7 +2071,7 @@ { global $objSession; - $fields_hash['CreatedById'] = $objSession->Get('UserId'); + $fields_hash['CreatedById'] = $objSession->Get('PortalUserId'); $d = new clsCategory(NULL); $fields_hash['Filename'] = $d->StripDisallowed($fields_hash['Filename']); @@ -2136,17 +2136,16 @@ return $d; } - function &Edit_Category($CategoryId, $Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, - $NewItem, $Pop, $Priority, $MetaKeywords,$MetaDesc, $auto_filename = 1, $filename = '') + function &Edit_Category($category_id, $fields_hash) { - $d =& $this->GetCategory($CategoryId); + $d =& $this->GetCategory($category_id); - $filename = $d->StripDisallowed($filename); - $d->Set( Array( 'Name', 'Description', 'CreatedOn', 'EditorsPick', 'Status', 'HotItem', - 'NewItem', 'PopItem', 'Priority', 'MetaKeywords','MetaDescription', - 'AutomaticFilename', 'Filename'), - Array( $Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, $NewItem, - $Pop, $Priority, $MetaKeywords,$MetaDesc, $auto_filename, $filename) ); + $fields_hash['Filename'] = $d->StripDisallowed($fields_hash['Filename']); + + foreach ($fields_hash as $field_name => $field_value) { + $d->Set($field_name, $field_value); + } + $d->Update(); $d->UpdateCachedPath(); return $d;