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 $getterURL = $cgi->param('getterURL');
24 $uri =~ s/(.*)\/$/$1/; # Remove a final slash if present
25 $uri .= "/"; # Put a final slash
28 $cont = ""; # modified by side-effect by &callback
29 my $ua = LWP::UserAgent->new;
30 my $request = HTTP::Request->new(GET => $getterURL."ls?format=txt&baseuri=".$uri);
31 my $response = $ua->request($request, \&callback);
33 @filenames = split(/\n/, $cont);
36 $uridotdot =~ s/(.*)\/.+/$1/;
37 if ($uri ne "theory:/") {
38 # Let's print the link to the parent directory
41 <td><img border="0" src="/icons/back.gif" alt="[BACK]"></td>
42 <td><a href="$myurl" onClick="top.theoryuri='$uridotdot'; refreshReload(); refreshTheoryHeader(); this.search='?theoryuri=$uridotdot&getterURL=$getterURL';" onMouseOver="window.status='$uridotdot'; return true">Parent Directory</a></td>
47 foreach $i (@filenames) {
48 my ($type,$name,$flags) = split(/, /, $i);
49 my ($flagscic, $flagstypes) = split(/,/, $flags);
50 $flagscic =~ s/^<(.*)/$1/;
51 $flagstypes =~ s/(.*)>$/$1/;
55 <td><img border="0" src="/icons/folder.gif" alt="[DIR]"></td>
56 <td><a href="$myurl" onClick="top.theoryuri='$uri$name'; refreshReload(); refreshTheoryHeader(); this.search='?theoryuri=$uri$name&getterURL=$getterURL';" onMouseOver="window.status='$uri$name'; return true">$name</a></td>
59 } elsif ($type eq "object") {
60 if ($name =~ /\.theory$/) {
64 <td><img border="0" src="/icons/generic.red.gif" alt="[DIR]"></td>
65 <td><a href="" target="theory" onClick="this.href=makeURL('theory','$uri$name','$flagscic','$flagstypes')" onMouseOver="window.status='$uri$name'; return true">$name</a>
71 <td><img border="0" src="/icons/unknown.gif" alt="[DIR]"></td>
79 <td><img border="0" src="/icons/burst.gif" alt="[DIR]"></td>
87 Content-type: text/html
89 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
90 "http://www.w3.org/TR/REC-html40/loose.dtd">
93 <title>Index of $uri</title>
94 <script language="JavaScript" src="http://phd.cs.unibo.it/helm/javascript/control.js">
97 <body bgcolor="#ffffff" text="#000000">
101 <hr noshade align="left" width="80%">
106 #================================