Index: openacs-4/packages/curriculum/lib/element-ave.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum/lib/element-ave.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/curriculum/lib/element-ave.tcl 15 Sep 2003 20:39:59 -0000 1.6 +++ openacs-4/packages/curriculum/lib/element-ave.tcl 22 Sep 2003 18:46:08 -0000 1.7 @@ -31,6 +31,10 @@ set form_mode edit set title "[_ curriculum.Add_Element]" + # Workaround for the default value of "url"; + # http://openacs.org/bugtracker/openacs/bug?bug%5fnumber=804 + set url $subsite_url + } else { #### @@ -41,7 +45,6 @@ # require permission on curriculum_id, not package_id basis. set write_p [permission::permission_p -object_id $curriculum_id -privilege write] - #permission::require_permission -object_id $curriculum_id -privilege write set form_mode display set curriculum_name [acs_object_name $curriculum_id] @@ -62,22 +65,20 @@ {label "[_ curriculum.Name]"} {html {size 50}} } - {description:richtext + {description:richtext,optional {label "[_ curriculum.Description]"} {help_text "[_ curriculum.lt_This_text_should_desc_1]"} {html {rows 10 cols 50 wrap soft}} - optional } - {url:text(text) + {url:text(text),optional {label "[_ curriculum.URL]"} {help_text "[_ curriculum.lt_A_leading_http_indica]"} {html {size 50}} - {value $subsite_url} } -} +} -on_request { + # Nothing, really +} -edit_request { -ad_form -extend -name element -edit_request { - curriculum::element::get -element_id $element_id -array element_array template::util::array_to_vars element_array @@ -98,11 +99,12 @@ } -new_data { curriculum::element::new \ + -element_id $element_id \ -curriculum_id $curriculum_id \ -name $name \ -description [template::util::richtext::get_property contents $description] \ -desc_format [template::util::richtext::get_property format $description] \ - -url $url \ + -url [ad_decode $url "" "[curriculum::conn package_url]element-ave?curriculum_id=$curriculum_id&element_id=$element_id" $url] \ -enabled_p t } -edit_data { @@ -112,7 +114,7 @@ -name $name \ -description [template::util::richtext::get_property contents $description] \ -desc_format [template::util::richtext::get_property format $description] \ - -url $url + -url [ad_decode $url "" "[curriculum::conn package_url]element-ave?curriculum_id=$curriculum_id&element_id=$element_id" $url] } -after_submit { @@ -131,12 +133,12 @@ set position [parameter::get -package_id $package_id -parameter ExternalSiteBarPosition -default bottom] set export_vars [export_vars -url {curriculum_id element_id position}] - element set_properties element url -display_value \ - "$url" + set link "$url" } else { - element set_properties element url -display_value \ - "$url" + set link "$url" } + + element set_properties element url -display_value $link } ad_return_template