2 $BEAUT_PATH = realpath(
".") .
"/Services/COPage/syntax_highlight/php";
6 require
"$BEAUT_PATH/Beautifier/HFile.php";
14 global $indent, $unindent, $stringchars,
$config, $keywords, $delimiters, $lang_name;
15 global $linecommenton, $blockcommenton, $blockcommentoff;
16 global $perl, $nocase, $notrim;
22 print
"######################################\n";
23 print
"# Beautifier Highlighting Configuration File \n";
24 print
"# $lang_name\n";
25 print
"######################################\n";
30 print
"\n# Colours\n\n";
34 dump_var(
"green",
"\$blockcommentcolour");
35 dump_var(
"green",
"\$linecommentcolour ");
36 print
"\n# Indent Strings\n\n";
39 print
"\n# String characters and delimiters\n\n";
43 print
"\n# Comment settings\n\n";
44 dump_var($linecommenton,
"\$linecommenton ");
45 dump_var($blockcommenton,
"\$blockcommenton ");
46 dump_var($blockcommentoff,
"\$blockcommentoff ");
47 print
"\n# Keywords (keyword mapping to colour number)\n\n";
49 print
"\n# Special extensions\n";
63 foreach (array_keys($keywords) as $k) {
65 if (!in_array($cat, $usedcats)) {
66 array_push($usedcats, $cat);
75 // Each category can specify a PHP function that returns an altered 76 // version of the keyword. 77 # This link is then placed in a <a href=\"...\">foo</a>; structure around keyword 'foo' - which is 82 foreach ($cats as $c) {
83 $linkhash{$c} =
"donothing";
87 print
"\n# DoNothing link function\n\n";
88 print
"function donothing(\$keywordin)\n{\n return \$keywordin;\n}\n";
96 foreach ($cats as $c) {
97 array_push($usedcols, $colours[$c-1]);
104 print
$name .
" = \"" . addslashes($variable) .
"\";\n";
110 print
$name .
" = array(";
111 foreach ($array as $a) {
117 print
"\"" . addslashes($a) .
"\"";
125 print
$name .
" = array(";
126 foreach (array_keys($hash) as $k) {
132 print
"\n \"" . addslashes($k) .
"\"";
133 print
" => \"" . addslashes($hash[$k]) .
"\"";
140 <h1>Important Note</h1>
141 <p>This script should <b>not</b> be run on a
public server. It
is possible
to access
files other than syntax highlight
files (by entering /etc/passwd,
for example). Although
this should not display anything useful, it
is still possible that important
data may be extractable. As such, only run
this script <b>locally</b> (it should not be necessary
to run it on a
public server, anyway).</p>
142 <form action=
"HFileconv.php">Please specify a syntax
file to convert:<br />
143 <input type=
"text" width=
"64" size=
"64" name=
"file" value=
"<?php print $file; ?>" /><br />
145 <input type=
"text" width=
"64" size=
"64" name=
"fileout" value=
"<?php print stripslashes($fileout); ?>" /><br />
146 <input type=
"submit" /></form><hr />
149 if (isset($fileout) && $fileout ==
"") {
153 HFile_parse_file(
$file);
156 $out = ob_get_contents();
157 if (isset($fileout)) {
158 $fd = fopen($fileout,
"w");
HFile_print_php_file($tofile=1)
dump_array($array, $name)
dump_var($variable, $name)
Reload workbook from saved file
Create styles array
The data for the language used.
Set page orientation and size