Index: openacs-4/packages/news/www/preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.tcl,v diff -u -r1.31.2.2 -r1.31.2.3 --- openacs-4/packages/news/www/preview.tcl 2 Jan 2016 20:34:50 -0000 1.31.2.2 +++ openacs-4/packages/news/www/preview.tcl 11 Aug 2016 12:52:38 -0000 1.31.2.3 @@ -30,7 +30,7 @@ } -validate { check_revision_log -requires {action revision_log} { - if { ![string match $action "News Item"] && $revision_log eq ""} { + if { $action eq "News Item" && $revision_log eq ""} { ad_complain "[_ news.lt_You_must_supply_a_rev]" return } @@ -65,7 +65,7 @@ # Template parser treats publish_body.format as an array reference set publish_format ${publish_body.format} -if { [string match $action "News Item"] } { +if { $action eq "News Item" } { set title "[_ news.Preview_news_item]" } else { set title "[_ news.Preview] $action" @@ -86,7 +86,7 @@ # deal with Dates, granularity is 'day' # with news_admin privilege fill in publish and archive dates -if { $news_admin_p == 1 || [string equal [parameter::get -parameter ApprovalPolicy] "open"] } { +if { $news_admin_p == 1 || [parameter::get -parameter ApprovalPolicy] eq "open" } { if { [info exists publish_date(year)] && [info exists publish_date(month)] && [info exists publish_date(day)] } { set publish_date_ansi "$publish_date(year)-$publish_date(month)-$publish_date(day)" @@ -132,7 +132,7 @@ } } -if { [string match $action "News Item"] } { +if { $action eq "News Item" } { # form variables for confirmation step @@ -141,8 +141,8 @@ set image_vars [export_vars -form {publish_title publish_lead publish_body publish_body.format \ publish_date_ansi archive_date_ansi html_p \ permanent_p action}] - set form_action "
" - set edit_action "" + set form_action "" + set edit_action "" } else { @@ -153,8 +153,8 @@ set image_vars [export_vars -form {publish_title publish_lead publish_body publish_body.format \ publish_date_ansi archive_date_ansi html_p \ permanent_p action item_id revision_log}] - set form_action "" - set edit_action "" + set form_action "" + set edit_action "" } # creator link @@ -163,7 +163,7 @@ from cc_users where user_id = :user_id }] -set creator_link "$creator_name" +set creator_link "[ns_quotehtml $creator_name]" template::head::add_style -style ".news-item-preview { color: inherit; background-color: #eeeeee; margin: 1em 4em 1em 4em; padding: 1em; }" -media screen