Index: openacs-4/packages/dotlrn/tcl/applets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/applets-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/tcl/applets-procs.tcl 16 Apr 2002 13:53:52 -0000 1.8 +++ openacs-4/packages/dotlrn/tcl/applets-procs.tcl 29 May 2002 04:45:23 -0000 1.9 @@ -14,15 +14,6 @@ # details. # - -# -# Procs for DOTLRN Class Management -# Copyright 2001 OpenForce, inc. -# Distributed under the GNU GPL v2 -# -# October 1st, 2001 -# - ad_library { Procs to manage dotLRN Applets @@ -34,7 +25,7 @@ ad_proc -public get_url {} { # MAJOR FIXME NOW - return "/dotlrn/applets" + return "[dotlrn::get_url]/applets" } ad_proc -public get_applet_url { @@ -45,51 +36,51 @@ ad_proc -public is_initalized {} { if {[site_nodes::get_node_id_from_url -url [get_url]] != [dotlrn::get_node_id] } { - return 1 - } else { + return 1 + } else { return 0 } } ad_proc -public init {} { # Create the applets node - site_nodes::site_node_create -parent_node_id [dotlrn::get_node_id] -name "applets" + site_nodes::site_node_create -parent_node_id [dotlrn::get_node_id] -name applets } ad_proc -public register { - applet_key + applet_key } { - Register an applet. + Register an applet. } { - # Check if it's registered + # Check if it's registered - # Add it - nsv_lappend dotlrn applets $applet_key + # Add it + nsv_lappend dotlrn applets $applet_key } ad_proc -public deregister { - applet_key + applet_key } { - Deregister an applet. Not currently threadsafe! + Deregister an applet. Not currently threadsafe! } { - # If the array hasn't even been created! The Horror! - if {![nsv_exists dotlrn applets]} { - return - } + # If the array hasn't even been created! The Horror! + if {![nsv_exists dotlrn applets]} { + return + } - # Get the list, remove the element, reset the list - set current_list [nsv_get dotlrn applets] - set index [lsearch -exact $current_list $applet_key] - set new_list [lreplace $current_list $index $index] + # Get the list, remove the element, reset the list + set current_list [nsv_get dotlrn applets] + set index [lsearch -exact $current_list $applet_key] + set new_list [lreplace $current_list $index $index] - nsv_set dotlrn applets $new_list + nsv_set dotlrn applets $new_list } ad_proc -public list_applets { } { - List all registered applets. + List all registered applets. } { - return [nsv_get dotlrn applets] + return [nsv_get dotlrn applets] } ad_proc -public applet_exists_p { @@ -102,7 +93,7 @@ ad_proc -public add_applet_to_dotlrn { {-applet_key:required} - {-activate_p "t"} + {-activate_p t} } { dotlrn-init.tcl calls AddApplet on all applets using acs_sc directly. The add_applet proc in the applet (e.g. dotlrn-calendar) calls this @@ -114,10 +105,10 @@ return } - if {[string equal $activate_p "t"] == 1} { - set status "active" + if {[string equal $activate_p t] == 1} { + set status active } else { - set status "inactive" + set status inactive } db_transaction { @@ -166,13 +157,11 @@ ad_proc -public is_applet_mounted { {-url:required} } { - if {[site_nodes::get_node_id_from_url -url "/dotlrn/applets/$url"] - == [site_nodes::get_node_id_from_url -url "/dotlrn/applets"]} { + if {[site_nodes::get_node_id_from_url -url "[get_url]/$url"] == [site_nodes::get_node_id_from_url -url [get_url]]} { return 0 } else { return 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.56 -r1.57 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 24 May 2002 01:58:45 -0000 1.56 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 29 May 2002 04:45:23 -0000 1.57 @@ -36,7 +36,7 @@ ad_proc -public community_type {} { returns the base community type } { - return "dotlrn_community" + return dotlrn_community } ad_proc -public class_group_type_key { @@ -56,7 +56,7 @@ ad_proc -public package_key {} { returns the package key } { - return "dotlrn" + return dotlrn } ad_proc -public get_url {} { @@ -65,6 +65,12 @@ return "/[package_key]" } + ad_proc -public get_admin_url {} { + returns the root URL for dotLRN + } { + return "[get_url]/admin" + } + ad_proc -public is_instantiated {} { returns 1 if dotlrn is instantiated, 0 otherwise } { @@ -84,19 +90,19 @@ } ad_proc -public init {} { - create base community_type for dotlrn and create the "user" and - "subgroups" portal templates + create base community_type for dotlrn and create the user and subgroups + portal templates } { db_transaction { dotlrn_community::set_type_package_id [community_type] [get_package_id] dotlrn::new_type_portal \ - -type "user" \ + -type user \ -pretty_name [dotlrn::parameter -name user_portal_pretty_name] # do the same for subgroups (the dotlrn_community type) dotlrn::new_type_portal \ - -type "dotlrn_community" \ + -type dotlrn_community \ -pretty_name [dotlrn::parameter -name subcommunities_pretty_plural] } } @@ -113,7 +119,7 @@ for {set i 1} {$i < [llength $package_list]} {incr i 2} { array set package_info [lindex $package_list $i] - if {[site_node_closest_ancestor_package -default 0 -url $package_info(url) "dotlrn"] != 0} { + if {[site_node_closest_ancestor_package -default 0 -url $package_info(url) [package_key]] != 0} { set dotlrn_ancestor_p 1 break } @@ -334,8 +340,8 @@ ad_proc -public render_page { {-workspace_p ""} - {-hide_links_p "f"} - {-render_style "individual"} + {-hide_links_p f} + {-render_style individual} {-page_num ""} portal_id } { @@ -395,12 +401,12 @@ {-type:required} } { What's this type's portal_id? If the type is not matched, - return the id of "dotlrn_class_instance" by default + return the id of dotlrn_class_instance by default } { set id [db_string select {} -default ""] if {[empty_string_p $id]} { - set type "dotlrn_class_instance" + set type dotlrn_class_instance set id [db_string select {}] } @@ -425,13 +431,13 @@ # based on the type: # 1. get the page_names and layouts # 2. the the list of default applets for this type - if {[string equal $type "dotlrn_community"]} { + if {[string equal $type dotlrn_community]} { set csv_list [dotlrn::parameter -name subcomm_pages_csv] set default_applets [dotlrn::parameter -name default_subcomm_applets] - } elseif {[string equal $type "dotlrn_club"]} { + } elseif {[string equal $type dotlrn_club]} { set csv_list [dotlrn::parameter -name club_pages_csv] set default_applets [dotlrn::parameter -name default_club_applets] - } elseif {[string equal $type "user"]} { + } elseif {[string equal $type user]} { set csv_list [dotlrn::parameter -name user_portal_pages_csv] set default_applets [dotlrn::parameter -name default_user_portal_applets] } else { Index: openacs-4/packages/dotlrn/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/navigation-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 21 May 2002 17:30:02 -0000 1.9 +++ openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 29 May 2002 04:45:23 -0000 1.10 @@ -14,15 +14,6 @@ # details. # - -# -# Procs for DOTLRN navigation -# Copyright 2001 OpenForce, inc. -# Distributed under the GNU GPL v2 -# -# November 10th, 2001 -# - ad_library { Procs for dotLRN navigation @@ -34,48 +25,43 @@ namespace eval dotlrn { - ad_proc -public root_url { - } { - return "/dotlrn" - } - ad_proc -public admin_navbar { - args + args } { - do an admin navbar + do an admin navbar } { - # Prepend some args - set first_args [list [list [root_url] "dotLRN"]] - if {[llength $args] > 0} { - lappend first_args [list "[root_url]/admin" Admin] - } else { - lappend first_args Admin - } + # Prepend some args + set first_args [list [list [get_url] "dotLRN"]] + if {[llength $args] > 0} { + lappend first_args [list [get_admin_url] Admin] + } else { + lappend first_args Admin + } - set args [concat $first_args $args] + set args [concat $first_args $args] - return [raw_navbar $args] + return [raw_navbar $args] } ad_proc -public navbar { - { -community_id "" } - { -community_type "" } - args + { -community_id "" } + { -community_type "" } + args } { - Creates a Navigation Bar for dotLRN + Creates a Navigation Bar for dotLRN } { - # Fetch community_id and community_type if they're not there - if {[empty_string_p $community_id] && [empty_string_p $community_type]} { - set community_id [dotlrn_community::get_community_id] - set community_type [dotlrn_community::get_community_type] - } + # Fetch community_id and community_type if they're not there + if {[empty_string_p $community_id] && [empty_string_p $community_type]} { + set community_id [dotlrn_community::get_community_id] + set community_type [dotlrn_community::get_community_type] + } - if {![empty_string_p $community_id]} { - set community_type [dotlrn_community::get_community_type_from_community_id $community_id] - } + if {![empty_string_p $community_id]} { + set community_type [dotlrn_community::get_community_type_from_community_id $community_id] + } - set first_args [] - lappend first_args [list [root_url] dotLRN] + set first_args [] + lappend first_args [list [get_url] dotLRN] if {[string equal ${community_type} "dotlrn_class_instance"] != 0} { lappend first_args [list [dotlrn_community::get_community_type_url $community_type] [parameter::get -parameter classes_pretty_plural]] @@ -86,33 +72,33 @@ lappend first_args [list [dotlrn_community::get_community_type_url $community_type] [dotlrn_community::get_community_type_name $community_type]] } - if {![empty_string_p $community_id]} { - lappend first_args [list [dotlrn_community::get_community_url $community_id] [dotlrn_community::get_community_name $community_id]] - } + if {![empty_string_p $community_id]} { + lappend first_args [list [dotlrn_community::get_community_url $community_id] [dotlrn_community::get_community_name $community_id]] + } - return [raw_navbar [concat $first_args $args]] + return [raw_navbar [concat $first_args $args]] } ad_proc -public raw_navbar { - list_of_args + list_of_args } { - do the raw navbar thing (both for admin and such) + do the raw navbar thing (both for admin and such) } { - set args $list_of_args - set list_of_links [list] - set total_n_args [llength $args] - set count 0 + set args $list_of_args + set list_of_links [list] + set total_n_args [llength $args] + set count 0 - foreach arg $args { - incr count - if {[llength $arg] == 2 && $count < $total_n_args} { - lappend list_of_links "[lindex $arg 1]" - } else { - lappend list_of_links "$arg" - } - } + foreach arg $args { + incr count + if {[llength $arg] == 2 && $count < $total_n_args} { + lappend list_of_links "[lindex $arg 1]" + } else { + lappend list_of_links "$arg" + } + } - return "[join $list_of_links " > "]
" + return "[join $list_of_links " > "]
" } - + } Index: openacs-4/packages/dotlrn/www/dotlrn-default-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/dotlrn-default-master.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/dotlrn-default-master.adp 28 May 2002 21:57:05 -0000 1.5 +++ openacs-4/packages/dotlrn/www/dotlrn-default-master.adp 29 May 2002 04:45:23 -0000 1.6 @@ -26,6 +26,8 @@ %> +<% set dotlrn_url [dotlrn::get_url] %> + @@ -41,24 +43,24 @@ - +
- - SloanSpaceLogo + + SloanSpaceLogo @text@ - MySloanSpace - Help - Logout + MySloanSpace + Help + Logout @@ -67,7 +69,7 @@ - +
Index: openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp,v diff -u -r1.26 -r1.27 --- openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp 21 May 2002 17:30:02 -0000 1.26 +++ openacs-4/packages/dotlrn/www/dotlrn-main-portlet.adp 29 May 2002 04:45:23 -0000 1.27 @@ -18,8 +18,10 @@ %> -Join/Drop a Class or Community Group ] +<% set dotlrn_url [dotlrn::get_url] %> +Join/Drop a Class or Community Group ] +