ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
langwiz.php File Reference

Go to the source code of this file.

Functions

if(get_magic_quotes_gpc()) htmlspecialchars_deep ($value)
 
 output_error_cache ()
 
 report_error ($type, $message)
 
 str_to_phpstring ($str, $doublequote=false)
 
 validate_lang ()
 
 gen_langfile ($lang)
 

Variables

 $time_start = explode(' ', microtime())
 
const TYPE_NOTICE 0
 
const TYPE_WARNING 1
 
const TYPE_ERROR 2
 
 $error_abort = false
 
 $error_cache = array()
 
if(is_readable('../geshi.php')) elseif(is_readable('geshi.php')) else
 
 $post_var_names = array('li', 'ai', 'ld')
 
 $li
 
 $ai
 
 $ld
 
 $kw_case_sel
 
 $kw_cases_sel
 
foreach($post_var_names as $varName) $kw_case_sel [$ld['kw_case']] = ' selected="selected"'
 
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang = validate_lang()
 
 $G = new GeSHi('', 'php')
 
 $langfile_source = gen_langfile($lang)
 
 $time_end = explode(' ', microtime())
 
 $time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1]
 

Function Documentation

◆ gen_langfile()

gen_langfile (   $lang)

Definition at line 905 of file langwiz.php.

905 {
906 $langfile = $lang['li']['file'];
907 $langdesc = $lang['li']['desc'];
908
909 $langauthor_name = $lang['ai']['name'];
910 $langauthor_email = $lang['ai']['email'];
911 $langauthor_web = $lang['ai']['web'];
912
913 $langversion = GESHI_VERSION;
914
915 $langdate = date('Y/m/d');
916 $langyear = date('Y');
917
918 $i = ' ';
919 $i = array('', $i, $i.$i, $i.$i.$i);
920
921 $src = <<<GESHI_LANGFILE_HEAD
922<?php
923/*************************************************************************************
924 * {$langfile}.php
925 * --------
926 * Author: {$langauthor_name} ({$langauthor_email})
927 * Copyright: (c) {$langyear} {$langauthor_name} ({$langauthor_web})
928 * Release Version: {$langversion}
929 * Date Started: {$langdate}
930 *
931 * {$langdesc} language file for GeSHi.
932 *
933 * CHANGES
934 * -------
935 * {$langdate} ({$langversion})
936 * - First Release
937 *
938 * TODO (updated {$langdate})
939 * -------------------------
940 * * Complete language file
941 *
942 *************************************************************************************
943 *
944 * This file is part of GeSHi.
945 *
946 * GeSHi is free software; you can redistribute it and/or modify
947 * it under the terms of the GNU General Public License as published by
948 * the Free Software Foundation; either version 2 of the License, or
949 * (at your option) any later version.
950 *
951 * GeSHi is distributed in the hope that it will be useful,
952 * but WITHOUT ANY WARRANTY; without even the implied warranty of
953 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
954 * GNU General Public License for more details.
955 *
956 * You should have received a copy of the GNU General Public License
957 * along with GeSHi; if not, write to the Free Software
958 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
959 *
960 ************************************************************************************/
961
962\$language_data = array(
963
964GESHI_LANGFILE_HEAD;
965
966 //Language Name
967 $src .= $i[1] . "'LANG_NAME' => ".str_to_phpstring($langdesc).",\n";
968
969 //Comments
970 $src .= $i[1] . "'COMMENT_SINGLE' => array(\n";
971 foreach($lang['ld']['cmt']['sl'] as $idx_cmt_sl => $tmp_cmt_sl) {
972 $src .= $i[2] . ((int)$idx_cmt_sl). " => ". str_to_phpstring($tmp_cmt_sl['start']) . ",\n";
973 }
974 $src .= $i[2] . "),\n";
975 $src .= $i[1] . "'COMMENT_MULTI' => array(\n";
976 foreach($lang['ld']['cmt']['ml'] as $tmp_cmt_ml) {
977 $src .= $i[2] . str_to_phpstring($tmp_cmt_ml['start']). " => ". str_to_phpstring($tmp_cmt_ml['end']) . ",\n";
978 }
979 $src .= $i[2] . "),\n";
980 $src .= $i[1] . "'COMMENT_REGEXP' => array(\n";
981 foreach($lang['ld']['cmt']['rxc'] as $idx_cmt_rxc => $tmp_cmt_rxc) {
982 $src .= $i[2] . ((int)$idx_cmt_rxc). " => ". str_to_phpstring($tmp_cmt_rxc['rx']) . ",\n";
983 }
984 $src .= $i[2] . "),\n";
985
986 //Case Keywords
987 $src .= $i[1] . "'CASE_KEYWORDS' => " . $lang['ld']['kw_case'] . ",\n";
988
989 //Quotes \ Strings
990 $src .= $i[1] . "'QUOTEMARKS' => array(\n";
991 foreach($lang['ld']['str']['qm'] as $idx_str_qm => $tmp_str_qm) {
992 $src .= $i[2] . ((int)$idx_str_qm). " => ". str_to_phpstring($tmp_str_qm['delim']) . ",\n";
993 }
994 $src .= $i[2] . "),\n";
995 $src .= $i[1] . "'ESCAPE_CHAR' => " . str_to_phpstring($lang['ld']['str']['ec']['char']) . ",\n";
996 $src .= $i[1] . "'ESCAPE_REGEXP' => array(\n";
997 foreach($lang['ld']['str']['erx'] as $idx_str_erx => $tmp_str_erx) {
998 $src .= $i[2] . ((int)$idx_str_erx). " => ". str_to_phpstring($tmp_str_erx['rx']) . ",\n";
999 }
1000 $src .= $i[2] . "),\n";
1001
1002 //HardQuotes
1003 $src .= $i[1] . "'HARDQUOTE' => array(\n";
1004 $src .= $i[2] . "),\n";
1005 $src .= $i[1] . "'HARDESCAPE' => array(\n";
1006 $src .= $i[2] . "),\n";
1007 $src .= $i[1] . "'HARDCHAR' => '',\n";
1008
1009 //Numbers
1010 $src .= $i[1] . "'NUMBERS' =>\n";
1011 $src .= $i[2] . "GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |\n";
1012 $src .= $i[2] . "GESHI_NUMBER_FLT_SCI_ZERO,\n";
1013
1014 //Keywords
1015 $src .= $i[1] . "'KEYWRODS' => array(\n";
1016 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1017 $src .= $i[2] . ((int)$idx_kw) . " => array(\n";
1018 if(!is_array($tmp_kw['list'])) {
1019 $tmp_kw['list'] = explode("\n", $tmp_kw['list']);
1020 }
1021 $tmp_kw['list'] = array_map('trim', $tmp_kw['list']);
1022 sort($tmp_kw['list']);
1023 $kw_esc = array_map('str_to_phpstring', $tmp_kw['list']);
1024 $kw_nl = true;
1025 $kw_pos = 0;
1026 foreach($kw_esc as $kw_data) {
1027 if((strlen($kw_data) + $kw_pos > 79) && $kw_pos > strlen($i[3])) {
1028 $src .= "\n";
1029 $kw_nl = true;
1030 $kw_pos = 0;
1031 }
1032 if($kw_nl) {
1033 $src .= $i[3];
1034 $kw_pos += strlen($i[3]);
1035 $kw_nl = false;
1036 }
1037 $src .= $kw_data . ', ';
1038 $kw_pos += strlen($kw_data) + 2;
1039 }
1040 $src .= "\n";
1041 $src .= $i[3] . "),\n";
1042 }
1043 $src .= $i[2] . "),\n";
1044
1045 //Case Sensitivity
1046 $src .= $i[1] . "'CASE_SENSITIVE' => array(\n";
1047 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1048 $src .= $i[2] . ((int)$idx_kw) . " => " . ($tmp_kw['case'] ? 'true' : 'false') . ",\n";
1049 }
1050 $src .= $i[2] . "),\n";
1051
1052 //Symbols
1053 $src .= $i[1] . "'SYMBOLS' => array(\n";
1054 foreach($lang['ld']['sy'] as $idx_kw => $tmp_kw) {
1055 $src .= $i[2] . ((int)$idx_kw) . " => array(\n";
1056 $tmp_kw['list'] = (array)$tmp_kw['list'];
1057 sort($tmp_kw['list']);
1058 $kw_esc = array_map('str_to_phpstring', $tmp_kw['list']);
1059 $kw_nl = true;
1060 $kw_pos = strlen($i[3]);
1061 foreach($kw_esc as $kw_data) {
1062 if((strlen($kw_data) + $kw_pos > 79) && $kw_pos > strlen($i[3])) {
1063 $src .= "\n";
1064 $kw_nl = true;
1065 $kw_pos = 0;
1066 }
1067 if($kw_nl) {
1068 $src .= $i[3];
1069 $kw_pos += strlen($i[3]);
1070 $kw_nl = false;
1071 }
1072 $src .= $kw_data . ', ';
1073 $kw_pos += strlen($kw_data) + 2;
1074 }
1075 $src .= "\n";
1076 $src .= $i[3] . "),\n";
1077 }
1078 $src .= $i[2] . "),\n";
1079
1080 //Styles \ CSS
1081 $src .= $i[1] . "'STYLES' => array(\n";
1082 $src .= $i[2] . "'KEYWRODS' => array(\n";
1083 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1084 $src .= $i[3] . ((int)$idx_kw) . " => " . str_to_phpstring($tmp_kw['style']) . ",\n";
1085 }
1086 $src .= $i[3] . "),\n";
1087 $src .= $i[2] . "'COMMENTS' => array(\n";
1088 foreach($lang['ld']['cmt']['sl'] as $idx_cmt_sl => $tmp_cmt_sl) {
1089 $src .= $i[3] . ((int)$idx_cmt_sl) . " => " . str_to_phpstring($tmp_cmt_sl['style']) . ",\n";
1090 }
1091 foreach($lang['ld']['cmt']['rxc'] as $idx_cmt_rxc => $tmp_cmt_rxc) {
1092 $src .= $i[3] . ((int)$idx_cmt_rxc) . " => " . str_to_phpstring($tmp_cmt_rxc['style']) . ",\n";
1093 }
1094 $src .= $i[3] . "'MULTI' => " . str_to_phpstring($lang['ld']['cmt']['ml'][1]['style']) . "\n";
1095 $src .= $i[3] . "),\n";
1096 $src .= $i[2] . "'ESCAPE_CHAR' => array(\n";
1097 foreach($lang['ld']['str']['erx'] as $idx_str_erx => $tmp_str_erx) {
1098 $src .= $i[3] . ((int)$idx_str_erx). " => ". str_to_phpstring($tmp_str_erx['style']) . ",\n";
1099 }
1100 // 'HARD' => 'color: #000099; font-weight: bold;'
1101 $src .= $i[3] . "),\n";
1102 $src .= $i[2] . "'BRACKETS' => array(\n";
1103 $src .= $i[3] . "),\n";
1104 $src .= $i[2] . "'STRINGS' => array(\n";
1105 foreach($lang['ld']['str']['qm'] as $idx_str_qm => $tmp_str_qm) {
1106 $src .= $i[3] . ((int)$idx_str_qm). " => ". str_to_phpstring($tmp_str_qm['style']) . ",\n";
1107 }
1108 // 'HARD' => 'color: #0000ff;'
1109 $src .= $i[3] . "),\n";
1110 $src .= $i[2] . "'NUMBERS' => array(\n";
1111 $src .= $i[3] . "),\n";
1112 $src .= $i[2] . "'METHODS' => array(\n";
1113 $src .= $i[3] . "),\n";
1114 $src .= $i[2] . "'SYMBOLS' => array(\n";
1115 foreach($lang['ld']['sy'] as $idx_kw => $tmp_kw) {
1116 $src .= $i[3] . ((int)$idx_kw) . " => " . str_to_phpstring($tmp_kw['style']) . ",\n";
1117 }
1118 $src .= $i[3] . "),\n";
1119 $src .= $i[2] . "'REGEXPS' => array(\n";
1120 $src .= $i[3] . "),\n";
1121 $src .= $i[2] . "'SCRIPT' => array(\n";
1122 $src .= $i[3] . "),\n";
1123 $src .= $i[2] . "),\n";
1124
1125 //Keyword Documentation
1126 $src .= $i[1] . "'URLS' => array(\n";
1127 foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
1128 $src .= $i[2] . ((int)$idx_kw) . " => " . str_to_phpstring($tmp_kw['docs']) . ",\n";
1129 }
1130 $src .= $i[2] . "),\n";
1131 $src .= $i[1] . "'OOLANG' => false,\n";
1132 $src .= $i[1] . "'OBJECT_SPLITTERS' => array(\n";
1133 $src .= $i[2] . "),\n";
1134 $src .= $i[1] . "'REGEXPS' => array(\n";
1135 $src .= $i[2] . "),\n";
1136 $src .= $i[1] . "'STRICT_MODE_APPLIES' => GESHI_MAYBE,\n";
1137 $src .= $i[1] . "'SCRIPT_DELIMITERS' => array(\n";
1138 $src .= $i[2] . "),\n";
1139 $src .= $i[1] . "'HIGHLIGHT_STRICT_BLOCK' => array(\n";
1140 $src .= $i[2] . "),\n";
1141 $src .= $i[1] . "'TAB_WIDTH' => 4\n";
1142
1143 $src .= <<<GESHI_LANGFILE_FOOTER
1144);
1145GESHI_LANGFILE_FOOTER;
1146
1147 //Reduce source ...
1148 $src = preg_replace('/array\‍(\s*\‍)/s', 'array()', $src);
1149 $src = preg_replace('/\,(\s*\‍))/s', '\1', $src);
1150 $src = preg_replace('/\s+$/m', '', $src);
1151
1152 return $src;
1153}
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
const GESHI_VERSION
The version of this GeSHi file.
Definition: geshi.php:44
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
str_to_phpstring($str, $doublequote=false)
Definition: langwiz.php:829

◆ htmlspecialchars_deep()

if(get_magic_quotes_gpc()) htmlspecialchars_deep (   $value)

Definition at line 35 of file langwiz.php.

35 {
36 return is_array($value) ? array_map('htmlspecialchars_deep', $value) : htmlspecialchars($value);
37}

◆ output_error_cache()

output_error_cache ( )

Definition at line 45 of file langwiz.php.

45 {
46 global $error_cache;
47
48 if(count($error_cache)) {
49 echo "<span style=\"color: #F00; font-weight: bold;\">Failed</span><br />";
50 echo "<ol>\n";
51 foreach($error_cache as $error_msg) {
52 echo "<li>";
53 switch($error_msg['t']) {
54 case TYPE_NOTICE:
55 echo "<span style=\"color: #080; font-weight: bold;\">NOTICE:</span>";
56 break;
57 case TYPE_WARNING:
58 echo "<span style=\"color: #CC0; font-weight: bold;\">WARNING:</span>";
59 break;
60 case TYPE_ERROR:
61 echo "<span style=\"color: #F00; font-weight: bold;\">ERROR:</span>";
62 break;
63 }
64 echo " " . $error_msg['m'] . "</li>";
65 }
66 echo "</ol>\n";
67 } else {
68 echo "<span style=\"color: #080; font-weight: bold;\">OK</span><br />";
69 }
70 echo "\n";
71
72 $error_cache = array();
73}
const TYPE_ERROR
Definition: langwiz.php:41
$error_cache
Definition: langwiz.php:44
const TYPE_WARNING
Definition: langwiz.php:40
const TYPE_NOTICE
Definition: langwiz.php:39

References $error_cache, TYPE_ERROR, TYPE_NOTICE, and TYPE_WARNING.

◆ report_error()

report_error (   $type,
  $message 
)

Definition at line 75 of file langwiz.php.

75 {
77
78 $error_cache[] = array('t' => $type, 'm' => $message);
79 if(TYPE_ERROR == $type) {
80 $error_abort = true;
81 }
82}
83
84?>
85<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
86 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
87<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
88<head>
89 <title>GeSHi Language File Generator Script</title>
90 <style type="text/css">
91 <!--
92 html {
93 background-color: #f0f0f0;
94 }
95 body {
96 font-family: Verdana, Arial, sans-serif;
97 margin: 10px;
98 border: 2px solid #e0e0e0;
99 background-color: #fcfcfc;
100 padding: 5px;
101 font-size: 10pt;
102 }
103 h2 {
104 margin: .1em 0 .2em .5em;
105 border-bottom: 1px solid #b0b0b0;
106 color: #b0b0b0;
107 font-weight: normal;
108 font-size: 150%;
109 }
110 h3 {
111 margin: .1em 0 .2em .5em;
112 color: #b0b0b0;
113 font-weight: normal;
114 font-size: 120%;
115 }
116 #footer {
117 text-align: center;
118 font-size: 80%;
119 color: #a9a9a9;
120 }
121 #footer a {
122 color: #9999ff;
123 }
124 textarea {
125 border: 1px solid #b0b0b0;
126 font-size: 90%;
127 color: #333;
128 margin-left: 20px;
129 }
130 select, input {
131 margin-left: 2px;
132 border: 1px solid #808080;
133 }
134 p {
135 font-size: 90%;
136 margin-left: .5em;
137 }
138 fieldset {
139 border: 1px dotted gray;
140 background-color: #f0f0f0;
141 margin-bottom: .5em;
142 }
143 legend {
144 font-weight: bold;
145 background-color: #f9f9f9;
146 border: 1px solid #a0a0a0;
147 border-width: 1px 2px 2px 1px;
148 }
149 fieldset table > tbody > tr > td {
150 width: 20%;
151 }
152 fieldset table > tbody > tr > td+td {
153 width: 80%;
154 }
155
156 fieldset table > tbody > tr > td+td > input {
157 width: 98%;
158 }
159 -->
160 </style>
161</head>
162<body>
163<h2>GeSHi Language File Generator Script</h2>
164<p>To use this script, make sure that <strong>geshi.php</strong> is in the
165parent directory or in your include_path, and that the language files are in a
166subdirectory of GeSHi's directory called <strong>geshi/</strong>.</p>
167<p>If not already done, select a language file below that will be used as
168base for the language file to generate or create a blank one. Following this
169you can do whatever you like to edit your language file. But note that not all
170features are made available through this script.</p>
171
172<p>Checking GeSHi installation ... <?php
173// Rudimentary checking of where GeSHi is. In a default install it will be in ../, but
174// it could be in the current directory if the include_path is set. There's nowhere else
175// we can reasonably guess.
176if (is_readable('../geshi.php')) {
177 $path = '../';
178} elseif (is_readable('geshi.php')) {
179 $path = './';
180} else {
181 report_error(TYPE_ERROR, 'Could not find geshi.php - make sure it is in your include path!');
182}
183
184if(!$error_abort) {
185 require $path . 'geshi.php';
186
187 if(!class_exists('GeSHi')) {
188 report_error(TYPE_ERROR, 'The GeSHi class was not found, although it seemed we loaded the correct file!');
189 }
190}
191
192if(!$error_abort) {
193 if(!defined('GESHI_LANG_ROOT')) {
194 report_error(TYPE_ERROR, 'There\'s no information present on where to find the language files!');
195 } elseif(!is_dir(GESHI_LANG_ROOT)) {
196 report_error(TYPE_ERROR, 'The path "'.GESHI_LANG_ROOT.'" given, does not ressemble a directory!');
197 } elseif(!is_readable(GESHI_LANG_ROOT)) {
198 report_error(TYPE_ERROR, 'The path "'.GESHI_LANG_ROOT.'" is not readable to this script!');
199 }
200}
201
202if(!$error_abort) {
203 if (!($dir = @opendir(GESHI_LANG_ROOT))) {
204 report_error(TYPE_ERROR, 'Error requesting listing for available language files!');
205 }
206
207 $languages = array();
208
209 if(!$error_abort) {
210 while ($file = readdir($dir)) {
211 if (!$file || $file[0] == '.' || strpos($file, '.') === false) {
212 continue;
213 }
214 $lang = substr($file, 0, strpos($file, '.'));
215 $languages[] = $lang;
216 }
217 closedir($dir);
218 }
219
220 $languages = array_unique($languages);
221 sort($languages);
222
223 if(!count($languages)) {
224 report_error(TYPE_WARNING, 'Unable to locate any usable language files in "'.GESHI_LANG_ROOT.'"!');
225 }
226}
227
229
230// --- empty variables for values of $_POST - begin ---
231$post_var_names = array('li', 'ai', 'ld');
232
233$li = array(
234 'file' => 'example',
235 'name' => 'Example'
236 );
237
238$ai = array(
239 'name' => 'Benny Baumann',
240 'email' => 'BenBE@geshi.org',
241 'web' => 'http://qbnz.com/highlighter/'
242 );
243
244$ld = array(
245 'cmt' => array(
246 'sl' => array(
247 1 => array(
248 'start' => '//',
249 'style' => 'font-style: italic; color: #666666;'
250 ),
251 2 => array(
252 'start' => '#',
253 'style' => 'font-style: italic; color: #666666;'
254 )
255 ),
256 'ml' => array(
257 1 => array(
258 'start' => '/*',
259 'end' => '*/',
260 'style' => 'font-style: italic; color: #666666;'
261 ),
262 2 => array(
263 'start' => '',
265 'style' => 'font-style: italic; color: #006600;'
266 )
267 ),
268 'rxc' => array(
269 1 => array(
270 'rx' => '/Hello RegExp/',
271 'style' => 'font-style: italic; color: #666666;'
272 )
273 )
274 ),
275 'str' => array(
276 'qm' => array(
277 1 => array(
278 'delim' => "'",
279 'style' => 'color: #0000FF;'
280 ),
281 2 => array(
282 'delim' => "&quot;",
283 'style' => 'color: #0000FF;'
284 )
285 ),
286 'ec' => array(
287 'char' => '\\',
288 'style' => 'font-weight: bold; color: #000080;'
289 ),
290 'erx' => array(
291 1 => array(
292 'rx' => '/\{\\\\$\w+\}/',
293 'style' => 'font-weight: bold; color: #008080;'
294 ),
295 2 => array(
296 'rx'=> '/\{\\\\$\w+\}/',
297 'style' => 'font-weight: bold; color: #008080;'
298 )
299 )
300 ),
301 'kw_case' => 'GESHI_CAPS_NO_CHANGE',
302 'kw' => array(
303 1 => array(
304 'list' => '',
305 'case' => '0',
306 'style' => 'color: #0000FF; font-weight: bold;',
307 'docs' => ''
308 )
309 ),
310 'sy' => array(
311 0 => array(
312 'list' => '',
313 'style' => 'color: #0000FF; font-weight: bold;'
314 )
315 )
316 );
317
318$kw_case_sel = array(
319 'GESHI_CAPS_NO_CHANGE' => '',
320 'GESHI_CAPS_UPPER' => '',
321 'GESHI_CAPS_LOWER' => ''
322 );
323
324$kw_cases_sel = array(
325 1 => array(
326 0 => '',
327 1 => ''
328 )
329 );
330// --- empty variables for values of $_POST - end ---
331
332echo "<pre>";
333//var_dump($languages);
334
335foreach($post_var_names as $varName) { // export wanted variables of $_POST array...
336 if(array_key_exists($varName, $_POST)) {
337 $$varName = htmlspecialchars_deep($_POST[$varName]);
338 }
339}
340
341// determine the selected kw_case...
342$kw_case_sel[$ld['kw_case']] = ' selected="selected"';
343
344// determine the selected kw_cases...
345for($i = 1; $i <= count($kw_cases_sel); $i += 1) {
346 $kw_cases_sel[$i][(int) $ld['kw'][$i]['case']] = ' selected="selected"';
347}
$path
Definition: aliased.php:25
$_POST["username"]
Definition: geshi.php:259
$languages
Definition: cssgen2.php:34
const GESHI_LANG_ROOT(!defined('GESHI_ROOT'))
The language file directory for GeSHi @access private.
Definition: geshi.php:53
if(PHP_SAPI !='cli') color
Definition: langcheck.php:120
input
Definition: langcheck.php:166
textarea
Definition: langcheck.php:160
font size
Definition: langcheck.php:162
p
Definition: langcheck.php:169
select
Definition: langcheck.php:166
margin left
Definition: langcheck.php:164
$ai
Definition: langwiz.php:238
output_error_cache()
Definition: langwiz.php:45
$post_var_names
Definition: langwiz.php:231
$kw_case_sel
Definition: langwiz.php:318
$kw_cases_sel
Definition: langwiz.php:324
if(get_magic_quotes_gpc()) htmlspecialchars_deep($value)
Definition: langwiz.php:35
$ld
Definition: langwiz.php:244
$li
Definition: langwiz.php:233
$error_abort
Definition: langwiz.php:43
report_error($type, $message)
Definition: langwiz.php:75
A simple script which outputs the CSS classes for all languages supported by GeSHi.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $error_abort, $error_cache, and TYPE_ERROR.

◆ str_to_phpstring()

str_to_phpstring (   $str,
  $doublequote = false 
)

Definition at line 829 of file langwiz.php.

829 {
830 if($doublequote) {
831 return '"' . strtr($str,
832 array(
833 "\"" => "\\\"",
834 "\\" => "\\\\",
835 "\0" => "\\0",
836 "\n" => "\\n",
837 "\r" => "\\r",
838 "\t" => "\\t",
839 "\$" => "\\\$"
840 )
841 ) . '"';
842 } else {
843 return "'" . strtr($str,
844 array(
845 "'" => "\\'",
846 "\\" => "\\\\"
847 )
848 ) . "'";
849 }
850}

◆ validate_lang()

validate_lang ( )

Definition at line 852 of file langwiz.php.

852 {
853 $ai = array(
854 'name' => 'Benny Baumann',
855 'email' => 'BenBE@geshi.org',
856 'web' => 'http://qbnz.com/highlighter/'
857 );
858
859 $li = array(
860 'file' => 'example',
861 'desc' => 'Example'
862 );
863
864 if(isset($_POST['ld'])) {
865 $ld = $_POST['ld'];
866 } else {
867 $ld = array(
868 'cmt' => array(
869 'sl' => array(
870 1 => array(
871 'start' => '//',
872 'style' => 'test'
873 )
874 ),
875 'ml' => array(
876 1 => array(
877 'start' => '/*',
878 'end' => '*/',
879 'style' => 'font-style: italic; color: #666666;'
880 )
881 ),
882 'rxc' => array(
883 1 => array(
884 'rx' => '/Hello/',
885 'style' => 'color: #00000'
886 )
887 )
888 ),
889 'str' => array(
890 'qm' => array(),
891 'ec' => array(
892 'char' => ''
893 ),
894 'erx' => array()
895 ),
896 'kw' => array(),
897 'kw_case' => 'GESHI_CAPS_NO_CHANGE',
898 'sy' => array()
899 );
900 }
901
902 return array('ai' => $ai, 'li' => $li, 'ld' => $ld);
903}

Variable Documentation

◆ $ai

$ai
Initial value:
= array(
'name' => 'Benny Baumann',
'email' => 'BenBE@geshi.org',
'web' => 'http://qbnz.com/highlighter/'
)

Definition at line 238 of file langwiz.php.

Referenced by assClozeTestImport\fromXML(), ilGlossaryPresentationGUI\listTerms(), and ilObjUserFolderGUI\viewObject().

◆ $error_abort

$error_abort = false

Definition at line 43 of file langwiz.php.

Referenced by report_error().

◆ $error_cache

$error_cache = array()

Definition at line 44 of file langwiz.php.

Referenced by output_error_cache(), and report_error().

◆ $G

$G = new GeSHi('', 'php')

Definition at line 805 of file langwiz.php.

Referenced by PHPExcel_Reader_Excel5_MD5\add().

◆ $kw_case_sel [1/2]

$kw_case_sel
Initial value:
= array(
'GESHI_CAPS_NO_CHANGE' => '',
'GESHI_CAPS_UPPER' => '',
'GESHI_CAPS_LOWER' => ''
)

Definition at line 318 of file langwiz.php.

◆ $kw_case_sel [2/2]

foreach ( $post_var_names as $varName) $kw_case_sel[ $ld[ 'kw_case']] = ' selected="selected"'

Definition at line 342 of file langwiz.php.

◆ $kw_cases_sel

$kw_cases_sel
Initial value:
= array(
1 => array(
0 => '',
1 => ''
)
)

Definition at line 324 of file langwiz.php.

◆ $lang

for ( $i=1;$i<=count( $kw_cases_sel);$i+=1) $lang = validate_lang()

Definition at line 349 of file langwiz.php.

Referenced by CAS_AuthenticationException\__construct(), CAS_Client\_authError(), ilTinyMCE\_getEditorLanguage(), ilLanguage\_getInstalledLanguages(), ilObjAssessmentFolder\_getLogLanguage(), ilMDLanguage\_lookupFirstLanguage(), ilECSAppEventListener\_sendNotification(), ilPageObjectGUI\addMultiLangActionsAndInfo(), ilECSCourseSettings\buildJson(), ilDBMySQL\checkQuerySize(), ilSurveyParticipantsGUI\codesObject(), ilObjLanguageFolderGUI\confirmRefreshObject(), HTMLPurifier_LanguageFactory\create(), ilGlossaryDefinition\createMetaData(), ilPCParagraphGUI\edit(), ilPasswordAssistanceGUI\executeCommand(), ilObjContentObject\exportHTML(), ilObjContentObjectGUI\exportHTML(), Context\from_language(), Magic\get_language(), GeSHi\get_language_name_from_extension(), ilContainerGUI\getContainerPageHTML(), ilGlossaryTermGUI\getEditTermForm(), ilObjLanguage\getInstalledLanguages(), ilHttpRequestsLanguageDetector\getIso2LanguageCode(), ilDatePresentation\getLanguage(), ilMDLanguageItem\getLanguageCode(), ilObjLanguageFolder\getLanguages(), ilLMPresentationGUI\getLMPresentationTitle(), ilDiskQuotaReminderMail\getLng(), ilObjContentObjectGUI\getMultiLangHeader(), ilLMMultiSrt\getMultiSrtFiles(), ilObjMediaObject\getMultiSrtFiles(), ilLMExplorerGUI\getNodeContent(), ilPublicSectionExplorerGUI\getNodeContent(), ilUserUtil\getPossibleStartingPoints(), ilDidacticTemplateSetting\getPresentation(), ilObjSurvey\getSurveyCodesTableData(), ilOrgUnitType\getTranslation(), ilStudyProgrammeType\getTranslation(), ilDidacticTemplateSetting\getTranslations(), ilCOPageExporter\getXmlExportHeadDependencies(), ilPCFileListGUI\initEditForm(), ilADTTest\initProperties(), ilPCTableGUI\initPropertiesForm(), ilPCSourceCodeGUI\initPropertyForm(), ilMDEditorGUI\initQuickEditForm(), ilLDAPSettingsGUI\initUserMappingForm(), ilMDEditorGUI\listQuickEdit_scorm(), ilObjGlossaryGUI\listTerms(), CAS_Client\logout(), CAS_Client\printHTMLFooter(), CAS_Client\redirectToCas(), ilObjLanguage\refreshAll(), ilPageMultiLang\save(), ilPCParagraph\saveMetaKeywords(), ilObjLanguageExtGUI\saveNewEntryObject(), ilAccountMail\send(), ilDiskQuotaReminderMail\send(), ilObjSurvey\sendCodes(), ilSurveyParticipantsGUI\sendCodesMailObject(), ilRemoteObjectBase\sendNewContentNotification(), ilECSObjectSettings\sendNewContentNotification(), ilAuthContainerECS\sendNotification(), CAS_Client\serviceMail(), CAS_Client\serviceWeb(), ilOrgUnitType\setDescription(), ilStudyProgrammeType\setDescription(), phpCAS\setLang(), CAS_Client\setLang(), ilDatePresentation\setLanguage(), ilOrgUnitType\setTitle(), ilStudyProgrammeType\setTitle(), ilObjComponentSettingsGUI\showPlugin(), ilNotificationSystem\toUsers(), ilMDEducational\toXML(), HTMLPurifier_AttrTransform_Lang\transform(), ilInitialisation\translateMessage(), ilMDKeyword\updateKeywords(), ilPlugin\updateLanguages(), ilObjCategoryGUI\updateObject(), ilMDEditorGUI\updateQuickEdit_scorm(), ilDidacticTemplateSettingsGUI\updateTemplate(), and ilValidatorAdapter\validate().

◆ $langfile_source

$langfile_source = gen_langfile($lang)

Definition at line 806 of file langwiz.php.

◆ $ld

◆ $li

◆ $post_var_names

$post_var_names = array('li', 'ai', 'ld')

Definition at line 231 of file langwiz.php.

◆ $time_diff

$time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1]

Definition at line 819 of file langwiz.php.

◆ $time_end

$time_end = explode(' ', microtime())

Definition at line 818 of file langwiz.php.

◆ $time_start

$time_start = explode(' ', microtime())

Definition at line 17 of file langwiz.php.

◆ else

if(is_readable('../geshi.php')) elseif (is_readable( 'geshi.php')) else
Initial value:
{
report_error(TYPE_ERROR, 'Could not find geshi.php - make sure it is in your include path!')

Definition at line 180 of file langwiz.php.

◆ TYPE_ERROR

const TYPE_ERROR 2

Definition at line 41 of file langwiz.php.

Referenced by output_error_cache(), and report_error().

◆ TYPE_NOTICE

const TYPE_NOTICE 0

Definition at line 39 of file langwiz.php.

Referenced by output_error_cache().

◆ TYPE_WARNING

const TYPE_WARNING 1

Definition at line 40 of file langwiz.php.

Referenced by output_error_cache().