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_string select_name "select name from site_nodes where node_id= (select parent_id from site_nodes where object_id=:package_id)" -default ""] (more)
|
"
-
-
- db_foreach select_faqs $query {
- append template "$faq_name |
"
+ 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 "$name (more)
|
"
+ db_foreach select_faqs $query {
+ append template "$faq_name |
"
+ }
+ } 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 "
-# FAQ List |
-#
"
-#
-# db_foreach select_faqs $query {
-# append template "$faq_name |
"
-# }
-# } else {
-# # no faqs
-# append template "No faqs available | |
"
-# }
-# }
append template "
"
}
-
+
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