ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilDataCollectionUiAdapter.php
Go to the documentation of this file.
1 <?php
2 
20 {
21  protected static ?self $instance = null;
22 
25  private ilTabsGUI $tabs;
29 
30  private function __construct(
32  ILIAS\DI\UIServices $ui,
33  ilTabsGUI $tabs,
34  ilErrorHandling $error,
35  ilLocatorGUI $locatorGui,
36  ilHelpGUI $help,
37  ilNavigationHistory $navigationHistory
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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
Help GUI class.
addLocatorItem(string $title, string $link, int $itemId)
$refId
Definition: xapitoken.php:58
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...
global $DIC
Definition: feed.php:28
Class HTTPServicesTest.
setScreenIdComponent(string $a_comp)
addDataCollectionEndpointToNavigationHistory(int $refId, string $link)
Navigation History of Repository Items.
setBackTab(string $label, string $link)
addPermaLinkTableView(int $refId, int $tableviewId)
Error Handling & global info handling uses PEAR error class.
__construct(ilGlobalTemplateInterface $tpl, ILIAS\DI\UIServices $ui, ilTabsGUI $tabs, ilErrorHandling $error, ilLocatorGUI $locatorGui, ilHelpGUI $help, ilNavigationHistory $navigationHistory)
$message
Definition: xapiexit.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...