Index: openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl 28 Aug 2003 09:41:41 -0000 1.14 +++ openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl 8 Sep 2003 09:48:52 -0000 1.15 @@ -23,23 +23,23 @@ # that the user does not have admin privilege on. If we don't do this # check, the user could end up making changes on site_nodes that he # does not have the admin privilege for. - + array set node [site_node::get -node_id $root_id] set parent_id $node(parent_id) set object_id $node(object_id) if {![empty_string_p $object_id]} { - ad_require_permission $object_id admin + ad_require_permission $object_id admin } if {![empty_string_p $new_parent]} { - set javascript "onLoad=\"javascript:document.new_parent.name.focus();document.new_parent.name.select()\"" + set javascript "onLoad=\"javascript:document.new_parent.name.focus();document.new_parent.name.select()\"" } elseif {![empty_string_p $new_application]} { - set javascript "onLoad=\"javascript:document.new_application.instance_name.focus();document.new_application.instance_name.select()\"" + set javascript "onLoad=\"javascript:document.new_application.instance_name.focus();document.new_application.instance_name.select()\"" } elseif {![empty_string_p $rename_application]} { - set javascript "onLoad=\"javascript:document.rename_application.instance_name.focus();document.rename_application.instance_name.select()\"" + set javascript "onLoad=\"javascript:document.rename_application.instance_name.focus();document.rename_application.instance_name.select()\"" } else { - set javascript "" + set javascript "" } set parent_link ".?[export_url_vars expand:multiple root_id=$parent_id]" @@ -54,44 +54,49 @@

- » Create new application +» Create new application

-
- - -
- - + + + -
" + + +
" set user_id [ad_conn user_id] db_foreach path_select {} { - if {$node_id != $root_id && $admin_p == "t"} { - doc_body_append "" - } - if {[empty_string_p $name]} { - doc_body_append "$obj_name:" - } else { - doc_body_append $name - } + if {$node_id != $root_id && $admin_p == "t"} { + doc_body_append "" + } + if {[empty_string_p $name]} { + doc_body_append "$obj_name:" + } else { + doc_body_append $name + } - if {$node_id != $root_id && $admin_p == "t"} { - doc_body_append "" - } + if {$node_id != $root_id && $admin_p == "t"} { + doc_body_append "" + } - if {$directory_p == "t"} { - doc_body_append "/" - } + if {$directory_p == "t"} { + doc_body_append "/" + } } if_no_rows { - doc_body_append " " + doc_body_append " " } doc_body_append " -
-
+
- + + + + + + " if {[llength $expand] == 0} { @@ -108,80 +113,92 @@ set open_nodes [list] db_foreach nodes_select {} { if { [lsearch -exact $open_nodes $parent_id] == -1 && $parent_id != "" && $mylevel > 2 } { continue } - doc_body_append "" + doc_body_append "" + if {!$root_p && $root_id != $node_id} { + doc_body_append "" + } + doc_body_append "$name" + if {!$root_p && $root_id != $node_id} { + doc_body_append "" + } - set controls [list] + doc_body_append [ad_decode $directory_p t / f ""] - if {$directory_p == "t"} { - lappend controls "new sub folder" - if {[empty_string_p $object_id]} { - lappend controls "mount" - lappend controls "new application" - } else { - # This makes sure you can't unmount the thing that is serving - # the page you're looking at. - if {[ad_conn node_id] != $node_id} { - lappend controls "unmount" - } + doc_body_append " [join $dir_controls " | "] " - # Is the object a package? - if {![empty_string_p $package_id]} { - if {$object_admin_p && ($parameter_count > 0)} { - lappend controls "parameters" - } - } - # Add a link to control permissioning - if {$object_admin_p} { - lappend controls "permissions" - lappend controls "rename" - lappend controls "delete" - } - } - } - - if {[ad_conn node_id] != $node_id && $n_children == 0 && [empty_string_p $object_id]} { - lappend controls "delete" - } doc_body_append "
URLInstance NamePackage Type 
URLInstance NamePackage Type 
" - for {set i 0} {$i < 3*$mylevel} {incr i} { - doc_body_append " " - } - if {!$root_p && $n_children > 0} { - set link "+" - set urlvars [list] - foreach n $expand { - if {$n == $node_id} { - set link "-" - lappend open_nodes "$node_id" - } else { - lappend urlvars "expand=$n" - } + # set up commands to put in the various columns + set controls [list] + set dir_controls [list] + set name_controls [list] + + if {$directory_p == "t"} { + lappend controls "add folder" + if {[empty_string_p $object_id]} { + lappend controls "mount" + lappend controls "new application" + } else { + # This makes sure you can't unmount the thing that is serving + # the page you're looking at. + if {[ad_conn node_id] != $node_id} { + lappend controls "unmount" + } + + # Is the object a package? + if {![empty_string_p $package_id]} { + if {$object_admin_p && ($parameter_count > 0)} { + lappend controls "parameters" + } + } + + # Add a link to control permissioning + if {$object_admin_p} { + lappend controls "permissions" + lappend controls "rename" + lappend controls "delete" + } + } } + + if {[ad_conn node_id] != $node_id && $n_children == 0 && [empty_string_p $object_id]} { + lappend controls "delete" + } - if {[string equal $link "+"]} { - lappend urlvars "expand=$node_id" + doc_body_append "
" + + # use the indent variable to hold current indent level + # we'll use it later to indent stuff at the end by the amount + # of the last node + set indent "" + for {set i 0} {$i < 3*$mylevel} {incr i} { + append indent " " } + doc_body_append $indent - lappend urlvars "root_id=$root_id" + if {!$root_p && $n_children > 0} { + set link "+" + set urlvars [list] + foreach n $expand { + if {$n == $node_id} { + set link "-" + lappend open_nodes "$node_id" + } else { + lappend urlvars "expand=$n" + } + } - doc_body_append "($link) " - } else { - doc_body_append "    " - } + if {[string equal $link "+"]} { + lappend urlvars "expand=$node_id" + } - doc_body_append "" - if {!$root_p && $root_id != $node_id} { - doc_body_append "" - } - doc_body_append "$name" - if {!$root_p && $root_id != $node_id} { - doc_body_append "" - } + lappend urlvars "root_id=$root_id" - doc_body_append [ad_decode $directory_p t / f ""] + doc_body_append "($link) " + } else { + doc_body_append "    " + } - doc_body_append "" @@ -209,11 +226,12 @@ [export_form_vars expand:multiple root_id node_id rename_package_id] + " } else { - doc_body_append "$object_name" + doc_body_append "$object_name" } if {![empty_string_p $object_id] || $new_application != $node_id } { @@ -242,61 +260,48 @@ } doc_body_append " -
-
- -
- -
-" - -doc_body_append " -

-

Applications
-

- + +
[export_form_vars expand:multiple] - Mount new application of type - [apm_application_new_checkbox] + $indent - - with package name at node name + + [apm_application_new_checkbox] - - + +
+ + + + + + + + " doc_body_append "

Manage unmounted applications

-

-

Configurable Services
- +

Set Parameters

- - - [ad_footer] "