Index: openacs.org-dev/packages/cms/www/modules/templates/template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/cms/www/modules/templates/template.tcl,v diff -u -r1.1.1.1 -r1.1.1.2 --- openacs.org-dev/packages/cms/www/modules/templates/template.tcl 9 Jul 2002 17:35:04 -0000 1.1.1.1 +++ openacs.org-dev/packages/cms/www/modules/templates/template.tcl 8 Oct 2002 15:47:03 -0000 1.1.1.2 @@ -18,67 +18,25 @@ # resolve any symlinks -template::query get_id resolved_template_id onevalue " - select content_symlink.resolve(:template_id) from dual -" +set resolved_template_id [db_string get_id ""] set template_id $resolved_template_id # get the path -template::query get_path path onevalue " - select content_item.get_path(:template_id, :root_id) from dual -" +set path [db_string get_path "" -default ""] # check for valid template_id -if { [template::util::is_nil path] } { +if { [string equal $path ""] } { ns_log Notice "/templates/template.tcl - BAD TEMPLATE_ID - $template_id" template::forward "../sitemap/index?mount_point=templates&id=" } # get the context bar info +db_multirow context get_context "" -template::query context multirow "select - t.tree_level, t.context_id, content_item.get_title(t.context_id) as title - from ( - select - context_id, level as tree_level - from - acs_objects - where - context_id <> 0 - connect by - prior context_id = object_id - start with - object_id = :template_id - ) t, cr_items i - where - i.item_id = t.context_id - order by - tree_level desc" - - # find out which items this template is registered to -template::query get_items items multirow " - select - content_item.get_title(item_id) title, item_id, use_context - from - cr_item_template_map - where - template_id = :template_id - order by - use_context" +db_multirow items get_items "" - # find out which types this template is registered to -template::query get_types types multirow " - select - pretty_name, content_type, use_context - from - acs_object_types types, cr_type_template_map map - where - map.template_id = :template_id - and - types.object_type = map.content_type - order by - types.pretty_name" +db_multirow types get_types ""