Index: openacs-4/packages/news/tcl/news-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-callback-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news/tcl/news-callback-procs.tcl 7 Aug 2017 23:48:12 -0000 1.4 +++ openacs-4/packages/news/tcl/news-callback-procs.tcl 3 Sep 2024 15:37:39 -0000 1.5 @@ -11,7 +11,7 @@ ad_proc -callback merge::MergeShowUserInfo -impl news { -user_id:required } { - Show the news items + Show the news items } { set msg "News items of $user_id" ns_log Notice $msg @@ -43,60 +43,60 @@ #Callbacks for application-track -ad_proc -callback application-track::getApplicationName -impl news {} { - callback implementation - } { - return "news" - } - -ad_proc -callback application-track::getGeneralInfo -impl news {} { - callback implementation - } { - db_1row my_query { - select count(n.item_id) as result - FROM news_items_approved n, dotlrn_class_instances_full com - WHERE class_instance_id=:comm_id - and apm_package__parent_id(n.package_id) = com.package_id - } - - return "$result" - } - - -ad_proc -callback application-track::getSpecificInfo -impl news {} { - callback implementation - } { - - upvar $query_name my_query - upvar $elements_name my_elements +ad_proc -callback application-track::getApplicationName -impl news {} { + callback implementation +} { + return "news" +} - set my_query { - SELECT news.publish_title as name, news.pretty_publish_date as initial_date, news.publish_date as finish_date - FROM news_items_approved news,dotlrn_communities_full com - WHERE community_id=:class_instance_id - and apm_package__parent_id(news.package_id) = com.package_id } - - set my_elements { - name { - label "Name" - display_col name - html {align center} - - } - initial_date { - label "Initial Date" - display_col initial_date - html {align center} - } - finish_date { - label "Finish Date" - display_col finish_date - html {align center} - } - } - return "OK" - } +ad_proc -callback application-track::getGeneralInfo -impl news {} { + callback implementation +} { + db_1row my_query { + select count(n.item_id) as result + FROM news_items_approved n, dotlrn_class_instances_full com + WHERE class_instance_id=:comm_id + and apm_package__parent_id(n.package_id) = com.package_id + } + return "$result" +} + + +ad_proc -callback application-track::getSpecificInfo -impl news {} { + callback implementation +} { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + SELECT news.publish_title as name, news.pretty_publish_date as initial_date, news.publish_date as finish_date + FROM news_items_approved news,dotlrn_communities_full com + WHERE community_id=:class_instance_id + and apm_package__parent_id(news.package_id) = com.package_id } + + set my_elements { + name { + label "Name" + display_col name + html {align center} + + } + initial_date { + label "Initial Date" + display_col initial_date + html {align center} + } + finish_date { + label "Finish Date" + display_col finish_date + html {align center} + } + } + return "OK" +} + # Local variables: # mode: tcl # tcl-indent-level: 4