Index: openacs-4/packages/acs-subsite/lib/applications.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/applications.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-subsite/lib/applications.adp 2 Oct 2003 22:04:46 -0000 1.1 @@ -0,0 +1,5 @@ +

+ + +

» Add new application

+
Index: openacs-4/packages/acs-subsite/lib/applications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/applications.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-subsite/lib/applications.tcl 2 Oct 2003 22:04:46 -0000 1.1 @@ -0,0 +1,47 @@ +set admin_p [permission::permission_p -object_id [ad_conn package_id] -privilege admin] +if { $admin_p } { + set add_url [export_vars -base "[subsite::get_element -element url]admin/applications/application-add" { { return_url [ad_return_url] } }] +} + +list::create \ + -name applications \ + -multirow applications \ + -no_data "No applications" \ + -elements { + instance_name { + label "Name" + link_url_eval {$name/} + } + } + + + +set applications [list] + +foreach url [site_node::get_children -package_type apm_application -node_id [subsite::get_element -element node_id]] { + array unset node + array set node [site_node::get_from_url -url $url -exact] + + if { [permission::permission_p -object_id $node(object_id) -privilege read] } { + lappend applications [list \ + $node(instance_name) \ + $node(node_id) \ + $node(name) \ + $node(object_id)] + } +} + +# Sort them by instance_name +set applications [lsort -index 0 $applications] + +multirow create applications instance_name node_id name package_id read_p + +foreach elm $applications { + multirow append applications \ + [lindex $elm 0] \ + [lindex $elm 1] \ + [lindex $elm 2] \ + [lindex $elm 3] \ + [lindex $elm 4] +} + Index: openacs-4/packages/acs-subsite/lib/subsites.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/subsites.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/lib/subsites.tcl 2 Oct 2003 21:18:11 -0000 1.2 +++ openacs-4/packages/acs-subsite/lib/subsites.tcl 2 Oct 2003 22:04:46 -0000 1.3 @@ -6,8 +6,6 @@ set pretty_plural "subcommunities" } -set user_id [ad_conn user_id] - set admin_p [permission::permission_p -object_id [ad_conn package_id] -privilege admin] if { $admin_p } { set add_url "[subsite::get_element -element url]admin/subsite-add" @@ -17,11 +15,10 @@ list::create \ -name subsites \ -multirow subsites \ - -key node_id \ -elements { instance_name { label "Name" - link_url_eval {$name/} + link_url_col url } num_members { label "\# Members" @@ -30,26 +27,20 @@ } - -# Get the subsite node ID -set subsite_url [site_node_closest_ancestor_package_url] -array set subsite_sitenode [site_node::get -url $subsite_url] -set subsite_node_id $subsite_sitenode(node_id) - set subsites [list] set package_ids [list] -foreach url [site_node::get_children -package_type apm_service -node_id $subsite_node_id] { +foreach url [site_node::get_children -package_key acs-subsite -node_id [subsite::get_element -element node_id]] { array unset node array set node [site_node::get_from_url -url $url -exact] - if { [string equal $node(package_key) "acs-subsite"] } { + if { [permission::permission_p -object_id $node(object_id) -privilege read] } { lappend subsites [list \ $node(instance_name) \ $node(node_id) \ $node(name) \ $node(object_id) \ - [permission::permission_p -object_id $node(object_id) -privilege read]] + $node(url)] lappend package_ids $node(object_id) } } @@ -72,7 +63,7 @@ # Sort them by instance_name set subsites [lsort -index 0 $subsites] -multirow create subsites instance_name node_id name package_id read_p num_members +multirow create subsites instance_name node_id name package_id url num_members foreach elm $subsites { set package_id [lindex $elm 3] Index: openacs-4/packages/acs-subsite/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/Attic/index-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/index-oracle.xql 17 May 2003 09:58:56 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/index-oracle.xql 2 Oct 2003 22:04:46 -0000 1.4 @@ -3,15 +3,6 @@ oracle8.1.6 - - - - select acs_object.name(:package_id) from dual - - - - - Index: openacs-4/packages/acs-subsite/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/Attic/index-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/index-postgresql.xql 17 May 2003 09:58:56 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/index-postgresql.xql 2 Oct 2003 22:04:46 -0000 1.6 @@ -3,23 +3,17 @@ postgresql7.1 - - - - select acs_object__name(:package_id) - - - - - select site_node__url(n.node_id) as url, acs_object__name(n.object_id) as name - from site_nodes n + from site_nodes n, apm_packages p, apm_package_types t where n.parent_id = :node_id - and n.object_id is not null and acs_permission__permission_p(n.object_id, :user_id, 'read') = 't' + and p.package_id = n.object_id + and t.package_key = p.package_key + and t.package_type = 'apm_service' + and t.package_key != 'acs-subsite' order by name Index: openacs-4/packages/acs-subsite/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/index.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-subsite/www/index.adp 2 Oct 2003 10:34:45 -0000 1.11 +++ openacs-4/packages/acs-subsite/www/index.adp 2 Oct 2003 22:04:46 -0000 1.12 @@ -1,44 +1,34 @@ @context;noquote@ - +
- - Leave community - - - - - Join community - - - Request membership - + + + Leave community - + + + + Join community + + + Request membership + + + + + + Admin +

Applications

- +

@communities_label@

Index: openacs-4/packages/acs-subsite/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/index.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-subsite/www/index.tcl 22 Sep 2003 11:20:47 -0000 1.12 +++ openacs-4/packages/acs-subsite/www/index.tcl 2 Oct 2003 22:04:46 -0000 1.13 @@ -35,17 +35,11 @@ set user_id [ad_conn user_id] -set subsite_name [db_string name { - select acs_object.name(:package_id) from dual -}] +set subsite_name [ad_conn instance_name] set subsite_url [subsite::get_element -element url] -set node_id [ad_conn node_id] -db_multirow nodes site_nodes {} - - # User's group membership set group_id [application_group::group_id_from_package_id] Index: openacs-4/packages/acs-subsite/www/admin/applications/application-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/applications/Attic/application-add-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/applications/application-add-oracle.xql 28 Aug 2003 09:41:40 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/applications/application-add-oracle.xql 2 Oct 2003 22:04:46 -0000 1.3 @@ -10,6 +10,7 @@ from apm_package_types where not (apm_package.singleton_p(package_key) = 1 and apm_package.num_instances(package_key) >= 1) + and package_key != 'acs-subsite' order by upper(pretty_name) Index: openacs-4/packages/acs-subsite/www/admin/applications/application-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/applications/Attic/application-add-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/applications/application-add-postgresql.xql 28 Aug 2003 09:41:40 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/applications/application-add-postgresql.xql 2 Oct 2003 22:04:46 -0000 1.3 @@ -10,6 +10,7 @@ from apm_package_types where not (apm_package__singleton_p(package_key) = 1 and apm_package__num_instances(package_key) >= 1) + and package_key != 'acs-subsite' order by upper(pretty_name) Index: openacs-4/packages/acs-subsite/www/admin/applications/application-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/applications/application-add.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/admin/applications/application-add.tcl 2 Oct 2003 14:56:57 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/admin/applications/application-add.tcl 2 Oct 2003 22:04:46 -0000 1.5 @@ -6,6 +6,7 @@ @cvs-id $Id$ } { node_id:integer,optional + {return_url "."} } set page_title "New Application" @@ -20,6 +21,7 @@ } ad_form -name application -cancel_url . -form { + {return_url:text(hidden),optional} {node_id:key} {package_key:text(select) {label "Application"} @@ -37,6 +39,8 @@ {help_text "This should be a short string, all lowercase, with hyphens instead of spaces, whicn will be used in the URL of the new application. If you leave this blank, we will generate one for you from name of the application."} {html {size 30}} } +} -new_request { + # Sets return_url } -edit_request { array set node [site_node::get -node_id $node_id] set package_key $node(package_key) @@ -96,6 +100,6 @@ site_node::rename -node_id $node_id -name $folder } } -after_submit { - ad_returnredirect . + ad_returnredirect $return_url ad_script_abort }