ILIAS  release_8 Revision v8.24
class.ilDataCollectionUiAdapter.php
Go to the documentation of this file.
1<?php
2
20{
21 protected static ?self $instance = null;
22
29
30 private function __construct(
32 ILIAS\DI\UIServices $ui,
36 ilHelpGUI $help,
38 ) {
39 $this->tpl = $tpl;
40 $this->ui = $ui;
41 $this->tabs = $tabs;
42 $this->error = $error;
43 $this->locatorGui = $locatorGui;
44 $this->navigationHistory = $navigationHistory;
45
46 $help->setScreenIdComponent("dcl");
47 }
48
49 public static function new(): self
50 {
51 if (is_null(static::$instance) === true) {
52 global $DIC;
53 static::$instance = new self(
54 $DIC["tpl"],
55 $DIC->ui(),
56 $DIC->tabs(),
57 $DIC['ilErr'],
58 $DIC['ilLocator'],
59 $DIC['ilHelp'],
60 $DIC['ilNavigationHistory']
61 );
62 }
63
64 return static::$instance;
65 }
66
67 public function addOnLoadJavaScriptCode(string $a_code): void
68 {
69 $this->tpl->addOnLoadCode($a_code);
70 }
71
72 public function addJavaScriptFile(string $filePath): void
73 {
74 $this->ui->mainTemplate()->addJavaScript($filePath);
75 }
76
77 public function displayFailureMessage(string $message): void
78 {
79 $this->ui->mainTemplate()->setOnScreenMessage('failure', $message, true);
80 }
81
82 public function displaySuccessMessage(string $message): void
83 {
84 $this->ui->mainTemplate()->setOnScreenMessage('success', $message, true);
85 }
86
87 public function displayErrorMessage(string $message): void
88 {
89 $this->error->raiseError($message);
90 }
91
92 public function displayInfoMessage(string $message): void
93 {
94 $this->ui->mainTemplate()->setOnScreenMessage('info', $message, true);
95 }
96
97 public function addLocatorItem(string $title, string $link, int $itemId): void
98 {
99 $this->locatorGui->addItem($title, $link, "", $itemId);
100 }
101
102 public function resetTabs(): void
103 {
104 $this->tabs->clearTargets();
105 $this->tabs->clearSubTabs();
106 }
107
108 public function setBackTab(string $label, string $link): void
109 {
110 $this->tabs->setBackTarget($label, $link);
111 }
112
113 public function addDataCollectionEndpointToNavigationHistory(int $refId, string $link): void
114 {
115 $this->navigationHistory->addItem($refId, $link, "dcl");
116 }
117
118 public function addCssFile(string $filePath): void
119 {
120 $this->tpl->addCss($filePath);
121 }
122
123 public function addPermaLinkTableView(int $refId, int $tableviewId): void
124 {
125 $this->tpl->setPermanentLink("dcl", $refId, "_" . $tableviewId);
126 }
127
128 public function setContent(string $content): void
129 {
130 $this->tpl->setContent($content);
131 }
132}
Provides fluid interface to RBAC services.
Definition: UIServices.php:24
error(string $a_errmsg)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilGlobalTemplateInterface $tpl, ILIAS\DI\UIServices $ui, ilTabsGUI $tabs, ilErrorHandling $error, ilLocatorGUI $locatorGui, ilHelpGUI $help, ilNavigationHistory $navigationHistory)
addDataCollectionEndpointToNavigationHistory(int $refId, string $link)
addLocatorItem(string $title, string $link, int $itemId)
addPermaLinkTableView(int $refId, int $tableviewId)
setBackTab(string $label, string $link)
Error Handling & global info handling uses PEAR error class.
Help GUI class.
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Navigation History of Repository Items.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class HTTPServicesTest.
Class ChatMainBarProvider \MainMenu\Provider.
$message
Definition: xapiexit.php:32
$refId
Definition: xapitoken.php:58