ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilGlobalTemplate Class Reference

special template class to simplify handling of ITX/PEAR More...

+ Inheritance diagram for ilGlobalTemplate:
+ Collaboration diagram for ilGlobalTemplate:

Public Member Functions

 __construct (string $file, bool $flag1, bool $flag2, string $in_module='', string $vars=self::DEFAULT_BLOCK, bool $plugin=false, bool $a_use_cache=true)
 
 printToString (string $part=self::DEFAULT_BLOCK)
 
 hideFooter ()
 Make the template hide the footer. More...
 
 setOnScreenMessage (string $a_type, string $a_txt, bool $a_keep=false)
 Set a message to be displayed to the user. More...
 
 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. More...
 
 addOnLoadCode (string $a_code, int $a_batch=2)
 Add on load code. More...
 
 getOnLoadCodeForAsynch ()
 Get js onload code for ajax calls. More...
 
 resetJavascript ()
 Reset javascript files. More...
 
 fillJavaScriptFiles (bool $a_force=false)
 Probably adds javascript files. More...
 
 fillOnLoadCode ()
 
 addCss (string $a_css_file, string $media="screen")
 Add a css file that should be included in the header. More...
 
 addInlineCss (string $a_css, string $media="screen")
 Add a css file that should be included in the header. More...
 
 fillCssFiles (bool $a_force=false)
 
 setBodyClass (string $a_class="")
 Sets the body-tags class. More...
 
 fillBodyClass ()
 
 renderPage (string $part, bool $a_fill_tabs, bool $a_skip_main_menu, Container $DIC)
 
 loadStandardTemplate ()
 This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STATUSLINE placeholders if they are not already loaded. More...
 
 setTitle (string $a_title, bool $hidden=false)
 Sets title in standard template. More...
 
 setDescription (string $a_descr)
 Sets descripton below title in standard template. More...
 
 setTitleIcon (string $a_icon_path, string $a_icon_desc="")
 set title icon More...
 
 setAlertProperties (array $a_props)
 Set alert properties. More...
 
 clearHeader ()
 Clear header. More...
 
 setHeaderActionMenu (string $a_header)
 Set header action menu. More...
 
 setHeaderPageTitle (string $a_title)
 Sets the title of the page (for browser window). More...
 
 setLocator ()
 Insert locator. More...
 
 setTabs (string $a_tabs_html)
 
 setSubTabs (string $a_tabs_html)
 sets subtabs in standard template More...
 
 fillTabs ()
 
 setContent (string $a_html)
 Sets content for standard template. More...
 
 setLeftContent (string $a_html)
 Sets content of left column. More...
 
 setLeftNavContent (string $a_content)
 Sets content of left navigation column. More...
 
 setRightContent (string $a_html)
 Sets content of right column. More...
 
 fillContentLanguage ()
 
 fillWindowTitle ()
 
 setPageFormAction (string $a_action)
 Sets the pages form action. More...
 
 setLoginTargetPar (string $a_val)
 Set target parameter for login (public sector). More...
 
 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)
 
 printToStdout (string $part=self::DEFAULT_BLOCK, bool $a_fill_tabs=true, bool $a_skip_main_menu=false)
 
 fillScreenReaderFocus ()
 
 setTreeFlatIcon (string $a_link, string $a_mode)
 Sets a tree or flat icon. More...
 
 addAdminPanelToolbar (ilToolbarGUI $toolb, bool $a_bottom_panel=true, bool $a_arrow=false)
 
 setPermanentLink (string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
 Generates and sets a permanent ilias link. More...
 
 resetHeaderBlock (bool $a_reset_header_action=true)
 Reset all header properties: title, icon, description, alerts, action menu. More...
 
 setFileUploadRefId (int $a_ref_id)
 Enables the file upload into this object by dropping a file. More...
 
 get (string $part=self::DEFAULT_BLOCK)
 
 setVariable (string $variable, $value='')
 Sets the given variable to the given value. More...
 
 setCurrentBlock (string $part=self::DEFAULT_BLOCK)
 
 touchBlock (string $block)
 
 parseCurrentBlock (string $part=self::DEFAULT_BLOCK)
 
 addBlockFile (string $var, string $block, string $template_name, ?string $in_module=null)
 
 blockExists (string $a_blockname)
 check if block exists in actual template More...
 
 getJSFiles ()
 
 getCSSFiles ()
 
- Public Member Functions inherited from ILIAS\UICore\GlobalTemplate
 hideFooter ()
 Make the template hide the footer. More...
 
 setOnScreenMessage (string $type, string $a_txt, bool $a_keep=false)
 Set a message to be displayed to the user. More...
 
 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. More...
 
 addOnLoadCode (string $a_code, int $a_batch=2)
 Add on load code. More...
 
 getOnLoadCodeForAsynch ()
 Get js onload code for ajax calls. More...
 
 resetJavascript ()
 Reset javascript files. More...
 
 fillJavaScriptFiles (bool $a_force=false)
 Probably adds javascript files. More...
 
 addCss (string $a_css_file, string $media="screen")
 Add a css file that should be included in the header. More...
 
 addInlineCss (string $a_css, string $media="screen")
 Add a css file that should be included in the header. More...
 
 setBodyClass (string $a_class="")
 Sets the body-tags class. More...
 
 loadStandardTemplate ()
 This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STATUSLINE placeholders if they are not already loaded. More...
 
 setTitle (string $a_title, bool $hidden=false)
 Sets title in standard template. More...
 
 setDescription (string $a_descr)
 Sets description below title in standard template. More...
 
 setTitleIcon (string $a_icon_path, string $a_icon_desc="")
 set title icon More...
 
 setAlertProperties (array $alerts)
 Set alert properties. More...
 
 clearHeader ()
 Clear header. More...
 
 setHeaderActionMenu (string $a_header)
 Set header action menu. More...
 
 setHeaderPageTitle (string $a_title)
 Sets the title of the page (for browser window). More...
 
 setLocator ()
 Insert locator. More...
 
 setTabs (string $a_tabs_html)
 sets tabs in standard template More...
 
 setSubTabs (string $a_tabs_html)
 sets subtabs in standard template More...
 
 setContent (string $a_html)
 Sets content for standard template. More...
 
 setLeftContent (string $a_html)
 Sets content of left column. More...
 
 setLeftNavContent (string $a_content)
 Sets content of left navigation column. More...
 
 setRightContent (string $a_html)
 Sets content of right column. More...
 
 setPageFormAction (string $a_action)
 Sets the pages form action. More...
 
 setLoginTargetPar (string $a_val)
 Set target parameter for login (public sector). More...
 
 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. More...
 
 printToStdout (string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
 
 printToString ()
 Use this method to get the finally rendered page as string. More...
 
 setTreeFlatIcon (string $a_link, string $a_mode)
 Sets a tree or flat icon. More...
 
 addAdminPanelToolbar (\ilToolbarGUI $toolbar, bool $is_bottom_panel=true, bool $has_arrow=false)
 Add admin panel commands as toolbar. More...
 
 setPermanentLink (string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
 Generates and sets a permanent ilias link. More...
 
 resetHeaderBlock (bool $a_reset_header_action=true)
 Reset all header properties: title, icon, description, alerts, action menu. More...
 
 setFileUploadRefId (int $a_ref_id)
 Enables the file upload into this object by dropping a file. More...
 
 get (string $part=self::DEFAULT_BLOCK)
 Renders the given block and returns the html string. More...
 
 setVariable (string $variable, $value='')
 Sets the given variable to the given value. More...
 
 setCurrentBlock (string $part=self::DEFAULT_BLOCK)
 Sets the template to the given block. More...
 
 parseCurrentBlock (string $block_name=self::DEFAULT_BLOCK)
 Parses the given block. More...
 
 touchBlock (string $block)
 overwrites ITX::touchBlock. More...
 
 addBlockFile (string $var, string $block, string $template_name, ?string $in_module=null)
 overwrites ITX::addBlockFile More...
 
 blockExists (string $block_name)
 check if block exists in actual template More...
 

Protected Member Functions

 getMainMenu ()
 
 fillMainMenu ()
 
 initHelp ()
 
 fillMessage ()
 
 getMessageTextForType (string $type)
 
 fillJavascriptFile (string $file, string $vers)
 
 resetCss ()
 
 fillInlineCss ()
 
 fillNewContentStyle ()
 
 fillHeader ()
 
 getHeaderActionMenu ()
 
 getTabsHTML ()
 
 fillLeftNav ()
 
 setCenterColumnClass ()
 
 fillMainContent ()
 
 fillLeftContent ()
 
 fillRightContent ()
 
 fillToolbar ()
 
 fillPageFormAction ()
 
 getLoginTargetPar ()
 
 fillSideIcons ()
 
 fillAdminPanel ()
 
 fillPermanentLink ()
 
 variableExists (string $a_variablename)
 

Protected Attributes

ilTemplate $template
 
ilToolbarGUI $admin_panel_commands_toolbar = null
 
array $js_files
 
array $js_files_vp
 
array $js_files_batch
 
array $css_files = []
 
array $inline_css = []
 
string $in_module
 
string $template_name
 
string $body_class = ''
 
string $tree_flat_link = ""
 
string $page_form_action = ""
 
array $permanent_link = []
 
string $main_content = ""
 
array $lightbox = []
 
bool $standard_template_loaded = false
 
string $main_menu = ''
 
string $main_menu_spacer = ''
 
array $messages = []
 
bool $show_footer = true
 
array $on_load_code = []
 
string $left_nav_content = ''
 
string $tree_flat_mode = ''
 
bool $admin_panel_arrow = false
 
bool $admin_panel_bottom = false
 
int $enable_fileupload = null
 
string $header_page_title = ""
 
string $title = ""
 
string $title_desc = ""
 
array $title_alerts = []
 
string $header_action = ''
 
string $icon_desc = ''
 
string $icon_path = ''
 
string $tabs_html = ""
 
string $sub_tabs_html = ""
 
string $left_content = ''
 
string $right_content = ''
 
string $login_target_par = ''
 

Additional Inherited Members

- Data Fields inherited from ILIAS\UICore\GlobalTemplate
const MESSAGE_TYPE_FAILURE = 'failure'
 
const MESSAGE_TYPE_SUCCESS = "success"
 
const MESSAGE_TYPE_QUESTION = "question"
 
const MESSAGE_TYPE_INFO = "info"
 
const MESSAGE_TYPES
 
const DEFAULT_BLOCK = 'DEFAULT'
 

Detailed Description

special template class to simplify handling of ITX/PEAR

Author
Stefan Kesseler skess.nosp@m.eler.nosp@m.@data.nosp@m.bay..nosp@m.de
Sascha Hofmann shofm.nosp@m.ann@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Thibeau Fuhrer thibe.nosp@m.au@s.nosp@m.r.sol.nosp@m.utio.nosp@m.ns

Definition at line 29 of file class.ilGlobalTemplate.php.

Constructor & Destructor Documentation

◆ __construct()

ilGlobalTemplate::__construct ( string  $file,
bool  $flag1,
bool  $flag2,
string  $in_module = '',
string  $vars = self::DEFAULT_BLOCK,
bool  $plugin = false,
bool  $a_use_cache = true 
)
Exceptions
ilTemplateException|ilSystemStyleException

Reimplemented in LTI\ilGlobalTemplate.

Definition at line 105 of file class.ilGlobalTemplate.php.

113 {
114 $this->setBodyClass("std");
115 $this->template_name = $file;
116 $this->in_module = $in_module;
117 $this->template = new ilTemplate(
118 $file,
119 $flag1,
120 $flag2,
122 $vars,
123 $plugin,
124 $a_use_cache
125 );
126 }
setBodyClass(string $a_class="")
Sets the body-tags class.
special template class to simplify handling of ITX/PEAR

References $in_module, XapiProxy\$plugin, and setBodyClass().

+ Here is the call graph for this function:

Member Function Documentation

◆ addAdminPanelToolbar()

ilGlobalTemplate::addAdminPanelToolbar ( ilToolbarGUI  $toolb,
bool  $a_bottom_panel = true,
bool  $a_arrow = false 
)

Definition at line 1060 of file class.ilGlobalTemplate.php.

1060 : void
1061 {
1062 $this->admin_panel_commands_toolbar = $toolb;
1063 $this->admin_panel_arrow = $a_arrow;
1064 $this->admin_panel_bottom = $a_bottom_panel;
1065 }

◆ addBlockFile()

ilGlobalTemplate::addBlockFile ( string  $var,
string  $block,
string  $template_name,
?string  $in_module = null 
)
Exceptions
ilTemplateException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1203 of file class.ilGlobalTemplate.php.

1203 : bool
1204 {
1205 return $this->template->addBlockFile($var, $block, $template_name, $in_module);
1206 }

◆ addCss()

ilGlobalTemplate::addCss ( string  $a_css_file,
string  $media = "screen" 
)

Add a css file that should be included in the header.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 318 of file class.ilGlobalTemplate.php.

318 : void
319 {
320 if (!array_key_exists($a_css_file . $media, $this->css_files)) {
321 $this->css_files[$a_css_file . $media] = [
322 "file" => $a_css_file,
323 "media" => $media,
324 ];
325 }
326 }

◆ addInlineCss()

ilGlobalTemplate::addInlineCss ( string  $a_css,
string  $media = "screen" 
)

Add a css file that should be included in the header.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 328 of file class.ilGlobalTemplate.php.

328 : void
329 {
330 $this->inline_css[] = [
331 "css" => $a_css,
332 "media" => $media,
333 ];
334 }

◆ addJavaScript()

ilGlobalTemplate::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.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 193 of file class.ilGlobalTemplate.php.

193 : void
194 {
195 // three batches currently
196 if ($a_batch < 1 || $a_batch > 3) {
197 $a_batch = 2;
198 }
199
200 // ensure jquery files being loaded first
201 if (is_int(strpos($a_js_file, "components/ILIAS/jQuery")) ||
202 is_int(strpos($a_js_file, "/jquery.js")) ||
203 is_int(strpos($a_js_file, "/jquery/")) ||
204 is_int(strpos($a_js_file, "/jquery-ui/")) ||
205 is_int(strpos($a_js_file, "/jquery-min.js"))
206 ) {
207 $a_batch = 0;
208 }
209
210 if (!in_array($a_js_file, $this->js_files, true)) {
211 $this->js_files[] = $a_js_file;
212 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
213 $this->js_files_batch[$a_js_file] = $a_batch;
214 }
215 }

◆ addOnLoadCode()

ilGlobalTemplate::addOnLoadCode ( string  $a_code,
int  $a_batch = 2 
)

Add on load code.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 217 of file class.ilGlobalTemplate.php.

217 : void
218 {
219 // three batches currently
220 if ($a_batch < 1 || $a_batch > 3) {
221 $a_batch = 2;
222 }
223
224 $this->on_load_code[$a_batch][] = $a_code;
225 }

◆ blockExists()

ilGlobalTemplate::blockExists ( string  $block_name)

check if block exists in actual template

Parameters
string$block_name

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1208 of file class.ilGlobalTemplate.php.

1208 : bool
1209 {
1210 return $this->template->blockExists($a_blockname);
1211 }

Referenced by fillBodyClass(), fillCssFiles(), and fillJavaScriptFiles().

+ Here is the caller graph for this function:

◆ clearHeader()

ilGlobalTemplate::clearHeader ( )

Clear header.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 564 of file class.ilGlobalTemplate.php.

564 : void
565 {
566 $this->setTitle("");
567 $this->setTitleIcon("");
568 $this->setDescription("");
569 $this->setAlertProperties([]);
570 }
setDescription(string $a_descr)
Sets descripton below title in standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setAlertProperties(array $a_props)
Set alert properties.

◆ fillAdminPanel()

ilGlobalTemplate::fillAdminPanel ( )
protected
Exceptions
ilTemplateException

Definition at line 1070 of file class.ilGlobalTemplate.php.

1070 : void
1071 {
1072 global $DIC;
1073 $lng = $DIC->language();
1074
1075 if ($this->admin_panel_commands_toolbar === null) {
1076 return;
1077 }
1078
1080
1081 // Add arrow if desired.
1082 if ($this->admin_panel_arrow) {
1083 $toolb->setLeadingImage(ilUtil::getImagePath("nav/arrow_upright.svg"), $lng->txt("actions"));
1084 }
1085
1086 $this->fillPageFormAction();
1087
1088 // Add top admin bar.
1089 $this->setCurrentBlock("adm_view_components");
1090 $this->setVariable("ADM_PANEL1", $toolb->getHTML());
1091 $this->parseCurrentBlock();
1092
1093 // Add bottom admin bar if user wants one.
1094 if ($this->admin_panel_bottom) {
1095 $this->setCurrentBlock("adm_view_components2");
1096
1097 // Replace previously set arrow image.
1098 if ($this->admin_panel_arrow) {
1099 $toolb->setLeadingImage(ilUtil::getImagePath("nav/arrow_downright.svg"), $lng->txt("actions"));
1100 }
1101
1102 $this->setVariable("ADM_PANEL2", $toolb->getHTML());
1103 $this->parseCurrentBlock();
1104 }
1105 }
ilToolbarGUI $admin_panel_commands_toolbar
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
parseCurrentBlock(string $part=self::DEFAULT_BLOCK)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setLeadingImage(string $a_img, string $a_alt)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, ilUtil\getImagePath(), and setVariable().

+ Here is the call graph for this function:

◆ fillBodyClass()

ilGlobalTemplate::fillBodyClass ( )
Exceptions
ilTemplateException

Definition at line 366 of file class.ilGlobalTemplate.php.

366 : void
367 {
368 if ($this->body_class !== "" && $this->blockExists("body_class")) {
369 $this->setCurrentBlock("body_class");
370 $this->setVariable("BODY_CLASS", $this->body_class);
371 $this->parseCurrentBlock();
372 }
373 }
blockExists(string $a_blockname)
check if block exists in actual template

References blockExists(), parseCurrentBlock(), setCurrentBlock(), and setVariable().

+ Here is the call graph for this function:

◆ fillContentLanguage()

ilGlobalTemplate::fillContentLanguage ( )

Definition at line 852 of file class.ilGlobalTemplate.php.

852 : void
853 {
854 global $DIC;
855 $lng = $DIC->language();
856
857 if (is_object($lng)) {
858 $this->setVariable('META_CONTENT_LANGUAGE', $lng->getContentLanguage());
859 $this->setVariable('LANGUAGE_DIRECTION', $lng->getTextDirection());
860 }
861 }

References $DIC, $lng, and setVariable().

+ Here is the call graph for this function:

◆ fillCssFiles()

ilGlobalTemplate::fillCssFiles ( bool  $a_force = false)
Exceptions
ilTemplateException

Definition at line 339 of file class.ilGlobalTemplate.php.

339 : void
340 {
341 if (!$this->blockExists("css_file")) {
342 return;
343 }
344 foreach ($this->css_files as $css) {
345 $filename = $css["file"];
346 if (strpos($filename, "?") > 0) {
347 $filename = substr($filename, 0, strpos($filename, "?"));
348 }
349 if ($a_force || is_file($filename)) {
350 $this->setCurrentBlock("css_file");
351 $this->setVariable("CSS_FILE", $css["file"]);
352 $this->setVariable("CSS_MEDIA", $css["media"]);
353 $this->parseCurrentBlock();
354 }
355 }
356 }
$filename
Definition: buildRTE.php:78

References $filename, blockExists(), parseCurrentBlock(), setCurrentBlock(), and setVariable().

+ Here is the call graph for this function:

◆ fillHeader()

ilGlobalTemplate::fillHeader ( )
protected
Exceptions
ilTemplateException

Definition at line 585 of file class.ilGlobalTemplate.php.

585 : void
586 {
587 global $DIC;
588
589 $lng = $DIC->language();
590 $header = $this->getHeaderActionMenu();
591
592 $header_tpl = new ilTemplate('tpl.il_header.html', true, true);
593
594 if ($this->icon_path !== "") {
595 $header_tpl->setCurrentBlock("header_image");
596 $header_tpl->setVariable("IMG_HEADER", $this->icon_path);
597 $header_tpl->parseCurrentBlock();
598 $header = true;
599 }
600
601 if ($this->title !== "") {
602 $title = ilUtil::stripScriptHTML($this->title);
603 $header_tpl->setVariable("HEADER", $title);
604
605 $header = true;
606 }
607
608 if ($header !== '') {
609 $header_tpl->setCurrentBlock("header_image");
610 $header_tpl->parseCurrentBlock();
611 }
612
613 if ($this->title_desc !== "") {
614 $header_tpl->setCurrentBlock("header_desc");
615 $header_tpl->setVariable("H_DESCRIPTION", $this->title_desc);
616 $header_tpl->parseCurrentBlock();
617 }
618
619 if ($header !== '') {
620 $header_tpl->setCurrentBlock("head_action_inner");
621 $header_tpl->setVariable("HEAD_ACTION", $header);
622 $header_tpl->parseCurrentBlock();
623 }
624
625 foreach ($this->title_alerts as $alert) {
626 $header_tpl->setCurrentBlock('header_alert');
627 if (!($alert['propertyNameVisible'] === false)) {
628 $header_tpl->setVariable('H_PROP', $alert['property'] . ':');
629 }
630 $header_tpl->setVariable('H_VALUE', $alert['value']);
631 $header_tpl->parseCurrentBlock();
632 }
633
634 // add file upload drop zone in header
635 if ($this->enable_fileupload !== null) {
636 $file_upload = new ilObjFileUploadDropzone(
637 $this->enable_fileupload,
638 $header_tpl->get()
639 );
640
641 $this->setVariable(
642 "IL_DROPZONE_HEADER",
643 $file_upload->getDropzoneHtml()
644 );
645 } else {
646 $this->setVariable("IL_HEADER", $header_tpl->get());
647 }
648 }
static stripScriptHTML(string $a_str, string $a_allow="", bool $a_rm_js=true)

References $DIC, $lng, setVariable(), and ilUtil\stripScriptHTML().

+ Here is the call graph for this function:

◆ fillInlineCss()

ilGlobalTemplate::fillInlineCss ( )
protected
Exceptions
ilTemplateException

Definition at line 489 of file class.ilGlobalTemplate.php.

489 : void
490 {
491 if (!$this->blockExists("css_inline")) {
492 return;
493 }
494 foreach ($this->inline_css as $css) {
495 $this->setCurrentBlock("css_inline");
496 $this->setVariable("CSS_INLINE", $css["css"]);
497 $this->parseCurrentBlock();
498 }
499 }

References setVariable().

+ Here is the call graph for this function:

◆ fillJavascriptFile()

ilGlobalTemplate::fillJavascriptFile ( string  $file,
string  $vers 
)
protected

Definition at line 307 of file class.ilGlobalTemplate.php.

307 : void
308 {
309 $this->setCurrentBlock("js_file");
310 if ($this->js_files_vp[$file]) {
311 $this->setVariable("JS_FILE", ilUtil::appendUrlParameterString($file, $vers));
312 } else {
313 $this->setVariable("JS_FILE", $file);
314 }
315 $this->parseCurrentBlock();
316 }
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)

References ilUtil\appendUrlParameterString(), parseCurrentBlock(), setCurrentBlock(), and setVariable().

Referenced by fillJavaScriptFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillJavaScriptFiles()

ilGlobalTemplate::fillJavaScriptFiles ( bool  $a_force = false)

Probably adds javascript files.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 253 of file class.ilGlobalTemplate.php.

253 : void
254 {
255 global $DIC;
256
257 $ilSetting = $DIC->settings();
258
259 $vers = '';
260 if (is_object($ilSetting)) { // maybe this one can be removed
261 $vers = "vers=" . str_replace([".", " "], "-", ILIAS_VERSION);
262
263 if (DEVMODE) {
264 $vers .= '-' . time();
265 }
266 }
267 if ($this->blockExists("js_file")) {
268 // three batches
269 for ($i = 0; $i <= 3; $i++) {
270 reset($this->js_files);
271 foreach ($this->js_files as $file) {
272 if ($this->js_files_batch[$file] === $i) {
273 if ($a_force ||
274 is_file($file) ||
275 strpos($file, "http") === 0 ||
276 strpos($file, "//") === 0
277 ) {
278 $this->fillJavascriptFile($file, $vers);
279 } elseif (strpos($file, './') === 0) { // #13962
280 $url_parts = parse_url($file);
281 if (is_file($url_parts['path'])) {
282 $this->fillJavascriptFile($file, $vers);
283 }
284 }
285 }
286 }
287 }
288 }
289 }
fillJavascriptFile(string $file, string $vers)
const ILIAS_VERSION
global $ilSetting
Definition: privfeed.php:31

References $DIC, $ilSetting, blockExists(), fillJavascriptFile(), and ILIAS_VERSION.

+ Here is the call graph for this function:

◆ fillLeftContent()

ilGlobalTemplate::fillLeftContent ( )
protected
Exceptions
ilTemplateException

Definition at line 810 of file class.ilGlobalTemplate.php.

810 : void
811 {
812 if (trim($this->left_content) !== "") {
813 $this->setCurrentBlock("left_column");
814 $this->setVariable("LEFT_CONTENT", trim($this->left_content));
815 $left_col_class = (trim($this->right_content) === "")
816 ? "col-sm-3 col-sm-pull-9"
817 : "col-sm-3 col-sm-pull-6";
818 $this->setVariable("LEFT_COL_CLASS", $left_col_class);
819 $this->parseCurrentBlock();
820 }
821 }

References setVariable().

+ Here is the call graph for this function:

◆ fillLeftNav()

ilGlobalTemplate::fillLeftNav ( )
protected
Exceptions
ilTemplateException

Definition at line 748 of file class.ilGlobalTemplate.php.

748 : void
749 {
750 if (trim($this->left_nav_content) !== "") {
751 $this->setCurrentBlock("left_nav");
752 $this->setVariable("LEFT_NAV_CONTENT", trim($this->left_nav_content));
753 $this->parseCurrentBlock();
754 $this->touchBlock("left_nav_space");
755 }
756 }

References setVariable().

+ Here is the call graph for this function:

◆ fillMainContent()

ilGlobalTemplate::fillMainContent ( )
protected

Definition at line 800 of file class.ilGlobalTemplate.php.

800 : void
801 {
802 if (trim($this->main_content) !== "") {
803 $this->setVariable("ADM_CONTENT", trim($this->main_content));
804 }
805 }

References setVariable().

+ Here is the call graph for this function:

◆ fillMainMenu()

ilGlobalTemplate::fillMainMenu ( )
protected

Definition at line 143 of file class.ilGlobalTemplate.php.

143 : void
144 {
145 }

◆ fillMessage()

ilGlobalTemplate::fillMessage ( )
protected

Definition at line 167 of file class.ilGlobalTemplate.php.

167 : void
168 {
169 $out = "";
170 foreach (self::MESSAGE_TYPES as $type) {
171 $txt = $this->getMessageTextForType($type);
172 if (null !== $txt) {
173 $out .= ilUtil::getSystemMessageHTML($txt, $type);
174 }
175
176 ilSession::clear($type);
177 }
178
179 if ($out !== "") {
180 $this->setVariable("MESSAGE", $out);
181 }
182 }
$out
Definition: buildRTE.php:24
getMessageTextForType(string $type)
static clear(string $a_var)
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.

References $out, ilSession\clear(), getMessageTextForType(), ilUtil\getSystemMessageHTML(), and setVariable().

+ Here is the call graph for this function:

◆ fillNewContentStyle()

ilGlobalTemplate::fillNewContentStyle ( )
protected

Definition at line 501 of file class.ilGlobalTemplate.php.

501 : void
502 {
503 $this->setVariable(
504 "LOCATION_NEWCONTENT_STYLESHEET_TAG",
505 '<link rel="stylesheet" type="text/css" href="' .
507 . '" />'
508 );
509 }
static getNewContentStyleSheetLocation(string $mode="output")
get full style sheet file name (path inclusive) of current user

References ilUtil\getNewContentStyleSheetLocation(), and setVariable().

+ Here is the call graph for this function:

◆ fillOnLoadCode()

ilGlobalTemplate::fillOnLoadCode ( )

Definition at line 291 of file class.ilGlobalTemplate.php.

291 : void
292 {
293 for ($i = 1; $i <= 3; $i++) {
294 if (isset($this->on_load_code[$i])) {
295 $this->setCurrentBlock("on_load_code");
296 foreach ($this->on_load_code[$i] as $code) {
297 $this->setCurrentBlock("on_load_code_inner");
298 $this->setVariable("OLCODE", $code);
299 $this->parseCurrentBlock();
300 }
301 $this->setCurrentBlock("on_load_code");
302 $this->parseCurrentBlock();
303 }
304 }
305 }

References parseCurrentBlock(), setCurrentBlock(), and setVariable().

+ Here is the call graph for this function:

◆ fillPageFormAction()

ilGlobalTemplate::fillPageFormAction ( )
protected
Exceptions
ilTemplateException

Definition at line 895 of file class.ilGlobalTemplate.php.

895 : void
896 {
897 if ($this->page_form_action !== "") {
898 $this->setCurrentBlock("page_form_start");
899 $this->setVariable("PAGE_FORM_ACTION", $this->page_form_action);
900 $this->parseCurrentBlock();
901 $this->touchBlock("page_form_end");
902 }
903 }

References setVariable().

+ Here is the call graph for this function:

◆ fillPermanentLink()

ilGlobalTemplate::fillPermanentLink ( )
protected

Definition at line 1123 of file class.ilGlobalTemplate.php.

1123 : void
1124 {
1125 if (!empty($this->permanent_link)) {
1126 $plinkgui = new ilPermanentLinkGUI(
1127 $this->permanent_link["type"],
1128 $this->permanent_link["id"],
1129 $this->permanent_link["append"],
1130 $this->permanent_link["target"]
1131 );
1132 if ($this->permanent_link["title"] !== "") {
1133 $plinkgui->setTitle($this->permanent_link["title"]);
1134 }
1135 $this->setVariable("PRMLINK", $plinkgui->getHTML());
1136 }
1137 }

References setVariable().

+ Here is the call graph for this function:

◆ fillRightContent()

ilGlobalTemplate::fillRightContent ( )
protected
Exceptions
ilTemplateException

Definition at line 826 of file class.ilGlobalTemplate.php.

826 : void
827 {
828 if (trim($this->right_content) !== "") {
829 $this->setCurrentBlock("right_column");
830 $this->setVariable("RIGHT_CONTENT", trim($this->right_content));
831 $this->parseCurrentBlock();
832 }
833 }

References setVariable().

+ Here is the call graph for this function:

◆ fillScreenReaderFocus()

ilGlobalTemplate::fillScreenReaderFocus ( )

Definition at line 1019 of file class.ilGlobalTemplate.php.

1019 : void
1020 {
1021 // abandoned
1022 }

◆ fillSideIcons()

ilGlobalTemplate::fillSideIcons ( )
protected
Exceptions
ilTemplateException

Definition at line 1027 of file class.ilGlobalTemplate.php.

1027 : void
1028 {
1029 global $DIC;
1030
1031 $ilSetting = $DIC->settings();
1032 $lng = $DIC->language();
1033
1034 if ($this->tree_flat_link !== "") {
1035 if ($this->left_nav_content !== "") {
1036 $this->touchBlock("tree_lns");
1037 }
1038
1039 $this->setCurrentBlock("tree_mode");
1040 $this->setVariable("LINK_MODE", $this->tree_flat_link);
1041 $this->setVariable("IMG_TREE", ilUtil::getImagePath("standard/icon_sidebar_on.svg"));
1042 if ($ilSetting->get("tree_frame") === "right") {
1043 $this->setVariable("RIGHT", "Right");
1044 }
1045 $this->setVariable("ALT_TREE", $lng->txt($this->tree_flat_mode . "view"));
1046 $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
1047 $this->parseCurrentBlock();
1048 }
1049
1050 $this->setCurrentBlock("tree_icons");
1051 $this->parseCurrentBlock();
1052 }
static _getFrame(string $a_class)

References $DIC, $ilSetting, $lng, ilFrameTargetInfo\_getFrame(), ilUtil\getImagePath(), and setVariable().

+ Here is the call graph for this function:

◆ fillTabs()

ilGlobalTemplate::fillTabs ( )
Exceptions
ilTemplateException

Definition at line 697 of file class.ilGlobalTemplate.php.

697 : void
698 {
699 if ($this->blockExists("tabs_outer_start")) {
700 $this->touchBlock("tabs_outer_start");
701 $this->touchBlock("tabs_outer_end");
702 $this->touchBlock("tabs_inner_start");
703 $this->touchBlock("tabs_inner_end");
704
705 if ($this->tabs_html !== "") {
706 $this->setVariable("TABS", $this->tabs_html);
707 }
708 $this->setVariable("SUB_TABS", $this->sub_tabs_html);
709 }
710 }

References setVariable().

+ Here is the call graph for this function:

◆ fillToolbar()

ilGlobalTemplate::fillToolbar ( )
protected
Exceptions
ilTemplateException

Definition at line 838 of file class.ilGlobalTemplate.php.

838 : void
839 {
840 global $DIC;
841
842 $ilToolbar = $DIC["ilToolbar"];
843 $thtml = $ilToolbar->getHTML();
844
845 if ($thtml !== "") {
846 $this->setCurrentBlock("toolbar_buttons");
847 $this->setVariable("BUTTONS", $thtml);
848 $this->parseCurrentBlock();
849 }
850 }

References $DIC, and setVariable().

+ Here is the call graph for this function:

◆ fillWindowTitle()

ilGlobalTemplate::fillWindowTitle ( )

Definition at line 863 of file class.ilGlobalTemplate.php.

863 : void
864 {
865 global $DIC;
866
867 $ilSetting = $DIC->settings();
868
869 if ($this->header_page_title !== "") {
870 $title = ilUtil::stripScriptHTML($this->header_page_title);
871 $this->setVariable("PAGETITLE", "- " . $title);
872 }
873
874 if ($ilSetting->get('short_inst_name') !== "") {
875 $this->setVariable(
876 "WINDOW_TITLE",
877 $ilSetting->get('short_inst_name')
878 );
879 } else {
880 $this->setVariable(
881 "WINDOW_TITLE",
882 "ILIAS"
883 );
884 }
885 }

References $DIC, $ilSetting, setVariable(), and ilUtil\stripScriptHTML().

+ Here is the call graph for this function:

◆ get()

ilGlobalTemplate::get ( string  $part = self::DEFAULT_BLOCK)
Exceptions
ilTemplateException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1161 of file class.ilGlobalTemplate.php.

1161 : string
1162 {
1163 return $this->template->get($part);
1164 }

◆ getCSSFiles()

ilGlobalTemplate::getCSSFiles ( )

Definition at line 1218 of file class.ilGlobalTemplate.php.

1218 : array
1219 {
1220 return $this->css_files;
1221 }

◆ getHeaderActionMenu()

ilGlobalTemplate::getHeaderActionMenu ( )
protected

Definition at line 650 of file class.ilGlobalTemplate.php.

650 : string
651 {
653 }

◆ getJSFiles()

ilGlobalTemplate::getJSFiles ( )

Definition at line 1213 of file class.ilGlobalTemplate.php.

1213 : array
1214 {
1215 return $this->js_files_batch;
1216 }

◆ getLoginTargetPar()

ilGlobalTemplate::getLoginTargetPar ( )
protected

Definition at line 914 of file class.ilGlobalTemplate.php.

914 : string
915 {
917 }

◆ getMainMenu()

ilGlobalTemplate::getMainMenu ( )
protected

Definition at line 139 of file class.ilGlobalTemplate.php.

139 : void
140 {
141 }

◆ getMessageTextForType()

ilGlobalTemplate::getMessageTextForType ( string  $type)
protected

Definition at line 184 of file class.ilGlobalTemplate.php.

184 : ?string
185 {
186 if (ilSession::has($type)) {
187 return (string) ilSession::get($type);
188 }
189
190 return $this->messages[$type] ?? null;
191 }
static get(string $a_var)
static has($a_var)

References ilSession\get(), and ilSession\has().

Referenced by fillMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOnLoadCodeForAsynch()

ilGlobalTemplate::getOnLoadCodeForAsynch ( )

Get js onload code for ajax calls.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 227 of file class.ilGlobalTemplate.php.

227 : string
228 {
229 $js = "";
230 for ($i = 1; $i <= 3; $i++) {
231 if (isset($this->on_load_code[$i])) {
232 foreach ($this->on_load_code[$i] as $code) {
233 $js .= $code . "\n";
234 }
235 }
236 }
237 if ($js) {
238 return '<script type="text/javascript">' . "\n" .
239 $js .
240 '</script>' . "\n";
241 }
242
243 return '';
244 }

◆ getSpecial()

ilGlobalTemplate::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 
)
Exceptions
ilTemplateException
ilCtrlException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 923 of file class.ilGlobalTemplate.php.

931 : string {
932 if ($add_error_mess) {
933 $this->fillMessage();
934 }
935
936 // set standard parts (tabs and title icon)
937 if ($add_standard_elements) {
938 if ($a_tabs && $this->blockExists("content")) {
939 // determine default screen id
940 $this->getTabsHTML();
941 }
942
943 // to get also the js files for the main menu
944 $this->getMainMenu();
945 $this->initHelp();
946
947 // these fill blocks in tpl.main.html
948 $this->fillCssFiles();
949 $this->fillInlineCss();
950 $this->fillBodyClass();
951
952 // these fill just plain placeholder variables in tpl.main.html
953 $this->setCurrentBlock();
954 $this->fillNewContentStyle();
955 $this->fillContentLanguage();
956 $this->fillWindowTitle();
957
958 // these fill blocks in tpl.adm_content.html
959 $this->fillHeader();
960 $this->fillSideIcons();
961 $this->fillScreenReaderFocus();
962 $this->fillLeftContent();
963 $this->fillLeftNav();
964 $this->fillRightContent();
965 $this->fillAdminPanel();
966 $this->fillToolbar();
967 $this->fillPermanentLink();
968
969 $this->setCenterColumnClass();
970
971 // late loading of javascipr files, since operations above may add files
972 $this->fillJavaScriptFiles();
973 $this->fillOnLoadCode();
974
975 // these fill just plain placeholder variables in tpl.adm_content.html
976 if ($this->blockExists("content")) {
977 $this->setCurrentBlock("content");
978 if ($a_tabs) {
979 $this->fillTabs();
980 }
981 $this->fillMainContent();
982 if ($a_main_menu) {
983 $this->fillMainMenu();
984 }
985 $this->parseCurrentBlock();
986 }
987 }
988
989 if ($part === self::DEFAULT_BLOCK) {
990 $html = $this->template->get();
991 } else {
992 $html = $this->template->get($part);
993 }
994
995 // save language usages as late as possible
997
998 return $html;
999 }
fillJavaScriptFiles(bool $a_force=false)
Probably adds javascript files.
fillCssFiles(bool $a_force=false)
static _saveUsages()
Store the collected language variable usages in the user session This should be called as late as pos...

◆ getTabsHTML()

ilGlobalTemplate::getTabsHTML ( )
protected

Definition at line 712 of file class.ilGlobalTemplate.php.

712 : void
713 {
714 global $DIC;
715
716 $ilTabs = $DIC["ilTabs"];
717
718 if ($this->blockExists("tabs_outer_start")) {
719 $this->sub_tabs_html = $ilTabs->getSubTabHTML();
720 $this->tabs_html = $ilTabs->getHTML(true);
721 }
722 }

References $DIC.

◆ hideFooter()

ilGlobalTemplate::hideFooter ( )

Make the template hide the footer.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 134 of file class.ilGlobalTemplate.php.

134 : void
135 {
136 $this->show_footer = false;
137 }

◆ initHelp()

ilGlobalTemplate::initHelp ( )
protected

Definition at line 147 of file class.ilGlobalTemplate.php.

147 : void
148 {
149 //ilHelpGUI::initHelp($this);
150 }

◆ loadStandardTemplate()

ilGlobalTemplate::loadStandardTemplate ( )

This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STATUSLINE placeholders if they are not already loaded.

Exceptions
ilTemplateException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 517 of file class.ilGlobalTemplate.php.

517 : void
518 {
519 if ($this->standard_template_loaded) {
520 return;
521 }
522
523 // always load jQuery
525
526 $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
527 $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
528
529 $this->standard_template_loaded = true;
530 }
addBlockFile(string $var, string $block, string $template_name, ?string $in_module=null)
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template

References iljQueryUtil\initjQuery().

+ Here is the call graph for this function:

◆ parseCurrentBlock()

ilGlobalTemplate::parseCurrentBlock ( string  $part = self::DEFAULT_BLOCK)
Exceptions
ilTemplateException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1195 of file class.ilGlobalTemplate.php.

1195 : bool
1196 {
1197 return $this->template->parseCurrentBlock($part);
1198 }

Referenced by fillBodyClass(), fillCssFiles(), fillJavascriptFile(), fillOnLoadCode(), and ilInternalLinkGUI\renderLink().

+ Here is the caller graph for this function:

◆ printToStdout()

ilGlobalTemplate::printToStdout ( string  $part = self::DEFAULT_BLOCK,
bool  $has_tabs = true,
bool  $skip_main_menu = false 
)
Parameters
bool$has_tabsif template variable {TABS} should be filled with content of ilTabs
bool$skip_main_menuif the main menu should be rendered.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1001 of file class.ilGlobalTemplate.php.

1005 : void {
1006 global $DIC;
1007
1008 header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
1009 header("Content-type: text/html; charset=UTF-8");
1010
1011 print $this->renderPage(
1012 $part,
1013 $a_fill_tabs,
1014 $a_skip_main_menu,
1015 $DIC
1016 );
1017 }
renderPage(string $part, bool $a_fill_tabs, bool $a_skip_main_menu, Container $DIC)

◆ printToString()

ilGlobalTemplate::printToString ( string  $part = self::DEFAULT_BLOCK)

Definition at line 128 of file class.ilGlobalTemplate.php.

128 : string
129 {
130 global $DIC;
131 return $this->renderPage($part, true, false, $DIC);
132 }

References $DIC, and renderPage().

+ Here is the call graph for this function:

◆ renderPage()

ilGlobalTemplate::renderPage ( string  $part,
bool  $a_fill_tabs,
bool  $a_skip_main_menu,
Container  $DIC 
)
Exceptions
ilTemplateException
ilCtrlException

Definition at line 379 of file class.ilGlobalTemplate.php.

384 : string {
385 $this->fillMessage();
386
387 // set standard parts (tabs and title icon)
388 $this->fillBodyClass();
389
390 // see #22992
391 $this->fillContentLanguage();
392
393 if ($a_fill_tabs) {
394 if ($this->blockExists("content")) {
395 // determine default screen id
396 $this->getTabsHTML();
397 }
398 // to get also the js files for the main menu
399 if (!$a_skip_main_menu) {
400 $this->getMainMenu();
401 $this->initHelp();
402 }
403
404 // these fill blocks in tpl.main.html
405 $this->fillCssFiles();
406 $this->fillInlineCss();
407 //$this->fillJavaScriptFiles();
408
409 // these fill just plain placeholder variables in tpl.main.html
410 $this->setCurrentBlock();
411 $this->fillNewContentStyle();
412 $this->fillWindowTitle();
413
414 // these fill blocks in tpl.adm_content.html
415 $this->fillHeader();
416 $this->fillSideIcons();
417 $this->fillScreenReaderFocus();
418 $this->fillLeftContent();
419 $this->fillLeftNav();
420 $this->fillRightContent();
421 $this->fillAdminPanel();
422 $this->fillToolbar();
423 $this->fillPermanentLink();
424
425 $this->setCenterColumnClass();
426
427 // late loading of javascipr files, since operations above may add files
428 $this->fillJavaScriptFiles();
429 $this->fillOnLoadCode();
430
431 // these fill just plain placeholder variables in tpl.adm_content.html
432 if ($this->blockExists("content")) {
433 $this->setCurrentBlock("content");
434 $this->fillTabs();
435 $this->fillMainContent();
436 $this->fillMainMenu();
437 $this->parseCurrentBlock();
438 }
439 }
440
441 if ($part === self::DEFAULT_BLOCK) {
442 $html = $this->template->getUnmodified();
443 } else {
444 $html = $this->template->getUnmodified($part);
445 }
446
447 // Modification of html is done inline here and can't be done
448 // by ilTemplate, because the "phase" is template_show in this
449 // case here.
450 $component_factory = $DIC["component.factory"];
451
452 // not quite sure if that's good.
453 $id = $this->template->getTemplateIdentifier(
454 $this->template_name,
455 $this->in_module
456 );
457
458 foreach ($component_factory->getActivePluginsInSlot("uihk") as $ui_plugin) {
459 $gui_class = $ui_plugin->getUIClassInstance();
460 $resp = $gui_class->getHTML(
461 "",
462 "template_show",
463 [
464 "tpl_id" => $id,
465 "tpl_obj" => $this,
466 "html" => $html
467 ]
468 );
469
470 if ($resp["mode"] !== ilUIHookPluginGUI::KEEP) {
471 $html = $gui_class->modifyHTML($html, $resp);
472 }
473 }
474
475 // save language usages as late as possible
477
478 return $html;
479 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

Referenced by printToString().

+ Here is the caller graph for this function:

◆ resetCss()

ilGlobalTemplate::resetCss ( )
protected

Definition at line 481 of file class.ilGlobalTemplate.php.

481 : void
482 {
483 $this->css_files = [];
484 }

◆ resetHeaderBlock()

ilGlobalTemplate::resetHeaderBlock ( bool  $a_reset_header_action = true)

Reset all header properties: title, icon, description, alerts, action menu.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1139 of file class.ilGlobalTemplate.php.

1139 : void
1140 {
1141 $this->setTitle('');
1142 $this->setTitleIcon('');
1143 $this->setDescription('');
1144 $this->setAlertProperties([]);
1145 $this->enable_fileupload = null;
1146
1147 // see setFullscreenHeader()
1148 if ($a_reset_header_action) {
1149 $this->setHeaderActionMenu('');
1150 }
1151 }
setHeaderActionMenu(string $a_header)
Set header action menu.

◆ resetJavascript()

ilGlobalTemplate::resetJavascript ( )

Reset javascript files.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 246 of file class.ilGlobalTemplate.php.

246 : void
247 {
248 $this->js_files = [];
249 $this->js_files_vp = [];
250 $this->js_files_batch = [];
251 }

◆ setAlertProperties()

ilGlobalTemplate::setAlertProperties ( array  $alerts)

Set alert properties.

Parameters
array<int,array>$alerts

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 559 of file class.ilGlobalTemplate.php.

559 : void
560 {
561 $this->title_alerts = $a_props;
562 }

◆ setBodyClass()

ilGlobalTemplate::setBodyClass ( string  $a_class = "")

Sets the body-tags class.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 358 of file class.ilGlobalTemplate.php.

358 : void
359 {
360 $this->body_class = $a_class;
361 }

Referenced by ilIndependentGlobalTemplate\__construct(), and __construct().

+ Here is the caller graph for this function:

◆ setCenterColumnClass()

ilGlobalTemplate::setCenterColumnClass ( )
protected
Exceptions
ilTemplateException

Definition at line 768 of file class.ilGlobalTemplate.php.

768 : void
769 {
770 if (!$this->blockExists("center_col_width")) {
771 return;
772 }
773
774 $left = trim($this->left_content);
775 $right = trim($this->right_content);
776
777 switch (true) {
778 case ('' !== $left && '' !== $right):
779 $center_column_class = 'col-sm-6';
780 break;
781
782 case ('' !== $left || '' !== $right):
783 $center_column_class = 'col-sm-9';
784 break;
785
786 default:
787 $center_column_class = "col-sm-12";
788 break;
789 }
790
791 if ('' !== $left) {
792 $center_column_class .= " col-sm-push-3";
793 }
794
795 $this->setCurrentBlock("center_col_width");
796 $this->setVariable("CENTER_COL", $center_column_class);
797 $this->parseCurrentBlock();
798 }

References setVariable().

+ Here is the call graph for this function:

◆ setContent()

ilGlobalTemplate::setContent ( string  $a_html)

Sets content for standard template.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 724 of file class.ilGlobalTemplate.php.

724 : void
725 {
726 if ($a_html !== "") {
727 $this->main_content = $a_html;
728 }
729 }

◆ setCurrentBlock()

ilGlobalTemplate::setCurrentBlock ( string  $part = self::DEFAULT_BLOCK)
Exceptions
ilTemplateException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1179 of file class.ilGlobalTemplate.php.

1179 : bool
1180 {
1181 return $this->template->setCurrentBlock($part);
1182 }

Referenced by fillBodyClass(), fillCssFiles(), fillJavascriptFile(), fillOnLoadCode(), ilInternalLinkGUI\outputThumbnail(), and ilInternalLinkGUI\renderLink().

+ Here is the caller graph for this function:

◆ setDescription()

ilGlobalTemplate::setDescription ( string  $a_descr)

Sets descripton below title in standard template.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 545 of file class.ilGlobalTemplate.php.

545 : void
546 {
547 $this->title_desc = $a_descr;
548 }

◆ setFileUploadRefId()

ilGlobalTemplate::setFileUploadRefId ( int  $a_ref_id)

Enables the file upload into this object by dropping a file.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1153 of file class.ilGlobalTemplate.php.

1153 : void
1154 {
1155 $this->enable_fileupload = $a_ref_id;
1156 }

◆ setHeaderActionMenu()

ilGlobalTemplate::setHeaderActionMenu ( string  $a_header)

Set header action menu.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 572 of file class.ilGlobalTemplate.php.

572 : void
573 {
574 $this->header_action = $a_header;
575 }

◆ setHeaderPageTitle()

ilGlobalTemplate::setHeaderPageTitle ( string  $a_title)

Sets the title of the page (for browser window).

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 577 of file class.ilGlobalTemplate.php.

577 : void
578 {
579 $this->header_page_title = $a_title;
580 }

◆ setLeftContent()

ilGlobalTemplate::setLeftContent ( string  $a_html)

Sets content of left column.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 731 of file class.ilGlobalTemplate.php.

731 : void
732 {
733 if ($a_html !== "") {
734 $this->left_content = $a_html;
735 }
736 }

◆ setLeftNavContent()

ilGlobalTemplate::setLeftNavContent ( string  $a_content)

Sets content of left navigation column.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 738 of file class.ilGlobalTemplate.php.

738 : void
739 {
740 if ($a_content !== "") {
741 $this->left_nav_content = $a_content;
742 }
743 }

◆ setLocator()

ilGlobalTemplate::setLocator ( )

Insert locator.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 655 of file class.ilGlobalTemplate.php.

655 : void
656 {
657 global $DIC;
658
659 $ilLocator = $DIC["ilLocator"];
660 $html = "";
661
662 $uip = new ilUIHookProcessor(
663 "components/ILIAS/Locator",
664 "main_locator",
665 ["locator_gui" => $ilLocator]
666 );
667 if (!$uip->replaced()) {
668 $html = $ilLocator->getHTML();
669 }
670 $html = $uip->getHTML($html);
671
672 $this->setVariable("LOCATOR", $html);
673 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $DIC, and setVariable().

+ Here is the call graph for this function:

◆ setLoginTargetPar()

ilGlobalTemplate::setLoginTargetPar ( string  $a_val)

Set target parameter for login (public sector).

This is used by the main menu

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 909 of file class.ilGlobalTemplate.php.

909 : void
910 {
911 $this->login_target_par = $a_val;
912 }

◆ setOnScreenMessage()

ilGlobalTemplate::setOnScreenMessage ( string  $type,
string  $a_txt,
bool  $a_keep = false 
)

Set a message to be displayed to the user.

Please use instead of ilUtil::sendInfo(), ilUtil::sendSuccess() and ilUtil::sendFailure().

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 152 of file class.ilGlobalTemplate.php.

152 : void
153 {
154 if ($a_txt === "" ||
155 !in_array($a_type, self::MESSAGE_TYPES, true)
156 ) {
157 return;
158 }
159
160 if (!$a_keep) {
161 $this->messages[$a_type] = $a_txt;
162 } else {
163 ilSession::set($a_type, $a_txt);
164 }
165 }
static set(string $a_var, $a_val)
Set a value.

References ilSession\set().

+ Here is the call graph for this function:

◆ setPageFormAction()

ilGlobalTemplate::setPageFormAction ( string  $a_action)

Sets the pages form action.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 887 of file class.ilGlobalTemplate.php.

887 : void
888 {
889 $this->page_form_action = $a_action;
890 }

◆ setPermanentLink()

ilGlobalTemplate::setPermanentLink ( string  $a_type,
?int  $a_id,
string  $a_append = "",
string  $a_target = "",
string  $a_title = "" 
)

Generates and sets a permanent ilias link.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1107 of file class.ilGlobalTemplate.php.

1113 : void {
1114 $this->permanent_link = [
1115 "type" => $a_type,
1116 "id" => $a_id,
1117 "append" => $a_append,
1118 "target" => $a_target,
1119 "title" => $a_title
1120 ];
1121 }

◆ setRightContent()

ilGlobalTemplate::setRightContent ( string  $a_html)

Sets content of right column.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 758 of file class.ilGlobalTemplate.php.

758 : void
759 {
760 if ($a_html !== '') {
761 $this->right_content = $a_html;
762 }
763 }

◆ setSubTabs()

ilGlobalTemplate::setSubTabs ( string  $a_tabs_html)

sets subtabs in standard template

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 689 of file class.ilGlobalTemplate.php.

689 : void
690 {
691 $this->setVariable("SUB_TABS", $a_tabs_html);
692 }

References setVariable().

+ Here is the call graph for this function:

◆ setTabs()

ilGlobalTemplate::setTabs ( string  $a_tabs_html)
Exceptions
ilTemplateException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 678 of file class.ilGlobalTemplate.php.

678 : void
679 {
680 if ($a_tabs_html !== "" && $this->blockExists("tabs_outer_start")) {
681 $this->touchBlock("tabs_outer_start");
682 $this->touchBlock("tabs_outer_end");
683 $this->touchBlock("tabs_inner_start");
684 $this->touchBlock("tabs_inner_end");
685 $this->setVariable("TABS", $a_tabs_html);
686 }
687 }

References setVariable().

+ Here is the call graph for this function:

◆ setTitle()

ilGlobalTemplate::setTitle ( string  $a_title,
bool  $hidden = false 
)

Sets title in standard template.

Will override the header_page_title.

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 536 of file class.ilGlobalTemplate.php.

536 : void
537 {
538 $this->title = $a_title;
539 $this->header_page_title = $a_title;
540 }

◆ setTitleIcon()

ilGlobalTemplate::setTitleIcon ( string  $a_icon_path,
string  $a_icon_desc = "" 
)

set title icon

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 553 of file class.ilGlobalTemplate.php.

553 : void
554 {
555 $this->icon_desc = $a_icon_desc;
556 $this->icon_path = $a_icon_path;
557 }

◆ setTreeFlatIcon()

ilGlobalTemplate::setTreeFlatIcon ( string  $a_link,
string  $a_mode 
)

Sets a tree or flat icon.

Parameters
string$a_mode("tree" | "flat")

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1054 of file class.ilGlobalTemplate.php.

1054 : void
1055 {
1056 $this->tree_flat_link = $a_link;
1057 $this->tree_flat_mode = $a_mode;
1058 }

◆ setVariable()

ilGlobalTemplate::setVariable ( string  $variable,
  $value = '' 
)

Sets the given variable to the given value.

Parameters
mixed$value

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1166 of file class.ilGlobalTemplate.php.

1166 : void
1167 {
1168 $this->template->setVariable($variable, $value);
1169 }

Referenced by fillBodyClass(), fillCssFiles(), fillJavascriptFile(), fillMessage(), fillOnLoadCode(), and ilInternalLinkGUI\renderLink().

+ Here is the caller graph for this function:

◆ touchBlock()

ilGlobalTemplate::touchBlock ( string  $block)
Exceptions
ilTemplateException

Implements ILIAS\UICore\GlobalTemplate.

Definition at line 1187 of file class.ilGlobalTemplate.php.

1187 : bool
1188 {
1189 return $this->template->touchBlock($block);
1190 }

◆ variableExists()

ilGlobalTemplate::variableExists ( string  $a_variablename)
protected

Definition at line 1171 of file class.ilGlobalTemplate.php.

1171 : bool
1172 {
1173 return $this->template->variableExists($a_variablename);
1174 }

Field Documentation

◆ $admin_panel_arrow

bool ilGlobalTemplate::$admin_panel_arrow = false
protected

Definition at line 86 of file class.ilGlobalTemplate.php.

◆ $admin_panel_bottom

bool ilGlobalTemplate::$admin_panel_bottom = false
protected

Definition at line 87 of file class.ilGlobalTemplate.php.

◆ $admin_panel_commands_toolbar

ilToolbarGUI ilGlobalTemplate::$admin_panel_commands_toolbar = null
protected

Definition at line 32 of file class.ilGlobalTemplate.php.

◆ $body_class

string ilGlobalTemplate::$body_class = ''
protected

Definition at line 72 of file class.ilGlobalTemplate.php.

◆ $css_files

array ilGlobalTemplate::$css_files = []
protected

Definition at line 62 of file class.ilGlobalTemplate.php.

◆ $enable_fileupload

int ilGlobalTemplate::$enable_fileupload = null
protected

Definition at line 88 of file class.ilGlobalTemplate.php.

◆ $header_action

string ilGlobalTemplate::$header_action = ''
protected

Definition at line 93 of file class.ilGlobalTemplate.php.

◆ $header_page_title

string ilGlobalTemplate::$header_page_title = ""
protected

Definition at line 89 of file class.ilGlobalTemplate.php.

◆ $icon_desc

string ilGlobalTemplate::$icon_desc = ''
protected

Definition at line 94 of file class.ilGlobalTemplate.php.

◆ $icon_path

string ilGlobalTemplate::$icon_path = ''
protected

Definition at line 95 of file class.ilGlobalTemplate.php.

◆ $in_module

string ilGlobalTemplate::$in_module
protected

◆ $inline_css

array ilGlobalTemplate::$inline_css = []
protected

Definition at line 68 of file class.ilGlobalTemplate.php.

◆ $js_files

array ilGlobalTemplate::$js_files
protected
Initial value:
= [
"assets/js/Basic.js",
]

Definition at line 38 of file class.ilGlobalTemplate.php.

◆ $js_files_batch

array ilGlobalTemplate::$js_files_batch
protected
Initial value:
= [
"assets/js/Basic.js" => 1,
]

Definition at line 54 of file class.ilGlobalTemplate.php.

◆ $js_files_vp

array ilGlobalTemplate::$js_files_vp
protected
Initial value:
= [
"assets/js/Basic.js" => true,
]

Definition at line 46 of file class.ilGlobalTemplate.php.

◆ $left_content

string ilGlobalTemplate::$left_content = ''
protected

Definition at line 98 of file class.ilGlobalTemplate.php.

◆ $left_nav_content

string ilGlobalTemplate::$left_nav_content = ''
protected

Definition at line 84 of file class.ilGlobalTemplate.php.

◆ $lightbox

array ilGlobalTemplate::$lightbox = []
protected

Definition at line 77 of file class.ilGlobalTemplate.php.

◆ $login_target_par

string ilGlobalTemplate::$login_target_par = ''
protected

Definition at line 100 of file class.ilGlobalTemplate.php.

◆ $main_content

string ilGlobalTemplate::$main_content = ""
protected

Definition at line 76 of file class.ilGlobalTemplate.php.

◆ $main_menu

string ilGlobalTemplate::$main_menu = ''
protected

Definition at line 79 of file class.ilGlobalTemplate.php.

◆ $main_menu_spacer

string ilGlobalTemplate::$main_menu_spacer = ''
protected

Definition at line 80 of file class.ilGlobalTemplate.php.

◆ $messages

array ilGlobalTemplate::$messages = []
protected

Definition at line 81 of file class.ilGlobalTemplate.php.

◆ $on_load_code

array ilGlobalTemplate::$on_load_code = []
protected

Definition at line 83 of file class.ilGlobalTemplate.php.

◆ $page_form_action

string ilGlobalTemplate::$page_form_action = ""
protected

Definition at line 74 of file class.ilGlobalTemplate.php.

◆ $permanent_link

array ilGlobalTemplate::$permanent_link = []
protected

Definition at line 75 of file class.ilGlobalTemplate.php.

◆ $right_content

string ilGlobalTemplate::$right_content = ''
protected

Definition at line 99 of file class.ilGlobalTemplate.php.

◆ $show_footer

bool ilGlobalTemplate::$show_footer = true
protected

Definition at line 82 of file class.ilGlobalTemplate.php.

◆ $standard_template_loaded

bool ilGlobalTemplate::$standard_template_loaded = false
protected

Definition at line 78 of file class.ilGlobalTemplate.php.

◆ $sub_tabs_html

string ilGlobalTemplate::$sub_tabs_html = ""
protected

Definition at line 97 of file class.ilGlobalTemplate.php.

◆ $tabs_html

string ilGlobalTemplate::$tabs_html = ""
protected

Definition at line 96 of file class.ilGlobalTemplate.php.

◆ $template

ilTemplate ilGlobalTemplate::$template
protected

Definition at line 31 of file class.ilGlobalTemplate.php.

◆ $template_name

string ilGlobalTemplate::$template_name
protected

Definition at line 71 of file class.ilGlobalTemplate.php.

◆ $title

string ilGlobalTemplate::$title = ""
protected

Definition at line 90 of file class.ilGlobalTemplate.php.

◆ $title_alerts

array ilGlobalTemplate::$title_alerts = []
protected

Definition at line 92 of file class.ilGlobalTemplate.php.

◆ $title_desc

string ilGlobalTemplate::$title_desc = ""
protected

Definition at line 91 of file class.ilGlobalTemplate.php.

◆ $tree_flat_link

string ilGlobalTemplate::$tree_flat_link = ""
protected

Definition at line 73 of file class.ilGlobalTemplate.php.

◆ $tree_flat_mode

string ilGlobalTemplate::$tree_flat_mode = ''
protected

Definition at line 85 of file class.ilGlobalTemplate.php.


The documentation for this class was generated from the following file: