28 public const JAVA =
"java";
29 public const PHP =
"php";
31 public const CPP =
"cpp";
32 public const HTML =
"html4strict";
33 public const XML =
"xml";
38 public const CSS =
"css";
40 public const SQL =
"sql";
41 public const BASH =
"bash";
47 protected static array
$langs = array(
52 self::DELPHI =>
"Delphi",
55 self::JAVASCRIPT =>
"Javascript",
56 self::LATEX =>
"LaTeX",
58 self::POWERSHELL =>
"Powershell",
59 self::PYTHON =>
"Python",
61 self::VISUAL_BASIC =>
"Visual Basic",
71 "html" =>
"html4strict" 78 $this->lang = $a_lang;
83 return new self($a_lang);
100 return isset(self::$langs[$a_lang]);
108 return self::$v51_map[$a_old_lang_id] ?? $a_old_lang_id;
118 $map = array_flip(self::$v51_map);
119 foreach (self::$langs as $k => $v) {
120 if (isset($map[$k])) {
130 include_once(
"./vendor/composer/vendor/geshi/geshi/src/geshi.php");
131 $geshi =
new Geshi(html_entity_decode($a_code), $this->lang);
136 $a_code = $geshi->parse_code();
139 $a_code = substr($a_code, strpos($a_code,
">") + 1);
140 $a_code = substr($a_code, 0, strrpos($a_code,
"<"));
static getInstance(string $a_lang)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(string $a_lang)
static getNewLanguageId(string $a_old_lang_id)
Get new language id (for an old one)
static getSupportedLanguages()
Get supported languages (keys are internal values, values are for representation) ...
highlight(string $a_code)
static getSupportedLanguagesV51()
Get supported languages (keys are ILIAS <= 5.1 internal values, values are for representation) ...
static isSupported(string $a_lang)
Is language supported?