Index: openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl,v diff -u -N -r1.39 -r1.40 --- openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 29 Mar 2002 19:51:44 -0000 1.39 +++ openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.40 @@ -71,7 +71,7 @@ if {[llength $element_id_list] == 0} { # Tell portal to add this element to the page - set element_id [portal::add_element -pretty_name "Bboards" $portal_id [my_name]] + set element_id [portal::add_element -pretty_name "Bboards" -force_region 1 $portal_id [my_name]] # There is already a value for the param which must be overwritten portal::set_element_param $element_id instance_id $instance_id set package_id_list [list] Index: openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl,v diff -u -N -r1.22 -r1.23 --- openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 29 Mar 2002 18:52:51 -0000 1.22 +++ openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.23 @@ -71,6 +71,7 @@ -portlet_name [my_name] \ -pretty_name [get_pretty_name] \ -value_id $calendar_id \ + -force_region 2 \ -key calendar_id] } Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -N -r1.69 -r1.70 --- openacs-4/packages/dotlrn/dotlrn.info 20 Mar 2002 20:04:01 -0000 1.69 +++ openacs-4/packages/dotlrn/dotlrn.info 2 Apr 2002 06:13:47 -0000 1.70 @@ -357,18 +357,18 @@ - - + - - + + + Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -N -r1.93 -r1.94 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 29 Mar 2002 19:14:45 -0000 1.93 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 2 Apr 2002 06:13:47 -0000 1.94 @@ -619,6 +619,7 @@ applets_dispatch -community_id $community_id \ -op AddUserToCommunity \ + -reorder_hack_p 1 \ -list_args [list $community_id $user_id] } } @@ -1245,16 +1246,40 @@ {-community_id ""} {-op:required} {-list_args {}} + {-reorder_hack_p ""} } { Dispatch an operation to every applet, either in one communtiy or on all the active dotlrn applets } { + set list_of_applets [list_active_applets -community_id $community_id] - ns_log notice "aks 20 debug applets_dispatch called with comm_id = $community_id, op $op, - list args $list_args length is [llength $list_args]" + if {![empty_string_p $reorder_hack_p]} { + ns_log notice "aks1: applets_dispatch: reorder hack!" - set list_of_applets [list_active_applets -community_id $community_id] + set reorder_applets_string [ad_parameter user_wsp_applet_ordering "dotlrn" "dotlrn_news,dotlrn_bboard,dotlrn_survey,dotlrn_faq"] + set reorder_applets_list [string trim [split $reorder_applets_string {,}]] + + # check if the applet is both in the reorder list and the applet list + # if so, put it into the right place in the result list + # if not, skip it + set result_list [list] + foreach applet $reorder_applets_list { + set index [lsearch -exact $list_of_applets $applet] + + if {$index != -1 } { + ns_log notice "aks2: reorder HIT with '$applet' against '$list_of_applets' // $index" + set list_of_applets [lreplace $list_of_applets $index $index] + lappend result_list $applet + } else { + ns_log notice "aks3: reorder MISS with '$applet' against '$list_of_applets'" + } + } + + set list_of_applets [concat $result_list $list_of_applets] + } + + foreach applet $list_of_applets { # Callback on applet applet_call $applet $op $list_args Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -N -r1.32 -r1.33 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 29 Mar 2002 19:14:45 -0000 1.32 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 2 Apr 2002 06:13:47 -0000 1.33 @@ -45,7 +45,7 @@ need collision detection and resolution, yada yada. } { - regsub -all {\W+} $name "-" name + regsub -all {\W+} [string tolower $name] "-" name regsub -all -- {-+} $name "-" name return "[string trim $name {-}]" Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -N -r1.38 -r1.39 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 29 Mar 2002 19:16:43 -0000 1.38 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 2 Apr 2002 06:13:47 -0000 1.39 @@ -113,6 +113,7 @@ set element_id \ [portal::add_element \ -pretty_name [get_pretty_name] \ + -force_region 2 \ $portal_template_id \ [calendar_portlet::my_name]] Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 29 Mar 2002 19:20:49 -0000 1.4 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.5 @@ -66,7 +66,7 @@ @creation-date Sept 2001 } { # Tell portal to add this element to the page - set element_id [portal::add_element $portal_id [my_name]] + set element_id [portal::add_element -force_region 1 $portal_id [my_name]] # The default param must be configured set key "community_id" Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 29 Mar 2002 19:20:49 -0000 1.3 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.4 @@ -61,6 +61,7 @@ -pretty_name [get_pretty_name] \ -portal_id $portal_id \ -portlet_name [my_name] \ + -force_region 2 \ -value_id $community_id \ -key community_id] } Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl,v diff -u -N -r1.26 -r1.27 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 29 Mar 2002 19:20:49 -0000 1.26 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.27 @@ -69,6 +69,7 @@ # Tell portal to add this element to the page set element_id [portal::add_element \ -pretty_name [get_pretty_name] \ + -force_region 2 \ $portal_id \ [my_name]] Index: openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl,v diff -u -N -r1.25 -r1.26 --- openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 29 Mar 2002 19:25:19 -0000 1.25 +++ openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.26 @@ -72,8 +72,10 @@ # Tell portal to add this element to the page set element_id [portal::add_element \ -pretty_name [get_pretty_name] \ + -force_region 1 \ $portal_id \ - [my_name]] + [my_name] + ] # There is already a value for the param which must be overwritten portal::set_element_param $element_id package_id $package_id Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -N -r1.123 -r1.124 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 29 Mar 2002 18:48:28 -0000 1.123 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 2 Apr 2002 06:13:47 -0000 1.124 @@ -1469,6 +1469,7 @@ {-value_id:required} {-key "instance_id"} {-extra_params ""} + {-force_region ""} } { A helper proc for portlet "add_self_to_page" procs. Adds the given portlet as an portal element to the given @@ -1491,8 +1492,12 @@ db_transaction { # Tell portal to add this element to the page - set element_id [add_element -pretty_name $pretty_name \ - -page_id $page_id $portal_id $portlet_name] + set element_id [add_element \ + -pretty_name $pretty_name \ + -page_id $page_id \ + -force_region $force_region \ + $portal_id \ + $portlet_name ] # There is already a value for the param which is overwritten set_element_param $element_id $key $value_id Index: openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 29 Mar 2002 19:26:23 -0000 1.2 +++ openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.3 @@ -69,7 +69,7 @@ if {[llength $element_id_list] == 0} { # Tell portal to add this element to the page - set element_id [portal::add_element $portal_id [my_name]] + set element_id [portal::add_element -force_region 2 $portal_id [my_name]] # There is already a value for the param which must be overwritten portal::set_element_param $element_id community_id $instance_id set package_id_list [list] Index: openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 29 Mar 2002 19:26:23 -0000 1.12 +++ openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.13 @@ -72,6 +72,7 @@ # Tell portal to add this element to the page set element_id [portal::add_element \ -pretty_name [get_pretty_name] \ + -force_region 1 \ $portal_id \ [my_name]] Index: openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 29 Mar 2002 19:43:33 -0000 1.5 +++ openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.6 @@ -62,7 +62,11 @@ # unlike bboard-portlet # Tell portal to add this element to the page - set element_id [portal::add_element $portal_id [my_name]] + set element_id [portal::add_element \ + -force_region 1 \ + $portal_id \ + [my_name] + ] # Set the instace of "static" that this PE will know portal::set_element_param $element_id instance_id $instance_id Index: openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 29 Mar 2002 19:43:33 -0000 1.3 +++ openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 2 Apr 2002 06:13:47 -0000 1.4 @@ -59,8 +59,7 @@ } { db_transaction { # Generate the element - set element_id [portal::add_element -pretty_name [get_pretty_name -content_id $content_id] \ - $portal_id [static_portlet::my_name]] + set element_id [portal::add_element -pretty_name [get_pretty_name -content_id $content_id] -force_region 1 $portal_id [static_portlet::my_name]] # Set the parameter portal::set_element_param $element_id content_id $content_id