]> matita.cs.unibo.it Git - helm.git/blob - helm/cgi/mkcontrol.pl
library3 ==> javascript
[helm.git] / helm / cgi / mkcontrol.pl
1 #!/usr/bin/perl
2
3 # First of all, let's load HELM configuration
4 use Env;
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";
10 } else {
11    $HELM_LIB_PATH = $DEFAULT_HELM_LIB_DIR."/configuration.pl";
12 }
13
14 # next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm
15 require $HELM_LIB_PATH;
16
17 use CGI;
18
19 $cgi = new CGI($ENV{"REQUEST_URL"});
20 $mode = $cgi->param('mode');
21 $cicuri = $cgi->param('cicuri');
22 $theoryuri = $cgi->param('theoryuri');
23 $topurl = $cgi->param('topurl');
24 ($mode1,$mode2,$mode3,$mode4,$mode5) = split(/,/, $mode);
25 $natural = "checked" if ($mode4 eq "yes");
26 $annotations = "checked" if ($mode5 eq "yes");
27 if ($mode1 eq "raw") {
28    $format_raw = "selected";
29 } else {
30    $format_processed = "selected";
31 }
32
33 print <<EOT;
34 Content-type: text/html
35
36 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
37 "http://www.w3.org/TR/REC-html40/loose.dtd">
38 <html>
39 <head>
40 <title>Control panel</title>
41 <script language="JavaScript" src="http://phd.cs.unibo.it/helm/javascript/control.js">
42 </script>
43 </head>
44 <body bgcolor="#ffffff" text="#000000">
45 <form>
46 <table>
47   <tr>
48     <td>
49       <b>Format</b>:
50     </td>
51     <td>
52       <select name="output" onChange="updateOutput(this,document.forms[0].format)">
53         <option value="processed" $format_processed>Processed</option>
54         <option value="raw" $format_raw>Raw</option>
55       </select>
56     </td>
57     <td>
58       <select name="format" onChange="updateFormat(this)">
59 EOT
60     if ($mode1 eq "raw") {
61        $tmp = "output_".$mode2;
62        $$tmp="selected";
63        print <<EOT;
64         <option value="cic" $output_cic>CIC</option>
65         <option value="zcic" $output_zcic>CIC GZipped</option>
66 EOT
67     } else {
68        $tmp = "output_".$mode3;
69        $$tmp="selected";
70        print <<EOT;
71         <option value="html" $output_html>HTML</option>
72         <option value="mml_cont" $output_mml_cont>MathML Content</option>
73         <option value="mml_pres" $output_mml_pres>MathML Presentation</option>
74 EOT
75     }
76 print <<EOT;
77       </select>
78     </td>
79     <td>
80      <a target="_top" href="$topurl?mode=$mode&cicuri=$cicuri&theoryuri=$theoryuri">Reload</a><br>
81      (do it also before attempting to take a link to the current page)
82      <input type="hidden" name="hiddentopurl" value="$topurl">
83      <input type="hidden" name="hiddenmode" value="$mode">
84      <input type="hidden" name="hiddencicuri" value="$cicuri">
85      <input type="hidden" name="hiddentheoryuri" value="$theoryuri">
86     </td>
87   </tr>
88   <tr>
89     <td colspan="3">
90       <input type="checkbox" $natural onClick="updateNatural(this)">&nbsp;Natural Language</input>
91       <input type="checkbox" $annotations onClick="updateAnnotations(this)">&nbsp;Annotations</input>
92     </td>
93   </tr>
94 </table>
95 </form>
96 </body>
97 </html>
98 EOT