26 public function __construct(
string $file,
bool $flag1,
bool $flag2,
bool $in_module =
false, $vars =
"DEFAULT",
bool $plugin =
false,
bool $a_use_cache =
true)
28 $this->template_file =
new ilTemplate($file, $flag1, $flag2, $in_module, $vars,
$plugin, $a_use_cache);
41 self::MESSAGE_TYPE_FAILURE,
42 self::MESSAGE_TYPE_INFO,
43 self::MESSAGE_TYPE_SUCCESS,
44 self::MESSAGE_TYPE_QUESTION,
96 public function addBlockFile($var, $block, $tplname, $in_module =
false)
98 return $this->template_file->addBlockFile($var, $block, $tplname, $in_module);
109 return $this->template_file->blockExists($blockname);
118 $this->template_file->removeBlockData($block);
128 $this->template_file->setVariable($variable, $value);
137 $this->template_file->setCurrentBlock($part);
146 $this->template_file->touchBlock($block);
155 $this->template_file->parseCurrentBlock($part);
203 $this->lightbox[$a_id] = $a_html;
222 $this->banner = $a_val;
243 $this->hiddenTitle = $hidden;
306 $this->right_content = $a_html;
330 if (trim($this->filter) !=
"") {
331 $this->template_file->setCurrentBlock(
"filter");
332 $this->template_file->setVariable(
"FILTER", $this->filter);
333 $this->template_file->parseCurrentBlock();
378 if (!in_array(
$a_type, self::$message_types) || $a_txt ==
"") {
382 $this->message[
$a_type] = $a_txt;
393 public function renderPage($part, $a_fill_tabs, $a_skip_main_menu) : string
414 if ($this->template_file->blockExists(
"content")) {
420 if (!$a_skip_main_menu) {
456 if ($this->template_file->blockExists(
"content")) {
457 $this->template_file->setCurrentBlock(
"content");
462 $this->template_file->parseCurrentBlock();
466 if ($part ==
"DEFAULT" or is_bool($part)) {
467 $html = $this->template_file->getUnmodified();
469 $html = $this->template_file->getUnmodified($part);
477 $ilPluginAdmin = $DIC[
"ilPluginAdmin"];
478 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"UIComponent",
"uihk");
479 foreach ($pl_names as $pl) {
481 $gui_class = $ui_plugin->getUIClassInstance();
483 $resp = $gui_class->getHTML(
486 array(
"tpl_id" => $this->tplIdentifier,
"tpl_obj" => $this,
"html" => $html)
490 $html = $gui_class->modifyHTML($html,
$resp);
507 foreach (self::$message_types as $m) {
514 $request = $DIC->http()->request();
515 $accept_header = $request->getHeaderLine(
'Accept');
516 if (isset(
$_SESSION[$m]) &&
$_SESSION[$m] && ($accept_header !==
'application/json')) {
522 $this->template_file->setVariable(
"MESSAGE",
$out);
538 if (isset($this->message[$m])) {
539 $txt = $this->message[$m];
551 $ilTabs = $DIC[
"ilTabs"];
553 if ($this->template_file->blockExists(
"tabs_outer_start")) {
554 $this->sub_tabs_html = $ilTabs->getSubTabHTML();
555 $this->tabs_html = $ilTabs->getHTML(
true);
565 include_once(
"./Services/Help/classes/class.ilHelpGUI.php");
574 $lng = $DIC->language();
577 if ($this->banner !=
"" && $this->template_file->blockExists(
"banner_bl")) {
578 $this->template_file->setCurrentBlock(
"banner_bl");
579 $this->template_file->setVariable(
"BANNER_URL", $this->banner);
581 $this->template_file->parseCurrentBlock();
586 if ($this->icon_path !=
"") {
588 $this->template_file->setCurrentBlock(
"header_image");
589 if ($this->icon_desc !=
"") {
594 $this->template_file->setVariable(
"IMG_HEADER", $this->icon_path);
595 $this->template_file->parseCurrentBlock();
599 if ($this->title !=
"") {
601 $this->template_file->setVariable(
"HEADER",
$title);
602 if ($this->hiddenTitle) {
603 $this->template_file->touchBlock(
"hidden_title");
609 if ($header && !$this->hiddenTitle) {
610 $this->template_file->setCurrentBlock(
"header_image");
611 $this->template_file->parseCurrentBlock();
614 if ($this->title_desc !=
"") {
615 $this->template_file->setCurrentBlock(
"header_desc");
616 $this->template_file->setVariable(
"H_DESCRIPTION", $this->title_desc);
617 $this->template_file->parseCurrentBlock();
622 $this->template_file->setCurrentBlock(
"head_action_inner");
623 $this->template_file->setVariable(
"HEAD_ACTION", $header);
624 $this->template_file->parseCurrentBlock();
625 $this->template_file->touchBlock(
"head_action");
628 if (count((array) $this->title_alerts)) {
629 foreach ($this->title_alerts as $alert) {
630 $this->template_file->setCurrentBlock(
'header_alert');
631 if (!($alert[
'propertyNameVisible'] ===
false)) {
632 $this->template_file->setVariable(
'H_PROP', $alert[
'property'] .
':');
634 $this->template_file->setVariable(
'H_VALUE', $alert[
'value']);
635 $this->template_file->parseCurrentBlock();
640 if ($this->enable_fileupload != null) {
642 $upload_id =
"dropzone_" . $ref_id;
644 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
645 $upload = new \ilFileUploadGUI($upload_id, $ref_id,
true);
647 $this->template_file->setVariable(
"FILEUPLOAD_DROPZONE_ID",
" id=\"$upload_id\"");
649 $this->template_file->setCurrentBlock(
"header_fileupload");
650 $this->template_file->setVariable(
"HEADER_FILEUPLOAD_SCRIPT", $upload->getHTML());
651 $this->template_file->parseCurrentBlock();
658 if (!$this->template_file->blockExists(
"center_col_width")) {
661 $center_column_class =
"";
662 if (trim($this->right_content) !=
"" && trim($this->left_content) !=
"") {
663 $center_column_class =
"two_side_col";
665 if (trim($this->right_content) !=
"" || trim($this->left_content) !=
"") {
666 $center_column_class =
"one_side_col";
670 switch ($center_column_class) {
672 $center_column_class =
"col-sm-9";
675 $center_column_class =
"col-sm-6";
678 $center_column_class =
"col-sm-12";
681 if (trim($this->left_content) !=
"") {
682 $center_column_class .=
" col-sm-push-3";
685 $this->template_file->setCurrentBlock(
"center_col_width");
686 $this->template_file->setVariable(
"CENTER_COL", $center_column_class);
687 $this->template_file->parseCurrentBlock();
693 if (trim($this->main_content) !=
"") {
694 $this->template_file->setVariable(
"ADM_CONTENT", $this->main_content);
701 if (trim($this->left_content) !=
"") {
702 $this->template_file->setCurrentBlock(
"left_column");
703 $this->template_file->setVariable(
"LEFT_CONTENT", $this->left_content);
704 $left_col_class = (trim($this->right_content) ==
"")
705 ?
"col-sm-3 col-sm-pull-9" 706 :
"col-sm-3 col-sm-pull-6";
707 $this->template_file->setVariable(
"LEFT_COL_CLASS", $left_col_class);
708 $this->template_file->parseCurrentBlock();
715 if (trim($this->right_content) !=
"") {
716 $this->template_file->setCurrentBlock(
"right_column");
717 $this->template_file->setVariable(
"RIGHT_CONTENT", $this->right_content);
718 $this->template_file->parseCurrentBlock();
726 $lng = $DIC->language();
728 if ($this->admin_panel_commands_toolbar === null) {
736 if ($this->admin_panel_arrow) {
743 $this->template_file->setCurrentBlock(
"adm_view_components");
744 $this->template_file->setVariable(
"ADM_PANEL1", $toolb->getHTML());
745 $this->template_file->parseCurrentBlock();
748 if ($this->admin_panel_bottom) {
749 $this->template_file->setCurrentBlock(
"adm_view_components2");
752 if ($this->admin_panel_arrow) {
756 $this->template_file->setVariable(
"ADM_PANEL2", $toolb->getHTML());
757 $this->template_file->parseCurrentBlock();
764 if ($this->page_form_action !=
"") {
765 $this->template_file->setCurrentBlock(
"page_form_start");
766 $this->template_file->setVariable(
"PAGE_FORM_ACTION", $this->page_form_action);
767 $this->template_file->parseCurrentBlock();
768 $this->template_file->touchBlock(
"page_form_end");
777 $ilToolbar = $DIC[
"ilToolbar"];
780 $thtml = $ilToolbar->getHTML();
782 $this->template_file->setCurrentBlock(
"toolbar_buttons");
783 $this->template_file->setVariable(
"BUTTONS", $thtml);
784 $this->template_file->parseCurrentBlock();
791 if ($this->template_file->blockExists(
"tabs_outer_start")) {
792 $this->template_file->touchBlock(
"tabs_outer_start");
793 $this->template_file->touchBlock(
"tabs_outer_end");
794 $this->template_file->touchBlock(
"tabs_inner_start");
795 $this->template_file->touchBlock(
"tabs_inner_end");
797 if ($this->tabs_html !=
"") {
798 $this->template_file->setVariable(
"TABS", $this->tabs_html);
800 $this->template_file->setVariable(
"SUB_TABS", $this->sub_tabs_html);
807 $this->template_file->setVariable(
'LIGHTBOX', implode(
'', $this->lightbox));
setLeftContent($left_content)
setVariable($variable, $value='')
setPermanentLink($permanent_link)
setHeaderPageTitle($header_page_title)
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
setMainContent($main_content)
const MESSAGE_TYPE_QUESTION
setTitleDesc($title_desc)
setPageFormAction($page_form_action)
static stripScriptHTML($a_str, $a_allow="", $a_rm_js=true)
strip only html tags (4.0) from text $allowed contains tags to be allowed, in format tags a and b ar...
const MESSAGE_TYPE_FAILURE
setCurrentBlock($part="DEFAULT")
setTitleAlerts($title_alerts)
const MESSAGE_TYPE_SUCCESS
setHeaderAction($header_action)
setAdminPanelBottom($admin_panel_bottom)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setBanner($a_val)
Set banner.
renderPage($part, $a_fill_tabs, $a_skip_main_menu)
setEnableFileupload($enable_fileupload)
setAdminPanelArrow($admin_panel_arrow)
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
setAdminPanelCommandsToolbar($admin_panel_commands_toolbar)
$standard_template_loaded
setTitle($title, bool $hidden=false)
addBlockFile($var, $block, $tplname, $in_module=false)
setOnScreenMessage($a_type, $a_txt, $a_keep=false)
Set a message to be displayed to the user.
parseCurrentBlock($part="DEFAULT")
static _saveUsages()
Store the collected language variable usages in the user session This should be called as late as pos...
addLightbox($a_html, $a_id)
getMessageTextForType($m)
__construct(string $file, bool $flag1, bool $flag2, bool $in_module=false, $vars="DEFAULT", bool $plugin=false, bool $a_use_cache=true)
$admin_panel_commands_toolbar
setFilter(string $filter)