source: HiSusy/trunk/Pythia8/pythia8170/phpdoc/SaveSettings.php @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 8.5 KB
Line 
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
9if($_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>
20function stopRKey(evt) {
21var evt = (evt) ? evt : ((event) ? event : null);
22var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null);
23if ((evt.keyCode == 13) && (node.type=="text"))
24{return false;}
25}
26
27document.onkeypress = stopRKey;
28</script>
29<?php
30if($_POST['saved'] == 1) {
31if($_POST['filepath'] != "files/") {
32echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; }
33else {
34echo "<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
42The information on this webpage is only valid if you access the PHP
43dynamic webpages via a web browser, and does not apply to the static
44HTML equivalents. With PHP, all of the settings in the PYTHIA program
45are represented by radio buttons or fill-in boxes, that makes it easy
46for you to  construct a file with your desired changes. This file can
47then be read into PYTHIA by your main program to steer the whole run.
48
49<h3>Basic instructions</h3>
50
51The functionality of the PHP option is described in the following.
52
53<p/>
54<table border="2" cellpadding="5"><td>
55<?php
56
57echo "<table border = 0><tr><td align=left valign=center>";
58
59if($_POST["resetval"] == 1)
60{
61  //DELETE OLD FILE ON RESET
62  unlink($_POST["rmfile"]);
63}
64
65if (!$_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}
73else 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
133echo "</td><td></td></tr></table>";
134
135?>
136</td></table>
137
138<ul>
139
140<p/><li>
141To begin with, you must specify a <b>(temporary) file name</b> in the
142box above. If the filename already exists on the server, you will be
143requested to pick a new name.</li>
144
145<p/><li>
146Once you have <b>Submit</b>ted your filename, you can browse through the
147pages and make your selections. The values currently selected when you
148load the page are the default values.</li>
149
150<p/><li>
151When you have finished making your changes to a particular page,
152you <b>must</b> click on <b>Save Settings</b> at the <b>bottom</b> of
153the page. This will write the changes to your temporary file. If you make
154a mistake, just repeat the procedure for that category again.<br>
155
156<p/><li>
157When you have finished all the changes you need, return to this page
158and click <b>Finish File</b>.</li>
159
160<p/><li>
161You will then get up a link, that you are asked to <b>right-click</b>
162with your mouse (or equivalent).</li>
163
164<p/><li>
165In the menu that appears, pick the option <b>Save Link As</b>
166(or equivalent).</li>
167
168<p/><li>
169You will now get up a file browser, for you to pick and <b>Save</b>
170the location and file name (the latter by default the same as the
171temporary file name).</li>
172
173<p/><li>
174At any time, if you click the <b>RESET</b> button, your temporary
175file will be erased and you can start anew.</li>
176
177<p/><li>
178Before you use a file, be sure to <b>check it visually</b> to confirm
179that you saved what you intended to. Minor corrections are easily made
180in a text editor.
181</li>
182
183</ul>
184
185<p/>
186<h3>Supplementary notes</h3>
187
188
189The documentation files exist in three versions.
190<ol>
191
192<p/><li> 
193As a set of <code>.xml</code> files, in the <code>xmldoc/</code>
194subdirectory. These are the master copies that no user ever should
195touch, but that are used to generate the variants below.</li> 
196
197<p/><li> 
198As a set of <code>.html</code> files, in the <code>htmldoc/</code>
199subdirectory. You can open your own locally installed copy of the
200<code>Welcome.html</code> file in your web browser and thereafter
201navigate among all the pages. You can learn which parameters are free
202to be changed, but not change anything, except by brute-force
203cut-and-paste to a file of your own.</li>
204
205<p/><li>
206As a set of <code>.php</code> files, in the <code>phpdoc/</code>
207subdirectory. For these files to provide the functionality described
208above they have to accessed via a webserver. The one where you have
209your homepage should work fine. Alternatively you can use pages already
210available on another server.</li>
211
212</ol>
213
214<p/>
215A few further comments about the operation of the PHP option:
216<ul>
217
218<p/><li>
219To 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
222subdirectory named <code>files</code> where the temporary files
223are stored. This subdirectory must have public write access to work
224(<code>chmod a+w files</code> if not).</li>
225
226<p/><li>
227The "temporary" files stored in <code>files</code> actually remain
228unless the RESET button is used. The good news is that this makes
229it possible to recover a file that otherwise might be lost. The bad
230news is that the <code>files</code> directory may need to be cleaned
231up from time to time. (But typically the files are pretty small, so
232this should not be a major problem.)</li>
233
234<p/><li>
235When you click the <b>Save Settings</b> button on the bottom of a page
236all changed settings are written on the temporary file in the format
237<pre>
238name-of-flag/mode/parameter/word = value
239</pre> 
240with one variable per line. Thereafter all the settings on the page
241are restored to their default values.</li>
242
243<p/><li>
244You can return to a page to do some further changes and save those.
245If you change the same parameter twice, it is the last value that
246counts. (Both values are stored in the file, with the more recent
247lower down, and then PYTHIA does the changes sequentially.) However
248remember that unchanged values are not stored, so if you want to
249restore some default value it may be simpler to edit the file
250afterwards.</li>   
251
252<p/><li>
253The changeable flags/modes/parameters/words are mainly in the 
254"Setup Run Tasks" section of the index, but a few (less
255frequently used ones) can also be found lower down, in the
256"Study Output" and "Link to Other Programs" pages.
257
258<p/><li>
259It is not (yet) possible to modify particle data within the PHP-based
260setup approach. This is a more difficult task, since e.g. the
261modifications one may want to do in a decay table can be quite
262interrelated.
263
264</body>
265</html>
266
267<!-- Copyright (C) 2012 Torbjorn Sjostrand -->
268
Note: See TracBrowser for help on using the repository browser.