gustafn
committed
on 26 Aug 14
- replace calls to deprecated function "ad_parameter" by non-deprecated counterparts
openacs-4/.../admin/set-publish-state.tcl (+6 -9)
1 1 ::xowiki::Package initialize -ad_doc {
2 2   Changes the publication state of a content item
3 3
4 4   @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at)
5 5   @creation-date Nov 16, 2006
6 6   @cvs-id $Id$
7 7
8 8   @param object_type
9 9   @param query
10 10 } -parameter {
11 11   {-state:required}
12     {-revision_id:required}
  12   {-revision_id:integer,required}
13 13   {-return_url "."}
14 14 }
15 15
16   set item_id [xo::dc get_value get_item_id \
17       {select item_id from cr_revisions where revision_id = :revision_id}]
18  
19   ns_cache flush xotcl_object_cache ::$item_id
20   ns_cache flush xotcl_object_cache ::$revision_id
21  
22   ::xo::db::sql::content_item set_live_revision \
  16 set page [::xo::db::CrClass get_instance_from_db -revision_id $revision_id]
  17 $page set_live_revision \
23 18     -revision_id $revision_id \
24 19     -publish_status $state
25 20
  21 ns_cache flush xotcl_object_cache ::$revision_id
  22
26 23 if {$state ne "production"} {
27 24   ::xowiki::notification::do_notifications -revision_id $revision_id
28 25   ::xowiki::datasource $revision_id
29 26 } else {
30 27   db_dml flush_syndication {delete from syndication where object_id = :revision_id}
31 28 }
32 29
33 30 ad_returnredirect $return_url