ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjFooterUIHandling Class Reference
+ Collaboration diagram for ilObjFooterUIHandling:

Public Member Functions

 __construct (private UIServices $ui, private Services $http, private ilTabsGUI $tabs_gui, private Translator $translator, private ilCtrlInterface $ctrl, private ilErrorHandling $error, private ilRbacSystem $rbac_system, private int $ref_id)
 
 outAsyncAsModal (string $title, string $post_url, ?Component ... $components)
 
 outAsync (?Component ... $components)
 
 out (?Component ... $components)
 
 render (?Component ... $components)
 
 buildMainTabs ()
 
 backToMainTab ()
 
 activateTab (string $tab)
 
 requireReadable ()
 
 requireWritable ()
 
 hasPermission (string $permissions)
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 
Renderer $ui_renderer
 
Factory $ui_factory
 

Detailed Description

Definition at line 34 of file class.ilObjFooterUIHandling.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjFooterUIHandling::__construct ( private UIServices  $ui,
private Services  $http,
private ilTabsGUI  $tabs_gui,
private Translator  $translator,
private ilCtrlInterface  $ctrl,
private ilErrorHandling  $error,
private ilRbacSystem  $rbac_system,
private int  $ref_id 
)

Definition at line 43 of file class.ilObjFooterUIHandling.php.

References ILIAS\Repository\ui().

52  {
53  $this->main_tpl = $this->ui->mainTemplate();
54  $this->ui_renderer = $this->ui->renderer();
55  $this->ui_factory = $this->ui->factory();
56  }
+ Here is the call graph for this function:

Member Function Documentation

◆ activateTab()

ilObjFooterUIHandling::activateTab ( string  $tab)

Definition at line 171 of file class.ilObjFooterUIHandling.php.

171  : void
172  {
173  $this->tabs_gui->activateTab($tab);
174  }

◆ backToMainTab()

ilObjFooterUIHandling::backToMainTab ( )

Definition at line 144 of file class.ilObjFooterUIHandling.php.

References ilObjFooterAdministrationGUI\CMD_DEFAULT, ilFooterEntriesGUI\CMD_DEFAULT, and ILIAS\Repository\ctrl().

144  : void
145  {
146  $this->tabs_gui->clearTargets();
147 
148  if (
150  && $this->ctrl->getCmdClass() === strtolower(ilFooterEntriesGUI::class)
151  ) {
152  $this->tabs_gui->setBackTarget(
153  $this->translator->translate('back'),
154  $this->ctrl->getLinkTargetByClass(
155  ilFooterEntriesGUI::class,
157  )
158  );
159  return;
160  }
161 
162  $this->tabs_gui->setBackTarget(
163  $this->translator->translate('back'),
164  $this->ctrl->getLinkTargetByClass(
165  ilObjFooterAdministrationGUI::class,
167  )
168  );
169  }
+ Here is the call graph for this function:

◆ buildMainTabs()

ilObjFooterUIHandling::buildMainTabs ( )

Definition at line 127 of file class.ilObjFooterUIHandling.php.

References ilObjFooterAdministrationGUI\CMD_DEFAULT, ILIAS\Repository\ctrl(), ilObjFooterAdministrationGUI\TAB_INDEX, and ilObjFooterAdministrationGUI\TAB_PERMISSIONS.

127  : void
128  {
129  $this->tabs_gui->addTab(
131  $this->translator->translate('groups'),
132  $this->ctrl->getLinkTargetByClass(
133  ilObjFooterAdministrationGUI::class,
135  )
136  );
137  $this->tabs_gui->addTab(
139  $this->translator->translate('perm_settings'),
140  $this->ctrl->getLinkTargetByClass([ilObjFooterAdministrationGUI::class, ilPermissionGUI::class], 'perm')
141  );
142  }
+ Here is the call graph for this function:

◆ hasPermission()

ilObjFooterUIHandling::hasPermission ( string  $permissions)

Definition at line 186 of file class.ilObjFooterUIHandling.php.

References $id, $message, $token, ILIAS\Repository\ctrl(), ILIAS\UI\URLBuilderToken\getName(), ILIAS\FileDelivery\http(), and null.

186  : bool
187  {
188  return $this->rbac_system->checkAccess($permissions, $this->ref_id);
189  }
+ Here is the call graph for this function:

◆ out()

ilObjFooterUIHandling::out ( ?Component ...  $components)

Definition at line 112 of file class.ilObjFooterUIHandling.php.

References null.

112  : void
113  {
114  $components = array_filter($components, fn($component): bool => $component !== null);
115 
116  $this->main_tpl->setContent(
117  $this->ui_renderer->render($components)
118  );
119  }
$components
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ outAsync()

ilObjFooterUIHandling::outAsync ( ?Component ...  $components)

Definition at line 98 of file class.ilObjFooterUIHandling.php.

References $response, ILIAS\FileDelivery\http(), and null.

Referenced by outAsyncAsModal().

98  : void
99  {
100  $components = array_filter($components, fn($component): bool => $component !== null);
101  $string = $this->ui_renderer->renderAsync($components);
102  $response = $this->http->response()->withBody(
103  Streams::ofString(
104  $string
105  )
106  );
107  $this->http->saveResponse($response);
108  $this->http->sendResponse();
109  $this->http->close();
110  }
$response
Definition: xapitoken.php:93
$components
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outAsyncAsModal()

ilObjFooterUIHandling::outAsyncAsModal ( string  $title,
string  $post_url,
?Component ...  $components 
)

Definition at line 58 of file class.ilObjFooterUIHandling.php.

References ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\InterruptiveItem\getId(), ILIAS\UI\Implementation\Component\Input\getInputs(), ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\KeyValue\getKey(), ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\KeyValue\getValue(), null, and outAsync().

62  : void {
63  $is_form = count($components) === 1 && $components[0] instanceof Form;
64  $are_interruptive = array_filter($components, fn($component): bool => $component instanceof KeyValue) !== [];
65 
66  $modal = match (true) {
67  $is_form => $this->ui_factory->modal()->roundtrip(
68  $title,
69  null,
70  $components[0]->getInputs(),
71  $post_url
72  ),
73  $are_interruptive => $this->ui_factory->modal()->interruptive(
74  $title,
75  $this->translator->translate('confirm_delete'),
76  $post_url
77  )->withAffectedItems(
78  array_map(
79  fn(KeyValue $item): \ILIAS\UI\Component\Modal\InterruptiveItem\KeyValue => $this->ui_factory->modal()->interruptiveItem()->keyValue(
80  $this->hash($item->getId()),
81  $item->getKey(),
82  $item->getValue()
83  ),
85  )
86  ),
87  default => $this->ui_factory->modal()->roundtrip(
88  $title,
90  [],
91  $post_url
92  )
93  };
94 
95  $this->outAsync($modal);
96  }
This describes commonalities between all forms.
Definition: Form.php:32
Interface Observer Contains several chained tasks and infos about them.
$components
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getValue()
The value string that will be displayed behind the label of the node.
Definition: KeyValue.php:46
outAsync(?Component ... $components)
+ Here is the call graph for this function:

◆ render()

ilObjFooterUIHandling::render ( ?Component ...  $components)

Definition at line 120 of file class.ilObjFooterUIHandling.php.

References null.

120  : string
121  {
122  $components = array_filter($components, fn($component): bool => $component !== null);
123 
124  return $this->ui_renderer->render($components);
125  }
$components
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ requireReadable()

ilObjFooterUIHandling::requireReadable ( )

Definition at line 176 of file class.ilObjFooterUIHandling.php.

176  : void
177  {
178  $this->require('read');
179  }

◆ requireWritable()

ilObjFooterUIHandling::requireWritable ( )

Definition at line 181 of file class.ilObjFooterUIHandling.php.

181  : void
182  {
183  $this->require('write');
184  }

Field Documentation

◆ $main_tpl

ilGlobalTemplateInterface ilObjFooterUIHandling::$main_tpl
private

Definition at line 38 of file class.ilObjFooterUIHandling.php.

◆ $ui_factory

Factory ilObjFooterUIHandling::$ui_factory
private

Definition at line 40 of file class.ilObjFooterUIHandling.php.

◆ $ui_renderer

Renderer ilObjFooterUIHandling::$ui_renderer
private

Definition at line 39 of file class.ilObjFooterUIHandling.php.


The documentation for this class was generated from the following file: