Index: openacs-4/packages/cms/www/modules/templates/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/templates/edit.tcl 8 Jun 2001 01:44:53 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/edit.tcl 19 Aug 2002 04:07:50 -0000 1.3 @@ -5,8 +5,7 @@ if { ! [request is_valid] } { return } -template::query get_path path onevalue " - select content_item.get_path(:template_id) from dual" +set path [db_string get_path ""] form create edit_template -html { enctype multipart/form-data } @@ -20,9 +19,7 @@ element create edit_template content -widget textarea -label {} \ -datatype text -html { cols 80 rows 30 } template -template::query get_mime_types mime_types multilist " - select label, m.mime_type from cr_mime_types m, cr_content_mime_type_map t - where t.content_type = 'content_template' and t.mime_type = m.mime_type" +set mime_types [db_list_of_lists get_mime_types ""] element create edit_template mime_type -widget select -label "Template Type" \ -datatype text -options $mime_types @@ -54,8 +51,7 @@ element set_value edit_template content \ [content::get_content_value $edit_revision] - template::query get_mime_type mime_type onevalue " - select mime_type from cr_revisions where revision_id = :edit_revision" + set mime_type [db_string get_mime_type ""] element set_value edit_template mime_type $mime_type } @@ -88,8 +84,7 @@ set tmpfile [content::prepare_content_file edit_template] - template::query get_revision_count revision_count onevalue " - select count(revision_id) from cr_revisions where item_id = :template_id" + set revision_count [db_string get_revision_count ""] if { $revision_count == 0 } { set is_update t Index: openacs-4/packages/cms/www/modules/templates/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/index.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/index.tcl 3 Sep 2001 05:28:28 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/index.tcl 19 Aug 2002 04:07:50 -0000 1.5 @@ -19,31 +19,25 @@ if { ! [string equal $path {}] } { - template::query get_id id onevalue " - select - content_item.get_id(:path, content_template.get_root_folder) - from dual" + set id [db_string get_id ""] - if { [string equal $id {}] } { + if { [string equal $id {}] } { - set msg "The requested folder $path does not exist." - request error invalid_path $msg - } + set msg "The requested folder $path does not exist." + request error invalid_path $msg + } } else { if { [string equal $id {}] } { - template::query get_root_folder_id id onevalue " - select content_template.get_root_folder from dual" + set id [db_string get_root_folder_id ""] } - template::query get_path path onevalue " - select content_item.get_path(:id) from dual" + set path [db_string get_path ""] } # query for the content type and redirect if a folder -template::query get_type type onevalue " - select content_type from cr_items where item_id = :id" +set type [db_string get_type ""] if { [string equal $type content_template] } { template::forward properties?id=$id @@ -52,56 +46,16 @@ # Query for the parent if { ! [string equal $path /] } { -template::query get_parent parent onerow " - select - f.folder_id, f.label, i.name, - to_char(o.last_modified, 'MM/DD/YY HH:MI AM') modified - from - cr_folders f, cr_items i, acs_objects o - where - i.item_id = (select parent_id from cr_items where item_id = :id) - and - i.item_id = f.folder_id - and - i.item_id = o.object_id" + db_1row get_parent "" -column_array parent } # Query folders first -template::query get_folders folders multirow " - select - f.folder_id, f.label, i.name, - to_char(o.last_modified, 'MM/DD/YY HH:MI AM') modified - from - cr_folders f, cr_items i, acs_objects o - where - i.parent_id = :id - and - i.item_id = f.folder_id - and - i.item_id = o.object_id - order by - upper(f.label), upper(i.name)" +db_multirow folders get_folders "" # items in the folder -template::query get_items items multirow " - select - t.template_id, i.name, - to_char(o.last_modified, 'MM/DD/YY HH:MI AM') modified, - nvl(round(r.content_length / 1000, 2), 0) || ' KB' as file_size - from - cr_templates t, cr_items i, acs_objects o, cr_revisions r - where - i.parent_id = :id - and - i.item_id = t.template_id - and - i.item_id = o.object_id - and - i.latest_revision = r.revision_id (+) - order by - upper(i.name)" +db_multirow items get_items "" # set a flag indicating whether the folder is empty Index: openacs-4/packages/cms/www/modules/templates/move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/move.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/templates/move.tcl 25 May 2001 02:15:56 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/move.tcl 19 Aug 2002 04:07:50 -0000 1.3 @@ -27,5 +27,4 @@ template::forward [ns_queryget return_url] } -template::query get_path path onevalue "select content_item.get_path(:folder_id) from dual" - +set path [db_string get_path ""] Index: openacs-4/packages/cms/www/modules/templates/new-folder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/new-folder.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/new-folder.tcl 8 Jun 2001 01:44:53 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/new-folder.tcl 19 Aug 2002 04:07:50 -0000 1.5 @@ -2,8 +2,7 @@ parent_id -datatype integer } -template::query get_path path onevalue " - select content_item.get_path(:parent_id) from dual" +set path [db_string get_path ""] form create new_folder -elements " return_url -datatype url -widget hidden Index: openacs-4/packages/cms/www/modules/templates/new-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/new-template.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/new-template.tcl 8 Jun 2001 01:44:53 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/new-template.tcl 19 Aug 2002 04:07:50 -0000 1.5 @@ -4,8 +4,7 @@ ns_log Notice "folder_id is $folder_id" -template::query get_path path onevalue " - select content_item.get_path(:folder_id) from dual" +set path [db_string get_path ""] form create new_template -elements " return_url -datatype url -widget hidden @@ -14,9 +13,7 @@ name -datatype filename -html { size 40 } " -template::query get_mime_types mime_types multilist " - select label, m.mime_type from cr_mime_types m, cr_content_mime_type_map t - where t.content_type = 'content_template' and t.mime_type = m.mime_type" +set mime_types [db_list_of_lists get_mime_types ""] element create new_template mime_type -widget select -label "Template Type" \ -datatype text -options $mime_types Index: openacs-4/packages/cms/www/modules/templates/properties.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/properties.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/templates/properties.tcl 8 Jun 2001 01:44:53 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/properties.tcl 19 Aug 2002 04:07:50 -0000 1.3 @@ -6,32 +6,26 @@ if { ! [string equal $path {}] } { - template::query get_id id onevalue " - select - content_item.get_id(:path, content_template.get_root_folder) - from dual" + set id [db_string get_id ""] - if { [string equal $id {}] } { + if { [string equal $id {}] } { - set msg "The requested folder $path does not exist." - request error invalid_path $msg - } + set msg "The requested folder $path does not exist." + request error invalid_path $msg + } } else { if { [string equal $id {}] } { - template::query get_root_id onevalue " - select content_template.get_root_folder from dual" + set id [db_string get_root_id ""] } - template::query get_path path onevalue " - select content_item.get_path(:id) from dual" + set path [db_string get_path ""] } # query for the content type and redirect if a folder -template::query get_type type onevalue " - select content_type from cr_items where item_id = :id" +set type [db_string get_type ""] if { [string equal $type content_folder] } { template::forward index?id=$id