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('cicuri');
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 "cic:/") {
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].hiddencicuri.value='$uridotdot'; refreshReload(); refreshCICHeader(); this.search='?cicuri=$uridotdot';" onMouseOver="window.status='$uridotdot'; return true">Parent Directory</a></td>
46 foreach $i (@filenames) {
47 my ($type,$name,$flags) = split(/, /, $i);
48 my ($flagscic, $flagstypes) = split(/,/, $flags);
49 $flagscic =~ s/^<(.*)/$1/;
50 $flagstypes =~ s/(.*)>$/$1/;
54 <td><img border="0" src="/icons/folder.gif" alt="[DIR]"></td>
55 <td><a href="$myurl" onClick="top.frames[0].document.forms[0].hiddencicuri.value='$uri$name'; refreshReload(); refreshCICHeader(); this.search='?cicuri=$uri$name';" onMouseOver="window.status='$uri$name'; return true">$name</a></td>
59 } elsif ($type eq "object") {
60 if ($name =~ /\.(con|var|ind)$/) {
64 <td><img border="0" src="/icons/generic.red.gif" alt="[DIR]"></td>
65 <td><a href="" target="cic" onClick="this.href=makeURL('cic','$uri$name','$processor_url','$getter_url','$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 #================================