]>
Commit | Line | Data |
---|---|---|
63ba5337 | 1 | <html> |
2 | <head> | |
3 | <title>Save Settings</title> | |
4 | <link rel="stylesheet" type="text/css" href="pythia.css"/> | |
5 | <link rel="shortcut icon" href="pythia32.gif"/> | |
6 | </head> | |
7 | ||
8 | <?php | |
9 | if($_GET["filename"] != "") | |
10 | { | |
11 | $_POST["filename"] = $_GET["filename"]; | |
12 | } | |
13 | ?> | |
14 | <script language="JavaScript1.2"> | |
15 | <?php echo "setTimeout(\"top.index.location='Index.php?filename=".$_POST["filename"]."'\", 1)"; ?> | |
16 | </script> | |
17 | <body> | |
18 | ||
19 | <script language=javascript type=text/javascript> | |
20 | function stopRKey(evt) { | |
21 | var evt = (evt) ? evt : ((event) ? event : null); | |
22 | var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null); | |
23 | if ((evt.keyCode == 13) && (node.type=="text")) | |
24 | {return false;} | |
25 | } | |
26 | ||
27 | document.onkeypress = stopRKey; | |
28 | </script> | |
29 | <?php | |
30 | if($_POST['saved'] == 1) { | |
31 | if($_POST['filepath'] != "files/") { | |
32 | echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; } | |
33 | else { | |
34 | echo "<font color='red'>NO FILE SELECTED YET.. PLEASE DO SO </font><a href='SaveSettings.php'>HERE</a><br/><br/>"; } | |
35 | } | |
36 | ?> | |
37 | ||
38 | <form method='post' action='SaveSettings.php'> | |
39 | ||
40 | <h2>Save Settings</h2> | |
41 | ||
42 | The information on this webpage is only valid if you access the PHP | |
43 | dynamic webpages via a web browser, and does not apply to the static | |
44 | HTML equivalents. With PHP, all of the settings in the PYTHIA program | |
45 | are represented by radio buttons or fill-in boxes, that makes it easy | |
46 | for you to construct a file with your desired changes. This file can | |
47 | then be read into PYTHIA by your main program to steer the whole run. | |
48 | ||
49 | <h3>Basic instructions</h3> | |
50 | ||
51 | The functionality of the PHP option is described in the following. | |
52 | ||
53 | <p/> | |
54 | <table border="2" cellpadding="5"><td> | |
55 | <?php | |
56 | ||
57 | echo "<table border = 0><tr><td align=left valign=center>"; | |
58 | ||
59 | if($_POST["resetval"] == 1) | |
60 | { | |
61 | //DELETE OLD FILE ON RESET | |
62 | unlink($_POST["rmfile"]); | |
63 | } | |
64 | ||
65 | if (!$_POST["filename"]) | |
66 | { | |
67 | echo "Please choose a (temporary) file name:</br>"; | |
68 | echo "<form method='POST' action='SaveParameters.php'>"; | |
69 | echo "<input type='text' name='filename'/>"; | |
70 | echo "<input type='submit' value='Submit'/>"; | |
71 | echo "</form>"; | |
72 | } | |
73 | else if ($_POST["filename"] != "") | |
74 | { | |
75 | $filename = $_POST["filename"]; | |
76 | $filepath = "files/".$_POST["filename"]; | |
77 | $filecheck = file_exists($filepath); | |
78 | ||
79 | if(($_POST["finish"] == 1) || ($_GET["returning"] == 1)) | |
80 | { | |
81 | $filecheck = 0; | |
82 | $fileopen = 1; | |
83 | } | |
84 | ||
85 | if ($filecheck == 1) | |
86 | { | |
87 | echo "<font color='red'>File in use.. choose again:</br></font>"; | |
88 | echo "<form method='POST' action='SaveParameters.php'>"; | |
89 | echo "<input type='text' name='filename'/>"; | |
90 | echo "<input type='submit' value='Submit'/>"; | |
91 | echo "</form>"; | |
92 | } | |
93 | else | |
94 | { | |
95 | if(!$_POST["finish"]) | |
96 | { | |
97 | echo "Filename chosen:<b> "; | |
98 | echo $_POST["filename"]; | |
99 | echo "</br></b>"; | |
100 | echo "<table border = 0 valign = top><tr><td valign=\"top\"><form method='POST' action='SaveParameters.php'>"; | |
101 | echo "<input type='hidden' name='filename' value='".$filename."'/>"; | |
102 | echo "<input type='hidden' name='finish' value='1'/>"; | |
103 | echo "<input type='submit' value='Finish File'/>"; | |
104 | echo "</form></td>"; | |
105 | echo "<td valign=\"top\"><form method='POST' action='SaveParameters.php'>"; | |
106 | echo "<input type='hidden' name='filename' value=''/>"; | |
107 | echo "<input type='hidden' name='rmfile' value='".$filepath."'/>"; | |
108 | echo "<input type='hidden' name='resetval' value='1'/>"; | |
109 | echo "<input type='submit' value='RESET'/>"; | |
110 | echo "</form></td></tr></table>"; | |
111 | } | |
112 | if($fileopen != 1) | |
113 | { | |
114 | //CREATE & OPEN FILE & CHANGE PERMISSIONS TO 666 | |
115 | $handle = fopen($filepath, 'w'); | |
116 | chmod($filepath, 0666); | |
117 | fclose($handle); | |
118 | ||
119 | } | |
120 | if ($_POST["finish"]) | |
121 | { | |
122 | echo "<b><li><a href='".$filepath."'>Right Click to Save Target: ".$filename."</a></b></br>"; | |
123 | echo "<form method='POST' action='SaveParameters.php'>"; | |
124 | echo "<input type='hidden' name='filename' value=''/>"; | |
125 | echo "<input type='hidden' name='rmfile' value='".$filepath."'/>"; | |
126 | echo "<input type='hidden' name='resetval' value='1'/>"; | |
127 | echo "<input type='submit' value='RESET'/>"; | |
128 | echo "</form>"; | |
129 | } | |
130 | } | |
131 | } | |
132 | ||
133 | echo "</td><td></td></tr></table>"; | |
134 | ||
135 | ?> | |
136 | </td></table> | |
137 | ||
138 | <ul> | |
139 | ||
140 | <p/><li> | |
141 | To begin with, you must specify a <b>(temporary) file name</b> in the | |
142 | box above. If the filename already exists on the server, you will be | |
143 | requested to pick a new name.</li> | |
144 | ||
145 | <p/><li> | |
146 | Once you have <b>Submit</b>ted your filename, you can browse through the | |
147 | pages and make your selections. The values currently selected when you | |
148 | load the page are the default values.</li> | |
149 | ||
150 | <p/><li> | |
151 | When you have finished making your changes to a particular page, | |
152 | you <b>must</b> click on <b>Save Settings</b> at the <b>bottom</b> of | |
153 | the page. This will write the changes to your temporary file. If you make | |
154 | a mistake, just repeat the procedure for that category again.<br> | |
155 | ||
156 | <p/><li> | |
157 | When you have finished all the changes you need, return to this page | |
158 | and click <b>Finish File</b>.</li> | |
159 | ||
160 | <p/><li> | |
161 | You will then get up a link, that you are asked to <b>right-click</b> | |
162 | with your mouse (or equivalent).</li> | |
163 | ||
164 | <p/><li> | |
165 | In the menu that appears, pick the option <b>Save Link As</b> | |
166 | (or equivalent).</li> | |
167 | ||
168 | <p/><li> | |
169 | You will now get up a file browser, for you to pick and <b>Save</b> | |
170 | the location and file name (the latter by default the same as the | |
171 | temporary file name).</li> | |
172 | ||
173 | <p/><li> | |
174 | At any time, if you click the <b>RESET</b> button, your temporary | |
175 | file will be erased and you can start anew.</li> | |
176 | ||
177 | <p/><li> | |
178 | Before you use a file, be sure to <b>check it visually</b> to confirm | |
179 | that you saved what you intended to. Minor corrections are easily made | |
180 | in a text editor. | |
181 | </li> | |
182 | ||
183 | </ul> | |
184 | ||
185 | <p/> | |
186 | <h3>Supplementary notes</h3> | |
187 | ||
188 | ||
189 | The documentation files exist in three versions. | |
190 | <ol> | |
191 | ||
192 | <p/><li> | |
193 | As a set of <code>.xml</code> files, in the <code>xmldoc/</code> | |
194 | subdirectory. These are the master copies that no user ever should | |
195 | touch, but that are used to generate the variants below.</li> | |
196 | ||
197 | <p/><li> | |
198 | As a set of <code>.html</code> files, in the <code>htmldoc/</code> | |
199 | subdirectory. You can open your own locally installed copy of the | |
200 | <code>Welcome.html</code> file in your web browser and thereafter | |
201 | navigate among all the pages. You can learn which parameters are free | |
202 | to be changed, but not change anything, except by brute-force | |
203 | cut-and-paste to a file of your own.</li> | |
204 | ||
205 | <p/><li> | |
206 | As a set of <code>.php</code> files, in the <code>phpdoc/</code> | |
207 | subdirectory. For these files to provide the functionality described | |
208 | above they have to accessed via a webserver. The one where you have | |
209 | your homepage should work fine. Alternatively you can use pages already | |
210 | available on another server.</li> | |
211 | ||
212 | </ol> | |
213 | ||
214 | <p/> | |
215 | A few further comments about the operation of the PHP option: | |
216 | <ul> | |
217 | ||
218 | <p/><li> | |
219 | To set up the PHP files on your webserver, you have to install the whole | |
220 | <code>phpdoc/</code> subdirectory there. In addition to the | |
221 | <code>.php</code> code this includes a few more files, plus a | |
222 | subdirectory named <code>files</code> where the temporary files | |
223 | are stored. This subdirectory must have public write access to work | |
224 | (<code>chmod a+w files</code> if not).</li> | |
225 | ||
226 | <p/><li> | |
227 | The "temporary" files stored in <code>files</code> actually remain | |
228 | unless the RESET button is used. The good news is that this makes | |
229 | it possible to recover a file that otherwise might be lost. The bad | |
230 | news is that the <code>files</code> directory may need to be cleaned | |
231 | up from time to time. (But typically the files are pretty small, so | |
232 | this should not be a major problem.)</li> | |
233 | ||
234 | <p/><li> | |
235 | When you click the <b>Save Settings</b> button on the bottom of a page | |
236 | all changed settings are written on the temporary file in the format | |
237 | <pre> | |
238 | name-of-flag/mode/parameter/word = value | |
239 | </pre> | |
240 | with one variable per line. Thereafter all the settings on the page | |
241 | are restored to their default values.</li> | |
242 | ||
243 | <p/><li> | |
244 | You can return to a page to do some further changes and save those. | |
245 | If you change the same parameter twice, it is the last value that | |
246 | counts. (Both values are stored in the file, with the more recent | |
247 | lower down, and then PYTHIA does the changes sequentially.) However | |
248 | remember that unchanged values are not stored, so if you want to | |
249 | restore some default value it may be simpler to edit the file | |
250 | afterwards.</li> | |
251 | ||
252 | <p/><li> | |
253 | The changeable flags/modes/parameters/words are mainly in the | |
254 | "Setup Run Tasks" section of the index, but a few (less | |
255 | frequently used ones) can also be found lower down, in the | |
256 | "Study Output" and "Link to Other Programs" pages. | |
257 | ||
258 | <p/><li> | |
259 | It is not (yet) possible to modify particle data within the PHP-based | |
260 | setup approach. This is a more difficult task, since e.g. the | |
261 | modifications one may want to do in a decay table can be quite | |
262 | interrelated. | |
263 | ||
264 | </body> | |
265 | </html> | |
266 | ||
267 | <!-- Copyright (C) 2012 Torbjorn Sjostrand --> | |
268 |