X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fcgi%2Fmkindex.pl;h=955d6d8b0e6dd597fc832d190da129d574bab783;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=9bc41ef11790d5c8c0e66170f5c3f9c7e8c45e00;hpb=eecd02f892cd859e137c550aaa0f2668986c5f2b;p=helm.git diff --git a/helm/cgi/mkindex.pl b/helm/cgi/mkindex.pl index 9bc41ef11..955d6d8b0 100755 --- a/helm/cgi/mkindex.pl +++ b/helm/cgi/mkindex.pl @@ -1,74 +1,30 @@ #!/usr/bin/perl -# the required file defines: $helm_dir, $helm_url_path, $getheader_url, -# $style_url, $webeq_url, $webeqp_url -require "/local/lib/helm/configuration.pl"; - -$baseuri0 = $dirname = $uri = $ENV{"REQUEST_URI"}; +# First of all, let's load HELM configuration +use Env; +my $HELM_LIB_DIR = $ENV{"HELM_LIB_DIR"}; +# this should be the only fixed constant +my $DEFAULT_HELM_LIB_DIR = "/projects/helm/on-line/local/lib/helm"; +if (defined ($HELM_LIB_DIR)) { + $HELM_LIB_PATH = $HELM_LIB_DIR."/configuration.pl"; +} else { + $HELM_LIB_PATH = $DEFAULT_HELM_LIB_DIR."/configuration.pl"; +} -$dirname =~ s/$helm_url_path//; -$dirname = $helm_dir.$dirname; +# next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm +require $HELM_LIB_PATH; -$baseuri0 =~ s/$helm_url_path//; +#use URI::Escape; +use CGI; -opendir(DIR, $dirname); -@filenames = readdir(DIR); -closedir(DIR); +$cgi = new CGI($ENV{"REQUEST_URL"}); -$output = ""; -foreach $i (@filenames) { - if ($i eq "..") { - $output .= < Parent Directory -EOT - } elsif ($i !~ /^\./) { - # hidden files excluded - (undef,undef,$mode) = stat("$dirname$i"); - if ($mode &= 16384) { - # directory - $output .= < $i -EOT - } else { - # file - if ($i =~ /\.(con|var|ind)\.xml$/) { - my $i_without_xml = $i; - $i_without_xml =~ s/(.*)\.xml/$1/; - # cic file - my $baseuri = "cic:".$baseuri0; - $output .= < $i MathML HTML WEBEQ WEBEQ PRESENTATION ONLY -EOT - } elsif ($i =~ /\.(con|var|ind)\.ann\.xml$/) { - my $i_without_xml = $i; - my $i_without_ann_and_xml = $i; - $i_without_xml =~ s/(.*)\.xml/$1/; - $i_without_ann_and_xml =~ s/(.*)\.ann\.xml/$1/; - # cic file - my $baseuri = "cic:".$baseuri0; - $output .= < $i MathML HTML WEBEQ WEBEQ PRESENTATION ONLY -EOT - } elsif ($i =~ /\.theory\.xml$/) { - my $i_without_xml = $i; - $i_without_xml =~ s/(.*)\.xml/$1/; - # theory file - my $baseuri = "theory:".$baseuri0; - $output .= < $i MathML HTML -EOT - } else { - # other file - $output .= < $i -EOT - } - } - } -} +$mode = $cgi->param('mode'); +$cicuri = $cgi->param('cicuri'); +$theoryuri = $cgi->param('theoryuri'); +$processorURL = $cgi->param('processorURL'); +$getterURL = $cgi->param('getterURL'); +$topurl = $cgi->url(); print < -Index of $uri + Index of $cicuri and $theoryuri - -
-Index of $uri -
-
-
-$output
-
-
- + + + + + + + + + + + + + EOT