All pastes #1835746 Raw Edit

clueless

public text v1 · immutable
#1835746 ·published 2010-03-12 17:42 UTC
rendered paste body
ad_page_contract {} -query {    site_id:integer,optional    package_id:integer,optional} -properties {}set user_id [ad_conn user_id]set package_id [ad_conn package_id]set doc(title) "Edit Site Parameters"set context ""ad_form -name site_fields -export {site_id} \    -form {        package_id:key        {landing_css:text             {label {CSS for landing page}}        }        {landing_title:text             {label {Title for landing page}}        }        {landing_who_its_for:richtext            {label {The Niche, Who the product is for}}            {help_text {could be something like "Special offer for (Niche)"}}        }        {landing_headline:richtext            {label {Headline for landing page}}            {help_text {could be "you are about to discover howto (solve problem)"}}        }        {landing_headshot:text             {label {location of headshot for landing page}}            {help_text {please enter the web address of your headshot photograph}}        }        {landing_what_youll_get:richtext            {label {What they get in exchange for their KIND permission to be contacted}}        }        {landing_contact_info:richtext            {label {Page signature, your contact info}}        }    } -edit_request {        db_1row get_site_row {            select                sts.package_id,                sts.site_id,                sts.landing_css,                sts.landing_title,                sts.landing_who_its_for as p_landing_who_its_for,                sts.landing_headline as p_landing_headline,                sts.landing_headshot,                sts.landing_what_youll_get as p_landing_what_youll_get,                sts.landing_testimonials as p_landing_testimonials,                sts.landing_contact_info as p_landing_contact_info            from                simple_twopage_sites sts            where                sts.package_id = :package_id        }        set landing_who_its_for \            [template::util::richtext::create \                $p_landing_who_its_for \		"text/html"]        set landing_headline \            [template::util::richtext::create \                $p_landing_headline \		"text/html"]        set landing_what_youll_get \            [template::util::richtext::create \                $p_landing_what_youll_get \		"text/html"]        set landing_testimonials \            [template::util::richtext::create \                $p_landing_testimonials \		"text/html"]        set landing_contact_info \            [template::util::richtext::create \                $p_landing_contact_info \		"text/html"]    } -edit_data {        set p_landing_who_its_for [lindex $landing_who_its_for 0]        set p_landing_headline [lindex $landing_headline 0]        set p_landing_what_youll_get [lindex $landing_what_youll_get 0]        set p_landing_testimonials [lindex $landing_testimonials 0]        set p_landing_contact_info [lindex $landing_contact_info 0]        db_dml update_site_row {            update                simple_twopage_sites            set                landing_css = :landing_css,                landing_title = :landing_title,                landing_who_its_for = :p_landing_who_its_for,                landing_headline = :p_landing_headline,                landing_headshot = :landing_headshot,                landing_what_youll_get = :p_landing_what_youll_get,                landing_testimonials = :p_landing_testimonials,                landing_contact_info = :p_landing_contact_info            where                package_id = :package_id        }    } -after_submit {        ad_returnredirect .        ad_script_abort    }