Syntax highlighter wrapper class.
More...
Syntax highlighter wrapper class.
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 12 of file class.ilSyntaxHighlighter.php.
◆ __construct()
ilSyntaxHighlighter::__construct |
( |
|
$a_lang | ) |
|
|
protected |
◆ getInstance()
static ilSyntaxHighlighter::getInstance |
( |
|
$a_lang | ) |
|
|
static |
◆ getNewLanguageId()
static ilSyntaxHighlighter::getNewLanguageId |
( |
|
$a_old_lang_id | ) |
|
|
static |
◆ getSupportedLanguages()
static ilSyntaxHighlighter::getSupportedLanguages |
( |
| ) |
|
|
static |
Get supported languages (keys are internal values, values are for representation)
- Parameters
-
return string[]
Definition at line 80 of file class.ilSyntaxHighlighter.php.
References $langs.
◆ getSupportedLanguagesV51()
static ilSyntaxHighlighter::getSupportedLanguagesV51 |
( |
| ) |
|
|
static |
Get supported languages (keys are ILIAS <= 5.1 internal values, values are for representation)
- Parameters
-
return string[]
Definition at line 117 of file class.ilSyntaxHighlighter.php.
118 {
120 $map = array_flip(self::$v51_map);
121 foreach (self::$langs as $k => $v) {
122 if (isset($map[$k])) {
123 $k = $map[$k];
124 }
126 }
128 }
References $langs.
Referenced by ilPCSourceCodeGUI\getProgLangOptions().
◆ highlight()
ilSyntaxHighlighter::highlight |
( |
|
$a_code | ) |
|
Highlight code.
- Parameters
-
- Returns
- string highlighted code
Definition at line 136 of file class.ilSyntaxHighlighter.php.
137 {
138 include_once("./libs/composer/vendor/geshi/geshi/src/geshi.php");
139 $geshi = new Geshi(html_entity_decode($a_code), $this->lang);
140
141
142
143
144 $a_code = $geshi->parse_code();
145
146
147 $a_code = substr($a_code, strpos($a_code, ">") + 1);
148 $a_code = substr($a_code, 0, strrpos($a_code, "<"));
149
150 return $a_code;
151 }
◆ isSupported()
static ilSyntaxHighlighter::isSupported |
( |
|
$a_lang | ) |
|
|
static |
◆ $lang
ilSyntaxHighlighter::$lang |
|
protected |
◆ $langs
ilSyntaxHighlighter::$langs |
|
staticprotected |
◆ $v51_map
ilSyntaxHighlighter::$v51_map |
|
staticprotected |
const ilSyntaxHighlighter::C = "c" |
◆ CPP
const ilSyntaxHighlighter::CPP = "cpp" |
◆ DELPHI
const ilSyntaxHighlighter::DELPHI = "delphi" |
◆ HTML
const ilSyntaxHighlighter::HTML = "html4strict" |
◆ JAVA
const ilSyntaxHighlighter::JAVA = "java" |
◆ LATEX
const ilSyntaxHighlighter::LATEX = "latex" |
◆ PHP
const ilSyntaxHighlighter::PHP = "php" |
◆ VISUAL_BASIC
const ilSyntaxHighlighter::VISUAL_BASIC = "vb" |
◆ XML
const ilSyntaxHighlighter::XML = "xml" |
The documentation for this class was generated from the following file: