Index: openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.7 +++ openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 13 May 2002 06:00:06 -0000 1.8 @@ -66,13 +66,13 @@ } ad_proc -public remove_self_from_page { - portal_id + {-portal_id:required} } { Removes the bboard admin PE from the portal } { portal::remove_element \ -portal_id $portal_id \ - -datasource_name [get_my_name] + -portlet_name [get_my_name] } ad_proc -public show { 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 -r1.114 -r1.115 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 12 May 2002 18:18:55 -0000 1.114 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 13 May 2002 06:00:06 -0000 1.115 @@ -544,12 +544,26 @@ # Take care of the admins set admin_segment_id [get_rel_segment_id -community_id $community_id -rel_type dotlrn_admin_rel] permission::revoke -party_id $admin_segment_id -object_id $community_id -privilege "admin" + + # a useful bit of code to find privs that you may not have properly revoked + # set foo [db_list_of_lists select_outstanding_privs { + # select o.object_id, object_type, privilege + # from acs_objects o, acs_permissions p + # where o.object_id = p.object_id + # and p.grantee_id = :admin_segment_id + # }] + # ad_return_complaint 1 "$foo" + # end + rel_segments_delete $admin_segment_id # Take care of the members set member_segment_id [get_rel_segment_id -community_id $community_id -rel_type dotlrn_member_rel] - permission::revoke -party_id $member_segment_id -object_id $community_id -privilege "edit" + permission::revoke -party_id $member_segment_id -object_id $community_id -privilege "read" + permission::revoke -party_id $member_segment_id -object_id $community_id -privilege "write" + rel_segments_delete $member_segment_id + } ad_proc -public list_admin_users { @@ -1354,20 +1368,28 @@ where community_id = :community_id } - # call the communitie's delete pl/sql, which removes - # the group + db_dml update_portal_id { + update dotlrn_communities + set portal_id = NULL + where community_id = :community_id + } - ad_return_complaint 1 "aks4" + db_dml update_admin_portal_id { + update dotlrn_communities + set admin_portal_id = NULL + where community_id = :community_id + } - db_exec_plsql \ - remove_community \ - "begin dotlrn_community.delete(:community_id); end;" + db_dml update_non_member_portal_id { + update dotlrn_communities + set non_member_portal_id = NULL + where community_id = :community_id + } - ad_return_complaint 1 "aks3" - # delete the rel segments delete_rel_segments -community_id $community_id + if {![empty_string_p $admin_portal_id]} { portal::delete $admin_portal_id } @@ -1380,6 +1402,23 @@ portal::delete $portal_id } + # a useful bit of code to find packages + # set foo [db_list_of_lists select_outstanding_packages { + # select o.object_id, o.object_type, package_key, + # from acs_objects o, apm_packages + # where o.context_id = :community_id + # and o.object_id = package_id + # }] + # ad_return_complaint 1 "$foo" + + + # call the communitie's delete pl/sql, which removes the group + db_exec_plsql \ + remove_community \ + "begin dotlrn_community.delete(:community_id); end;" + + ad_return_complaint 1 "aks6" + # Remove the package db_exec_plsql delete_package "begin acs_object.delete(:package_id) end;" } 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.49 -r1.50 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 12 May 2002 20:51:52 -0000 1.49 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 13 May 2002 06:00:06 -0000 1.50 @@ -177,6 +177,37 @@ } } + ad_proc -public get_community_applet_node_id { + {-community_id:required} + {-package_key:required} + } { + returns the node_id of the applet in the given community. + this should probably be done by querying the dotlrn_community_applets table + directly, but we can do it through site_map:: too + } { + set parent_node_id [site_nodes::get_node_id_from_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] + ] + + return [site_nodes::get_node_id_from_child_name \ + -parent_node_id $parent_node_id \ + -name $package_key] + + } + + ad_proc -public get_community_applet_package_id { + {-community_id:required} + {-package_key:required} + } { + like above but returns the pacakge_id + } { + set node_id [get_community_applet_node_id \ + -community_id $community_id \ + -package_key $package_key + ] + return [site_nodes::get_package_id_from_node_id -node_id $node_id] + } + ad_proc -public unmount_community_applet_package { {-community_id:required} {-package_key:required} @@ -185,14 +216,11 @@ should be in dotlrn_community:: } { db_transaction { - set parent_node_id [site_nodes::get_node_id_from_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] + set child_node_id [get_community_applet_node_id \ + -community_id $community_id \ + -package_key $package_key ] - - set child_node_id [site_nodes::get_node_id_from_child_name \ - -parent_node_id $parent_node_id \ - -name $package_key] - + # site node del package instance site_node_delete_package_instance -node_id $child_node_id } Index: openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 12 May 2002 18:15:03 -0000 1.36 +++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 13 May 2002 06:00:06 -0000 1.37 @@ -57,7 +57,10 @@ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] # Mount the package - dotlrn_applet::mount -package_key "dotlrn-bboard" -url "bboard" -pretty_name "Bboards" + dotlrn_applet::mount \ + -package_key "dotlrn-bboard" \ + -url "bboard" \ + -pretty_name "Bboards" } } @@ -134,7 +137,50 @@ } { remove the applet from the given community } { - ad_return_complaint 1 "aks1" + set portal_id [dotlrn_community::get_portal_id \ + -community_id $community_id + ] + + + # ug, can't use the package_key proc here since this uses site_nodes:: + # we need to use the name it's mounted with "forums" instead FIXME + set package_id [dotlrn::get_community_applet_package_id \ + -community_id $community_id \ + -package_key "forums" + ] + + # revoke the member's privs + set members [dotlrn_community::get_rel_segment_id \ + -community_id $community_id \ + -rel_type dotlrn_member_rel + ] + + permission::revoke -party_id $members -object_id $package_id -privilege bboard_read_forum + permission::revoke -party_id $members -object_id $package_id -privilege bboard_read_category + permission::revoke -party_id $members -object_id $package_id -privilege bboard_read_message + permission::revoke -party_id $members -object_id $package_id -privilege bboard_create_message + + # remove the admin portlet + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] + bboard_admin_portlet::remove_self_from_page -portal_id $admin_portal_id + + # remove the portlet + bboard_portlet::remove_self_from_page $portal_id $package_id + + set auto_create_forum_p [oacs_util::parameter \ + -package_key "dotlrn-bboard" \ + -key "auto_create_forum_p" + ] + + if {[string equal $auto_create_forum_p "t"]} { + ad_return_complaint 1 "no bboard delete proc" + } + + # unmount from the site-map + set node_id [site_nodes::get_node_id_from_package_id -package_id $package_id] + site_node_delete_package_instance -node_id $node_id } ad_proc -public add_user { 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 -r1.51 -r1.52 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 12 May 2002 18:15:03 -0000 1.51 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 13 May 2002 06:00:06 -0000 1.52 @@ -237,7 +237,9 @@ # remove the portlets, params will cascade # first the admin portlet, from the comm's admin portal - set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] portal::remove_element \ -portal_id $admin_portal_id \ Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 12 May 2002 18:15:03 -0000 1.24 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 13 May 2002 06:00:06 -0000 1.25 @@ -69,31 +69,38 @@ Add the dotlrn applet to a specific community } { set pt_id [dotlrn_community::get_portal_id -community_id $community_id] - dotlrn_portlet::add_self_to_page -portal_id $pt_id -community_id $community_id + dotlrn_portlet::add_self_to_page -portal_id $pt_id -community_id $community_id if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { return } # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - dotlrn_admin_portlet::add_self_to_page -portal_id $admin_portal_id -community_id $community_id + dotlrn_admin_portlet::add_self_to_page \ + -portal_id $admin_portal_id \ + -community_id $community_id return $community_id } - ad_proc -public remove_applet { + ad_proc -public remove_applet_from_community { community_id - package_id } { - remove the applet from the community + remove the dotlrn applet from a specific community } { - # Remove all instances of the dotlrn portlet! (this is some serious stuff!) + set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] + dotlrn_admin_portlet::remove_self_from_page -portal_id $admin_portal_id - # Dropping all messages, forums + set pt_id [dotlrn_community::get_portal_id -community_id $community_id] + dotlrn_portlet::remove_self_from_page -portal_id $pt_id + } - # Killing the package - + ad_proc -public remove_applet { + package_id + } { + remove the applet from dotlrn + } { } ad_proc -public add_user { Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 12 May 2002 18:35:20 -0000 1.9 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 13 May 2002 06:00:06 -0000 1.10 @@ -96,11 +96,19 @@ return $community_id } + ad_proc -public remove_applet_from_community { + community_id + } { + remove the dotlrn members applet from a specific community + } { + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + dotlrn_members_portlet::remove_self_from_page -portal_id $portal_id + } + ad_proc -public remove_applet { - community_id package_id } { - remove the applet from the community + remove the applet from dotlrn } { } Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 12 May 2002 18:15:03 -0000 1.6 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 13 May 2002 06:00:06 -0000 1.7 @@ -55,11 +55,21 @@ ad_proc -public add_applet_to_community { community_id } { - Add the dotlrn applet to a specific community + Add the dotlrn members staff applet to a specific community } { set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + dotlrn_members_staff_portlet::add_self_to_page \ + -portal_id $portal_id \ + -community_id $community_id + } - dotlrn_members_staff_portlet::add_self_to_page -portal_id $portal_id -community_id $community_id + ad_proc -public remove_applet_from_community { + community_id + } { + removes the dotlrn members staff applet from a community + } { + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + dotlrn_members_staff_portlet::remove_self_from_page -portal_id $portal_id } ad_proc -public remove_applet { Index: openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 12 May 2002 18:15:03 -0000 1.30 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 13 May 2002 06:00:06 -0000 1.31 @@ -92,30 +92,32 @@ } ad_proc -public remove_applet_from_community { - comminuty_id + community_id } { Drops the faq applet from the given community } { # remove the faq admin portlet from the comm's admin page set admin_portal_id \ - [dotlrn_community::get_admin_portal_id -community_id $community_id] - set admin_element_id [portal::get_element_ids_by_ds \ - $admin_portal_id \ - [faq_admin_portlet::get_my_name] - ] + [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] - portal::remove_element $admin_element_id + portal::remove_element \ + -portal_id $admin_portal_id \ + -portlet_name [faq_admin_portlet::get_my_name] # remove the faq portlet from the comm's portal set portal_id \ [dotlrn_community::get_portal_id -community_id $community_id] - portal::remove_element [portal::get_element_ids_by_ds \ - $portal_id \ - [faq_portlet::get_my_name] - ] + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [faq_portlet::get_my_name] - + site_node_delete_package_instance \ + -node_id [dotlrn::get_community_applet_node_id \ + -community_id $community_id \ + -package_key [package_key]] } ad_proc -public add_user { Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -r1.59 -r1.60 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 12 May 2002 18:15:03 -0000 1.59 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 13 May 2002 06:00:06 -0000 1.60 @@ -237,11 +237,49 @@ set root_folder_id [fs::get_root_folder -package_id $package_id] set public_folder_id [get_public_folder_id -parent_id $root_folder_id] + set admins [dotlrn_community::get_rel_segment_id \ + -community_id $community_id \ + -rel_type dotlrn_admin_rel \ + ] + permission::revoke -party_id $admins -object_id $root_folder_id -privilege "admin" + + set members [dotlrn_community::get_rel_segment_id \ + -community_id $community_id \ + -rel_type dotlrn_member_rel \ + ] + permission::revoke -party_id $members -object_id $root_folder_id -privilege "read" + # remove the portlet from the non_member_portal - set non_member_portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] - fs_portlet::remove_self_to_page $non_member_portal_id $package_id $public_folder_id + set non_member_portal_id \ + [dotlrn_community::get_non_member_portal_id -community_id $community_id] - ad_return_complaint 1 "aks1" + fs_portlet::remove_self_from_page \ + $non_member_portal_id \ + $package_id \ + $public_folder_id + + # set node_id [site_nodes::get_node_id_from_package_id -package_id $package_id] + + # just unmount fs, dont attempt of delete the package + # the delete_p flag deletes the "node" not the "package" like other + # procs do + + # aks fixme - need to re-factor, re-name all deletetion procs + # both in dotlrn and in site_nodes + # site_map_unmount_application -delete_p "t" $node_id + + # aks hack deleting the root folder + db_dml delete_root_folder { + delete from fs_root_folders where folder_id = :root_folder_id + } + + db_exec_plsql delete_content_folder { + declare + begin + content_folder.delete(:root_folder_id); + end; + } + } ad_proc -public add_user { @@ -450,8 +488,6 @@ get the folder_id for the public folder given the parent folder id } { set foo [fs::get_folder -name "public" -parent_id $parent_id] - - ad_return_complaint 1 $foo } ad_proc -public get_user_root_folder_name { Index: openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 12 May 2002 18:15:03 -0000 1.20 +++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 13 May 2002 06:00:06 -0000 1.21 @@ -79,29 +79,55 @@ return } - # REVISIT this (ben) - set node_id [site_node_id [ad_conn url]] - # create the news package instance (all in one, I've mounted it) set package_key [package_key] set package_id [dotlrn::instantiate_and_mount $community_id $package_key] - news_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id + news_portlet::add_self_to_page \ + -portal_id $portal_id \ + -package_id $package_id # set up the DS for the admin portal - set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] - news_admin_portlet::add_self_to_page -portal_id $admin_portal_id -package_id $package_id + news_admin_portlet::add_self_to_page \ + -portal_id $admin_portal_id \ + -package_id $package_id return $package_id } - ad_proc -public remove_applet { + ad_proc -public remove_applet_from_community { community_id - package_id } { remove the applet from the community } { + set package_id [dotlrn::get_community_applet_package_id \ + -community_id $community_id \ + -package_key [package_key] + ] + + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] + + set portal_id [dotlrn_community::get_portal_id \ + -community_id $community_id + ] + + news_admin_portlet::remove_self_from_page \ + -portal_id $admin_portal_id + + news_portlet::remove_self_from_page \ + -portal_id $portal_id \ + -package_id $package_id + + site_node_delete_package_instance \ + -node_id [dotlrn::get_community_applet_node_id \ + -community_id $community_id \ + -package_key [package_key]] } ad_proc -public add_user { @@ -139,7 +165,9 @@ set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] set portal_id [dotlrn::get_workspace_portal_id $user_id] - news_portlet::remove_self_from_page $portal_id $package_id + news_portlet::remove_self_from_page \ + -portal_id $portal_id \ + -package_id $package_id } ad_proc -public add_portlet { 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 -r1.8 -r1.9 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 12 May 2002 18:15:03 -0000 1.8 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 13 May 2002 06:00:06 -0000 1.9 @@ -72,7 +72,7 @@ } ad_proc -public remove_self_from_page { - portal_id + {-portal_id:required} } { Removes a dotlrn PE from the given portal } { Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 12 May 2002 18:35:20 -0000 1.8 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 13 May 2002 06:00:06 -0000 1.9 @@ -66,6 +66,16 @@ return $element_id } + ad_proc -public remove_self_from_page { + {-portal_id:required} + } { + Removes the dotlrn "memebers" PE from the given portal + } { + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + } + ad_proc -public show { cf } { @@ -76,14 +86,4 @@ -template_src "dotlrn-members-portlet" } - ad_proc -public remove_self_from_page { - portal_id - } { - Removes the dotlrn "memebers" PE from the given portal - } { - portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] - } - } 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 -r1.6 -r1.7 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 12 May 2002 18:15:03 -0000 1.6 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 13 May 2002 06:00:06 -0000 1.7 @@ -68,8 +68,7 @@ } ad_proc -public remove_self_from_page { - portal_id - community_id + {-portal_id:required} } { Removes the PE from the given page } { 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 -r1.31 -r1.32 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 12 May 2002 18:35:20 -0000 1.31 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 13 May 2002 06:00:06 -0000 1.32 @@ -73,17 +73,8 @@ return $element_id } - ad_proc -public show { - cf - } { - } { - portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf - } - ad_proc -public remove_self_from_page { - portal_id + {-portal_id:required} } { Removes the dotlrn PE from the portal. } { @@ -93,4 +84,13 @@ -portlet_name [get_my_name] } + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf + } + } Index: openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 12 May 2002 18:15:04 -0000 1.17 +++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 13 May 2002 06:00:06 -0000 1.18 @@ -83,7 +83,6 @@ Add the static applet to a dotlrn community } { set community_type [dotlrn_community::get_community_type_from_community_id $community_id] - set portal_id [dotlrn_community::get_portal_id -community_id $community_id] # If i'm in a class, add a portlet called "class (pn) info" @@ -107,18 +106,15 @@ -pretty_name "[dotlrn::parameter subcommunities_pretty_name] Info" ] - static_portal_content::add_to_portal -content_id $content_id -portal_id $portal_id - + static_portal_content::add_to_portal -content_id $content_id -portal_id $portal_id } else { - set content_id [static_portal_content::new \ -package_id $community_id \ -content " " \ -pretty_name "[dotlrn::parameter class_instances_pretty_name] Info" ] static_portal_content::add_to_portal -content_id $content_id -portal_id $portal_id - } if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { @@ -127,20 +123,34 @@ # the non-member page gets the same static portlet set n_p_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] - static_portal_content::add_to_portal -content_id $content_id -portal_id $n_p_id # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] static_admin_portlet::add_self_to_page -portal_id $admin_portal_id -package_id $community_id + } + ad_proc -public remove_applet_from_community { + community_id + } { + Remove static applet from a dotlrn community + } { + set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] + static_admin_portlet::remove_self_from_page -portal_id $admin_portal_id + + set n_p_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] + static_portal_content::remove_all_from_portal -portal_id $n_p_id + + # remove all static content + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + static_portal_content::remove_all_from_portal -portal_id $portal_id } + ad_proc -public remove_applet { - community_id package_id } { - remove the applet from the community + remove the applet from dotlrn } { } Index: openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl 9 May 2002 23:59:53 -0000 1.2 +++ openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl 13 May 2002 06:00:06 -0000 1.3 @@ -60,6 +60,14 @@ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] } + ad_proc -public remove_applet { + community_id + package_id + } { + remove the applet from dotlrn + } { + } + ad_proc -public add_applet_to_community { community_id } { @@ -71,14 +79,20 @@ syllabus_admin_portlet::add_self_to_page $pt_id $community_id } - ad_proc -public remove_applet { + # aks XXX FIXME - i think these procs are messed up somehow. + # is it just ordering? i can't tell + + ad_proc -public remove_applet_from_community { community_id - package_id } { - remove the applet from the community } { + set pt_id \ + [dotlrn_community::get_community_admin_portal_id $community_id] + + syllabus_admin_portlet::remove_self_to_page $pt_id $community_id } + ad_proc -public add_user { user_id } { Index: openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl 10 May 2002 06:35:15 -0000 1.3 +++ openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl 13 May 2002 06:00:06 -0000 1.4 @@ -74,20 +74,21 @@ } { set pt_id [dotlrn_community::get_portal_template_id $community_id] + syllabus_portlet::add_self_to_page $pt_id $community_id + if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { - syllabus_portlet::add_self_to_page $pt_id $community_id return } - syllabus_portlet::add_self_to_page $pt_id $community_id - dotlrn_syllabus_admin::add_applet_to_community $community_id } ad_proc -public remove_applet_from_community { community_id } { } { + dotlrn_syllabus_admin::remove_applet_to_community $community_id + syllabus_portlet::remove_self_from_page $pt_id $community_id } ad_proc -public add_user { 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 -r1.139 -r1.140 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 12 May 2002 18:15:03 -0000 1.139 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 13 May 2002 06:00:07 -0000 1.140 @@ -1042,7 +1042,7 @@ that datasource on the portal. An element_id overrides all other params } { if {![empty_string_p $element_id]} { - db_dml delete {} + db_dml delete {} } else { if {[empty_string_p $portal_id] && [empty_string_p $portlet_name]} { ad_return_complaint 1 "portal::remove_element error bad params! \n @@ -1810,7 +1810,7 @@ if {[llength [get_element_param_list \ -element_id $element_id \ -key $key]] == 0} { - remove_element $element_id + remove_element -element_id $element_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 -r1.5 -r1.6 --- openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.5 +++ openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 13 May 2002 06:00:07 -0000 1.6 @@ -70,7 +70,7 @@ } ad_proc -public remove_self_from_page { - portal_id + {-portal_id:required} } { Removes a news admin PE from the given page } { 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 -r1.16 -r1.17 --- openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.16 +++ openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 13 May 2002 06:00:07 -0000 1.17 @@ -70,8 +70,8 @@ } ad_proc -public remove_self_from_page { - portal_id - package_id + {-portal_id:required} + {-package_id:required} } { Removes a news PE from the given page or the package_id of the news pacakge from the portlet if there are others remaining 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 -r1.9 -r1.10 --- openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.9 +++ openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 13 May 2002 06:00:07 -0000 1.10 @@ -73,7 +73,7 @@ } ad_proc -public remove_self_from_page { - portal_id + {-portal_id:required} } { Removes static PE from the given page } { 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 -r1.7 -r1.8 --- openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 12 May 2002 18:15:04 -0000 1.7 +++ openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 13 May 2002 06:00:07 -0000 1.8 @@ -69,6 +69,25 @@ } } + ad_proc -public remove_from_portal { + {-content_id:required} + {-portal_id:required} + } { + ad_return_complaint 1 "static_portal_content::remove_from_portal not implimented" + } + + ad_proc -public remove_all_from_portal { + {-portal_id:required} + } { + db_transaction { + # should remove all of 'em + set element_id [portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [static_portlet::get_my_name] + ] + } + } + ad_proc -public update { {-content_id:required} {-content:required}