Index: openacs-4/packages/cms/tcl/cms-folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/cms-folder-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/tcl/cms-folder-procs.tcl 3 Jul 2001 16:37:55 -0000 1.2 +++ openacs-4/packages/cms/tcl/cms-folder-procs.tcl 14 Aug 2002 03:57:42 -0000 1.3 @@ -44,29 +44,11 @@ folder_id {datasource multilist} {name registered_types} } { - set code [list \ - template::query get_name_type $name $datasource " - select - o.pretty_name, - m.content_type - from - acs_object_types o, cr_folder_type_map m - where - m.folder_id = :folder_id - and - m.content_type = o.object_type - and - content_item.is_subclass(o.object_type, 'content_revision') = 't' - order by - decode(o.object_type, 'content_revision', '----', o.pretty_name)" \ - -cache "folder_registered_types $folder_id $datasource" -persistent \ - -timeout 3600] - if { [string equal $datasource "multirow"] } { - lappend code "-uplevel" + return [uplevel 1 "db_multirow $name get_name_type {}"] + } else { + return [db_list_of_lists get_name_type ""] } - - eval $code } # @public flush_registered_types @@ -82,4 +64,4 @@ proc cms_folder::flush_registered_types { {id ""} } { set cache_id "folder_registered_types $id" template::query::flush_cache "$cache_id*" -} \ No newline at end of file +} Index: openacs-4/packages/cms/tcl/content-add-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/content-add-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/tcl/content-add-procs.tcl 20 Aug 2001 04:35:41 -0000 1.4 +++ openacs-4/packages/cms/tcl/content-add-procs.tcl 14 Aug 2002 03:57:42 -0000 1.5 @@ -38,26 +38,9 @@ set target "revision-add-2?item_id=$item_id" - template::query count_text_mime_types has_text_mime_type onevalue " - select - count(*) - from - cr_content_mime_type_map - where - mime_type like ('%text/%') - and - content_type = :content_type - " + set has_text_mime_type [db_string count_text_mime_types ""] + set mime_type_count [db_string count_mime_types ""] - template::query count_mime_types mime_type_count onevalue " - select - count(*) - from - cr_content_mime_type_map - where - content_type = :content_type - " - if { $mime_type_count > 0 } { append content_method_html "Add revised content via \[" 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