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.18 -r1.19 --- openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 11 Dec 2001 04:32:54 -0000 1.18 +++ openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 11 Dec 2001 06:09:28 -0000 1.19 @@ -78,8 +78,7 @@ array set config $cf - - set query "select f.faq_id, + set query "select f.faq_id, f.faq_name, entry_id, question @@ -100,44 +99,21 @@ " -# if { [llength $list_of_package_ids] > 1 } { - # more than one package_id, we're in a workspace - - foreach package_id $list_of_package_ids { + 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 } { - - append template "" - - - db_foreach select_faqs $query { - append template "" + 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 } { + set name [db_string select_name "select name from site_nodes where node_id= (select parent_id from site_nodes where object_id=:package_id)" -default ""] + append template "" + db_foreach select_faqs $query { + append template "" + } + } else { + # workspace no faqs + } } - } else { - # workspace no faqs - } - } -# } else { -# set package_id $config(package_id) -# -# # not in workspace -# if { [db_string count_faqs "select count(*) as faqcount from faq_q_and_as, acs_objects where context_id = :package_id and object_id=faq_id" ] != 0 } { -# # we have faqs -# append template " -# -# " -# -# db_foreach select_faqs $query { -# append template "" -# } -# } else { -# # no faqs -# append template "" -# } -# } append template "
[db_string select_name "select name from site_nodes where node_id= (select parent_id from site_nodes where object_id=:package_id)" -default ""] (more)
$faq_name
$name (more)
$faq_name
FAQ List
$faq_name
No faqs available
" } - + set code [template::adp_compile -string $template] set output [template::adp_eval code] @@ -178,6 +154,7 @@ } } } + } ad_proc -public make_self_available { portal_id