| |
1 |
1 |
ad_page_contract { |
| |
2 |
2 |
packages/editthispage/www/index.vuh |
| |
3 |
3 |
|
| |
4 |
4 |
@author Luke Pond (dlpond@pobox.com) |
| |
5 |
5 |
@creation-date 2001-06-01 |
| |
6 |
6 |
|
| |
7 |
7 |
Virtual URL Handler to serve files from an |
| |
8 |
8 |
instance of the Edit This Page package. |
| |
9 |
9 |
|
| |
10 |
10 |
Helpful .vuh example at |
| |
11 |
11 |
http://www.arsdigita.com/bboard/q-and-a-fetch-msg?msg_id=000JTn |
| |
12 |
12 |
} { |
| |
13 |
13 |
{revision_id ""} |
| |
14 |
14 |
} |
| |
15 |
15 |
|
| |
16 |
16 |
ad_conn -set revision_id $revision_id |
| |
17 |
17 |
|
| |
18 |
18 |
# get the portion of the url following the package directory |
| |
19 |
19 |
set name [ad_conn path_info] |
| |
20 |
20 |
|
| |
21 |
|
ns_log Notice "index.vuh: request for $name" |
| |
|
21 |
#ns_log Notice "index.vuh: request for $name" |
| |
22 |
22 |
|
| |
23 |
23 |
if { [string index $name end] == "/" } { |
| |
24 |
24 |
# it's in a subdirectory, and we know there's no |
| |
25 |
25 |
# other package mounted on that subdirectory. |
| |
26 |
26 |
ns_returnnotfound |
| |
27 |
27 |
} |
| |
28 |
28 |
|
| |
29 |
29 |
set server_root [file dirname [ns_info pageroot]] |
| |
30 |
30 |
|
| |
31 |
31 |
if {[empty_string_p $name] || $name == "index"} { |
| |
32 |
32 |
set path "$server_root/[etp::get_application_param index_template]" |
| |
33 |
33 |
} elseif {[string match "etp*" $name]} { |
| |
34 |
34 |
# this trickery is for serving pages from the top level, |
| |
35 |
35 |
# where the acs-subsite package is mounted rather than |
| |
36 |
36 |
# the editthispage package. normally the request processor |
| |
37 |
37 |
# finds these before invoking this file. |
| |
38 |
38 |
set path "$server_root/packages/edit-this-page/www/$name" |
| |
39 |
39 |
} else { |
| |
40 |
40 |
|
| |
41 |
41 |
set path "$server_root/[etp::get_application_param content_template]" |