ILIAS  release_8 Revision v8.24
ILIAS\UICore\PageContentProvider Class Reference
+ Inheritance diagram for ILIAS\UICore\PageContentProvider:
+ Collaboration diagram for ILIAS\UICore\PageContentProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getContentModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getFooterModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getContentModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getLogoModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getResponsiveLogoModification (CalledContexts $screen_context_stack)
 
 getMainBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getFooterModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getTitleModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getShortTitleModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getViewTitleModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getFullyQualifiedClassName ()
 @inheritDoc More...
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getContentModification (CalledContexts $screen_context_stack)
 
 getLogoModification (CalledContexts $screen_context_stack)
 
 getResponsiveLogoModification (CalledContexts $screen_context_stack)
 
 getMainBarModification (CalledContexts $screen_context_stack)
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 
 getFooterModification (CalledContexts $screen_context_stack)
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 
 getTitleModification (CalledContexts $screen_context_stack)
 
 getShortTitleModification (CalledContexts $screen_context_stack)
 
 getViewTitleModification (CalledContexts $screen_context_stack)
 
 isInterestedInContexts ()
 

Static Public Member Functions

static setContent (string $content)
 
static setTitle (string $title)
 
static setShortTitle (string $short_title)
 
static setViewTitle (string $view_title)
 
static setPermaLink (string $perma_link)
 

Private Member Functions

 buildTabTitle ()
 @description This method was introduced due to A11y problems, see https://mantis.ilias.de/view.php?id=31534. More...
 

Static Private Attributes

static string $content = ""
 
static string $perma_link = ""
 
static string $title = ""
 
static string $short_title = ""
 
static string $view_title = ""
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
ContextCollection $context_collection
 
ILIAS GlobalScreen Scope Layout Factory ModificationFactory $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

Detailed Description

Member Function Documentation

◆ buildTabTitle()

ILIAS\UICore\PageContentProvider::buildTabTitle ( )
private

@description This method was introduced due to A11y problems, see https://mantis.ilias.de/view.php?id=31534.

This is definitely only a workaround, but since this is currently the only way to implement it, it is just introduced... We keep all the logic within this method because we don't want this to become common or even used elsewhere. Hence certain things as anonymous functions...

Definition at line 126 of file PageContentProvider.php.

126 : string
127 {
128 // This anonymous function generates a translated title from a "tab" array.
129 // in some cases the tabs are already translated (dir_text = true), in others not...
130 $tab_title_generator = function (array $tab): string {
131 if (($tab['dir_text'] ?? false) === false) {
132 $tab_title = $this->dic->language()->txt($tab['text']);
133 } else {
134 $tab_title = $tab['text'] ?? '';
135 }
136 $tab_title .= ': ';
137 return $tab_title;
138 };
139
140 // we only know the 'id' of the active tab and don't want to rely on the array index, so we
141 // loop over tabs or subtabs to find the "right" one
142 $tab_looper = static function (array $tabs, string $active_tab) use ($tab_title_generator): string {
143 $tab_title = '';
144 foreach ($tabs as $tab) {
145 if ($tab['id'] === $active_tab) {
146 $tab_title = $tab_title_generator($tab);
147 break;
148 }
149 }
150 return $tab_title;
151 };
152
153 // TABS
154 $tabs = $this->dic->tabs()->target; // this only works because target is currently public...
155 $active_tab = $this->dic->tabs()->getActiveTab();
156 if ($active_tab === '' && isset($tabs[0])) {
157 $active_tab = $tabs[0]['id']; // if no tab is active, use the first one
158 }
159
160 $tab_title = $tab_looper($tabs, $active_tab);
161
162 // SUBTABS
163 $subtab_title = '';
164 $subtabs = $this->dic->tabs()->sub_target; // this only works because subtarget is currently public...
165 if (count($subtabs) > 1) { // we only need to do something if there are more than one subtabs
166 $active_subtab = array_values(
167 array_filter($subtabs, static function (array $subtab): bool {
168 return $subtab['activate'] ?? false;
169 })
170 )[0]['id'] ?? '';
171
172 if ($active_subtab === '' && isset($subtabs[0])) {
173 $active_subtab = $subtabs[0]['id']; // if no tab is active, use the first one
174 }
175 $subtab_title = $tab_looper($subtabs, $active_subtab);
176 }
177
178 return $subtab_title . $tab_title;
179 }

◆ getContentModification()

ILIAS\UICore\PageContentProvider::getContentModification ( CalledContexts  $screen_context_stack)

@inheritDoc

Reimplemented from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider.

Definition at line 78 of file PageContentProvider.php.

78 : ?ContentModification
79 {
80 return $this->globalScreen()->layout()->factory()->content()->withModification(function (
81 ?Legacy $content
82 ): ?Legacy {
83 $ui = $this->dic->ui();
84 return $ui->factory()->legacy(
85 $ui->renderer()->render($content) . self::$content
86 );
87 })->withLowPriority();
88 }

References ILIAS\UICore\PageContentProvider\$content, ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

+ Here is the call graph for this function:

◆ getFooterModification()

ILIAS\UICore\PageContentProvider::getFooterModification ( CalledContexts  $screen_context_stack)

@inheritDoc

Reimplemented from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider.

Definition at line 182 of file PageContentProvider.php.

182 : ?FooterModification
183 {
184 return $this->globalScreen()->layout()->factory()->footer()->withModification(function (?Footer $footer): ?Footer {
185 $f = $this->dic->ui()->factory();
186
187 $links = [];
188 // ILIAS Version and Text
189 $ilias_version = ILIAS_VERSION;
190 $text = "powered by ILIAS (v{$ilias_version})";
191
192 // Imprint
193 $base_class = ($this->dic->http()->wrapper()->query()->has(\ilCtrlInterface::PARAM_BASE_CLASS)) ?
194 $this->dic->http()->wrapper()->query()->retrieve(
196 $this->dic->refinery()->kindlyTo()->string()
197 ) : null;
198
199 if ($base_class !== \ilImprintGUI::class && \ilImprint::isActive()) {
200 $imprint_title = $this->dic->language()->txt("imprint");
201 $imprint_url = \ilLink::_getStaticLink(0, "impr");
202 $links[] = $f->link()->standard($imprint_title, $imprint_url);
203 }
204
205 // system support contacts
206 if (($system_support_url = \ilSystemSupportContactsGUI::getFooterLink()) !== '') {
207 $system_support_title = \ilSystemSupportContactsGUI::getFooterText();
208 $links[] = $f->link()->standard($system_support_title, $system_support_url);
209 }
210
211 // output translation link
214 $translation_title = $this->dic->language()->txt('translation');
215 $links[] = $f->link()->standard($translation_title, $translation_url)->withOpenInNewViewport(true);
216 }
217
218 // accessibility control concept
219 if (($accessibility_control_url = \ilAccessibilityControlConceptGUI::getFooterLink()) !== '') {
220 $accessibility_control_title = \ilAccessibilityControlConceptGUI::getFooterText();
221 $links[] = $f->link()->standard($accessibility_control_title, $accessibility_control_url);
222 }
223
224 // report accessibility issue
225 if (($accessibility_report_url = \ilAccessibilitySupportContactsGUI::getFooterLink()) !== '') {
226 $accessibility_report_title = \ilAccessibilitySupportContactsGUI::getFooterText();
227 $links[] = $f->link()->standard($accessibility_report_title, $accessibility_report_url);
228 }
229
230 $footer = $f->mainControls()->footer($links, $text);
231
232 $tosWithdrawalGui = new \ilTermsOfServiceWithdrawalGUIHelper($this->dic->user());
233 $footer = $tosWithdrawalGui->modifyFooter($footer);
234
235 if (self::$perma_link !== "") {
236 $footer = $footer->withPermanentURL(new URI(self::$perma_link));
237 }
238
239 return $footer;
240 });
241 }
static isActive()
static _checkTranslate()
Permission check for translations.
static _isPageTranslation()
Check if the current request is a page translation.
static _getTranslationLink()
Get the link to translate the current page.
const ILIAS_VERSION
has(string $class_name)

References Vendor\Package\$f, ilObjLanguageAccess\_checkTranslate(), ilLink\_getStaticLink(), ilObjLanguageAccess\_getTranslationLink(), ilObjLanguageAccess\_isPageTranslation(), ilAccessibilitySupportContactsGUI\getFooterLink(), ilSystemSupportContactsGUI\getFooterLink(), ilAccessibilityControlConceptGUI\getFooterLink(), ilAccessibilitySupportContactsGUI\getFooterText(), ilSystemSupportContactsGUI\getFooterText(), ilAccessibilityControlConceptGUI\getFooterText(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), ILIAS\GlobalScreen\has(), ILIAS_VERSION, ilImprint\isActive(), ilCtrlInterface\PARAM_BASE_CLASS, and ILIAS\UI\Component\MainControls\Footer\withPermanentURL().

+ Here is the call graph for this function:

◆ isInterestedInContexts()

ILIAS\UICore\PageContentProvider::isInterestedInContexts ( )
Returns
ContextCollection

Implements ILIAS\GlobalScreen\ScreenContext\ScreenContextAwareProvider.

Definition at line 73 of file PageContentProvider.php.

73 : ContextCollection
74 {
75 return $this->context_collection->main();
76 }

References ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection\main().

+ Here is the call graph for this function:

◆ setContent()

static ILIAS\UICore\PageContentProvider::setContent ( string  $content)
static

Definition at line 48 of file PageContentProvider.php.

48 : void
49 {
50 self::$content = $content;
51 }

References ILIAS\UICore\PageContentProvider\$content.

◆ setPermaLink()

static ILIAS\UICore\PageContentProvider::setPermaLink ( string  $perma_link)
static

Definition at line 68 of file PageContentProvider.php.

68 : void
69 {
70 self::$perma_link = $perma_link;
71 }

References ILIAS\UICore\PageContentProvider\$perma_link.

◆ setShortTitle()

static ILIAS\UICore\PageContentProvider::setShortTitle ( string  $short_title)
static

Definition at line 58 of file PageContentProvider.php.

58 : void
59 {
60 self::$short_title = $short_title;
61 }

References ILIAS\UICore\PageContentProvider\$short_title.

◆ setTitle()

static ILIAS\UICore\PageContentProvider::setTitle ( string  $title)
static

Definition at line 53 of file PageContentProvider.php.

53 : void
54 {
55 self::$title = $title;
56 }

References ILIAS\UICore\PageContentProvider\$title.

◆ setViewTitle()

static ILIAS\UICore\PageContentProvider::setViewTitle ( string  $view_title)
static

Definition at line 63 of file PageContentProvider.php.

63 : void
64 {
65 self::$view_title = $view_title;
66 }

References ILIAS\UICore\PageContentProvider\$view_title.

Field Documentation

◆ $content

string ILIAS\UICore\PageContentProvider::$content = ""
staticprivate

◆ $perma_link

string ILIAS\UICore\PageContentProvider::$perma_link = ""
staticprivate

◆ $short_title

string ILIAS\UICore\PageContentProvider::$short_title = ""
staticprivate

◆ $title

string ILIAS\UICore\PageContentProvider::$title = ""
staticprivate

Definition at line 44 of file PageContentProvider.php.

Referenced by ILIAS\UICore\PageContentProvider\setTitle().

◆ $view_title

string ILIAS\UICore\PageContentProvider::$view_title = ""
staticprivate

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