Index: openacs-4/packages/lars-blogger/www/admin/entry-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/Attic/entry-edit.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/lars-blogger/www/admin/entry-edit.tcl 30 Jan 2003 12:34:54 -0000 1.7.2.1 +++ openacs-4/packages/lars-blogger/www/admin/entry-edit.tcl 13 Mar 2003 17:06:07 -0000 1.7.2.2 @@ -24,7 +24,8 @@ form create entry element create entry title -label "Title" -datatype text -html { size 50 } -element create entry content -label "Content" -datatype text -widget textarea -html { cols 80 rows 20 } +element create entry title_url -label "Title URL (optional)" -datatype text -html { size 50 } -optional +element create entry content -label "Content" -datatype richtext -widget richtext -html { cols 80 rows 20 } element create entry entry_date -label "Entry date" -datatype text \ -help_text "If you set this to something other than today's date, you must use this form to publish your entry, otherwise the entry date will be set to the date you publish the item." \ -after_html {(Set to today)} @@ -54,10 +55,10 @@ db_1row entry { *SQL* } - element set_properties entry title -value $title - element set_properties entry content -value $content - element set_properties entry entry_date -value $entry_date - element set_properties entry draft_p -value $draft_p + element set_value entry title $title + element set_value entry title_url $title_url + element set_value entry entry_date $entry_date + element set_value entry draft_p $draft_p } element set_properties entry entry_id -value $entry_id @@ -68,7 +69,9 @@ if { [form is_valid entry] } { set entry_id [element get_value entry entry_id] set title [element get_value entry title] - set content [element get_value entry content] + set title_url [element get_value entry title_url] + set content [template::util::richtext::get_property contents [element get_value entry content]] + set content_format [template::util::richtext::get_property format [element get_value entry content]] set entry_date [element get_value entry entry_date] set draft_p [element get_value entry draft_p] set draft_p [ad_decode $draft_p "" "f" $draft_p] @@ -81,21 +84,38 @@ -entry_id $entry_id \ -package_id [ad_conn package_id] \ -title $title \ + -title_url $title_url \ -content $content \ -entry_date $entry_date \ -draft_p "$draft_p" } else { - set set_clauses { "title = :title" "content = :content" "entry_date = to_date(:entry_date, 'YYYY-MM-DD')" "draft_p = :draft_p" } + set set_clauses { + "title = :title" + "title_url = :title_url" + "content = :content" + "content_format = :content_format" + "entry_date = to_date(:entry_date, 'YYYY-MM-DD')" + "draft_p = :draft_p" + } set org_draft_p [db_string org_draft_p { select draft_p from pinds_blog_entries where entry_id = :entry_id } ] + # Is this a publish? if { [string equal $draft_p "t"] && [string equal $org_draft_p "f"] } { - # If this is a publish, set the posted_date to now + # set the posted_date to now lappend set_clauses [db_map now] } db_dml update_entry { *SQL* } + # Is this a publish? + if { [string equal $draft_p "t"] && [string equal $org_draft_p "f"] } { + # do notifications + lars_blogger::entry::do_notifications -entry_id $entry_id + # and ping weblogs.com + lars_blog_weblogs_com_update_ping + } + lars_blog_flush_cache [ad_conn package_id] } @@ -120,6 +140,6 @@ } } -set context_bar [ad_context_bar $page_title] +set context [list $page_title] -ad_return_template \ No newline at end of file +ad_return_template