$file = fopen("{$tempdir}/{$filename}.ann", "w"); fwrite($file, $annfile); fclose($file); chronometer(); if ($spec == 1) { $retarray = specialise($filename, $goal, $tempdir, $watch_opts, $logging, $safe); } else { $retarray = create_gx($filename, $tempdir, $watch_opts, $logging); } $time = chronometer(); if ($retarray[0] == 0) { // No error $_SESSION['specerror'] = ''; html_start('Specialising : ' . $_SESSION['filename'], 'prolog.css', '', 4, ''); echo '<div class="codeframe" style="height: 490px">'; echo process_xml($retarray[1], 'prologtohtml.xsl'); echo '</div>'; $log = $retarray[2]; print_save_link_and_save_output_to_session($filename, $spec, $tempdir); global $ecce_url; ?> <script type="text/javascript" src="getText.js"></script> <script type="text/javascript"> function setprogram(name) { var source = getText(document.getElementById('source')); document.getElementById(name + 'source').value = source; return true; } </script>
</td> <td valign="top" width="50%"> <div class="codeframe"> <textarea name="filters" style="width: 99%; height: 98%"> <?php echo $_SESSION['filters']; ?> </textarea> </div> </td> </tr> </table> <?php } else { echo '<h2>Source Code</h2>'; echo process_xml($xml, 'prologtohtml.xsl'); ?> <h2>Filters</h2> <input type="hidden" name="textedit" value="on"> <textarea rows="30" cols="80" name="filters"> <?php echo $_SESSION['filters']; echo "</textarea>\n"; } ?> <p> <input id="annotations" type="hidden" name="annotations" value=""/> <input type="submit" value="Save Changes"/> <input type="button" value="Revert Changes" onclick="window.location='upload_annfile.php'"/> </p>
function report_xml_error($title, $xml) { html_start($title, '', ''); echo process_xml($xml, 'error.xsl'); html_end(); }
Annotation File <select name="annfile"> <?php $session_stock = $_SESSION['stock_annfile']; foreach ($files as $f) { if ($f == $session_stock) { echo "<option selected=\"selected\">{$f}</option>\n"; } else { echo "<option>{$f}</option>\n"; } } ?> </select> <input type="submit" value="Use Ready-Made Annotations" /> <?php insert_tooltip('Use a ready made set of annotations for the current file.', $default_tooltip_size); ?> </div></form><?php } ?> <script type="text/javascript"> d = document.getElementById('annselect'); setAnnMethod(d.options[d.selectedIndex].value); </script> <br/> <?php echo '<div style="border: 1px solid black; margin-left: 10px; margin-right: 10px; padding: 4px; background-color: #f0f0fa; overflow: auto; height: 400px">'; echo process_xml($xml, 'simpleprologtohtml.xsl'); echo '</div>'; echo "\n<p><a href='get_pl.php'>Download Source Program</a></p>"; html_end();
function display_spec_error() { global $message, $errortype, $fix, $xml, $history; echo '<div id="errorblock">'; $error = htmlspecialchars($_SESSION['specerror']); echo "<table><tr><td>\n"; echo "<p>An error occurred during specialisation: <b>{$message}</b>"; ?> This will be highlighted in red (e.g. <span class="unsafe">match</span>). <?php if ($errortype == 'warning') { ?> This is a warning produced by running in watchdog mode and so it is possible that your annotations are fine. If so, you should re-run your goal with watchdog mode disabled.<?php } ?> </p> <form action="bug_report.php" method="post"> <p> <?php if ($fix) { $fix_js = process_xml($xml, 'get_fixes.xsl'); echo "<input type='button' value='Automatically Fix' onclick='{$fix_js} changed = true; getElementById(\"errorblock\").style.display=\"none\"'/>\n"; } echo "<input id='showlog' type='button' value='Show Log' onclick='toggleShow(\"speclog\", \"showlog\", \"Show Log\", \"Hide Log\")'/>\n"; echo "<div style='display: none' id='speclog'>"; echo "<div class='log' style='display: block; overflow:auto'><pre>{$error}</pre></div>\n"; global $db_name; if (isset($db_name)) { ?> <p>If you think this error is due to a bug in weblogen you can submit a bug report. <input type="submit" value="Submit Bug Report" /> <input type="hidden" name="stage" value="spec" /> </p> <?php } ?> </form> </div></td> <?php if (isset($history)) { echo "<td valign='top' style='border: 1px solid black; padding-left: 10px; padding-right: 10px'><p><b>Call History</b></p>"; foreach ($history as $call) { echo "<tt>", htmlspecialchars($call), "</tt><br>"; } echo "</td>"; } ?> </tr></table> </div> <?php }
<td valign="top" width="50%"> <div class="codeframe" id="sourcebox"> <?php echo process_xml($xml, 'prologtohtml.xsl'); ?> </div> <?php if ($unsafe) { generate_scroll_to_error_code('sourcebox'); } ?> </td> <td valign="top" width="50%"> <div class="codeframe" id="filterbox"> <?php echo process_xml($xml, 'filterstohtml.xsl'); ?> </div> <?php if ($unsafe) { generate_scroll_to_error_code('filterbox'); } ?> </td> </tr> </table> <?php } ?> <p> <input id="filters_input" type="hidden" name="filters" value=""/>