-- -- etp__create_extlink/4 -- create or replace function etp__create_extlink( p_package_id integer, p_url character varying, p_title character varying, p_description character varying ) returns int4 as $$ DECLARE v_item_id integer; v_folder_id integer; BEGIN return etp__create_extlink(null::integer, p_package_id, p_url, p_title, p_description); END; $$ language plpgsql; -- -- etp__create_extlink/5 -- create or replace function etp__create_extlink( p_item_id integer, p_package_id integer, p_url character varying, p_title character varying, p_description character varying ) returns int4 as $$ DECLARE v_item_id integer; v_folder_id integer; BEGIN v_item_id := acs_object__new(p_item_id, 'content_extlink'); v_folder_id := etp__get_folder_id(p_package_id); insert into cr_items ( item_id, parent_id, name, content_type ) values ( v_item_id, v_folder_id, 'extlink ' || nextval('t_etp_auto_page_number_seq'), 'content_extlink' ); insert into cr_extlinks (extlink_id, url, label, description) values (v_item_id, p_url, p_title, p_description); return 1; END; $$ language plpgsql;