Index: openacs-4/packages/dotlrn/tcl/class-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/class-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/dotlrn/tcl/class-procs.tcl 5 Dec 2001 13:32:40 -0000 1.14 +++ openacs-4/packages/dotlrn/tcl/class-procs.tcl 5 Dec 2001 22:05:23 -0000 1.15 @@ -18,6 +18,39 @@ namespace eval dotlrn_class { + ad_proc -public community_type {} { + returns the base community type for classes + } { + return "dotlrn_class_instance" + } + + ad_proc -public is_initialized {} { + is dotlrn_class initialized with the right community_type? + } { + set community_type [community_type] + return [db_string is_dotlrn_class_initialized { + select count(*) + from dotlrn_community_types + where community_type = :community_type + and package_id is not null + }] + } + + ad_proc -public init {} { + create base community_type for dotlrn_class + } { + db_transaction { + set dotlrn_classes_url "[dotlrn::get_url][dotlrn_class::get_url]/" + if {![dotlrn::is_instantiated_here -url $dotlrn_classes_url]} { + set package_id [dotlrn::mount_package \ + -package_key [dotlrn::package_key] \ + -url [dotlrn_class::get_url_part] \ + -directory_p "t"] + dotlrn_community::set_type_package_id [community_type] $package_id + } + } + } + ad_proc -public new { {-description ""} {-class_key:required} @@ -67,7 +100,7 @@ return [dotlrn_community::new \ -description $description \ -community_type $class_type \ - -object_type dotlrn_class_instance \ + -object_type [community_type] \ -community_key $community_key \ -pretty_name $class_name \ -extra_vars $extra_vars]