ad_page_contract { Create a Classified Ads Category @author Deds Castillo (deds@infiniteinfo.com) @creation-date 2002-10-08 @cvs-id $Id: category-new.tcl.bak,v 1.1 2003/07/16 04:52:32 rmello Exp $ } { parent_id:integer,notnull {return_url "categories"} } form create category element create category keyword_id \ -label "Keyword ID" \ -datatype integer \ -widget hidden element create category parent_id \ -label "Parent ID" \ -datatype integer \ -widget hidden element create category heading \ -label "Category" \ -datatype text \ -widget text \ -html {size 60} {maxlength 600} element create category description \ -label "Description" \ -datatype text \ -widget textarea \ -html {cols 60 rows 10 wrap soft} \ -optional if {[form is_valid category]} { template::form get_values category \ keyword_id parent_id heading description if {[catch {set keyword_id [classified-ads::categories::new -keyword_id $keyword_id \ -heading $heading \ -parent_id $parent_id \ -description $description \ ]} errmsg] } { # DEDS: FIXME - do this better via select and compare of keyword id # double click protection ad_return_complaint 1 "
  • you probably clicked the submit button more than once" ad_script_abort } ad_returnredirect $return_url ad_script_abort } if { [form is_request category] } { # Pre-fetch the keyword_id set keyword_id [db_nextval acs_object_id_seq] element set_properties category keyword_id -value $keyword_id element set_properties category parent_id -value $parent_id } set title "Create new category" set context [classified-ads::categories::generate_trail -keyword_id $parent_id -append_element $title] ad_return_template