3 declare(strict_types=1);
39 protected array
$js_files = [0 =>
'./Services/JavaScript/js/Basic.js'];
45 protected array
$js_files_vp = [
'./Services/JavaScript/js/Basic.js' =>
true];
57 string $in_module =
'',
58 string $vars =
'DEFAULT',
60 bool $a_use_cache =
true 63 $this->
template =
new ilTemplate($file, $flag1, $flag2, $in_module, $vars,
$plugin, $a_use_cache);
79 public function addJavaScript(
string $a_js_file,
bool $a_add_version_parameter =
true,
int $a_batch = 2): void
82 if ($a_batch < 1 || $a_batch > 3) {
88 is_int(strpos($a_js_file,
'Services/jQuery')) ||
89 is_int(strpos($a_js_file,
'/jquery.js')) ||
90 is_int(strpos($a_js_file,
'/jquery-min.js'))
95 if (!in_array($a_js_file, $this->js_files,
true)) {
96 $this->js_files[] = $a_js_file;
97 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
98 $this->js_files_batch[$a_js_file] = $a_batch;
114 $this->js_files = [];
115 $this->js_files_vp = [];
116 $this->js_files_batch = [];
127 $vers =
'vers=' . str_replace([
'.',
' '],
'-',
ILIAS_VERSION);
129 if (defined(
'DEVMODE') && DEVMODE) {
130 $vers .=
'-' . time();
135 for (
$i = 0;
$i <= 3;
$i++) {
136 reset($this->js_files);
137 foreach ($this->js_files as $file) {
138 if ($this->js_files_batch[$file] ===
$i) {
139 if ($a_force || is_file($file) || strpos($file,
'http') === 0 || strpos($file,
'//') === 0) {
141 } elseif (strpos($file,
'./') === 0) {
142 $url_parts = parse_url($file);
143 if (is_file($url_parts[
'path'])) {
156 if ($this->js_files_vp[$file]) {
164 public function addCss(
string $a_css_file,
string $media =
"screen"): void
168 public function addInlineCss(
string $a_css,
string $media =
"screen"): void
174 $this->body_class = $a_class;
179 if ($this->body_class !==
'' && $this->
blockExists(
'body_class')) {
181 $this->
setVariable(
'BODY_CLASS', $this->body_class);
188 if ($this->standard_template_loaded) {
197 $this->
addBlockFile(
'CONTENT',
'content',
'tpl.adm_content.html');
198 $this->
addBlockFile(
'STATUSLINE',
'statusline',
'tpl.statusline.html');
200 $this->standard_template_loaded =
true;
203 public function setTitle(
string $a_title,
bool $hidden =
false): void
211 public function setTitleIcon(
string $a_icon_path,
string $a_icon_desc =
""): void
235 public function setTabs(
string $a_tabs_html): void
269 string $part = self::DEFAULT_BLOCK,
270 bool $add_error_mess =
false,
271 bool $handle_referer =
false,
272 bool $add_ilias_footer =
false,
273 bool $add_standard_elements =
false,
274 bool $a_main_menu =
true,
281 string $part = self::DEFAULT_BLOCK,
282 bool $has_tabs =
true,
283 bool $skip_main_menu =
false 287 $http = $DIC->http();
288 switch (
$http->request()->getHeaderLine(
'Accept')) {
292 header(
'P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
293 header(
'Content-type: text/html; charset=UTF-8');
301 if ($part === self::DEFAULT_BLOCK) {
302 $html = $this->
template->getUnmodified();
304 $html = $this->
template->getUnmodified($part);
323 bool $is_bottom_panel =
true,
324 bool $has_arrow =
false 331 string $a_append =
"",
332 string $a_target =
"",
345 public function get(
string $part = self::DEFAULT_BLOCK):
string 347 return $this->
template->get($part);
352 $this->
template->setVariable($variable, $value);
357 return $this->
template->setCurrentBlock($part);
362 return $this->
template->touchBlock($block);
367 return $this->
template->parseCurrentBlock($block_name);
370 public function addBlockFile(
string $var,
string $block,
string $template_name,
string $in_module = null): bool
372 return $this->
template->addBlockFile($var, $block, $template_name, $in_module);
377 return $this->
template->blockExists($block_name);
fillJavascriptFile(string $file, string $vers)
addAdminPanelToolbar(ilToolbarGUI $toolbar, bool $is_bottom_panel=true, bool $has_arrow=false)
Add admin panel commands as toolbar.
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
setLeftNavContent(string $a_content)
Sets content of left navigation column.
addLightbox(string $a_html, string $a_id)
Add a lightbox html to the template.
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
setLoginTargetPar(string $a_val)
Set target parameter for login (public sector).
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
setHeaderPageTitle(string $a_title)
Sets the title of the page (for browser window).
setDescription(string $a_descr)
Sets description below title in standard template.
addInlineCss(string $a_css, string $media="screen")
Add a css file that should be included in the header.
setHeaderActionMenu(string $a_header)
Set header action menu.
__construct(string $file, bool $flag1, bool $flag2, string $in_module='', string $vars='DEFAULT', bool $plugin=false, bool $a_use_cache=true)
setBodyClass(string $a_class='')
Sets the body-tags class.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
setTabs(string $a_tabs_html)
sets tabs in standard template
setSubTabs(string $a_tabs_html)
sets subtabs in standard template
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
printToString()
Use this method to get the finally rendered page as string.
setTreeFlatIcon(string $a_link, string $a_mode)
Sets a tree or flat icon.
static initDom(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Dom.
setAlertProperties(array $alerts)
Set alert properties.
clearHeader()
Clear header.
setPageFormAction(string $a_action)
Sets the pages form action.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
resetJavascript()
Reset javascript files.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
setLeftContent(string $a_html)
Sets content of left column.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
touchBlock(string $block)
overwrites ITX::touchBlock.
blockExists(string $block_name)
check if block exists in actual template
fillJavaScriptFiles(bool $a_force=false)
Probably adds javascript files.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
static init(ilGlobalTemplateInterface $template=null)
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
setRightContent(string $a_html)
Sets content of right column.
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
addBlockFile(string $var, string $block, string $template_name, string $in_module=null)
overwrites ITX::addBlockFile
setLocator()
Insert locator.
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
setFileUploadRefId(int $a_ref_id)
Enables the file upload into this object by dropping a file.
hideFooter()
Make the template hide the footer.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
getSpecial(string $part=self::DEFAULT_BLOCK, bool $add_error_mess=false, bool $handle_referer=false, bool $add_ilias_footer=false, bool $add_standard_elements=false, bool $a_main_menu=true, bool $a_tabs=true)
Renders the page with specific elements enabled.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
bool $standard_template_loaded