ad_page_contract {
@author rhs@mit.edu
@author bquinn@arsidigta.com
@creation-date 2000-09-09
@cvs-id $Id: site-map.tcl,v 1.1.2.3 2005/01/14 18:15:58 vivianh Exp $
} {
{expand:integer,multiple ""}
{new_parent:integer ""}
{new_type ""}
{root_id:integer ""}
{new_application:integer ""}
{rename_application:integer {}}
}
if {[empty_string_p $root_id]} {
set root_id [ad_conn node_id]
}
# We do a check for the admin privilege because a user could have
# admin privilege on a site_node that has other site_nodes beneath it
# 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
}
if {![empty_string_p $new_parent]} {
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()\""
} elseif {![empty_string_p $rename_application]} {
set javascript "onLoad=\"javascript:document.rename_application.instance_name.focus();document.rename_application.instance_name.select()\""
} else {
set javascript ""
}
set javascript "onload=\"javascript:document.check_checkbox()\""
set parent_link ".?[export_url_vars expand:multiple root_id=$parent_id]"
set page_title "Build Your Site Map "
set context [list [list "." "Site Map"] $page_title]
set user_id [ad_conn user_id]
db_foreach path_select {} {
if {$node_id != $root_id && $admin_p == "t"} {
append head ""
}
if {[empty_string_p $name]} {
append head "$obj_name:"
} else {
append head $name
}
if {$node_id != $root_id && $admin_p == "t"} {
append head ""
}
if {$directory_p == "t"} {
append head "/"
}
} if_no_rows {
append head " "
}
if {[llength $expand] == 0} {
lappend expand $root_id
if { ![empty_string_p $parent_id] } {
lappend expand $parent_id
}
}
set return_url [ad_return_url]
template::list::create \
-name nodes \
-multirow nodes \
-key node_id \
-has_checkboxes \
-bulk_actions {
"Allow for view (Publish)" "allow-for-view"
} \
-bulk_action_method post \
-bulk_action_export_vars { return_url } \
-elements {
checkbox {
display_template {