Index: openacs-4/packages/news/www/preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/news/www/preview.tcl 21 Jan 2018 00:38:38 -0000 1.34 +++ openacs-4/packages/news/www/preview.tcl 29 Jan 2018 13:09:43 -0000 1.35 @@ -57,16 +57,22 @@ set user_id [auth::require_login] set package_id [ad_conn package_id] -# only people with at least write-permission beyond this point -permission::require_permission -object_id $package_id -privilege news_create +# +# Only people with news_create permission beyond this point +# +permission::require_permission \ + -object_id $package_id \ + -privilege news_create -set news_admin_p [permission::permission_p -object_id $package_id -privilege news_admin] +set news_admin_p [permission::permission_p \ + -object_id $package_id \ + -privilege news_admin] # Template parser treats publish_body.format as an array reference set publish_format ${publish_body.format} if { $action eq "News Item" } { - set title "[_ news.Preview_news_item]" + set title [_ news.Preview_news_item] } else { set title "[_ news.Preview] $action" } @@ -108,11 +114,11 @@ } if { [dt_interval_check $archive_date_ansi $publish_date_ansi] >= 0 } { - ad_return_error "[_ news.Scheduling_Error]" \ - "[_ news.lt_The_archive_date_must]" + ad_return_error \ + [_ news.Scheduling_Error] \ + [_ news.lt_The_archive_date_must] ad_script_abort } - } if { ${publish_body.format} eq "text/html" || ${publish_body.format} eq "text/enhanced" } { @@ -137,23 +143,28 @@ # form variables for confirmation step - set hidden_vars [export_vars -form {publish_title publish_lead publish_body publish_body.format \ - publish_date_ansi archive_date_ansi html_p permanent_p imgfile}] - 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 hidden_vars [export_vars -form { + publish_title publish_lead publish_body publish_body.format + publish_date_ansi archive_date_ansi html_p permanent_p imgfile + }] + 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 "