19 declare(strict_types=1);
21 require_once(__DIR__ .
'/../../../../../vendor/composer/vendor/autoload.php');
24 require_once(__DIR__ .
'/../../../../../components/ILIAS/UICore/lib/html-it/IT.php');
25 require_once(__DIR__ .
'/../../../../../components/ILIAS/UICore/lib/html-it/ITX.php');
26 require_once(__DIR__ .
'/../../../../../components/ILIAS/UICore/classes/class.ilTemplate.php');
35 $vars = self::DEFAULT_BLOCK,
46 bool $add_error_mess =
false,
47 bool $handle_referer =
false,
48 bool $add_ilias_footer =
false,
49 bool $add_standard_elements =
false,
50 bool $a_main_menu =
true,
53 return $this->
template->get($part);
66 if ($filename[0] ===
'/' && substr($this->fileRoot, -1) ===
'/') {
67 $filename = substr($filename, 1);
74 if (!($fh = @fopen($filename,
'rb'))) {
75 $this->err[] = (
new PEAR())->raiseError(
76 $this->errorMessage(self::IT_TPL_NOT_FOUND) .
77 ': "' . $filename .
'"',
78 self::IT_TPL_NOT_FOUND
83 $fsize = filesize($filename);
89 $content = fread($fh, $fsize);
92 return preg_replace_callback(
93 "#<!-- INCLUDE (.*) -->#im",
95 return $this->getFile($hit[1]);
107 bool $removeUnknownVariables =
true,
108 bool $removeEmptyBlocks =
true 114 public function get(?
string $part =
null):
string 116 if ($part ===
null) {
117 $part = self::IT_DEFAULT_BLOCK;
119 if ($part === self::IT_DEFAULT_BLOCK && !$this->flagGlobalParsed) {
120 $this->parse(self::IT_DEFAULT_BLOCK);
123 if (!isset($this->blocklist[$part])) {
128 if (isset($this->blockdata[$part])) {
129 $ret = $this->blockdata[$part];
130 if ($this->clearCache) {
131 unset($this->blockdata[$part]);
133 if ($this->_options[
'preserve_data']) {
135 $this->openingDelimiter .
136 '%preserved%' . $this->closingDelimiter,
137 $this->openingDelimiter,
special template class to simplify handling of ITX/PEAR
__construct( $file, $flag1, $flag2, $in_module='', $vars=self::DEFAULT_BLOCK, $plugin=false, $a_use_cache=true)
loadTemplatefile(string $filename, bool $removeUnknownVariables=true, bool $removeEmptyBlocks=true)
Reads a template file from the disk.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getFile(string $filename)
Reads a file from disk and returns its content.
setBodyClass(string $a_class="")
Sets the body-tags class.
loadTemplatefile(string $filename, bool $removeUnknownVariables=true, bool $removeEmptyBlocks=true)
Reads a template file from the disk.