ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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;
97 }
98
99 public function setChildLimit(int $a_val): void
100 {
101 $this->child_limit = $a_val;
102 }
103
104 public function getChildLimit(): int
105 {
106 return $this->child_limit;
107 }
108
109 public function setSearchTerm(string $a_val): void
110 {
111 $this->search_term = $a_val;
112 }
113
114 public function getSearchTerm(): string
115 {
116 return $this->search_term;
117 }
118
119 public function setMainTemplate(?ilGlobalTemplateInterface $a_main_tpl = null): void
120 {
121 $this->tpl = $a_main_tpl;
122 }
123
124 public static function getLocalExplorerJsPath(): string
125 {
126 return self::$js_expl_path;
127 }
128
129 public static function getLocalJsTreeJsPath(): string
130 {
131 return self::$js_tree_path;
132 }
133
134 public static function getLocalJsTreeCssPath(): string
135 {
137 }
138
139 public static function createHTMLExportDirs(string $a_target_dir): void
140 {
141 ilFileUtils::makeDirParents($a_target_dir . "/components/ILIAS/UIComponent/Explorer2/lib/jstree-v.pre1.0");
142 ilFileUtils::makeDirParents($a_target_dir . "/components/ILIAS/UIComponent/Explorer2/js");
143 }
144
145
146 //
147 // Abstract functions that need to be overwritten in derived classes
148 //
149
158 abstract public function getRootNode();
159
165 abstract public function getChildsOfNode($a_parent_node_id): array;
166
172 abstract public function getNodeContent($a_node): string;
173
179 abstract public function getNodeId($a_node);
180
181
182 //
183 // Functions with standard implementations that may be overwritten
184 //
185
191 public function getNodeHref($a_node): string
192 {
193 return "#";
194 }
195
203 public function nodeHasVisibleChilds($a_node): bool
204 {
205 $childs = $this->getChildsOfNode($this->getNodeId($a_node));
206
207 foreach ($childs as $child) {
208 if ($this->isNodeVisible($child)) {
209 return true;
210 }
211 }
212 return false;
213 }
214
221 public function sortChilds(array $a_childs, $a_parent_node_id): array
222 {
223 return $a_childs;
224 }
225
231 public function getNodeIcon($a_node): string
232 {
233 return "";
234 }
235
241 public function getNodeIconAlt($a_node): string
242 {
243 return "";
244 }
245
251 public function getNodeTarget($a_node): string
252 {
253 return "";
254 }
255
261 public function getNodeOnClick($a_node): string
262 {
263 if ($this->select_postvar !== "") {
264 return $this->getSelectOnClick($a_node);
265 }
266 return "";
267 }
268
274 public function isNodeVisible($a_node): bool
275 {
276 return true;
277 }
278
284 public function isNodeHighlighted($a_node): bool
285 {
286 return false;
287 }
288
294 public function isNodeClickable($a_node): bool
295 {
296 return true;
297 }
298
304 protected function isNodeSelectable($a_node): bool
305 {
306 return true;
307 }
308
309
310 //
311 // Basic configuration / setter/getter
312 //
313
318 public function getId(): string
319 {
320 return $this->id;
321 }
322
323 public function setSkipRootNode(bool $a_val): void
324 {
325 $this->skip_root_node = $a_val;
326 }
327
328 public function getSkipRootNode(): bool
329 {
331 }
332
333 public function setAjax(bool $a_val): void
334 {
335 $this->ajax = $a_val;
336 }
337
338 public function getAjax(): bool
339 {
340 return $this->ajax;
341 }
342
346 public function setSecondaryHighlightedNodes(array $a_val): void
347 {
348 $this->sec_highl_nodes = $a_val;
349 }
350
354 public function getSecondaryHighlightedNodes(): array
355 {
357 }
358
363 public function setNodeOpen($a_id): void
364 {
365 if (!in_array($a_id, $this->custom_open_nodes)) {
366 $this->custom_open_nodes[] = $a_id;
367 }
368 }
369
374 final protected function getNodeToggleOnClick($a_node): string
375 {
376 return "$('#" . $this->getContainerId() . "').jstree('toggle_node' , '#" .
377 $this->getDomNodeIdForNodeId($this->getNodeId($a_node)) . "'); return false;";
378 }
379
384 final protected function getSelectOnClick($a_node): string
385 {
386 $dn_id = $this->getDomNodeIdForNodeId($this->getNodeId($a_node));
387 $oc = "il.Explorer2.selectOnClick(event, '" . $dn_id . "'); return false;";
388 return $oc;
389 }
390
396 public function setSelectMode(string $a_postvar, bool $a_multi = false): void
397 {
398 $this->select_postvar = $a_postvar;
399 $this->select_multi = $a_multi;
400 }
401
406 public function setNodeSelected($a_id): void
407 {
408 if (!in_array($a_id, $this->selected_nodes)) {
409 $this->selected_nodes[] = $a_id;
410 }
411 }
412
413 public function setOfflineMode(bool $a_val): void
414 {
415 $this->offline_mode = $a_val;
416 }
417
418 public function getOfflineMode(): bool
419 {
420 return $this->offline_mode;
421 }
422
423 //
424 // Standard functions that usually are not overwritten / internal use
425 //
426
430 public function handleCommand(): bool
431 {
432 if ($this->requested_exp_cmd !== "" &&
433 $this->requested_exp_cont === $this->getContainerId()) {
435 if (in_array($cmd, array("openNode", "closeNode", "getNodeAsync"))) {
436 $this->$cmd();
437 }
438
439 return true;
440 }
441 return false;
442 }
443
444 public function getContainerId(): string
445 {
446 return "il_expl2_jstree_cont_" . $this->getId();
447 }
448
452 public function openNode(): void
453 {
454 $id = $this->getNodeIdForDomNodeId($this->requested_node_id);
455 if (!in_array($id, $this->open_nodes)) {
456 $this->open_nodes[] = $id;
457 }
458 $this->store->set("on_" . $this->id, serialize($this->open_nodes));
459 exit;
460 }
461
465 public function closeNode(): void
466 {
467 $id = $this->getNodeIdForDomNodeId($this->requested_node_id);
468 if (in_array($id, $this->open_nodes)) {
469 $k = array_search($id, $this->open_nodes);
470 unset($this->open_nodes[$k]);
471 }
472 $this->store->set("on_" . $this->id, serialize($this->open_nodes));
473 exit;
474 }
475
479 public function getNodeAsync(): string
480 {
481 $this->beforeRendering();
482
483 $etpl = new ilTemplate("tpl.explorer2.html", true, true, "components/ILIAS/UIComponent/Explorer2");
484
485 $root = $this->getNodeId($this->getRootNode());
486 if (!in_array($root, $this->open_nodes)) {
487 $this->open_nodes[] = $root;
488 }
489 $this->setSearchTerm(ilUtil::stripSlashes($this->requested_searchterm));
490 if ($this->requested_node_id !== "") {
491 $id = $this->getNodeIdForDomNodeId($this->requested_node_id);
492 $this->renderChilds($id, $etpl);
493 } else {
494 $this->getNodeId($this->getRootNode());
495 $this->renderNode($this->getRootNode(), $etpl);
496 }
497 echo $etpl->get("tag");
498 exit;
499 }
500
504 public function beforeRendering(): void
505 {
506 }
507
512 protected function isNodeOpen($node_id): bool
513 {
514 return ($this->getNodeId($this->getRootNode()) == $node_id
515 || in_array($node_id, $this->open_nodes)
516 || in_array($node_id, $this->custom_open_nodes));
517 }
518
519
523 public function getOnLoadCode(): string
524 {
525 $ilCtrl = $this->ctrl;
526
527 $container_id = $this->getContainerId();
528 $container_outer_id = "il_expl2_jstree_cont_out_" . $this->getId();
529
530 // collect open nodes
531 $open_nodes = array($this->getDomNodeIdForNodeId($this->getNodeId($this->getRootNode())));
532 foreach ($this->open_nodes as $nid) {
533 $open_nodes[] = $this->getDomNodeIdForNodeId($nid);
534 }
535 foreach ($this->custom_open_nodes as $nid) {
536 $dnode = $this->getDomNodeIdForNodeId($nid);
537 if (!in_array($dnode, $open_nodes)) {
538 $open_nodes[] = $dnode;
539 }
540 }
541 // ilias config options
542 $url = "";
543 if (!$this->getOfflineMode()) {
544 if (is_object($this->parent_obj)) {
545 $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd, "", true);
546 } else {
547 if (!is_null($this->parent_obj)) {
548 $url = $ilCtrl->getLinkTargetByClass($this->parent_obj, $this->parent_cmd, "", true);
549 }
550 }
551 }
552
553 // secondary highlighted nodes
554 $shn = array();
555 foreach ($this->sec_highl_nodes as $sh) {
556 $shn[] = $this->getDomNodeIdForNodeId($sh);
557 }
558 $config = array(
559 "container_id" => $container_id,
560 "container_outer_id" => $container_outer_id,
561 "url" => $url,
562 "second_hnodes" => $shn,
563 "ajax" => $this->getAjax(),
564 "node_par_name" => $this->node_parameter_name
565 );
566
567
568 // jstree config options
569 $js_tree_config = array(
570 "core" => array(
571 "animation" => 0,
572 "initially_open" => $open_nodes,
573 "open_parents" => false,
574 "strings" => array("loading" => "Loading ...", "new_node" => "New node"),
575 "themes" => array("dots" => false, "icons" => false, "theme" => "")
576 ),
577 "plugins" => $this->getJSTreePlugins(),
578 "html_data" => array()
579 );
580 return (
581 'il.Explorer2.init(' .
582 json_encode($config, JSON_THROW_ON_ERROR) . ', ' .
583 json_encode($js_tree_config, JSON_THROW_ON_ERROR) . ');'
584 );
585 }
586
587 protected function getJSTreePlugins(): array
588 {
589 $plugins = array("html_data", "themes", "json_data");
590 if ($this->isEnableDnd()) {
591 $plugins[] = "dnd";
592 }
593 return $plugins;
594 }
595
596
597 // Init JS/CSS
598 public static function init(?ilGlobalTemplateInterface $a_main_tpl = null): void
599 {
600 global $DIC;
601
602 $tpl = $a_main_tpl ?? $DIC["tpl"];
603
606
607 $tpl->addJavaScript(self::getLocalExplorerJsPath());
608 $tpl->addJavaScript(self::getLocalJsTreeJsPath());
609 $tpl->addCss(self::getLocalJsTreeCssPath());
610 }
611
612
613 public function getHTML(): string
614 {
616 $ilCtrl = $this->ctrl;
617
618 $root = $this->getNodeId($this->getRootNode());
619 if (!in_array($root, $this->open_nodes)) {
620 $this->open_nodes[] = $root;
621 }
622
623 $this->beforeRendering();
624
625 self::init($tpl);
626 $container_id = $this->getContainerId();
627 $container_outer_id = "il_expl2_jstree_cont_out_" . $this->getId();
628
629 if (!$ilCtrl->isAsynch()) {
631 }
632
633 $etpl = new ilTemplate("tpl.explorer2.html", true, true, "components/ILIAS/UIComponent/Explorer2");
634
635 if (!$this->ajax) {
636 // render childs
637 $root_node = $this->getRootNode();
638
639 if (!$this->getSkipRootNode() &&
640 $this->isNodeVisible($this->getRootNode())) {
641 $this->listStart($etpl);
642 $this->renderNode($this->getRootNode(), $etpl);
643 $this->listEnd($etpl);
644 } else {
645 $childs = $this->getChildsOfNode($this->getNodeId($root_node));
646 $childs = $this->sortChilds($childs, $this->getNodeId($root_node));
647 $any = false;
648 foreach ($childs as $child_node) {
649 if ($this->isNodeVisible($child_node)) {
650 if (!$any) {
651 $this->listStart($etpl);
652 $any = true;
653 }
654 $this->renderNode($child_node, $etpl);
655 }
656 }
657 if ($any) {
658 $this->listEnd($etpl);
659 }
660 }
661 }
662
663 $etpl->setVariable("CONTAINER_ID", $container_id);
664 $etpl->setVariable("CONTAINER_OUTER_ID", $container_outer_id);
665
666 $add = "";
667 if ($ilCtrl->isAsynch()) {
668 $add = "<script>" . $this->getOnLoadCode() . "</script>";
669 }
670
671 $content = $etpl->get();
672 //echo $content.$add; exit;
673 return $content . $add;
674 }
675
680 public function renderNode($a_node, ilTemplate $tpl): void
681 {
682 $skip = ($this->getSkipRootNode()
683 && $this->getNodeId($this->getRootNode()) == $this->getNodeId($a_node));
684 if (!$skip) {
685 $this->listItemStart($tpl, $a_node);
686
687 // select mode?
688 if ($this->select_postvar !== "" && $this->isNodeSelectable($a_node)) {
689 if ($this->select_multi) {
690 $tpl->setCurrentBlock("cb");
691 if (in_array($this->getNodeId($a_node), $this->selected_nodes)) {
692 $tpl->setVariable("CHECKED", 'checked="checked"');
693 }
694 $tpl->setVariable("CB_VAL", $this->getNodeId($a_node));
695 $tpl->setVariable("CB_NAME", $this->select_postvar . "[]");
696 } else {
697 $tpl->setCurrentBlock("rd");
698 if (in_array($this->getNodeId($a_node), $this->selected_nodes)) {
699 $tpl->setVariable("SELECTED", 'checked="checked"');
700 }
701 $tpl->setVariable("RD_VAL", $this->getNodeId($a_node));
702 $tpl->setVariable("RD_NAME", $this->select_postvar);
703 }
705 }
706
707
708 if ($this->isNodeHighlighted($a_node)) {
709 $tpl->touchBlock("hl");
710 }
711 $tpl->setCurrentBlock("content");
712 if ($this->getNodeIcon($a_node) !== "") {
713 $tpl->setVariable("ICON", ilUtil::img($this->getNodeIcon($a_node), $this->getNodeIconAlt($a_node)) . " ");
714 }
715 $tpl->setVariable("CONTENT", $this->getNodeContent($a_node));
716 if ($this->isNodeClickable($a_node)) {
717 $tpl->setVariable("HREF", $this->getNodeHref($a_node));
718 }
719 $target = $this->getNodeTarget($a_node);
720 if ($target !== "") {
721 $targetRelatedParams = array(
722 'target="' . $target . '"'
723 );
724
725 if ('_blank' === $target) {
726 $targetRelatedParams[] = 'rel="noopener"';
727 }
728
729 $tpl->setVariable('TARGET', implode(' ', $targetRelatedParams));
730 }
731 if (!$this->isNodeOnclickEnabled() || !$this->isNodeClickable($a_node)) {
732 $tpl->setVariable("ONCLICK", 'onclick="return false;"');
733 $tpl->setVariable("A_CLASS", 'class="disabled"');
734 } else {
735 $onclick = $this->getNodeOnClick($a_node);
736 if ($onclick !== "") {
737 $tpl->setVariable("ONCLICK", 'onclick="' . $onclick . '"');
738 }
739 }
741
742 $tpl->touchBlock("tag");
743 }
744
745 if (!$this->getAjax() || in_array($this->getNodeId($a_node), $this->open_nodes)
746 || in_array($this->getNodeId($a_node), $this->custom_open_nodes)) {
747 $this->renderChilds($this->getNodeId($a_node), $tpl);
748 }
749
750 if (!$skip) {
751 $this->listItemEnd($tpl);
752 }
753 }
754
759 final public function renderChilds($a_node_id, ilTemplate $tpl): void
760 {
761 $childs = $this->getChildsOfNode($a_node_id);
762 $childs = $this->sortChilds($childs, $a_node_id);
763
764 if (count($childs) > 0 || ($this->getSearchTerm() !== "" && $this->isNodeRequested($a_node_id))) {
765 // collect visible childs
766
767 $visible_childs = [];
768 $cnt_child = 0;
769
770 foreach ($childs as $child) {
771 $cnt_child++;
772 if ($this->getChildLimit() > 0 && $this->getChildLimit() < $cnt_child) {
773 continue;
774 }
775
776 if ($this->isNodeVisible($child)) {
777 $visible_childs[] = $child;
778 }
779 }
780
781 // search field, if too many childs
782 $any = false;
783 if (($this->getChildLimit() > 0 && $this->getChildLimit() < $cnt_child) || ($this->getSearchTerm() !== "" && $this->isNodeRequested($a_node_id))) {
784 $this->listStart($tpl);
785 $any = true;
786
787 $tpl->setCurrentBlock("list_search");
788 $tpl->setVariable("SEARCH_CONTAINER_ID", $a_node_id);
789 if ($this->isNodeRequested($a_node_id)) {
790 $tpl->setVariable("SEARCH_VAL", $this->getSearchTerm());
791 }
792 $tpl->parseCurrentBlock();
793 $tpl->touchBlock("tag");
794 }
795
796 // render visible childs
797 foreach ($visible_childs as $child) {
798 // check child limit
799 $cnt_child++;
800
801 if ($this->isNodeVisible($child)) {
802 if (!$any) {
803 $this->listStart($tpl);
804 $any = true;
805 }
806 $this->renderNode($child, $tpl);
807 }
808 }
809 if ($any) {
810 $this->listEnd($tpl);
811 }
812 }
813 }
814
815 protected function isNodeRequested(string $a_node_id): bool
816 {
817 return ($this->requested_node_id === $this->getDomNodeIdForNodeId($a_node_id) ||
818 ($this->requested_node_id === "" && $a_node_id == $this->getNodeId($this->getRootNode())));
819 }
820
825 public function getDomNodeIdForNodeId($a_node_id): string
826 {
827 return "exp_node_" . $this->getId() . "_" . $a_node_id;
828 }
829
833 public function getNodeIdForDomNodeId(string $a_dom_node_id): string
834 {
835 $i = strlen("exp_node_" . $this->getId() . "_");
836 return substr($a_dom_node_id, $i);
837 }
838
843 public function listItemStart(ilTemplate $tpl, $a_node): void
844 {
845 $tpl->setCurrentBlock("list_item_start");
846 if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node) && !$this->isNodeOpen($this->getNodeId($a_node))) {
847 $tpl->touchBlock("li_closed");
848 }
849 if ($this->isNodeOpen($this->getNodeId($a_node))) {
850 $tpl->touchBlock("li_opened");
851 }
852
854 "DOM_NODE_ID",
855 $this->getDomNodeIdForNodeId($this->getNodeId($a_node))
856 );
858 $tpl->touchBlock("tag");
859 }
860
861 public function listItemEnd(ilTemplate $tpl): void
862 {
863 $tpl->touchBlock("list_item_end");
864 $tpl->touchBlock("tag");
865 }
866
867 public function listStart(ilTemplate $tpl): void
868 {
869 $tpl->touchBlock("list_start");
870 $tpl->touchBlock("tag");
871 }
872
873 public function listEnd(ilTemplate $tpl): void
874 {
875 $tpl->touchBlock("list_end");
876 $tpl->touchBlock("tag");
877 }
878
879 public function isNodeOnclickEnabled(): bool
880 {
882 }
883
884 public function setNodeOnclickEnabled(bool $nodeOnclickEnabled): void
885 {
886 $this->nodeOnclickEnabled = $nodeOnclickEnabled;
887 }
888
889 public function isEnableDnd(): bool
890 {
891 return $this->enable_dnd;
892 }
893
894 // Enable Drag & Drop functionality
895 public function setEnableDnd(bool $enable_dnd): void
896 {
897 $this->enable_dnd = $enable_dnd;
898 }
899}
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 initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
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