-- -- content_folder__rename/4 -- create or replace function content_folder__rename( integer, character varying, character varying, character varying ) returns int4 as $$ declare rename__folder_id alias for $1; rename__name alias for $2; -- default null rename__label alias for $3; -- default null rename__description alias for $4; -- default null v_name_already_exists_p integer; begin if rename__name is not null and rename__name != '' then PERFORM content_item__rename(rename__folder_id, rename__name); end if; if rename__label is not null and rename__label != '' then update acs_objects set title = rename__label where object_id = rename__folder_id; end if; if rename__label is not null and rename__label != '' and rename__description is not null and rename__description != '' then update cr_folders set label = rename__label, description = rename__description where folder_id = rename__folder_id; else if(rename__label is not null and rename__label != '') and (rename__description is null or rename__description = '') then update cr_folders set label = rename__label where folder_id = rename__folder_id; end if; end if; return 0; end;$$ language plpgsql;