3 # First of all, let's load HELM configuration
5 my $HELM_LIB_DIR = $ENV{"HELM_LIB_DIR"};
6 # this should be the only fixed constant
7 my $DEFAULT_HELM_LIB_DIR = "/projects/helm/on-line/local/lib/helm";
8 if (defined ($HELM_LIB_DIR)) {
9 $HELM_LIB_PATH = $HELM_LIB_DIR."/configuration.pl";
11 $HELM_LIB_PATH = $DEFAULT_HELM_LIB_DIR."/configuration.pl";
14 # next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm
15 require $HELM_LIB_PATH;
21 my $cgi = new CGI($ENV{"REQUEST_URL"});
22 $uri = $cgi->param('theoryuri');
23 $uri =~ s/(.*)\/$/$1/; # Remove a final slash if present
24 $uri .= "/"; # Put a final slash
27 $cont = ""; # modified by side-effect by &callback
28 my $ua = LWP::UserAgent->new;
29 my $request = HTTP::Request->new(GET => $getter_url."ls?format=txt&baseuri=".$uri);
30 my $response = $ua->request($request, \&callback);
32 @filenames = split(/\n/, $cont);
35 $uridotdot =~ s/(.*)\/.+/$1/;
36 if ($uri ne "theory:/") {
37 # Let's print the link to the parent directory
40 <td><img border="0" src="/icons/back.gif" alt="[BACK]"></td>
41 <td><a href="$myurl" onClick="top.frames[0].document.forms[0].hiddentheoryuri.value='$uridotdot'; refreshReload(); refreshTheoryHeader(); this.search='?theoryuri=$uridotdot';" onMouseOver="window.status='$uridotdot'; return true">Parent Directory</a></td>
46 foreach $i (@filenames) {
47 my ($type,$name) = split(/,/, $i);
51 <td><img border="0" src="/icons/folder.gif" alt="[DIR]"></td>
52 <td><a href="$myurl" onClick="top.frames[0].document.forms[0].hiddentheoryuri.value='$uri$name'; refreshReload(); refreshTheoryHeader(); this.search='?theoryuri=$uri$name';" onMouseOver="window.status='$uri$name'; return true">$name</a></td>
55 } elsif ($type eq "object") {
56 if ($name =~ /\.theory$/) {
60 <td><img border="0" src="/icons/generic.red.gif" alt="[DIR]"></td>
61 <td><a href="" target="theory" onClick="this.href=makeURL('theory','$uri$name','$processor_url','$getter_url')" onMouseOver="window.status='$uri$name'; return true">$name</a>
67 <td><img border="0" src="/icons/unknown.gif" alt="[DIR]"></td>
75 <td><img border="0" src="/icons/burst.gif" alt="[DIR]"></td>
83 Content-type: text/html
85 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
86 "http://www.w3.org/TR/REC-html40/loose.dtd">
89 <title>Index of $uri</title>
90 <script language="JavaScript" src="http://phd.cs.unibo.it/helm/library3/control.js">
93 <body bgcolor="#ffffff" text="#000000">
97 <hr noshade align="left" width="80%">
102 #================================