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();
627 if (count((array) $this->title_alerts)) {
628 foreach ($this->title_alerts as $alert) {
629 $this->template_file->setCurrentBlock(
'header_alert');
630 if (!($alert[
'propertyNameVisible'] ===
false)) {
631 $this->template_file->setVariable(
'H_PROP', $alert[
'property'] .
':');
633 $this->template_file->setVariable(
'H_VALUE', $alert[
'value']);
634 $this->template_file->parseCurrentBlock();
639 if ($this->enable_fileupload != null) {
641 $upload_id =
"dropzone_" . $ref_id;
643 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
644 $upload = new \ilFileUploadGUI($upload_id, $ref_id,
true);
646 $this->template_file->setVariable(
"FILEUPLOAD_DROPZONE_ID",
" id=\"$upload_id\"");
648 $this->template_file->setCurrentBlock(
"header_fileupload");
649 $this->template_file->setVariable(
"HEADER_FILEUPLOAD_SCRIPT", $upload->getHTML());
650 $this->template_file->parseCurrentBlock();
657 if (!$this->template_file->blockExists(
"center_col_width")) {
660 $center_column_class =
"";
661 if (trim($this->right_content) !=
"" && trim($this->left_content) !=
"") {
662 $center_column_class =
"two_side_col";
664 if (trim($this->right_content) !=
"" || trim($this->left_content) !=
"") {
665 $center_column_class =
"one_side_col";
669 switch ($center_column_class) {
671 $center_column_class =
"col-sm-9";
674 $center_column_class =
"col-sm-6";
677 $center_column_class =
"col-sm-12";
680 if (trim($this->left_content) !=
"") {
681 $center_column_class .=
" col-sm-push-3";
684 $this->template_file->setCurrentBlock(
"center_col_width");
685 $this->template_file->setVariable(
"CENTER_COL", $center_column_class);
686 $this->template_file->parseCurrentBlock();
692 if (trim($this->main_content) !=
"") {
693 $this->template_file->setVariable(
"ADM_CONTENT", $this->main_content);
700 if (trim($this->left_content) !=
"") {
701 $this->template_file->setCurrentBlock(
"left_column");
702 $this->template_file->setVariable(
"LEFT_CONTENT", $this->left_content);
703 $left_col_class = (trim($this->right_content) ==
"")
704 ?
"col-sm-3 col-sm-pull-9" 705 :
"col-sm-3 col-sm-pull-6";
706 $this->template_file->setVariable(
"LEFT_COL_CLASS", $left_col_class);
707 $this->template_file->parseCurrentBlock();
714 if (trim($this->right_content) !=
"") {
715 $this->template_file->setCurrentBlock(
"right_column");
716 $this->template_file->setVariable(
"RIGHT_CONTENT", $this->right_content);
717 $this->template_file->parseCurrentBlock();
725 $lng = $DIC->language();
727 if ($this->admin_panel_commands_toolbar === null) {
735 if ($this->admin_panel_arrow) {
742 $this->template_file->setCurrentBlock(
"adm_view_components");
743 $this->template_file->setVariable(
"ADM_PANEL1", $toolb->getHTML());
744 $this->template_file->parseCurrentBlock();
747 if ($this->admin_panel_bottom) {
748 $this->template_file->setCurrentBlock(
"adm_view_components2");
751 if ($this->admin_panel_arrow) {
754 $toolb->setId($toolb->getId() .
"2");
755 $this->template_file->setVariable(
"ADM_PANEL2", $toolb->getHTML());
756 $this->template_file->parseCurrentBlock();
763 if ($this->page_form_action !=
"") {
764 $this->template_file->setCurrentBlock(
"page_form_start");
765 $this->template_file->setVariable(
"PAGE_FORM_ACTION", $this->page_form_action);
766 $this->template_file->parseCurrentBlock();
767 $this->template_file->touchBlock(
"page_form_end");
776 $ilToolbar = $DIC[
"ilToolbar"];
779 $thtml = $ilToolbar->getHTML();
781 $this->template_file->setCurrentBlock(
"toolbar_buttons");
782 $this->template_file->setVariable(
"BUTTONS", $thtml);
783 $this->template_file->parseCurrentBlock();
790 if ($this->template_file->blockExists(
"tabs_outer_start")) {
791 $this->template_file->touchBlock(
"tabs_outer_start");
792 $this->template_file->touchBlock(
"tabs_outer_end");
793 $this->template_file->touchBlock(
"tabs_inner_start");
794 $this->template_file->touchBlock(
"tabs_inner_end");
796 if ($this->tabs_html !=
"") {
797 $this->template_file->setVariable(
"TABS", $this->tabs_html);
799 $this->template_file->setVariable(
"SUB_TABS", $this->sub_tabs_html);
806 $this->template_file->setVariable(
'LIGHTBOX', implode(
'', $this->lightbox));
setAdminPanelCommandsToolbar($admin_panel_commands_toolbar)
const MESSAGE_TYPE_SUCCESS
$admin_panel_commands_toolbar
setMainContent($main_content)
setTitleDesc($title_desc)
const MESSAGE_TYPE_FAILURE
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
setCurrentBlock($part="DEFAULT")
setBanner($a_val)
Set banner.
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_QUESTION
setPermanentLink($permanent_link)
setAdminPanelArrow($admin_panel_arrow)
setLeftContent($left_content)
setTitleAlerts($title_alerts)
setOnScreenMessage($a_type, $a_txt, $a_keep=false)
Set a message to be displayed to the user.
setTitle($title, bool $hidden=false)
setHeaderAction($header_action)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
setAdminPanelBottom($admin_panel_bottom)
setFilter(string $filter)
setEnableFileupload($enable_fileupload)
$standard_template_loaded
addBlockFile($var, $block, $tplname, $in_module=false)
__construct(string $file, bool $flag1, bool $flag2, bool $in_module=false, $vars="DEFAULT", bool $plugin=false, bool $a_use_cache=true)
getMessageTextForType($m)
parseCurrentBlock($part="DEFAULT")
addLightbox($a_html, $a_id)
static _saveUsages()
Store the collected language variable usages in the user session This should be called as late as pos...
renderPage($part, $a_fill_tabs, $a_skip_main_menu)
setVariable($variable, $value='')
setPageFormAction($page_form_action)
setHeaderPageTitle($header_page_title)