Index: openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl 4 Dec 2001 20:53:53 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl 4 Dec 2001 23:56:14 -0000 1.6 @@ -1,5 +1,3 @@ - - # # Procs for initializing DOTLRN basic system # Copyright 2001 OpenForce, inc. @@ -17,11 +15,9 @@ } - # We check to see if dotLRN has been installed, and if so, if permissions # have been granted - # if installed if {[dotlrn::is_instantiated]} { # Grantee @@ -40,13 +36,27 @@ # init of each applet NOTE: this applet_add proc _must_ be able to be # called repeatedly since this script is eval'd at every server startup # - aks - foreach applet [dotlrn_community::list_applets] { # Callback on all applets dotlrn_community::applet_call $applet "AddApplet" [list] } + + set dotlrn_classes_url "[dotlrn::get_url][dotlrn_class::get_url]" + if {![dotlrn::is_instantiated_here $dotlrn_classes_url]} { + dotlrn::mount_package + -package_key [dotlrn::package_key] \ + -url $dotlrn_classes_url \ + -directory_p 1 + } + + set dotlrn_clubs_url "[dotlrn::get_url][dotlrn_club::get_url]" + if {![dotlrn::is_instantiated_here $dotlrn_clubs_url]} { + dotlrn::mount_package + -package_key [dotlrn::package_key] \ + -url $dotlrn_clubs_url \ + -directory_p 1 + } } # Make sure that privacy is turned on acs_privacy::privacy_control_set 1 - Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 4 Dec 2001 22:43:20 -0000 1.18 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 4 Dec 2001 23:56:14 -0000 1.19 @@ -50,6 +50,32 @@ return [ad_decode [apm_num_instances [package_key]] 0 0 1] } + ad_proc -public is_instantiated_here { + {-url:required} + } { + returns 1 if dotlrn is instantiaed under the url specified, 0 + otherwise + } { + set result 0 + set site_node_list [nsv_array get site_nodes {${url}/?}] + + for {set x 0} {$x < [llength $site_node_list]} {incr x 2} { + if {[string match {${url}/?} [lindex $site_node_list $x]]} { + set site_node [lindex $site_node_list [expr $x + 1]] + + if {[string equals [dotlrn::package_key] $site_node(package_key)]} { + set result 1 + break + } else { + # XXX need to figure out how to error out of here, this + # really bad + } + } + } + + return $result + } + ad_proc -public is_package_mounted { {-package_key:required} } { @@ -78,7 +104,7 @@ mount a package under dotlrn } { db_transaction { - set parent_node [site_node [site_node_closest_ancestor_package_url -package_key $package_key]] + set parent_node [site_node [site_node::get_url_from_node_id [site_node::get_parent_id [site_node::get_node_id_from_url $url]]]] set parent_id $parent_node(node_id) set parent_package_id $parent_node(object_id)