ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilDataCollectionGlobalTemplate.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/UICore/lib/html-it/IT.php");
5include_once("./Services/UICore/lib/html-it/ITX.php");
6
15{
16 protected $tree_flat_link = "";
17 protected $page_form_action = "";
18 protected $permanent_link = false;
19 protected $lightbox = array();
20 protected $standard_template_loaded = false;
24 protected $template;
25
26
38 public function __construct(
39 $file,
40 $flag1,
41 $flag2,
42 $in_module = false,
43 $vars = "DEFAULT",
44 $plugin = false,
45 $a_use_cache = true
46 ) {
47 $this->setBodyClass("std");
48 $this->template = new ilTemplate($file, $flag1, $flag2, $in_module, $vars, $plugin, $a_use_cache);
49 }
50
54 public function printToString() : string
55 {
56 throw new ilException('not implemented');
57 }
58
59
60 //***********************************
61 //
62 // FOOTER
63 //
64 // Used in:
65 // * ilStartUPGUI
66 // * ilTestSubmissionReviewGUI
67 // * ilTestPlayerAbstractGUI
68 // * ilAssQuestionHintRequestGUI
69 //
70 //***********************************
71
72 private $show_footer = true;
73
74
78 public function hideFooter()
79 {
80 $this->show_footer = false;
81 }
82
83
87 private function fillFooter()
88 {
89 global $DIC;
90
91 $ilSetting = $DIC->settings();
92
93 $lng = $DIC->language();
94
95 $ilCtrl = $DIC->ctrl();
96 $ilDB = $DIC->database();
97
98 if (!$this->show_footer) {
99 return;
100 }
101
102 $ftpl = new ilTemplate("tpl.footer.html", true, true, "Services/UICore");
103
104 $php = "";
105 if (DEVMODE) {
106 $php = ", PHP " . phpversion();
107 }
108 $ftpl->setVariable("ILIAS_VERSION", $ilSetting->get("ilias_version") . $php);
109
110 $link_items = array();
111
112 // imprint
113 include_once "Services/Imprint/classes/class.ilImprint.php";
114 if ($_REQUEST["baseClass"] != "ilImprintGUI" && ilImprint::isActive()) {
115 include_once "Services/Link/classes/class.ilLink.php";
116 $link_items[ilLink::_getStaticLink(0, "impr")] = array($lng->txt("imprint"), true);
117 }
118
119 // system support contacts
120 include_once("./Modules/SystemFolder/classes/class.ilSystemSupportContactsGUI.php");
122 $link_items[$l] = array(ilSystemSupportContactsGUI::getFooterText(), false);
123 }
124
125 if (DEVMODE) {
126 if (function_exists("tidy_parse_string")) {
127 $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=xhtml")] = array("Validate", true);
128 $link_items[ilUtil::appendUrlParameterString($_SERVER["REQUEST_URI"], "do_dev_validate=accessibility")] = array("Accessibility", true);
129 }
130 }
131
132 // output translation link
133 include_once("Services/Language/classes/class.ilObjLanguageAccess.php");
135 $link_items[ilObjLanguageAccess::_getTranslationLink()] = array($lng->txt('translation'), true);
136 }
137
138 $cnt = 0;
139 foreach ($link_items as $url => $caption) {
140 $cnt++;
141 if ($caption[1]) {
142 $ftpl->touchBlock("blank");
143 }
144 if ($cnt < sizeof($link_items)) {
145 $ftpl->touchBlock("item_separator");
146 }
147
148 $ftpl->setCurrentBlock("items");
149 $ftpl->setVariable("URL_ITEM", ilUtil::secureUrl($url));
150 $ftpl->setVariable("TXT_ITEM", $caption[0]);
151 $ftpl->parseCurrentBlock();
152 }
153
154 if (DEVMODE) {
155 // execution time
156 $t1 = explode(" ", $GLOBALS['ilGlobalStartTime']);
157 $t2 = explode(" ", microtime());
158 $diff = $t2[0] - $t1[0] + $t2[1] - $t1[1];
159
160 $mem_usage = array();
161 if (function_exists("memory_get_usage")) {
162 $mem_usage[]
163 = "Memory Usage: " . memory_get_usage() . " Bytes";
164 }
165 if (function_exists("xdebug_peak_memory_usage")) {
166 $mem_usage[]
167 = "XDebug Peak Memory Usage: " . xdebug_peak_memory_usage() . " Bytes";
168 }
169 $mem_usage[] = round($diff, 4) . " Seconds";
170
171 if (sizeof($mem_usage)) {
172 $ftpl->setVariable("MEMORY_USAGE", "<br>" . implode(" | ", $mem_usage));
173 }
174
175 if (!empty($_GET["do_dev_validate"]) && $ftpl->blockExists("xhtml_validation")) {
176 require_once("Services/XHTMLValidator/classes/class.ilValidatorAdapter.php");
177 $template2 = clone($this);
178 $ftpl->setCurrentBlock("xhtml_validation");
179 $ftpl->setVariable(
180 "VALIDATION",
181 ilValidatorAdapter::validate($template2->get(
182 "DEFAULT",
183 false,
184 false,
185 false,
186 true
187 ), $_GET["do_dev_validate"])
188 );
189 $ftpl->parseCurrentBlock();
190 }
191
192 // controller history
193 if (is_object($ilCtrl) && $ftpl->blockExists("c_entry")
194 && $ftpl->blockExists("call_history")
195 ) {
196 $hist = $ilCtrl->getCallHistory();
197 foreach ($hist as $entry) {
198 $ftpl->setCurrentBlock("c_entry");
199 $ftpl->setVariable("C_ENTRY", $entry["class"]);
200 if (is_object($ilDB)) {
201 $file = $ilCtrl->lookupClassPath($entry["class"]);
202 $add = $entry["mode"] . " - " . $entry["cmd"];
203 if ($file != "") {
204 $add .= " - " . $file;
205 }
206 $ftpl->setVariable("C_FILE", $add);
207 }
208 $ftpl->parseCurrentBlock();
209 }
210 $ftpl->setCurrentBlock("call_history");
211 $ftpl->parseCurrentBlock();
212 }
213
214 // included files
215 if (is_object($ilCtrl) && $ftpl->blockExists("i_entry")
216 && $ftpl->blockExists("included_files")
217 ) {
218 $fs = get_included_files();
219 $ifiles = array();
220 $total = 0;
221 foreach ($fs as $f) {
222 $ifiles[] = array("file" => $f, "size" => filesize($f));
223 $total += filesize($f);
224 }
225 $ifiles = ilUtil::sortArray($ifiles, "size", "desc", true);
226 foreach ($ifiles as $f) {
227 $ftpl->setCurrentBlock("i_entry");
228 $ftpl->setVariable("I_ENTRY", $f["file"] . " (" . $f["size"] . " Bytes, " . round(100 / $total * $f["size"], 2) . "%)");
229 $ftpl->parseCurrentBlock();
230 }
231 $ftpl->setCurrentBlock("i_entry");
232 $ftpl->setVariable("I_ENTRY", "Total (" . $total . " Bytes, 100%)");
233 $ftpl->parseCurrentBlock();
234 $ftpl->setCurrentBlock("included_files");
235 $ftpl->parseCurrentBlock();
236 }
237 }
238
239 // BEGIN Usability: Non-Delos Skins can display the elapsed time in the footer
240 // The corresponding $ilBench->start invocation is in inc.header.php
241 $ilBench = $DIC["ilBench"];
242 $ilBench->stop("Core", "ElapsedTimeUntilFooter");
243 $ftpl->setVariable(
244 "ELAPSED_TIME",
245 ", " . number_format($ilBench->getMeasuredTime("Core", "ElapsedTimeUntilFooter"), 1) . ' seconds'
246 );
247 // END Usability: Non-Delos Skins can display the elapsed time in the footer
248
249 $this->setVariable("FOOTER", $ftpl->get());
250 }
251
252
253 //***********************************
254 //
255 // MAIN MENU
256 //
257 //***********************************
258
262 protected $main_menu;
267
268
269 private function getMainMenu()
270 {
271 global $DIC;
272
273 $ilMainMenu = $DIC["ilMainMenu"];
274
275 if ($this->variableExists('MAINMENU')) {
276 $ilMainMenu->setLoginTargetPar($this->getLoginTargetPar());
277 $this->main_menu = $ilMainMenu->getHTML();
278 $this->main_menu_spacer = $ilMainMenu->getSpacerClass();
279 }
280 }
281
282
283 private function fillMainMenu()
284 {
285 global $DIC;
286 $tpl = $DIC["tpl"];
287 if ($this->variableExists('MAINMENU')) {
288 $tpl->setVariable("MAINMENU", $this->main_menu);
289 $tpl->setVariable("MAINMENU_SPACER", $this->main_menu_spacer);
290 }
291 }
292
293
294 //***********************************
295 //
296 // HELP
297 //
298 //***********************************
299
303 private function initHelp()
304 {
305 include_once("./Services/Help/classes/class.ilHelpGUI.php");
306 //ilHelpGUI::initHelp($this);
307 }
308
309
310 //***********************************
311 //
312 // MESSAGES
313 //
314 // setMessage is only used in ilUtil
315 //
316 //***********************************
317
318 const MESSAGE_TYPE_FAILURE = 'failure';
319 const MESSAGE_TYPE_INFO = "info";
320 const MESSAGE_TYPE_SUCCESS = "success";
321 const MESSAGE_TYPE_QUESTION = "question";
325 protected static $message_types
326 = array(
327 self::MESSAGE_TYPE_FAILURE,
328 self::MESSAGE_TYPE_INFO,
329 self::MESSAGE_TYPE_SUCCESS,
330 self::MESSAGE_TYPE_QUESTION,
331 );
332 protected $message = array();
333
334
346 public function setOnScreenMessage($a_type, $a_txt, $a_keep = false)
347 {
348 if (!in_array($a_type, self::$message_types) || $a_txt == "") {
349 return;
350 }
351 if (!$a_keep) {
352 $this->message[$a_type] = $a_txt;
353 } else {
354 $_SESSION[$a_type] = $a_txt;
355 }
356 }
357
358
362 private function fillMessage()
363 {
364 global $DIC;
365
366 $out = "";
367
368 foreach (self::$message_types as $m) {
369 $txt = $this->getMessageTextForType($m);
370
371 if ($txt != "") {
373 }
374
375 $request = $DIC->http()->request();
376 $accept_header = $request->getHeaderLine('Accept');
377 if (isset($_SESSION[$m]) && $_SESSION[$m] && ($accept_header !== 'application/json')) {
378 unset($_SESSION[$m]);
379 }
380 }
381
382 if ($out != "") {
383 $this->setVariable("MESSAGE", $out);
384 }
385 }
386
387
393 private function getMessageTextForType($m)
394 {
395 $txt = "";
396 if (isset($_SESSION[$m]) && $_SESSION[$m] != "") {
397 $txt = $_SESSION[$m];
398 } else {
399 if (isset($this->message[$m])) {
400 $txt = $this->message[$m];
401 }
402 }
403
404 return $txt;
405 }
406
407 //***********************************
408 //
409 // JAVASCRIPT files and code
410 //
411 //***********************************
412
418 protected $js_files = array(0 => "./Services/JavaScript/js/Basic.js");
424 protected $js_files_vp = array("./Services/JavaScript/js/Basic.js" => true);
430 protected $js_files_batch = array("./Services/JavaScript/js/Basic.js" => 1);
431
432
436 public function addJavaScript($a_js_file, $a_add_version_parameter = true, $a_batch = 2)
437 {
438 // three batches currently
439 if ($a_batch < 1 || $a_batch > 3) {
440 $a_batch = 2;
441 }
442
443 // ensure jquery files being loaded first
444 if (is_int(strpos($a_js_file, "Services/jQuery"))
445 || is_int(strpos($a_js_file, "/jquery.js"))
446 || is_int(strpos($a_js_file, "/jquery-min.js"))
447 ) {
448 $a_batch = 0;
449 }
450
451 if (!in_array($a_js_file, $this->js_files)) {
452 $this->js_files[] = $a_js_file;
453 $this->js_files_vp[$a_js_file] = $a_add_version_parameter;
454 $this->js_files_batch[$a_js_file] = $a_batch;
455 }
456 }
457
458
462 public function addOnLoadCode($a_code, $a_batch = 2)
463 {
464 // three batches currently
465 if ($a_batch < 1 || $a_batch > 3) {
466 $a_batch = 2;
467 }
468 $this->on_load_code[$a_batch][] = $a_code;
469 }
470
471
477 public function getOnLoadCodeForAsynch()
478 {
479 $js = "";
480 for ($i = 1; $i <= 3; $i++) {
481 if (is_array($this->on_load_code[$i])) {
482 foreach ($this->on_load_code[$i] as $code) {
483 $js .= $code . "\n";
484 }
485 }
486 }
487 if ($js) {
488 return '<script type="text/javascript">' . "\n" .
489 $js .
490 '</script>' . "\n";
491 }
492 }
493
494 // REMOVAL CANDIDATE
495 // Usage locations:
496 // - latex.php
500 public function resetJavascript()
501 {
502 $this->js_files = array();
503 $this->js_files_vp = array();
504 $this->js_files_batch = array();
505 }
506
507 // PRIVATE CANDIDATE
508 // Usage locations:
509 // - ilPageObjectGUI
510 // - ilStartUpGUI
511 // - ilObjPortfolioGUI
512 // - latex.php
513 public function fillJavaScriptFiles($a_force = false)
514 {
515 global $DIC;
516
517 $ilSetting = $DIC->settings();
518
519 if (is_object($ilSetting)) { // maybe this one can be removed
520 $vers = "vers=" . str_replace(array(".", " "), "-", $ilSetting->get("ilias_version"));
521
522 if (DEVMODE) {
523 $vers .= '-' . time();
524 }
525 }
526 if ($this->blockExists("js_file")) {
527 // three batches
528 for ($i = 0; $i <= 3; $i++) {
529 reset($this->js_files);
530 foreach ($this->js_files as $file) {
531 if ($this->js_files_batch[$file] == $i) {
532 if (is_file($file) || substr($file, 0, 4) == "http" || substr($file, 0, 2) == "//" || $a_force) {
533 $this->fillJavascriptFile($file, $vers);
534 } else {
535 if (substr($file, 0, 2) == './') { // #13962
536 $url_parts = parse_url($file);
537 if (is_file($url_parts['path'])) {
538 $this->fillJavascriptFile($file, $vers);
539 }
540 }
541 }
542 }
543 }
544 }
545 }
546 }
547
548
552 private function fillOnLoadCode()
553 {
554 for ($i = 1; $i <= 3; $i++) {
555 if (is_array($this->on_load_code[$i])) {
556 $this->setCurrentBlock("on_load_code");
557 foreach ($this->on_load_code[$i] as $code) {
558 $this->setCurrentBlock("on_load_code_inner");
559 $this->setVariable("OLCODE", $code);
560 $this->parseCurrentBlock();
561 }
562 $this->setCurrentBlock("on_load_code");
563 $this->parseCurrentBlock();
564 }
565 }
566 }
567
568
573 protected function fillJavascriptFile($file, $vers)
574 {
575 $this->setCurrentBlock("js_file");
576 if ($this->js_files_vp[$file]) {
577 $this->setVariable("JS_FILE", ilUtil::appendUrlParameterString($file, $vers));
578 } else {
579 $this->setVariable("JS_FILE", $file);
580 }
581 $this->parseCurrentBlock();
582 }
583
584
585 //***********************************
586 //
587 // CSS files and code
588 //
589 //***********************************
590
596 protected $css_files = array();
601 protected $inline_css = array();
602
603
607 public function addCss($a_css_file, $media = "screen")
608 {
609 if (!array_key_exists($a_css_file . $media, $this->css_files)) {
610 $this->css_files[$a_css_file . $media] = array("file" => $a_css_file, "media" => $media);
611 }
612 }
613
614 // REMOVAL CANDIDATE
615 // Usage locations:
616 // - ilDclRecordEditGUI
617 // - ilObjStyleSheetGUI
621 public function addInlineCss($a_css, $media = "screen")
622 {
623 $this->inline_css[] = array("css" => $a_css, "media" => $media);
624 }
625
626 // PRIVATE CANDIDATE
627 // Usage locations:
628 // - ilPageObjectGUI
629 // - ilDclDetailedViewGUI
630 // - ilStartUpGUI
636 public function fillCssFiles($a_force = false)
637 {
638 if (!$this->blockExists("css_file")) {
639 return;
640 }
641 foreach ($this->css_files as $css) {
642 $filename = $css["file"];
643 if (strpos($filename, "?") > 0) {
644 $filename = substr($filename, 0, strpos($filename, "?"));
645 }
646 if (is_file($filename) || $a_force) {
647 $this->setCurrentBlock("css_file");
648 $this->setVariable("CSS_FILE", $css["file"]);
649 $this->setVariable("CSS_MEDIA", $css["media"]);
650 $this->parseCurrentBlock();
651 }
652 }
653 }
654
655 // REMOVAL CANDIDATE:
656 // Usage locations:
657 // - ilObjMediaPoolGUI
658 // - ilAttendanceList
659 // - ilObjPortfolioGUI
660 // - ilSCORM2004ScoGUI
661 // - ilTestSubmissionReviewGUI
662 // - ilTestPlayerAbstractGUI
663 // - ilAssQuestionHintRequestGUI
664 // - ilWorkspaceFolderExplorer
665 public function setBodyClass($a_class = "")
666 {
667 $this->body_class = $a_class;
668 }
669
670
671 private function fillBodyClass()
672 {
673 if ($this->body_class != "" && $this->blockExists("body_class")) {
674 $this->setCurrentBlock("body_class");
675 $this->setVariable("BODY_CLASS", $this->body_class);
676 $this->parseCurrentBlock();
677 }
678 }
679
680
684 private function resetCss()
685 {
686 $this->css_files = array();
687 }
688
689
695 private function fillInlineCss()
696 {
697 if (!$this->blockExists("css_inline")) {
698 return;
699 }
700 foreach ($this->inline_css as $css) {
701 $this->setCurrentBlock("css_inline");
702 $this->setVariable("CSS_INLINE", $css["css"]);
703 $this->parseCurrentBlock();
704 }
705 }
706
707
711 private function fillNewContentStyle()
712 {
713 $this->setVariable(
714 "LOCATION_NEWCONTENT_STYLESHEET_TAG",
715 '<link rel="stylesheet" type="text/css" href="' .
717 . '" />'
718 );
719 }
720
721
722 //***********************************
723 //
724 // ILIAS STANDARD TEMPLATE
725 // which is responsible for the look
726 // i.e. a title, tabs, ...
727 //
728 //***********************************
729
735 public function loadStandardTemplate()
736 {
737 if ($this->standard_template_loaded) {
738 return;
739 }
740
741 // always load jQuery
742 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
745
746 // always load ui framework
747 include_once("./Services/UICore/classes/class.ilUIFramework.php");
749
750 $this->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
751 $this->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
752
753 $this->standard_template_loaded = true;
754 }
755
756
757 //***********************************
758 //
759 // HEADER in standard template
760 //
761 //***********************************
762
763 protected $header_page_title = "";
764 protected $title = "";
765 protected $title_desc = "";
766 protected $title_alerts = array();
767 protected $header_action;
768
769
775 public function setTitle($a_title, $hidden = false)
776 {
777 $this->title = $a_title;
778 $this->header_page_title = $a_title;
779 }
780
781
785 public function setDescription($a_descr)
786 {
787 $this->title_desc = $a_descr;
788 }
789
790
794 public function setTitleIcon($a_icon_path, $a_icon_desc = "")
795 {
796 $this->icon_desc = $a_icon_desc;
797 $this->icon_path = $a_icon_path;
798 }
799
800
808 public function setAlertProperties(array $a_props)
809 {
810 $this->title_alerts = $a_props;
811 }
812
813
817 public function clearHeader()
818 {
819 $this->setTitle("");
820 $this->setTitleIcon("");
821 $this->setDescription("");
822 $this->setAlertProperties(array());
823 }
824
825 // REMOVAL CANDIDATE
826 // Usage locations:
827 // - ilCalendarPresentationGUI
828 // - ilContainerGUI
829 // - ilObjDataCollectionGUI
830 // - ilDashboardGUI
831 // - ilObjPortfolioTemplateGUI
832 // - ilWikiPageGUI
833 // - ilObjWikiGUI
839 public function setHeaderActionMenu($a_header)
840 {
841 $this->header_action = $a_header;
842 }
843
844 // REMOVAL CANDIDATE
845 // Usage locations:
846 // - ilObjLanguageExtGUI
847 // - ilTestServiceGUI
848 // - ilWikiPageGUI
852 public function setHeaderPageTitle($a_title)
853 {
854 $this->header_page_title = $a_title;
855 }
856
857
861 private function fillHeader()
862 {
863 global $DIC;
864
865 $lng = $DIC->language();
866
867 $icon = false;
868 if ($this->icon_path != "") {
869 $icon = true;
870 $this->setCurrentBlock("header_image");
871 if ($this->icon_desc != "") {
872 $this->setVariable("IMAGE_DESC", $lng->txt("icon") . " " . $this->icon_desc);
873 $this->setVariable("IMAGE_ALT", $lng->txt("icon") . " " . $this->icon_desc);
874 }
875
876 $this->setVariable("IMG_HEADER", $this->icon_path);
877 $this->parseCurrentBlock();
878 $header = true;
879 }
880
881 if ($this->title != "") {
882 $title = ilUtil::stripScriptHTML($this->title);
883 $this->setVariable("HEADER", $title);
884
885 $header = true;
886 }
887
888 if ($header) {
889 $this->setCurrentBlock("header_image");
890 $this->parseCurrentBlock();
891 }
892
893 if ($this->title_desc != "") {
894 $this->setCurrentBlock("header_desc");
895 $this->setVariable("H_DESCRIPTION", $this->title_desc);
896 $this->parseCurrentBlock();
897 }
898
899 $header = $this->getHeaderActionMenu();
900 if ($header) {
901 $this->setCurrentBlock("head_action_inner");
902 $this->setVariable("HEAD_ACTION", $header);
903 $this->parseCurrentBlock();
904 $this->touchBlock("head_action");
905 }
906
907 if (count((array) $this->title_alerts)) {
908 foreach ($this->title_alerts as $alert) {
909 $this->setCurrentBlock('header_alert');
910 if (!($alert['propertyNameVisible'] === false)) {
911 $this->setVariable('H_PROP', $alert['property'] . ':');
912 }
913 $this->setVariable('H_VALUE', $alert['value']);
914 $this->parseCurrentBlock();
915 }
916 }
917
918 // add file upload drop zone in header
919 if ($this->enable_fileupload != null) {
920 $ref_id = $this->enable_fileupload;
921 $upload_id = "dropzone_" . $ref_id;
922
923 include_once("./Services/FileUpload/classes/class.ilFileUploadGUI.php");
924 $upload = new ilFileUploadGUI($upload_id, $ref_id, true);
925
926 $this->setVariable("FILEUPLOAD_DROPZONE_ID", " id=\"$upload_id\"");
927
928 $this->setCurrentBlock("header_fileupload");
929 $this->setVariable("HEADER_FILEUPLOAD_SCRIPT", $upload->getHTML());
930 $this->parseCurrentBlock();
931 }
932 }
933
934
940 private function getHeaderActionMenu()
941 {
943 }
944
945
946 //***********************************
947 //
948 // LOCATOR in standard template
949 //
950 //***********************************
951
955 public function setLocator()
956 {
957 global $DIC;
958
959 $ilMainMenu = $DIC["ilMainMenu"];
960 $ilLocator = $DIC["ilLocator"];
961
962 $ilPluginAdmin = $DIC["ilPluginAdmin"];
963
964 // blog/portfolio
965 if ($ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_REDUCED
966 || $ilMainMenu->getMode() == ilMainMenuGUI::MODE_TOPBAR_ONLY
967 ) {
968 $this->setVariable("LOCATOR", "");
969
970 return;
971 }
972
973 $html = "";
974 if (is_object($ilPluginAdmin)) {
975 include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
976 $html = $ilLocator->getHTML();
977 $uip = new ilUIHookProcessor(
978 "Services/Locator",
979 "main_locator",
980 array("locator_gui" => $ilLocator, "html" => $html)
981 );
982 $html = $uip->getHTML($html);
983 } else {
984 $html = $ilLocator->getHTML();
985 }
986
987 $this->setVariable("LOCATOR", $html);
988 }
989
990
991 //***********************************
992 //
993 // TABS in standard template
994 //
995 //***********************************
996
1000 protected $tabs_html = "";
1004 protected $sub_tabs_html = "";
1005
1006
1010 public function setTabs($a_tabs_html)
1011 {
1012 if ($a_tabs_html != "" && $this->blockExists("tabs_outer_start")) {
1013 $this->touchBlock("tabs_outer_start");
1014 $this->touchBlock("tabs_outer_end");
1015 $this->touchBlock("tabs_inner_start");
1016 $this->touchBlock("tabs_inner_end");
1017 $this->setVariable("TABS", $a_tabs_html);
1018 }
1019 }
1020
1021
1025 public function setSubTabs($a_tabs_html)
1026 {
1027 $this->setVariable("SUB_TABS", $a_tabs_html);
1028 }
1029
1030
1031 private function fillTabs()
1032 {
1033 if ($this->blockExists("tabs_outer_start")) {
1034 $this->touchBlock("tabs_outer_start");
1035 $this->touchBlock("tabs_outer_end");
1036 $this->touchBlock("tabs_inner_start");
1037 $this->touchBlock("tabs_inner_end");
1038
1039 if ($this->tabs_html != "") {
1040 $this->setVariable("TABS", $this->tabs_html);
1041 }
1042 $this->setVariable("SUB_TABS", $this->sub_tabs_html);
1043 }
1044 }
1045
1046
1047 private function getTabsHTML()
1048 {
1049 global $DIC;
1050
1051 $ilTabs = $DIC["ilTabs"];
1052
1053 if ($this->blockExists("tabs_outer_start")) {
1054 $this->sub_tabs_html = $ilTabs->getSubTabHTML();
1055 $this->tabs_html = $ilTabs->getHTML(true);
1056 }
1057 }
1058
1059
1060 //***********************************
1061 //
1062 // COLUMN LAYOUT in standard template
1063 //
1064 //***********************************
1065
1069 public function setContent($a_html)
1070 {
1071 if ($a_html != "") {
1072 $this->main_content = $a_html;
1073 }
1074 }
1075
1076
1080 public function setLeftContent($a_html)
1081 {
1082 $this->left_content = $a_html;
1083 }
1084
1085
1089 public function setLeftNavContent($a_content)
1090 {
1091 $this->left_nav_content = $a_content;
1092 }
1093
1094
1098 private function fillLeftNav()
1099 {
1100 if (trim($this->left_nav_content) != "") {
1101 $this->setCurrentBlock("left_nav");
1102 $this->setVariable("LEFT_NAV_CONTENT", $this->left_nav_content);
1103 $this->parseCurrentBlock();
1104 $this->touchBlock("left_nav_space");
1105 }
1106 }
1107
1108
1112 public function setRightContent($a_html)
1113 {
1114 $this->right_content = $a_html;
1115 }
1116
1117
1118 private function setCenterColumnClass()
1119 {
1120 if (!$this->blockExists("center_col_width")) {
1121 return;
1122 }
1123 $center_column_class = "";
1124 if (trim($this->right_content) != "" && trim($this->left_content) != "") {
1125 $center_column_class = "two_side_col";
1126 } else {
1127 if (trim($this->right_content) != "" || trim($this->left_content) != "") {
1128 $center_column_class = "one_side_col";
1129 }
1130 }
1131
1132 switch ($center_column_class) {
1133 case "one_side_col":
1134 $center_column_class = "col-sm-9";
1135 break;
1136 case "two_side_col":
1137 $center_column_class = "col-sm-6";
1138 break;
1139 default:
1140 $center_column_class = "col-sm-12";
1141 break;
1142 }
1143 if (trim($this->left_content) != "") {
1144 $center_column_class .= " col-sm-push-3";
1145 }
1146
1147 $this->setCurrentBlock("center_col_width");
1148 $this->setVariable("CENTER_COL", $center_column_class);
1149 $this->parseCurrentBlock();
1150 }
1151
1152
1153 private function fillMainContent()
1154 {
1155 if (trim($this->main_content) != "") {
1156 $this->setVariable("ADM_CONTENT", $this->main_content);
1157 }
1158 }
1159
1160
1161 private function fillLeftContent()
1162 {
1163 if (trim($this->left_content) != "") {
1164 $this->setCurrentBlock("left_column");
1165 $this->setVariable("LEFT_CONTENT", $this->left_content);
1166 $left_col_class = (trim($this->right_content) == "")
1167 ? "col-sm-3 col-sm-pull-9"
1168 : "col-sm-3 col-sm-pull-6";
1169 $this->setVariable("LEFT_COL_CLASS", $left_col_class);
1170 $this->parseCurrentBlock();
1171 }
1172 }
1173
1174
1175 private function fillRightContent()
1176 {
1177 if (trim($this->right_content) != "") {
1178 $this->setCurrentBlock("right_column");
1179 $this->setVariable("RIGHT_CONTENT", $this->right_content);
1180 $this->parseCurrentBlock();
1181 }
1182 }
1183
1184
1185 //***********************************
1186 //
1187 // TOOLBAR in standard template
1188 //
1189 //***********************************
1190
1191 private function fillToolbar()
1192 {
1193 global $DIC;
1194
1195 $ilToolbar = $DIC["ilToolbar"];
1196 ;
1197
1198 $thtml = $ilToolbar->getHTML();
1199 if ($thtml != "") {
1200 $this->setCurrentBlock("toolbar_buttons");
1201 $this->setVariable("BUTTONS", $thtml);
1202 $this->parseCurrentBlock();
1203 }
1204 }
1205
1206 // SPECIAL REQUIREMENTS
1207 //
1208 // Stuff that is only used by a little other classes.
1209
1213 private function fillContentLanguage()
1214 {
1215 global $DIC;
1216 $lng = $DIC->language();
1217
1218 if (is_object($lng)) {
1219 $this->setVariable('META_CONTENT_LANGUAGE', $lng->getContentLanguage());
1220 $this->setVariable('LANGUAGE_DIRECTION', $lng->getTextDirection());
1221 }
1222 }
1223
1224
1225 private function fillWindowTitle()
1226 {
1227 global $DIC;
1228
1229 $ilSetting = $DIC->settings();
1230
1231 if ($this->header_page_title != "") {
1232 $title = ilUtil::stripScriptHTML($this->header_page_title);
1233 $this->setVariable("PAGETITLE", "- " . $title);
1234 }
1235
1236 if ($ilSetting->get('short_inst_name') != "") {
1237 $this->setVariable(
1238 "WINDOW_TITLE",
1239 $ilSetting->get('short_inst_name')
1240 );
1241 } else {
1242 $this->setVariable(
1243 "WINDOW_TITLE",
1244 "ILIAS"
1245 );
1246 }
1247 }
1248
1249 // REMOVAL CANDIDATE
1250 // Usage locations:
1251 // - ilLuceneAdvancedSearchGUI
1252 // - ilLuceneSearchGUI
1253 // - ilContainerGUI
1254 public function setPageFormAction($a_action)
1255 {
1256 $this->page_form_action = $a_action;
1257 }
1258
1259
1260 private function fillPageFormAction()
1261 {
1262 if ($this->page_form_action != "") {
1263 $this->setCurrentBlock("page_form_start");
1264 $this->setVariable("PAGE_FORM_ACTION", $this->page_form_action);
1265 $this->parseCurrentBlock();
1266 $this->touchBlock("page_form_end");
1267 }
1268 }
1269
1270
1271 // REMOVAL CANDIDATE
1272 // Usage locations:
1273 // - ilObjForumGUI
1274 // - ilObjPortfolioBaseGUI
1275 // - ilWikiPageGUI
1280 public function setLoginTargetPar($a_val)
1281 {
1282 $this->login_target_par = $a_val;
1283 }
1284
1285
1289 private function getLoginTargetPar()
1290 {
1291 return $this->login_target_par;
1292 }
1293
1294
1295 // REMOVAL CANDIDATE:
1296 // Usage locations:
1297 // - ilLPListOfObjectsGUI
1298 // - ilExport
1299 // - ilLMEditorGUI
1300 // - ilObjPortfolioGUI
1301 // - ilPortfolioHTMLExport
1302 // - ilForumExportGUI
1303 // - ilObjWikiGUI.php
1304 // - ilWikiHTMLExport
1305 // - ilScormSpecialPagesTableGUI
1306 //
1307 // Also this seems to be somehow similar to the stuff going on in printToStdout.
1308 // Maybe we could unify them.
1314 public function getSpecial(
1315 $part = "DEFAULT",
1316 $add_error_mess = false,
1317 $handle_referer = false,
1318 $add_ilias_footer = false,
1319 $add_standard_elements = false,
1320 $a_main_menu = true,
1321 $a_tabs = true
1322 ) {
1323 global $DIC;
1324
1325 if ($add_error_mess) {
1326 $this->fillMessage();
1327 }
1328
1329 if ($add_ilias_footer) {
1330 $this->fillFooter();
1331 }
1332
1333 // set standard parts (tabs and title icon)
1334 if ($add_standard_elements) {
1335 if ($this->blockExists("content") && $a_tabs) {
1336 // determine default screen id
1337 $this->getTabsHTML();
1338 }
1339
1340 // to get also the js files for the main menu
1341 $this->getMainMenu();
1342 $this->initHelp();
1343
1344 // these fill blocks in tpl.main.html
1345 $this->fillCssFiles();
1346 $this->fillInlineCss();
1347 $this->fillBodyClass();
1348
1349 // these fill just plain placeholder variables in tpl.main.html
1350 $this->setCurrentBlock("DEFAULT");
1351 $this->fillNewContentStyle();
1352 $this->fillContentLanguage();
1353 $this->fillWindowTitle();
1354
1355 // these fill blocks in tpl.adm_content.html
1356 $this->fillHeader();
1357 $this->fillSideIcons();
1358 $this->fillScreenReaderFocus();
1359 $this->fillLeftContent();
1360 $this->fillLeftNav();
1361 $this->fillRightContent();
1362 $this->fillAdminPanel();
1363 $this->fillToolbar();
1364 $this->fillPermanentLink();
1365
1366 $this->setCenterColumnClass();
1367
1368 // late loading of javascipr files, since operations above may add files
1369 $this->fillJavaScriptFiles();
1370 $this->fillOnLoadCode();
1371
1372 // these fill just plain placeholder variables in tpl.adm_content.html
1373 if ($this->blockExists("content")) {
1374 $this->setCurrentBlock("content");
1375 if ($a_tabs) {
1376 $this->fillTabs();
1377 }
1378 $this->fillMainContent();
1379 if ($a_main_menu) {
1380 $this->fillMainMenu();
1381 }
1382 $this->fillLightbox();
1383 $this->parseCurrentBlock();
1384 }
1385 }
1386
1387 if ($handle_referer) {
1388 $this->handleReferer();
1389 }
1390
1391 if ($part == "DEFAULT") {
1392 $html = $this->template->get();
1393 } else {
1394 $html = $this->template->get($part);
1395 }
1396
1397 // save language usages as late as possible
1399
1400 return $html;
1401 }
1402
1403
1409 public function printToStdout($part = "DEFAULT", $a_fill_tabs = true, $a_skip_main_menu = false)
1410 {
1411 global $DIC;
1412
1413 $http = $DIC->http();
1414 switch ($http->request()->getHeaderLine('Accept')) {
1415 case 'application/json':
1416 $string = json_encode([
1417 self::MESSAGE_TYPE_SUCCESS => is_null($this->message[self::MESSAGE_TYPE_FAILURE]),
1418 'message' => '',
1419 ]);
1421 $http->saveResponse($http->response()->withBody($stream));
1422 $http->sendResponse();
1423 exit;
1424 default:
1425 // include yahoo dom per default
1426 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
1428
1429 header('P3P: CP="CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa OUR BUS IND UNI COM NAV INT CNT STA PRE"');
1430 header("Content-type: text/html; charset=UTF-8");
1431
1432 $this->fillMessage();
1433
1434 // display ILIAS footer
1435 if ($part !== false) {
1436 $this->fillFooter();
1437 }
1438
1439 // set standard parts (tabs and title icon)
1440 $this->fillBodyClass();
1441 if ($a_fill_tabs) {
1442 if ($this->blockExists("content")) {
1443 // determine default screen id
1444 $this->getTabsHTML();
1445 }
1446
1447 // to get also the js files for the main menu
1448 if (!$a_skip_main_menu) {
1449 $this->getMainMenu();
1450 $this->initHelp();
1451 }
1452
1453 // these fill blocks in tpl.main.html
1454 $this->fillCssFiles();
1455 $this->fillInlineCss();
1456 //$this->fillJavaScriptFiles();
1457
1458 // these fill just plain placeholder variables in tpl.main.html
1459 $this->setCurrentBlock("DEFAULT");
1460 $this->fillNewContentStyle();
1461 $this->fillContentLanguage();
1462 $this->fillWindowTitle();
1463
1464 // these fill blocks in tpl.adm_content.html
1465 $this->fillHeader();
1466 $this->fillSideIcons();
1467 $this->fillScreenReaderFocus();
1468 $this->fillLeftContent();
1469 $this->fillLeftNav();
1470 $this->fillRightContent();
1471 $this->fillAdminPanel();
1472 $this->fillToolbar();
1473 $this->fillPermanentLink();
1474
1475 $this->setCenterColumnClass();
1476
1477 // late loading of javascipr files, since operations above may add files
1478 $this->fillJavaScriptFiles();
1479 $this->fillOnLoadCode();
1480
1481 // these fill just plain placeholder variables in tpl.adm_content.html
1482 if ($this->blockExists("content")) {
1483 $this->setCurrentBlock("content");
1484 $this->fillTabs();
1485 $this->fillMainContent();
1486 $this->fillMainMenu();
1487 $this->fillLightbox();
1488 $this->parseCurrentBlock();
1489 }
1490 }
1491
1492 if ($part == "DEFAULT" or is_bool($part)) {
1493 $html = $this->template->getUnmodified();
1494 } else {
1495 $html = $this->template->getUnmodified($part);
1496 }
1497
1498 // Modification of html is done inline here and can't be done
1499 // by ilTemplate, because the "phase" is template_show in this
1500 // case here.
1501 $ilPluginAdmin = $DIC["ilPluginAdmin"];
1502 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
1503 foreach ($pl_names as $pl) {
1504 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
1505 $gui_class = $ui_plugin->getUIClassInstance();
1506
1507 $resp = $gui_class->getHTML(
1508 "",
1509 "template_show",
1510 array("tpl_id" => $this->tplIdentifier, "tpl_obj" => $this, "html" => $html)
1511 );
1512
1513 if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
1514 $html = $gui_class->modifyHTML($html, $resp);
1515 }
1516 }
1517
1518 // save language usages as late as possible
1520
1521 print $html;
1522
1523 $this->handleReferer();
1524 break;
1525 }
1526 }
1527
1528
1533 private function handleReferer()
1534 {
1535 if (((substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "error.php")
1536 && (substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "adm_menu.php")
1537 && (substr(strrchr($_SERVER["PHP_SELF"], "/"), 1) != "chat.php"))
1538 ) {
1539 // referer is modified if query string contains cmd=gateway and $_POST is not empty.
1540 // this is a workaround to display formular again in case of error and if the referer points to another page
1541 $url_parts = @parse_url($_SERVER["REQUEST_URI"]);
1542 if (!$url_parts) {
1543 $protocol = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://';
1544 $host = $_SERVER['HTTP_HOST'];
1545 $path = $_SERVER['REQUEST_URI'];
1546 $url_parts = @parse_url($protocol . $host . $path);
1547 }
1548
1549 if (isset($url_parts["query"]) && preg_match("/cmd=gateway/", $url_parts["query"]) && (isset($_POST["cmd"]["create"]))) {
1550 foreach ($_POST as $key => $val) {
1551 if (is_array($val)) {
1552 $val = key($val);
1553 }
1554
1555 $str .= "&" . $key . "=" . $val;
1556 }
1557
1558 $_SESSION["referer"] = preg_replace("/cmd=gateway/", substr($str, 1), $_SERVER["REQUEST_URI"]);
1559 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1560 } else {
1561 if (isset($url_parts["query"]) && preg_match("/cmd=post/", $url_parts["query"]) && (isset($_POST["cmd"]["create"]))) {
1562 foreach ($_POST as $key => $val) {
1563 if (is_array($val)) {
1564 $val = key($val);
1565 }
1566
1567 $str .= "&" . $key . "=" . $val;
1568 }
1569
1570 $_SESSION["referer"] = preg_replace("/cmd=post/", substr($str, 1), $_SERVER["REQUEST_URI"]);
1571 if (isset($_GET['ref_id'])) {
1572 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1573 } else {
1574 $_SESSION['referer_ref_id'] = 0;
1575 }
1576 } else {
1577 $_SESSION["referer"] = $_SERVER["REQUEST_URI"];
1578 if (isset($_GET['ref_id'])) {
1579 $_SESSION['referer_ref_id'] = (int) $_GET['ref_id'];
1580 } else {
1581 $_SESSION['referer_ref_id'] = 0;
1582 }
1583 }
1584 }
1585
1586 unset($_SESSION["error_post_vars"]);
1587 }
1588 }
1589
1590
1594 private function fillScreenReaderFocus()
1595 {
1596 global $DIC;
1597
1598 $ilUser = $DIC->user();
1599
1600 if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization") && $this->blockExists("sr_focus")) {
1601 $this->touchBlock("sr_focus");
1602 }
1603 }
1604
1605
1609 private function fillSideIcons()
1610 {
1611 global $DIC;
1612
1613 $ilSetting = $DIC->settings();
1614
1615 $lng = $DIC->language();
1616
1617 // tree/flat icon
1618 if ($this->tree_flat_link != "") {
1619 if ($this->left_nav_content != "") {
1620 $this->touchBlock("tree_lns");
1621 }
1622
1623 $this->setCurrentBlock("tree_mode");
1624 $this->setVariable("LINK_MODE", $this->tree_flat_link);
1625 if ($ilSetting->get("tree_frame") == "right") {
1626 if ($this->tree_flat_mode == "tree") {
1627 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
1628 $this->setVariable("RIGHT", "Right");
1629 } else {
1630 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
1631 $this->setVariable("RIGHT", "Right");
1632 }
1633 } else {
1634 if ($this->tree_flat_mode == "tree") {
1635 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
1636 } else {
1637 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
1638 }
1639 }
1640 $this->setVariable("ALT_TREE", $lng->txt($this->tree_flat_mode . "view"));
1641 $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
1642 include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
1643 $this->setVariable(
1644 "TREE_ACC_KEY",
1645 ilAccessKeyGUI::getAttribute(($this->tree_flat_mode == "tree")
1648 );
1649 $this->parseCurrentBlock();
1650 }
1651
1652 $this->setCurrentBlock("tree_icons");
1653 $this->parseCurrentBlock();
1654 }
1655
1656
1663 public function setTreeFlatIcon($a_link, $a_mode)
1664 {
1665 $this->tree_flat_link = $a_link;
1666 $this->tree_flat_mode = $a_mode;
1667 }
1668
1669
1673 public function addLightbox($a_html, $a_id)
1674 {
1675 $this->lightbox[$a_id] = $a_html;
1676 }
1677
1678
1686 private function fillLightbox()
1687 {
1688 $html = "";
1689
1690 foreach ($this->lightbox as $lb) {
1691 $html .= $lb;
1692 }
1693 $this->setVariable("LIGHTBOX", $html);
1694 }
1695
1696 // ADMIN PANEL
1697 //
1698 // Only used in ilContainerGUI
1699 //
1700 // An "Admin Panel" is that toolbar thingy that could be found on top and bottom
1701 // of a repository listing when editing objects in a container gui.
1702
1704 protected $admin_panel_arrow = null;
1705 protected $admin_panel_bottom = null;
1706
1707
1714 public function addAdminPanelToolbar(ilToolbarGUI $toolb, $a_bottom_panel = true, $a_arrow = false)
1715 {
1716 $this->admin_panel_commands_toolbar = $toolb;
1717 $this->admin_panel_arrow = $a_arrow;
1718 $this->admin_panel_bottom = $a_bottom_panel;
1719 }
1720
1721
1727 private function fillAdminPanel()
1728 {
1729 global $DIC;
1730 $lng = $DIC->language();
1731
1732 if ($this->admin_panel_commands_toolbar === null) {
1733 return;
1734 }
1735
1737 assert($toolbar instanceof \ilToolbarGUI);
1738
1739 // Add arrow if desired.
1740 if ($this->admin_panel_arrow) {
1741 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
1742 }
1743
1744 $this->fillPageFormAction();
1745
1746 // Add top admin bar.
1747 $this->setCurrentBlock("adm_view_components");
1748 $this->setVariable("ADM_PANEL1", $toolb->getHTML());
1749 $this->parseCurrentBlock();
1750
1751 // Add bottom admin bar if user wants one.
1752 if ($this->admin_panel_bottom) {
1753 $this->setCurrentBlock("adm_view_components2");
1754
1755 // Replace previously set arrow image.
1756 if ($this->admin_panel_arrow) {
1757 $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
1758 }
1759
1760 $this->setVariable("ADM_PANEL2", $toolb->getHTML());
1761 $this->parseCurrentBlock();
1762 }
1763 }
1764
1765
1766 public function setPermanentLink($a_type, $a_id, $a_append = "", $a_target = "", $a_title = "")
1767 {
1768 $this->permanent_link = array(
1769 "type" => $a_type,
1770 "id" => $a_id,
1771 "append" => $a_append,
1772 "target" => $a_target,
1773 "title" => $a_title,
1774 );
1775 }
1776
1777
1781 private function fillPermanentLink()
1782 {
1783 if (is_array($this->permanent_link)) {
1784 include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
1785 $plinkgui = new ilPermanentLinkGUI(
1786 $this->permanent_link["type"],
1787 $this->permanent_link["id"],
1788 $this->permanent_link["append"],
1789 $this->permanent_link["target"]
1790 );
1791 if ($this->permanent_link["title"] != "") {
1792 $plinkgui->setTitle($this->permanent_link["title"]);
1793 }
1794 $this->setVariable("PRMLINK", $plinkgui->getHTML());
1795 }
1796 }
1797
1798
1802 public function resetHeaderBlock($a_reset_header_action = true)
1803 {
1804 $this->setTitle(null);
1805 $this->setTitleIcon(null);
1806 $this->setDescription(null);
1807 $this->setAlertProperties(array());
1808 $this->enableDragDropFileUpload(null);
1809
1810 // see setFullscreenHeader()
1811 if ($a_reset_header_action) {
1812 $this->setHeaderActionMenu(null);
1813 }
1814 }
1815
1816
1820 public function enableDragDropFileUpload($a_ref_id)
1821 {
1822 $this->enable_fileupload = $a_ref_id;
1823 }
1824
1825
1826 // TEMPLATING AND GLOBAL RENDERING
1827 //
1828 // Forwards to ilTemplate-member.
1829
1835 public function get($part = "DEFAULT")
1836 {
1837 return $this->template->get($part);
1838 }
1839
1840
1841 public function setVariable($variable, $value = '')
1842 {
1843 return $this->template->setVariable($variable, $value);
1844 }
1845
1846
1847 private function variableExists($a_variablename)
1848 {
1849 return $this->template->variableExists($a_variablename);
1850 }
1851
1852
1860 public function setCurrentBlock($part = "DEFAULT")
1861 {
1862 return $this->template->setCurrentBlock($part);
1863 }
1864
1865
1875 public function touchBlock($block)
1876 {
1877 return $this->template->touchBlock($block);
1878 }
1879
1880
1890 public function parseCurrentBlock($part = "DEFAULT")
1891 {
1892 return $this->template->parseCurrentBlock($part);
1893 }
1894
1895
1908 public function addBlockFile($var, $block, $tplname, $in_module = false)
1909 {
1910 return $this->template->addBlockFile($var, $block, $tplname, $in_module);
1911 }
1912
1913
1923 public function blockExists($a_blockname)
1924 {
1925 return $this->template->blockExists($a_blockname);
1926 }
1927}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$total
Definition: Utf8Test.php:87
if(! $in) print
$filename
Definition: buildRTE.php:89
$_GET["client_id"]
$_POST["username"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
static ofString($string)
Creates a new stream with an initial value.
Definition: Streams.php:25
const IL_COMP_SERVICE
static getAttribute($a_func_id)
Get accesskey HTML attribute.
special template class to simplify handling of ITX/PEAR
handleReferer()
TODO: this is nice, but shouldn't be done here (-> maybe at the end of ilias.php!?...
$inline_css
Stores CSS to be included directly.
addInlineCss($a_css, $media="screen")
Add a css file that should be included in the header.
setSubTabs($a_tabs_html)
sets subtabs in standard template
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
setAlertProperties(array $a_props)
Set alert properties.
printToStdout($part="DEFAULT", $a_fill_tabs=true, $a_skip_main_menu=false)
setRightContent($a_html)
Sets content of right column.
setTreeFlatIcon($a_link, $a_mode)
set tree/flat icon
addBlockFile($var, $block, $tplname, $in_module=false)
overwrites ITX::addBlockFile
setOnScreenMessage($a_type, $a_txt, $a_keep=false)
Set a message to be displayed to the user.
__construct( $file, $flag1, $flag2, $in_module=false, $vars="DEFAULT", $plugin=false, $a_use_cache=true)
constructor
setTabs($a_tabs_html)
sets tabs in standard template
setHeaderPageTitle($a_title)
Sets the title of the page (for browser window).
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
addCss($a_css_file, $media="screen")
Add a css file that should be included in the header.
setTitleIcon($a_icon_path, $a_icon_desc="")
set title icon
blockExists($a_blockname)
check if block exists in actual template
setDescription($a_descr)
Sets descripton below title in standard template.
setHeaderActionMenu($a_header)
Set header action menu.
setLeftContent($a_html)
Sets content of left column.
addAdminPanelToolbar(ilToolbarGUI $toolb, $a_bottom_panel=true, $a_arrow=false)
Add admin panel commands as toolbar.
enableDragDropFileUpload($a_ref_id)
Enables the file upload into this object by dropping a file.
resetHeaderBlock($a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt.
setLeftNavContent($a_content)
Sets content of left navigation column.
fillCssFiles($a_force=false)
Fill in the css file tags.
getLoginTargetPar()
Get target parameter for login.
fillSideIcons()
Fill side icons (upper icon, tree icon, webfolder icon)
hideFooter()
Make the template hide the footer.
setPermanentLink($a_type, $a_id, $a_append="", $a_target="", $a_title="")
setLoginTargetPar($a_val)
Set target parameter for login (public sector).
setContent($a_html)
Sets content for standard template.
fillScreenReaderFocus()
Accessibility focus for screen readers.
setTitle($a_title, $hidden=false)
Sets title in standard template.
fillContentLanguage()
Add current user language to meta tags.
addJavaScript($a_js_file, $a_add_version_parameter=true, $a_batch=2)
Add a javascript file that should be included in the header.
getSpecial( $part="DEFAULT", $add_error_mess=false, $handle_referer=false, $add_ilias_footer=false, $add_standard_elements=false, $a_main_menu=true, $a_tabs=true)
addOnLoadCode($a_code, $a_batch=2)
Add on load code.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getFrame($a_class, $a_type='')
Get content frame name.
static isActive()
static _saveUsages()
Store the collected language variable usages in the user session This should be called as late as pos...
static _checkTranslate()
Permission check for translations.
static _isPageTranslation()
Check if the current request is a page translation.
static _getTranslationLink()
Get the link to translate the current page.
Class for permanent links.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
special template class to simplify handling of ITX/PEAR
static init(ilGlobalTemplateInterface $a_tpl=null)
Init.
Class ilUIHookProcessor.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getNewContentStyleSheetLocation($mode="output")
get full style sheet file name (path inclusive) of current user
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...
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static secureUrl($url)
Prepare secure href attribute.
static validate($a_html, $a_mode)
static initDom(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Dom.
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....
$txt
Definition: error.php:13
global $DIC
Definition: goto.php:24
global $ilBench
Definition: ilias.php:21
$ilUser
Definition: imgupload.php:18
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
exit
Definition: login.php:29
$i
Definition: metadata.php:24
global $ilSetting
Definition: privfeed.php:17
$url
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$http
Definition: raiseError.php:7
$lng
global $ilDB