19 declare(strict_types=1);
47 "assets/js/Basic.js" =>
true,
55 "assets/js/Basic.js" => 1,
109 string $in_module =
'',
110 string $vars = self::DEFAULT_BLOCK,
112 bool $a_use_cache =
true 115 $this->template_name = $file;
132 return $this->
renderPage($part,
true,
false, $DIC);
137 $this->show_footer =
false;
156 !in_array($a_type, self::MESSAGE_TYPES,
true)
162 $this->messages[$a_type] = $a_txt;
171 foreach (self::MESSAGE_TYPES as $type) {
191 return $this->messages[$type] ??
null;
194 public function addJavaScript(
string $a_js_file,
bool $a_add_version_parameter =
true,
int $a_batch = 2): void
197 if ($a_batch < 1 || $a_batch > 3) {
202 if (is_int(strpos($a_js_file,
"components/ILIAS/jQuery")) ||
203 is_int(strpos($a_js_file,
"/jquery.js")) ||
204 is_int(strpos($a_js_file,
"/jquery/")) ||
205 is_int(strpos($a_js_file,
"/jquery-ui/")) ||
206 is_int(strpos($a_js_file,
"/jquery-min.js"))
211 if (!in_array($a_js_file, $this->js_files,
true)) {
212 $this->js_files[] = $a_js_file;
213 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
214 $this->js_files_batch[$a_js_file] = $a_batch;
221 if ($a_batch < 1 || $a_batch > 3) {
225 $this->on_load_code[$a_batch][] = $a_code;
231 for ($i = 1; $i <= 3; $i++) {
232 if (isset($this->on_load_code[$i])) {
233 foreach ($this->on_load_code[$i] as $code) {
239 return '<script type="text/javascript">' .
"\n" .
249 $this->js_files = [];
250 $this->js_files_vp = [];
251 $this->js_files_batch = [];
262 $vers =
"vers=" . str_replace([
".",
" "],
"-",
ILIAS_VERSION);
265 $vers .=
'-' . time();
270 for ($i = 0; $i <= 3; $i++) {
271 reset($this->js_files);
272 foreach ($this->js_files as $file) {
273 if ($this->js_files_batch[$file] === $i) {
276 strpos($file,
"http") === 0 ||
277 strpos($file,
"//") === 0
280 } elseif (strpos($file,
'./') === 0) {
281 $url_parts = parse_url($file);
282 if (is_file($url_parts[
'path'])) {
294 for ($i = 1; $i <= 3; $i++) {
295 if (isset($this->on_load_code[$i])) {
297 foreach ($this->on_load_code[$i] as $code) {
311 if ($this->js_files_vp[$file]) {
319 public function addCss(
string $a_css_file,
string $media =
"screen"): void
321 if (!array_key_exists($a_css_file . $media, $this->css_files)) {
322 $this->css_files[$a_css_file . $media] = [
323 "file" => $a_css_file,
329 public function addInlineCss(
string $a_css,
string $media =
"screen"): void
331 $this->inline_css[] = [
345 foreach ($this->css_files as $css) {
361 $this->body_class = $a_class;
369 if ($this->body_class !==
"" && $this->
blockExists(
"body_class")) {
371 $this->
setVariable(
"BODY_CLASS", $this->body_class);
383 bool $a_skip_main_menu,
400 if (!$a_skip_main_menu) {
442 if ($part === self::DEFAULT_BLOCK) {
443 $html = $this->
template->getUnmodified();
445 $html = $this->
template->getUnmodified($part);
451 $component_factory = $DIC[
"component.factory"];
454 $id = $this->
template->getTemplateIdentifier(
455 $this->template_name,
459 foreach ($component_factory->getActivePluginsInSlot(
"uihk") as $ui_plugin) {
460 $gui_class = $ui_plugin->getUIClassInstance();
461 $resp = $gui_class->getHTML(
472 $html = $gui_class->modifyHTML($html,
$resp);
484 $this->css_files = [];
495 foreach ($this->inline_css as $css) {
505 "LOCATION_NEWCONTENT_STYLESHEET_TAG",
506 '<link rel="stylesheet" type="text/css" href="' .
520 if ($this->standard_template_loaded) {
528 $this->
addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
529 $this->
addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
531 $this->standard_template_loaded =
true;
538 public function setTitle(
string $a_title,
bool $hidden =
false): void
540 $this->title = $a_title;
541 $this->header_page_title = $a_title;
549 $this->title_desc = $a_descr;
555 public function setTitleIcon(
string $a_icon_path,
string $a_icon_desc =
""): void
557 $this->icon_desc = $a_icon_desc;
558 $this->icon_path = $a_icon_path;
563 $this->title_alerts = $a_props;
576 $this->header_action = $a_header;
581 $this->header_page_title = $a_title;
591 $lng = $DIC->language();
594 $header_tpl =
new ilTemplate(
'tpl.il_header.html',
true,
true);
596 if ($this->icon_path !==
"") {
597 $header_tpl->setCurrentBlock(
"header_image");
598 $header_tpl->setVariable(
"IMG_HEADER", $this->icon_path);
599 $header_tpl->parseCurrentBlock();
603 if ($this->title !==
"") {
605 $header_tpl->setVariable(
"HEADER", $title);
610 if ($header !==
'') {
611 $header_tpl->setCurrentBlock(
"header_image");
612 $header_tpl->parseCurrentBlock();
615 if ($this->title_desc !==
"") {
616 $header_tpl->setCurrentBlock(
"header_desc");
617 $header_tpl->setVariable(
"H_DESCRIPTION", $this->title_desc);
618 $header_tpl->parseCurrentBlock();
621 if ($header !==
'') {
622 $header_tpl->setCurrentBlock(
"head_action_inner");
623 $header_tpl->setVariable(
"HEAD_ACTION", $header);
624 $header_tpl->parseCurrentBlock();
627 foreach ($this->title_alerts as $alert) {
628 $header_tpl->setCurrentBlock(
'header_alert');
629 if (!($alert[
'propertyNameVisible'] ===
false)) {
630 $header_tpl->setVariable(
'H_PROP', $alert[
'property'] .
':');
632 $header_tpl->setVariable(
'H_VALUE', $alert[
'value']);
633 $header_tpl->parseCurrentBlock();
637 if ($this->enable_fileupload !==
null) {
639 $this->enable_fileupload,
644 "IL_DROPZONE_HEADER",
645 $file_upload->getDropzoneHtml()
648 $this->
setVariable(
"IL_HEADER", $header_tpl->get());
661 $ilLocator = $DIC[
"ilLocator"];
665 "components/ILIAS/Locator",
667 [
"locator_gui" => $ilLocator]
669 if (!$uip->replaced()) {
670 $html = $ilLocator->getHTML();
672 $html = $uip->getHTML($html);
680 public function setTabs(
string $a_tabs_html): void
682 if ($a_tabs_html !==
"" && $this->
blockExists(
"tabs_outer_start")) {
707 if ($this->tabs_html !==
"") {
710 $this->
setVariable(
"SUB_TABS", $this->sub_tabs_html);
718 $ilTabs = $DIC[
"ilTabs"];
721 $this->sub_tabs_html = $ilTabs->getSubTabHTML();
722 $this->tabs_html = $ilTabs->getHTML(
true);
728 if ($a_html !==
"") {
729 $this->main_content = $a_html;
735 if ($a_html !==
"") {
736 $this->left_content = $a_html;
742 if ($a_content !==
"") {
743 $this->left_nav_content = $a_content;
752 if (trim($this->left_nav_content) !==
"") {
754 $this->
setVariable(
"LEFT_NAV_CONTENT", trim($this->left_nav_content));
762 if ($a_html !==
'') {
763 $this->right_content = $a_html;
776 $left = trim($this->left_content);
777 $right = trim($this->right_content);
780 case (
'' !== $left &&
'' !== $right):
781 $center_column_class =
'col-sm-6';
784 case (
'' !== $left ||
'' !== $right):
785 $center_column_class =
'col-sm-9';
789 $center_column_class =
"col-sm-12";
794 $center_column_class .=
" col-sm-push-3";
798 $this->
setVariable(
"CENTER_COL", $center_column_class);
804 if (trim($this->main_content) !==
"") {
805 $this->
setVariable(
"ADM_CONTENT", trim($this->main_content));
814 if (trim($this->left_content) !==
"") {
816 $this->
setVariable(
"LEFT_CONTENT", trim($this->left_content));
817 $left_col_class = (trim($this->right_content) ===
"")
818 ?
"col-sm-3 col-sm-pull-9" 819 :
"col-sm-3 col-sm-pull-6";
820 $this->
setVariable(
"LEFT_COL_CLASS", $left_col_class);
830 if (trim($this->right_content) !==
"") {
832 $this->
setVariable(
"RIGHT_CONTENT", trim($this->right_content));
844 $ilToolbar = $DIC[
"ilToolbar"];
845 $thtml = $ilToolbar->getHTML();
857 $lng = $DIC->language();
859 if (is_object(
$lng)) {
860 $this->
setVariable(
'META_CONTENT_LANGUAGE',
$lng->getContentLanguage());
871 if ($this->header_page_title !==
"") {
876 if (
$ilSetting->get(
'short_inst_name') !==
"") {
891 $this->page_form_action = $a_action;
899 if ($this->page_form_action !==
"") {
901 $this->
setVariable(
"PAGE_FORM_ACTION", $this->page_form_action);
913 $this->login_target_par = $a_val;
926 string $part = self::DEFAULT_BLOCK,
927 bool $add_error_mess =
false,
928 bool $handle_referer =
false,
929 bool $add_ilias_footer =
false,
930 bool $add_standard_elements =
false,
931 bool $a_main_menu =
true,
934 if ($add_error_mess) {
939 if ($add_standard_elements) {
991 if ($part === self::DEFAULT_BLOCK) {
992 $html = $this->
template->get();
994 $html = $this->
template->get($part);
1004 string $part = self::DEFAULT_BLOCK,
1005 bool $a_fill_tabs =
true,
1006 bool $a_skip_main_menu =
false 1013 header(
'P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
1014 header(
"Content-type: text/html; charset=UTF-8");
1037 $lng = $DIC->language();
1039 if ($this->tree_flat_link !==
"") {
1040 if ($this->left_nav_content !==
"") {
1045 $this->
setVariable(
"LINK_MODE", $this->tree_flat_link);
1047 if (
$ilSetting->get(
"tree_frame") ===
"right") {
1050 $this->
setVariable(
"ALT_TREE",
$lng->txt($this->tree_flat_mode .
"view"));
1061 $this->tree_flat_link = $a_link;
1062 $this->tree_flat_mode = $a_mode;
1067 $this->admin_panel_commands_toolbar = $toolb;
1068 $this->admin_panel_arrow = $a_arrow;
1069 $this->admin_panel_bottom = $a_bottom_panel;
1078 $lng = $DIC->language();
1080 if ($this->admin_panel_commands_toolbar ===
null) {
1087 if ($this->admin_panel_arrow) {
1095 $this->
setVariable(
"ADM_PANEL1", $toolb->getHTML());
1099 if ($this->admin_panel_bottom) {
1103 if ($this->admin_panel_arrow) {
1107 $this->
setVariable(
"ADM_PANEL2", $toolb->getHTML());
1115 string $a_append =
"",
1116 string $a_target =
"",
1117 string $a_title =
"" 1119 $this->permanent_link = [
1122 "append" => $a_append,
1123 "target" => $a_target,
1130 if (!empty($this->permanent_link)) {
1131 $plinkgui =
new ilPermanentLinkGUI(
1132 $this->permanent_link[
"type"],
1133 $this->permanent_link[
"id"],
1134 $this->permanent_link[
"append"],
1135 $this->permanent_link[
"target"]
1137 if ($this->permanent_link[
"title"] !==
"") {
1138 $plinkgui->setTitle($this->permanent_link[
"title"]);
1140 $this->
setVariable(
"PRMLINK", $plinkgui->getHTML());
1150 $this->enable_fileupload =
null;
1153 if ($a_reset_header_action) {
1160 $this->enable_fileupload = $a_ref_id;
1166 public function get(
string $part = self::DEFAULT_BLOCK):
string 1168 return $this->
template->get($part);
1173 $this->
template->setVariable($variable, $value);
1178 return $this->
template->variableExists($a_variablename);
1186 return $this->
template->setCurrentBlock($part);
1194 return $this->
template->touchBlock($block);
1202 return $this->
template->parseCurrentBlock($part);
1208 public function addBlockFile(
string $var,
string $block,
string $template_name, ?
string $in_module =
null): bool
1210 return $this->
template->addBlockFile($var, $block, $template_name, $in_module);
1215 return $this->
template->blockExists($a_blockname);
static get(string $a_var)
ilToolbarGUI $admin_panel_commands_toolbar
variableExists(string $a_variablename)
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)
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
resetJavascript()
Reset javascript files.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setAlertProperties(array $a_props)
Set alert properties.
special template class to simplify handling of ITX/PEAR
setLeftNavContent(string $a_content)
Sets content of left navigation column.
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)
clearHeader()
Clear header.
setLeftContent(string $a_html)
Sets content of left column.
setDescription(string $a_descr)
Sets descripton below title in standard template.
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
static stripScriptHTML(string $a_str, string $a_allow="", bool $a_rm_js=true)
parseCurrentBlock(string $part=self::DEFAULT_BLOCK)
setLoginTargetPar(string $a_val)
Set target parameter for login (public sector).
addAdminPanelToolbar(ilToolbarGUI $toolb, bool $a_bottom_panel=true, bool $a_arrow=false)
setOnScreenMessage(string $a_type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
Customizing of pimple-DIC for ILIAS.
__construct(string $file, bool $flag1, bool $flag2, string $in_module='', string $vars=self::DEFAULT_BLOCK, bool $plugin=false, bool $a_use_cache=true)
static getNewContentStyleSheetLocation(string $mode="output")
get full style sheet file name (path inclusive) of current user
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
blockExists(string $a_blockname)
check if block exists in actual template
static initDom(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Dom.
addBlockFile(string $var, string $block, string $template_name, ?string $in_module=null)
setHeaderPageTitle(string $a_title)
Sets the title of the page (for browser window).
setSubTabs(string $a_tabs_html)
sets subtabs 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.
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.
setBodyClass(string $a_class="")
Sets the body-tags class.
bool $standard_template_loaded
addInlineCss(string $a_css, string $media="screen")
Add a css file that should be included in the header.
fillJavaScriptFiles(bool $a_force=false)
Probably adds javascript files.
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
string $header_page_title
hideFooter()
Make the template hide the footer.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
printToString(string $part=self::DEFAULT_BLOCK)
setContent(string $a_html)
Sets content for standard template.
fillJavascriptFile(string $file, string $vers)
setPageFormAction(string $a_action)
Sets the pages form action.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setTreeFlatIcon(string $a_link, string $a_mode)
Sets a tree or flat icon.
setLocator()
Insert locator.
getMessageTextForType(string $type)
fillCssFiles(bool $a_force=false)
setTabs(string $a_tabs_html)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
static _saveUsages()
Store the collected language variable usages in the user session This should be called as late as pos...
setHeaderActionMenu(string $a_header)
Set header action menu.
setRightContent(string $a_html)
Sets content of right column.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
setFileUploadRefId(int $a_ref_id)
Enables the file upload into this object by dropping a file.
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
renderPage(string $part, bool $a_fill_tabs, bool $a_skip_main_menu, Container $DIC)
touchBlock(string $block)