ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\LTI\Screen\LtiViewLayoutProvider Class Reference

Class LtiViewLayoutProvider. More...

+ Inheritance diagram for ILIAS\LTI\Screen\LtiViewLayoutProvider:
+ Collaboration diagram for ILIAS\LTI\Screen\LtiViewLayoutProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getMainBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getTitleModification (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 ()
 

Data Fields

const GS_EXIT_LTI = 'lti_exit_mode'
 

Protected Member Functions

 isLTIExitMode (CalledContexts $screen_context_stack)
 
- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
 $context_collection
 
 $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

Detailed Description

Member Function Documentation

◆ getMainBarModification()

ILIAS\LTI\Screen\LtiViewLayoutProvider::getMainBarModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 77 of file LtiViewLayoutProvider.php.

77 : ?MainBarModification
78 {
79 $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
80
81 return $this->globalScreen()->layout()->factory()->mainbar()
82 ->withModification(
83 function (MainBar $mainbar) use ($is_exit_mode) : ?MainBar {
84 $tools = $mainbar->getToolEntries();
85 $mainbar = $mainbar->withClearedEntries();
86 if ($is_exit_mode) {
87 return $mainbar;
88 }
89 foreach ($tools as $id => $entry) {
90 $mainbar = $mainbar->withAdditionalToolEntry($id, $entry);
91 }
92 //$mainbar = $mainbar->withAdditionalEntry('lti_home', $lti_home);
93 return $mainbar;
94 }
95 )
96 ->withHighPriority();
97 }
isLTIExitMode(CalledContexts $screen_context_stack)

References ILIAS\UI\Component\MainControls\MainBar\getToolEntries(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), ILIAS\LTI\Screen\LtiViewLayoutProvider\isLTIExitMode(), ILIAS\UI\Component\MainControls\MainBar\withAdditionalToolEntry(), and ILIAS\UI\Component\MainControls\MainBar\withClearedEntries().

+ Here is the call graph for this function:

◆ getMetaBarModification()

ILIAS\LTI\Screen\LtiViewLayoutProvider::getMetaBarModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 102 of file LtiViewLayoutProvider.php.

102 : ?MetaBarModification
103 {
104 $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
105
106 return $this->globalScreen()->layout()->factory()->metabar()
107 ->withModification(
108 function (MetaBar $metabar) use ($is_exit_mode, $screen_context_stack): ?Metabar {
109 $metabar = $metabar->withClearedEntries();
110 if ($is_exit_mode) {
111 return $metabar;
112 }
113 $f = $this->dic->ui()->factory();
114 $exit_symbol = $f->symbol()->glyph()->close();
115 $exit_txt = $this->dic['lti']->lng->txt('lti_exit');
116 $exit = $f->button()->bulky($exit_symbol, $exit_txt, $this->dic["lti"]->getCmdLink('exit'));
117 $metabar = $metabar->withAdditionalEntry('exit', $exit);
118 return $metabar;
119 }
120 )
121 ->withHighPriority();
122 }
close()
Definition: close.php:2

References Vendor\Package\$f, close(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), ILIAS\LTI\Screen\LtiViewLayoutProvider\isLTIExitMode(), ILIAS\UI\Component\MainControls\MetaBar\withAdditionalEntry(), and ILIAS\UI\Component\MainControls\MetaBar\withClearedEntries().

+ Here is the call graph for this function:

◆ getPageBuilderDecorator()

ILIAS\LTI\Screen\LtiViewLayoutProvider::getPageBuilderDecorator ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 48 of file LtiViewLayoutProvider.php.

48 : ?PageBuilderModification
49 {
50 $this->globalScreen()->layout()->meta()->addCss('./Services/LTI/templates/default/lti.css');
51 $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
52 $external_css = ($is_exit_mode) ? '' : $this->dic["lti"]->getExternalCss();
53 if ($external_css !== '') {
54 $this->globalScreen()->layout()->meta()->addCss($external_css);
55 }
56
57 return $this->factory->page()
58 ->withModification(
59 function (PagePartProvider $parts) : Page {
60 $p = new StandardPageBuilder();
61 $page = $p->build($parts);
62
63 $mv_modeinfo = MemberViewLayoutProvider::getMemberViewModeInfo($this->dic);
64 if ($mv_modeinfo) {
65 $page = $page->withModeInfo($mv_modeinfo);
66 }
67
68 return $page->withNoFooter();
69 }
70 )
71 ->withHighPriority();
72 }

References ILIAS\Container\Screen\MemberViewLayoutProvider\getMemberViewModeInfo(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and ILIAS\LTI\Screen\LtiViewLayoutProvider\isLTIExitMode().

+ Here is the call graph for this function:

◆ getTitleModification()

ILIAS\LTI\Screen\LtiViewLayoutProvider::getTitleModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 127 of file LtiViewLayoutProvider.php.

127 : ?TitleModification
128 {
129 $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
130
131 return $this->globalScreen()->layout()->factory()->title()
132 ->withModification(
133 function (string $content) use ($is_exit_mode) : string {
134 if ($is_exit_mode) {
135 return $this->dic["lti"]->getTitleForExitPage();
136 }
137 return $this->dic["lti"]->getTitle();
138 }
139 )
140 ->withHighPriority();
141 }

References ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and ILIAS\LTI\Screen\LtiViewLayoutProvider\isLTIExitMode().

+ Here is the call graph for this function:

◆ isInterestedInContexts()

ILIAS\LTI\Screen\LtiViewLayoutProvider::isInterestedInContexts ( )
Returns
ContextCollection

Implements ILIAS\GlobalScreen\ScreenContext\ScreenContextAwareProvider.

Definition at line 40 of file LtiViewLayoutProvider.php.

40 : ContextCollection
41 {
42 return $this->context_collection->lti();
43 }

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

+ Here is the call graph for this function:

◆ isLTIExitMode()

ILIAS\LTI\Screen\LtiViewLayoutProvider::isLTIExitMode ( CalledContexts  $screen_context_stack)
protected

Definition at line 33 of file LtiViewLayoutProvider.php.

33 : bool
34 {
35 $data_collection = $screen_context_stack->current()->getAdditionalData();
36 $is_exit_mode = $data_collection->is(self::GS_EXIT_LTI, true);
37 return $is_exit_mode;
38 }

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current().

Referenced by ILIAS\LTI\Screen\LtiViewLayoutProvider\getMainBarModification(), ILIAS\LTI\Screen\LtiViewLayoutProvider\getMetaBarModification(), ILIAS\LTI\Screen\LtiViewLayoutProvider\getPageBuilderDecorator(), and ILIAS\LTI\Screen\LtiViewLayoutProvider\getTitleModification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ GS_EXIT_LTI

const ILIAS\LTI\Screen\LtiViewLayoutProvider::GS_EXIT_LTI = 'lti_exit_mode'

Definition at line 31 of file LtiViewLayoutProvider.php.


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