Index: openacs-4/packages/cms/tcl/content-method-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/content-method-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/cms/tcl/content-method-procs.tcl 28 Aug 2001 23:31:30 -0000 1.5 +++ openacs-4/packages/cms/tcl/content-method-procs.tcl 14 Aug 2002 03:57:42 -0000 1.6 @@ -38,46 +38,21 @@ set text_entry_filter [text_entry_filter_sql $content_type] # get default content method (if any) - template::query get_default_method default_method onevalue " - select - content_method - from - cm_content_methods m - where - content_method = content_method.get_method (:content_type ) - $text_entry_filter - " -cache "content_method_types_default $content_type" + set default_method [db_string get_default_method ""] # if the default exists, return it if { ![template::util::is_nil default_method] } { set methods [list $default_method] } else { # otherwise look up all content method mappings - template::query get_methods_1 methods onelist " - select - map.content_method - from - cm_content_type_method_map map, cm_content_methods m - where - map.content_method = m.content_method - and - map.content_type = :content_type - $text_entry_filter - " -cache "content_method_types $content_type" + set methods [db_list get_methods_1 ""] } # if there are no mappings, return all methods if { [template::util::is_nil methods] } { - template::query get_methods_2 methods onelist " - select - content_method - from - cm_content_methods m - where 1 = 1 - $text_entry_filter - " -cache "content_method_types" + set methods [db_list get_methods_2 ""] } return $methods @@ -102,48 +77,19 @@ set text_entry_filter [text_entry_filter_sql $content_type] - template::query get_content_default_method default_method onerow " - select - label, map.content_method - from - cm_content_type_method_map map, cm_content_methods m - where - map.content_method = m.content_method - and - map.content_method = content_method.get_method( :content_type ) - $text_entry_filter - " -cache "content_method_types_n_labels_default $content_type" + db_1row get_content_default_method "" - template::util::array_to_vars default_method - if { ![template::util::is_nil content_method] } { set methods [list [list $label $content_method]] } else { # otherwise look up all content methods mappings - template::query get_methods_1 methods multilist " - select - label, map.content_method - from - cm_content_methods m, cm_content_type_method_map map - where - m.content_method = map.content_method - and - map.content_type = :content_type - $text_entry_filter - " -cache "content_method_types_n_labels $content_type" + set methods [db_list_of_lists get_methods_1 ""] } # if there are no mappings, return all methods if { [template::util::is_nil methods] } { - template::query get_methods_2 methods multilist " - select - label, content_method - from - cm_content_methods m - where 1 = 1 - $text_entry_filter - " -cache "content_method_types_n_labels" + set methods [db_list_of_lists get_methods_2 ""] } return $methods