ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilExplorerBaseGUI.php
Go to the documentation of this file.
1<?php
2
28abstract class ilExplorerBaseGUI
29{
30 protected string $node_parameter_name;
31 protected ilLogger $log;
32 protected ilCtrl $ctrl;
34
35 protected static string $js_tree_path = "./node_modules/jstree/dist/jstree.js";
36 protected static string $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css";
37
38 protected static string $js_expl_path = "assets/js/Explorer2.js";
39 protected bool $skip_root_node = false;
40 protected bool $ajax = false;
41 protected array $custom_open_nodes = array();
42 protected array $selected_nodes = array();
43 protected string $select_postvar = "";
44 protected bool $offline_mode = false;
45 protected array $sec_highl_nodes = array();
46 protected bool $enable_dnd = false;
47 protected string $search_term = "";
48 protected array $open_nodes = [];
50 protected bool $select_multi = false;
51
55 protected $parent_obj;
56 protected int $child_limit = 0;
57 private bool $nodeOnclickEnabled;
58 protected string $parent_cmd = '';
59
60 protected string $requested_exp_cmd = "";
61 protected string $requested_exp_cont = "";
62 protected string $requested_searchterm = "";
63 protected string $requested_node_id = "";
64 protected string $id;
65
66 public function __construct(
67 string $a_expl_id,
68 $a_parent_obj,
69 string $a_parent_cmd,
70 string $a_node_parameter_name = "node_id"
71 ) {
73 global $DIC;
74 $this->log = $DIC["ilLog"];
75 $this->ctrl = $DIC->ctrl();
76 $this->tpl = $DIC["tpl"];
77 $this->id = $a_expl_id;
78 $this->parent_obj = $a_parent_obj;
79 $this->parent_cmd = $a_parent_cmd;
80 $this->node_parameter_name = $a_node_parameter_name;
81 // get open nodes
82 $this->store = new ilSessionIStorage("expl2");
83 $open_nodes = $this->store->get("on_" . $this->id);
84 $this->open_nodes = unserialize($open_nodes, ['allowed_classes' => false]) ?: [];
85 if (!is_array($this->open_nodes)) {
86 $this->open_nodes = array();
87 }
88
89 $params = $DIC->http()->request()->getQueryParams();
90 $this->requested_node_id = ($params[$a_node_parameter_name] ?? "");
91 $this->requested_exp_cmd = ($params["exp_cmd"] ?? "");
92 $this->requested_exp_cont = ($params["exp_cont"] ?? "");
93 $this->requested_searchterm = ($params["searchterm"] ?? "");
94
95 $this->nodeOnclickEnabled = true;
96 }
97
98 public function setChildLimit(int $a_val): void
99 {
100 $this->child_limit = $a_val;
101 }
102
103 public function getChildLimit(): int
104 {
105 return $this->child_limit;
106 }
107
108 public function setSearchTerm(string $a_val): void
109 {
110 $this->search_term = $a_val;
111 }
112
113 public function getSearchTerm(): string
114 {
115 return $this->search_term;
116 }
117
118 public function setMainTemplate(?ilGlobalTemplateInterface $a_main_tpl = null): void
119 {
120 $this->tpl = $a_main_tpl;
121 }
122
123 public static function getLocalExplorerJsPath(): string
124 {
125 return self::$js_expl_path;
126 }
127
128 public static function getLocalJsTreeJsPath(): string
129 {
130 return self::$js_tree_path;
131 }
132
133 public static function getLocalJsTreeCssPath(): string
134 {
136 }
137
138 public static function createHTMLExportDirs(string $a_target_dir): void
139 {
140 ilFileUtils::makeDirParents($a_target_dir . "/components/ILIAS/UIComponent/Explorer2/lib/jstree-v.pre1.0");
141 ilFileUtils::makeDirParents($a_target_dir . "/components/ILIAS/UIComponent/Explorer2/js");
142 }
143
144
145 //
146 // Abstract functions that need to be overwritten in derived classes
147 //
148
157 abstract public function getRootNode();
158
164 abstract public function getChildsOfNode($a_parent_node_id): array;
165
171 abstract public function getNodeContent($a_node): string;
172
178 abstract public function getNodeId($a_node);
179
180
181 //
182 // Functions with standard implementations that may be overwritten
183 //
184
190 public function getNodeHref($a_node): string
191 {
192 return "#";
193 }
194
202 public function nodeHasVisibleChilds($a_node): bool
203 {
204 $childs = $this->getChildsOfNode($this->getNodeId($a_node));
205
206 foreach ($childs as $child) {
207 if ($this->isNodeVisible($child)) {
208 return true;
209 }
210 }
211 return false;
212 }
213
220 public function sortChilds(array $a_childs, $a_parent_node_id): array
221 {
222 return $a_childs;
223 }
224
230 public function getNodeIcon($a_node): string
231 {
232 return "";
233 }
234
240 public function getNodeIconAlt($a_node): string
241 {
242 return "";
243 }
244
250 public function getNodeTarget($a_node): string
251 {
252 return "";
253 }
254
260 public function getNodeOnClick($a_node): string
261 {
262 if ($this->select_postvar !== "") {
263 return $this->getSelectOnClick($a_node);
264 }
265 return "";
266 }
267
273 public function isNodeVisible($a_node): bool
274 {
275 return true;
276 }
277
283 public function isNodeHighlighted($a_node): bool
284 {
285 return false;
286 }
287
293 public function isNodeClickable($a_node): bool
294 {
295 return true;
296 }
297
303 protected function isNodeSelectable($a_node): bool
304 {
305 return true;
306 }
307
308
309 //
310 // Basic configuration / setter/getter
311 //
312
317 public function getId(): string
318 {
319 return $this->id;
320 }
321
322 public function setSkipRootNode(bool $a_val): void
323 {
324 $this->skip_root_node = $a_val;
325 }
326
327 public function getSkipRootNode(): bool
328 {
330 }
331
332 public function setAjax(bool $a_val): void
333 {
334 $this->ajax = $a_val;
335 }
336
337 public function getAjax(): bool
338 {
339 return $this->ajax;
340 }
341
345 public function setSecondaryHighlightedNodes(array $a_val): void
346 {
347 $this->sec_highl_nodes = $a_val;
348 }
349
353 public function getSecondaryHighlightedNodes(): array
354 {
356 }
357
362 public function setNodeOpen($a_id): void
363 {
364 if (!in_array($a_id, $this->custom_open_nodes)) {
365 $this->custom_open_nodes[] = $a_id;
366 }
367 }
368
373 final protected function getNodeToggleOnClick($a_node): string
374 {
375 return "$('#" . $this->getContainerId() . "').jstree('toggle_node' , '#" .
376 $this->getDomNodeIdForNodeId($this->getNodeId($a_node)) . "'); return false;";
377 }
378
383 final protected function getSelectOnClick($a_node): string
384 {
385 $dn_id = $this->getDomNodeIdForNodeId($this->getNodeId($a_node));
386 $oc = "il.Explorer2.selectOnClick(event, '" . $dn_id . "'); return false;";
387 return $oc;
388 }
389
395 public function setSelectMode(string $a_postvar, bool $a_multi = false): void
396 {
397 $this->select_postvar = $a_postvar;
398 $this->select_multi = $a_multi;
399 }
400
405 public function setNodeSelected($a_id): void
406 {
407 if (!in_array($a_id, $this->selected_nodes)) {
408 $this->selected_nodes[] = $a_id;
409 }
410 }
411
412 public function setOfflineMode(bool $a_val): void
413 {
414 $this->offline_mode = $a_val;
415 }
416
417 public function getOfflineMode(): bool
418 {
419 return $this->offline_mode;
420 }
421
422 //
423 // Standard functions that usually are not overwritten / internal use
424 //
425
429 public function handleCommand(): bool
430 {
431 if ($this->requested_exp_cmd !== "" &&
432 $this->requested_exp_cont === $this->getContainerId()) {
434 if (in_array($cmd, array("openNode", "closeNode", "getNodeAsync"))) {
435 $this->$cmd();
436 }
437
438 return true;
439 }
440 return false;
441 }
442
443 public function getContainerId(): string
444 {
445 return "il_expl2_jstree_cont_" . $this->getId();
446 }
447
451 public function openNode(): void
452 {
453 $id = $this->getNodeIdForDomNodeId($this->requested_node_id);
454 if (!in_array($id, $this->open_nodes)) {
455 $this->open_nodes[] = $id;
456 }
457 $this->store->set("on_" . $this->id, serialize($this->open_nodes));
458 exit;
459 }
460
464 public function closeNode(): void
465 {
466 $id = $this->getNodeIdForDomNodeId($this->requested_node_id);
467 if (in_array($id, $this->open_nodes)) {
468 $k = array_search($id, $this->open_nodes);
469 unset($this->open_nodes[$k]);
470 }
471 $this->store->set("on_" . $this->id, serialize($this->open_nodes));
472 exit;
473 }
474
478 public function getNodeAsync(): string
479 {
480 $this->beforeRendering();
481
482 $etpl = new ilTemplate("tpl.explorer2.html", true, true, "components/ILIAS/UIComponent/Explorer2");
483
484 $root = $this->getNodeId($this->getRootNode());
485 if (!in_array($root, $this->open_nodes)) {
486 $this->open_nodes[] = $root;
487 }
488 $this->setSearchTerm(ilUtil::stripSlashes($this->requested_searchterm));
489 if ($this->requested_node_id !== "") {
490 $id = $this->getNodeIdForDomNodeId($this->requested_node_id);
491 $this->renderChilds($id, $etpl);
492 } else {
493 $this->getNodeId($this->getRootNode());
494 $this->renderNode($this->getRootNode(), $etpl);
495 }
496 echo $etpl->get("tag");
497 exit;
498 }
499
503 public function beforeRendering(): void
504 {
505 }
506
511 protected function isNodeOpen($node_id): bool
512 {
513 return ($this->getNodeId($this->getRootNode()) == $node_id
514 || in_array($node_id, $this->open_nodes)
515 || in_array($node_id, $this->custom_open_nodes));
516 }
517
518
522 public function getOnLoadCode(): string
523 {
524 $ilCtrl = $this->ctrl;
525
526 $container_id = $this->getContainerId();
527 $container_outer_id = "il_expl2_jstree_cont_out_" . $this->getId();
528
529 // collect open nodes
530 $open_nodes = array($this->getDomNodeIdForNodeId($this->getNodeId($this->getRootNode())));
531 foreach ($this->open_nodes as $nid) {
532 $open_nodes[] = $this->getDomNodeIdForNodeId($nid);
533 }
534 foreach ($this->custom_open_nodes as $nid) {
535 $dnode = $this->getDomNodeIdForNodeId($nid);
536 if (!in_array($dnode, $open_nodes)) {
537 $open_nodes[] = $dnode;
538 }
539 }
540 // ilias config options
541 $url = "";
542 if (!$this->getOfflineMode()) {
543 if (is_object($this->parent_obj)) {
544 $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd, "", true);
545 } else {
546 if (!is_null($this->parent_obj)) {
547 $url = $ilCtrl->getLinkTargetByClass($this->parent_obj, $this->parent_cmd, "", true);
548 }
549 }
550 }
551
552 // secondary highlighted nodes
553 $shn = array();
554 foreach ($this->sec_highl_nodes as $sh) {
555 $shn[] = $this->getDomNodeIdForNodeId($sh);
556 }
557 $config = array(
558 "container_id" => $container_id,
559 "container_outer_id" => $container_outer_id,
560 "url" => $url,
561 "second_hnodes" => $shn,
562 "ajax" => $this->getAjax(),
563 "node_par_name" => $this->node_parameter_name
564 );
565
566
567 // jstree config options
568 $js_tree_config = array(
569 "core" => array(
570 "animation" => 0,
571 "initially_open" => $open_nodes,
572 "open_parents" => false,
573 "strings" => array("loading" => "Loading ...", "new_node" => "New node"),
574 "themes" => array("dots" => false, "icons" => false, "theme" => "")
575 ),
576 "plugins" => $this->getJSTreePlugins(),
577 "html_data" => array()
578 );
579 return (
580 'il.Explorer2.init(' .
581 json_encode($config, JSON_THROW_ON_ERROR) . ', ' .
582 json_encode($js_tree_config, JSON_THROW_ON_ERROR) . ');'
583 );
584 }
585
586 protected function getJSTreePlugins(): array
587 {
588 $plugins = array("html_data", "themes", "json_data");
589 if ($this->isEnableDnd()) {
590 $plugins[] = "dnd";
591 }
592 return $plugins;
593 }
594
595
596 // Init JS/CSS
597 public static function init(?ilGlobalTemplateInterface $a_main_tpl = null): void
598 {
599 global $DIC;
600
601 $tpl = $a_main_tpl ?? $DIC["tpl"];
602
604
605 $tpl->addJavaScript(self::getLocalExplorerJsPath());
606 $tpl->addJavaScript(self::getLocalJsTreeJsPath());
607 $tpl->addCss(self::getLocalJsTreeCssPath());
608 }
609
610
611 public function getHTML(): string
612 {
614 $ilCtrl = $this->ctrl;
615
616 $root = $this->getNodeId($this->getRootNode());
617 if (!in_array($root, $this->open_nodes)) {
618 $this->open_nodes[] = $root;
619 }
620
621 $this->beforeRendering();
622
623 self::init($tpl);
624 $container_id = $this->getContainerId();
625 $container_outer_id = "il_expl2_jstree_cont_out_" . $this->getId();
626
627 if (!$ilCtrl->isAsynch()) {
629 }
630
631 $etpl = new ilTemplate("tpl.explorer2.html", true, true, "components/ILIAS/UIComponent/Explorer2");
632
633 if (!$this->ajax) {
634 // render childs
635 $root_node = $this->getRootNode();
636
637 if (!$this->getSkipRootNode() &&
638 $this->isNodeVisible($this->getRootNode())) {
639 $this->listStart($etpl);
640 $this->renderNode($this->getRootNode(), $etpl);
641 $this->listEnd($etpl);
642 } else {
643 $childs = $this->getChildsOfNode($this->getNodeId($root_node));
644 $childs = $this->sortChilds($childs, $this->getNodeId($root_node));
645 $any = false;
646 foreach ($childs as $child_node) {
647 if ($this->isNodeVisible($child_node)) {
648 if (!$any) {
649 $this->listStart($etpl);
650 $any = true;
651 }
652 $this->renderNode($child_node, $etpl);
653 }
654 }
655 if ($any) {
656 $this->listEnd($etpl);
657 }
658 }
659 }
660
661 $etpl->setVariable("CONTAINER_ID", $container_id);
662 $etpl->setVariable("CONTAINER_OUTER_ID", $container_outer_id);
663
664 $add = "";
665 if ($ilCtrl->isAsynch()) {
666 $add = "<script>" . $this->getOnLoadCode() . "</script>";
667 }
668
669 $content = $etpl->get();
670 //echo $content.$add; exit;
671 return $content . $add;
672 }
673
678 public function renderNode($a_node, ilTemplate $tpl): void
679 {
680 $skip = ($this->getSkipRootNode()
681 && $this->getNodeId($this->getRootNode()) == $this->getNodeId($a_node));
682 if (!$skip) {
683 $this->listItemStart($tpl, $a_node);
684
685 // select mode?
686 if ($this->select_postvar !== "" && $this->isNodeSelectable($a_node)) {
687 if ($this->select_multi) {
688 $tpl->setCurrentBlock("cb");
689 if (in_array($this->getNodeId($a_node), $this->selected_nodes)) {
690 $tpl->setVariable("CHECKED", 'checked="checked"');
691 }
692 $tpl->setVariable("CB_VAL", $this->getNodeId($a_node));
693 $tpl->setVariable("CB_NAME", $this->select_postvar . "[]");
694 } else {
695 $tpl->setCurrentBlock("rd");
696 if (in_array($this->getNodeId($a_node), $this->selected_nodes)) {
697 $tpl->setVariable("SELECTED", 'checked="checked"');
698 }
699 $tpl->setVariable("RD_VAL", $this->getNodeId($a_node));
700 $tpl->setVariable("RD_NAME", $this->select_postvar);
701 }
703 }
704
705
706 if ($this->isNodeHighlighted($a_node)) {
707 $tpl->touchBlock("hl");
708 }
709 $tpl->setCurrentBlock("content");
710 if ($this->getNodeIcon($a_node) !== "") {
711 $tpl->setVariable("ICON", ilUtil::img($this->getNodeIcon($a_node), $this->getNodeIconAlt($a_node)) . " ");
712 }
713 $tpl->setVariable("CONTENT", $this->getNodeContent($a_node));
714 if ($this->isNodeClickable($a_node)) {
715 $tpl->setVariable("HREF", $this->getNodeHref($a_node));
716 }
717 $target = $this->getNodeTarget($a_node);
718 if ($target !== "") {
719 $targetRelatedParams = array(
720 'target="' . $target . '"'
721 );
722
723 if ('_blank' === $target) {
724 $targetRelatedParams[] = 'rel="noopener"';
725 }
726
727 $tpl->setVariable('TARGET', implode(' ', $targetRelatedParams));
728 }
729 if (!$this->isNodeOnclickEnabled() || !$this->isNodeClickable($a_node)) {
730 $tpl->setVariable("ONCLICK", 'onclick="return false;"');
731 $tpl->setVariable("A_CLASS", 'class="disabled"');
732 } else {
733 $onclick = $this->getNodeOnClick($a_node);
734 if ($onclick !== "") {
735 $tpl->setVariable("ONCLICK", 'onclick="' . $onclick . '"');
736 }
737 }
739
740 $tpl->touchBlock("tag");
741 }
742
743 if (!$this->getAjax() || in_array($this->getNodeId($a_node), $this->open_nodes)
744 || in_array($this->getNodeId($a_node), $this->custom_open_nodes)) {
745 $this->renderChilds($this->getNodeId($a_node), $tpl);
746 }
747
748 if (!$skip) {
749 $this->listItemEnd($tpl);
750 }
751 }
752
757 final public function renderChilds($a_node_id, ilTemplate $tpl): void
758 {
759 $childs = $this->getChildsOfNode($a_node_id);
760 $childs = $this->sortChilds($childs, $a_node_id);
761
762 if (count($childs) > 0 || ($this->getSearchTerm() !== "" && $this->isNodeRequested($a_node_id))) {
763 // collect visible childs
764
765 $visible_childs = [];
766 $cnt_child = 0;
767
768 foreach ($childs as $child) {
769 $cnt_child++;
770 if ($this->getChildLimit() > 0 && $this->getChildLimit() < $cnt_child) {
771 continue;
772 }
773
774 if ($this->isNodeVisible($child)) {
775 $visible_childs[] = $child;
776 }
777 }
778
779 // search field, if too many childs
780 $any = false;
781 if (($this->getChildLimit() > 0 && $this->getChildLimit() < $cnt_child) || ($this->getSearchTerm() !== "" && $this->isNodeRequested($a_node_id))) {
782 $this->listStart($tpl);
783 $any = true;
784
785 $tpl->setCurrentBlock("list_search");
786 $tpl->setVariable("SEARCH_CONTAINER_ID", $a_node_id);
787 if ($this->isNodeRequested($a_node_id)) {
788 $tpl->setVariable("SEARCH_VAL", $this->getSearchTerm());
789 }
790 $tpl->parseCurrentBlock();
791 $tpl->touchBlock("tag");
792 }
793
794 // render visible childs
795 foreach ($visible_childs as $child) {
796 // check child limit
797 $cnt_child++;
798
799 if ($this->isNodeVisible($child)) {
800 if (!$any) {
801 $this->listStart($tpl);
802 $any = true;
803 }
804 $this->renderNode($child, $tpl);
805 }
806 }
807 if ($any) {
808 $this->listEnd($tpl);
809 }
810 }
811 }
812
813 protected function isNodeRequested(string $a_node_id): bool
814 {
815 return ($this->requested_node_id === $this->getDomNodeIdForNodeId($a_node_id) ||
816 ($this->requested_node_id === "" && $a_node_id == $this->getNodeId($this->getRootNode())));
817 }
818
823 public function getDomNodeIdForNodeId($a_node_id): string
824 {
825 return "exp_node_" . $this->getId() . "_" . $a_node_id;
826 }
827
831 public function getNodeIdForDomNodeId(string $a_dom_node_id): string
832 {
833 $i = strlen("exp_node_" . $this->getId() . "_");
834 return substr($a_dom_node_id, $i);
835 }
836
841 public function listItemStart(ilTemplate $tpl, $a_node): void
842 {
843 $tpl->setCurrentBlock("list_item_start");
844 if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node) && !$this->isNodeOpen($this->getNodeId($a_node))) {
845 $tpl->touchBlock("li_closed");
846 }
847 if ($this->isNodeOpen($this->getNodeId($a_node))) {
848 $tpl->touchBlock("li_opened");
849 }
850
852 "DOM_NODE_ID",
853 $this->getDomNodeIdForNodeId($this->getNodeId($a_node))
854 );
856 $tpl->touchBlock("tag");
857 }
858
859 public function listItemEnd(ilTemplate $tpl): void
860 {
861 $tpl->touchBlock("list_item_end");
862 $tpl->touchBlock("tag");
863 }
864
865 public function listStart(ilTemplate $tpl): void
866 {
867 $tpl->touchBlock("list_start");
868 $tpl->touchBlock("tag");
869 }
870
871 public function listEnd(ilTemplate $tpl): void
872 {
873 $tpl->touchBlock("list_end");
874 $tpl->touchBlock("tag");
875 }
876
877 public function isNodeOnclickEnabled(): bool
878 {
880 }
881
882 public function setNodeOnclickEnabled(bool $nodeOnclickEnabled): void
883 {
884 $this->nodeOnclickEnabled = $nodeOnclickEnabled;
885 }
886
887 public function isEnableDnd(): bool
888 {
889 return $this->enable_dnd;
890 }
891
892 // Enable Drag & Drop functionality
893 public function setEnableDnd(bool $enable_dnd): void
894 {
895 $this->enable_dnd = $enable_dnd;
896 }
897}
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setNodeSelected($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour)
sortChilds(array $a_childs, $a_parent_node_id)
Sort childs.
getNodeIcon($a_node)
Get node icon path.
getNodeContent($a_node)
Get content of a node.
getId()
Get id of explorer element.
isNodeSelectable($a_node)
Is node selectable?
getNodeIconAlt($a_node)
Get node icon alt attribute.
getNodeAsync()
Get node asynchronously.
setSelectMode(string $a_postvar, bool $a_multi=false)
Set select mode (to deactivate, pass an empty string as postvar)
getNodeOnClick($a_node)
Get node onclick attribute.
renderNode($a_node, ilTemplate $tpl)
Render node.
beforeRendering()
Before rendering.
getOnLoadCode()
Get on load code.
getNodeIdForDomNodeId(string $a_dom_node_id)
Get node id for dom node id.
getChildsOfNode($a_parent_node_id)
Get children of node.
isNodeClickable($a_node)
Is node clickable?
getDomNodeIdForNodeId($a_node_id)
Get DOM node id for node id.
getNodeTarget($a_node)
Get node target (frame) attribute.
listItemStart(ilTemplate $tpl, $a_node)
List item start.
setSecondaryHighlightedNodes(array $a_val)
Set secondary (background) highlighted nodes.
handleCommand()
Handle explorer internal command.
nodeHasVisibleChilds($a_node)
Node has children Please note that this standard method may not be optimal depending on what a derive...
getSecondaryHighlightedNodes()
Get secondary (background) highlighted nodes.
getNodeId($a_node)
Get id of a node.
getNodeToggleOnClick($a_node)
Get onclick attribute for node toggling.
ilSessionIStorage $store
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour)
getNodeHref($a_node)
Get href for node.
isNodeHighlighted($a_node)
Is node highlighted?
setNodeOnclickEnabled(bool $nodeOnclickEnabled)
static createHTMLExportDirs(string $a_target_dir)
isNodeOpen($node_id)
Get all open nodes.
isNodeRequested(string $a_node_id)
renderChilds($a_node_id, ilTemplate $tpl)
Render childs.
getRootNode()
Get root node.
isNodeVisible($a_node)
Is node visible?
ilGlobalTemplateInterface $tpl
listItemEnd(ilTemplate $tpl)
setEnableDnd(bool $enable_dnd)
getSelectOnClick($a_node)
Get onclick attribute for selecting radio/checkbox.
setMainTemplate(?ilGlobalTemplateInterface $a_main_tpl=null)
static init(?ilGlobalTemplateInterface $a_main_tpl=null)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
Component logger with individual log levels by component id.
Session based immediate storage.
special template class to simplify handling of ITX/PEAR
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
exit
setVariable(string $variable, $value='')
Sets the given variable to the given value.
touchBlock(string $block)
overwrites ITX::touchBlock.
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.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68