Index: openacs-4/packages/faq-portlet/www/faq-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/www/faq-portlet.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/faq-portlet/www/faq-portlet.adp 13 Mar 2002 22:00:45 -0000 1.2 +++ openacs-4/packages/faq-portlet/www/faq-portlet.adp 29 Mar 2002 17:18:10 -0000 1.3 @@ -1,16 +1,16 @@ - + - + - -
    - + +
      + - @data@ + @data@ - -
    -
    + +
+
Index: openacs-4/packages/faq-portlet/www/faq-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/www/faq-portlet.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/faq-portlet/www/faq-portlet.tcl 20 Mar 2002 20:08:12 -0000 1.9 +++ openacs-4/packages/faq-portlet/www/faq-portlet.tcl 29 Mar 2002 17:18:10 -0000 1.10 @@ -1,70 +1,63 @@ -# -# /faq-portlet/www/faq-portlet.tcl -# -# distributed under the terms of the GNU GPL version 2 -# -# arjun@openforce.net -# -# The logic for the faq portlet -# -# $Id$ -# +# faq-portlet/www/faq-portlet.tcl +ad_page_contract { + The logic for the faq portlet. + @creation-user Arjun Sanyal (arjun@openforce.net) + @version $Id$ +} -query { +} -array set config $cf +array set config $cf set shaded_p $config(shaded_p) -# Should be a list already! +# Should be a list already! set list_of_package_ids $config(package_id) set data "" - if {[llength $list_of_package_ids] == 1} { set one_instance_p 1 } else { set one_instance_p 0 } - - if {[ad_parameter community_level_p] == 1} { # if i'm in a comm, have the list UI - + foreach package_id $list_of_package_ids { - + if { [db_string faq_q_and_as_count_select {} ] != 0 } { - + set comm_name [site_nodes::get_parent_name \ -instance_id $package_id ] - + set comm_url [dotlrn_community::get_url_from_package_id -package_id $package_id] - + set f_check [db_0or1row faqs_check {}] - - if {!$one_instance_p && $f_check} { + + if {!$one_instance_p && $f_check} { append data "
  • $comm_name" append data "
      " } - + db_foreach faqs_select {} { append data "
    • $faq_name
      " } - - if {!$one_instance_p && $f_check} { + + if {!$one_instance_p && $f_check} { append data "
    " } - - } + + } } - + } else { # i'm at /dotlrn, so have the table UI, hack # - # this seems broken, but it was working ystr - aks 3/18 + # this seems broken, but it was working ystr - aks 3/18 # @@ -78,13 +71,13 @@ " foreach package_id $list_of_package_ids { - + set comm_url [dotlrn_community::get_url_from_package_id -package_id $package_id] - + set comm_name [site_nodes::get_parent_name \ -instance_id $package_id ] - + set count 0 db_foreach faqs_select {} { @@ -105,7 +98,7 @@ append $data_start $data $data_end } - + } # portlets shouldn't disappear anymore (ben) @@ -114,4 +107,3 @@ } else { set no_faqs_p "f" } -