ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilFooterStandardGroupsProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
23 use ILIAS\Data\URI;
28 
33 {
34  private readonly Translator $translator;
35 
36  public function __construct(Container $dic)
37  {
38  parent::__construct($dic);
39  $this->translator = new Translator($dic);
40  }
41 
43  {
44  return $this->id_factory->identifier($group->value);
45  }
46 
47  public function getGroups(): array
48  {
49  return [
50  $this->item_factory->group(
51  $this->getIdentificationFor(ilFooterStandardGroups::ACCESSIBILITY),
52  $this->translator->translate('accessibility')
53  )->withPosition(10),
54  $this->item_factory->group(
55  $this->getIdentificationFor(ilFooterStandardGroups::LEGAL_INFORMATION),
56  $this->translator->translate('legal_information')
57  )->withPosition(20),
58  $this->item_factory->group(
59  $this->getIdentificationFor(ilFooterStandardGroups::SUPPORT),
60  $this->translator->translate('support')
61  )->withPosition(30),
62  $this->item_factory->group(
64  $this->translator->translate('services')
65  )->withPosition(40),
66  ];
67  }
68 
69  private function buildURI(string $from_path): URI
70  {
71  $request = $this->dic->http()->request()->getUri();
72  return new URI($request->getScheme() . '://' . $request->getHost() . '/' . ltrim($from_path, '/'));
73  }
74 
75  public function getEntries(): array
76  {
77  $entries = [];
78  // Accessibility Items
79  // accessibility control concept
80  if (($accessibility_control_url = \ilAccessibilityControlConceptGUI::getFooterLink()) !== '') {
81  $accessibility_control_title = \ilAccessibilityControlConceptGUI::getFooterText();
82  $entries[] = $this->item_factory
83  ->link(
84  $this->id_factory->identifier('accessibility_control'),
85  $accessibility_control_title
86  )
87  ->withAction($this->buildURI($accessibility_control_url))
88  ->withParent($this->getIdentificationFor(ilFooterStandardGroups::ACCESSIBILITY));
89  }
90 
91  // report accessibility issue
92  if (($accessibility_report_url = \ilAccessibilitySupportContactsGUI::getFooterLink()) !== '') {
93  $accessibility_report_title = \ilAccessibilitySupportContactsGUI::getFooterText();
94  $entries[] = $this->item_factory
95  ->link(
96  $this->id_factory->identifier('accessibility_report'),
97  $accessibility_report_title
98  )
99  ->withAction($this->buildURI($accessibility_report_url))
100  ->withParent($this->getIdentificationFor(ilFooterStandardGroups::ACCESSIBILITY));
101  }
102 
103  // Imprint
104  /*$base_class = ($this->dic->http()->wrapper()->query()->has(\ilCtrlInterface::PARAM_BASE_CLASS)) ?
105  $this->dic->http()->wrapper()->query()->retrieve(
106  \ilCtrlInterface::PARAM_BASE_CLASS,
107  $this->dic->refinery()->kindlyTo()->string()
108  ) : null;*/
109 
110  // there was another check $base_class !== \ilImprintGUI::class &&
111  if (\ilImprint::isActive()) {
112  $imprint_title = $this->dic->language()->txt("imprint");
113 
114  $entries[] = $this->item_factory
115  ->link(
116  $this->id_factory->identifier('imprint'),
117  $imprint_title
118  )
119  ->withAction(new URI(\ilLink::_getStaticLink(0, "impr")))
120  ->withParent($this->getIdentificationFor(ilFooterStandardGroups::LEGAL_INFORMATION));
121  }
122 
123  // system support contacts
124  if (($system_support_url = \ilSystemSupportContactsGUI::getFooterLink()) !== '') {
125  $system_support_title = \ilSystemSupportContactsGUI::getFooterText();
126  $entries[] = $this->item_factory
127  ->link(
128  $this->id_factory->identifier('system_support'),
129  $system_support_title
130  )
131  ->withAction($this->buildURI($system_support_url))
132  ->withParent($this->getIdentificationFor(ilFooterStandardGroups::SUPPORT));
133  }
134 
135  // output translation link
137  $translation_url = \ilObjLanguageAccess::_getTranslationLink();
138  $translation_title = $this->dic->language()->txt('translation');
139  $entries[] = $this->item_factory
140  ->link(
141  $this->id_factory->identifier('translation'),
142  $translation_title
143  )
144  ->withAction($this->buildURI($translation_url))
145  ->withOpenInNewViewport(true)
147  }
148 
149  return $entries;
150  }
151 
152  #[\Override]
153  public function getAdditionalTexts(): array
154  {
155  $ilias_version = ILIAS_VERSION;
156  $text = "powered by ILIAS (v{$ilias_version})";
157 
158  return [
159  $this->item_factory->text(
160  $this->id_factory->identifier('ilias_version'),
161  $text
162  )
163  ];
164  }
165 
166  public function getPermanentURI(): ?Permanent
167  {
168  $permanant_link = PageContentProvider::getPermaLink();
169  if (empty($permanant_link)) {
170  return null;
171  }
172 
173  return $this->item_factory->permanent(
174  $this->id_factory->identifier('permanent'),
175  $this->translator->translate('permanent'),
176  new URI($permanant_link)
177  );
178  }
179 
180  private function txt(string $key): string
181  {
182  return $this->dic->language()->txt($key);
183  }
184 
185 }
static _isPageTranslation()
Check if the current request is a page translation.
getIdentificationFor(ilFooterStandardGroups $group)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const ILIAS_VERSION
static _getTranslationLink()
Get the link to translate the current page.
withParent(IdentificationInterface $identification)
__construct(Container $dic, ilPlugin $plugin)
$dic
Definition: result.php:31
static _checkTranslate()
Permission check for translations.
static isActive()