Index: openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 11 Jan 2002 21:31:26 -0000 1.21 +++ openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 25 Feb 2002 20:37:51 -0000 1.22 @@ -17,9 +17,14 @@ ad_proc -private my_name { } { - return "faq_portlet" + return "faq_portlet" } + ad_proc -private my_package_key { + } { + return "faq-portlet" + } + ad_proc -public get_pretty_name { } { return "Frequently Asked Questions" @@ -75,60 +80,11 @@ @author arjun@openforce.net @creation-date Sept 2001 } { - - array set config $cf - - set query "select f.faq_id, - f.faq_name, - entry_id, - question - from acs_objects o, faqs f, faq_q_and_as qa - where object_id = f.faq_id - and context_id = :package_id - and qa.faq_id(+) = f.faq_id" - - # Should be a list already! - set list_of_package_ids $config(package_id) - - if { $config(shaded_p) == "t" } { - set data "" - set template "" - } else { - # not shaded - set template " - - " - - foreach package_id $list_of_package_ids { - - if { [db_string count_faqs "select count(*) as count from faq_q_and_as, acs_objects where context_id = :package_id and object_id=faq_id" ] != 0 } { - - # aks fold into site_nodes:: or dotlrn_community - set comm_object_id [db_string select_name "select object_id from site_nodes where node_id= (select parent_id from site_nodes where object_id=:package_id)" ] - - set name [db_string select_pretty_name " - select instance_name - from apm_packages - where package_id= :comm_object_id "] - - append template "" - db_foreach select_faqs $query { - append template "" - } - } else { - # workspace no faqs - set template "
$name FAQs
  $faq_name
" - } - } - append template "
No FAQs available
" - } - - set code [template::adp_compile -string $template] - - set output [template::adp_eval code] - - return $output - + # no return call required with the helper proc + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "faq-portlet" }