ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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)
 
 getMainBarModification (CalledContexts $screen_context_stack)
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 
 getTitleModification (CalledContexts $screen_context_stack)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
 __construct (Container $dic)
 
 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)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

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 ()
 

Private Attributes

const MODIFICATION_PRIORITY = 63
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
ContextCollection $context_collection
 
DataFactory $data
 
ILIAS GlobalScreen Scope Layout Factory ModificationFactory $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

Detailed Description

Member Function Documentation

◆ getMainBarModification()

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

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 94 of file LtiViewLayoutProvider.php.

References $id, 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().

94  : ?MainBarModification
95  {
96  $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
97 
98  return $this->globalScreen()->layout()->factory()->mainbar()
99  ->withModification(
100  function (?MainBar $mainbar) use ($is_exit_mode): ?MainBar {
101  $tools = $mainbar->getToolEntries();
102  $mainbar = $mainbar->withClearedEntries();
103  if ($is_exit_mode) {
104  return $mainbar;
105  }
106  foreach ($tools as $id => $entry) {
107  $mainbar = $mainbar->withAdditionalToolEntry($id, $entry);
108  }
109  //$mainbar = $mainbar->withAdditionalEntry('lti_home', $lti_home);
110  return $mainbar;
111  }
112  )
113  ->withPriority(self::MODIFICATION_PRIORITY);
114  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
isLTIExitMode(CalledContexts $screen_context_stack)
+ Here is the call graph for this function:

◆ getMetaBarModification()

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

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 119 of file LtiViewLayoutProvider.php.

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

119  : ?MetaBarModification
120  {
121  $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
122 
123  return $this->globalScreen()->layout()->factory()->metabar()
124  ->withModification(
125  function (?MetaBar $metabar) use ($is_exit_mode, $screen_context_stack): ?Metabar {
126  $metabar = $metabar->withClearedEntries();
127  if ($is_exit_mode) {
128  return $metabar;
129  }
130  $f = $this->dic->ui()->factory();
131  $exit_symbol = $f->symbol()->glyph()->close();
132  $exit_txt = $this->dic['lti']->lng->txt('lti_exit');
133  $exit = $f->button()->bulky($exit_symbol, $exit_txt, $this->dic["lti"]->getCmdLink('exit'));
134  $metabar = $metabar->withAdditionalEntry('exit', $exit);
135  return $metabar;
136  }
137  )
138  ->withPriority(self::MODIFICATION_PRIORITY);
139  }
isLTIExitMode(CalledContexts $screen_context_stack)
+ Here is the call graph for this function:

◆ getPageBuilderDecorator()

ILIAS\LTI\Screen\LtiViewLayoutProvider::getPageBuilderDecorator ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
||null

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 58 of file LtiViewLayoutProvider.php.

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

58  : ?PageBuilderModification
59  {
60  $this->globalScreen()->layout()->meta()->addCss('./Services/LTI/templates/default/lti.css');
61  $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
62  $external_css = ($is_exit_mode) ? '' : $this->dic["lti"]->getExternalCss();
63  if ($external_css !== '') {
64  $this->globalScreen()->layout()->meta()->addCss($external_css);
65  }
66 
67  return $this->factory->page()
68  ->withModification(
69  function (PagePartProvider $parts): Page {
70  $p = new StandardPageBuilder();
71  $page = $p->build($parts);
72 
73  $mv_modeinfo = MemberViewLayoutProvider::getMemberViewModeInfo($this->dic);
74  if ($mv_modeinfo) {
75  $page = $page->withModeInfo($mv_modeinfo);
76  }
77 
78  return $page->withNoFooter();
79  }
80  )
81  ->withPriority(self::MODIFICATION_PRIORITY);
82  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
isLTIExitMode(CalledContexts $screen_context_stack)
+ Here is the call graph for this function:

◆ getTitleModification()

ILIAS\LTI\Screen\LtiViewLayoutProvider::getTitleModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
||null

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 145 of file LtiViewLayoutProvider.php.

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

145  : ?TitleModification
146  {
147  $is_exit_mode = $this->isLTIExitMode($screen_context_stack);
148 
149  return $this->globalScreen()->layout()->factory()->title()
150  ->withModification(
151  function (?string $content) use ($is_exit_mode): string {
152  if ($is_exit_mode) {
153  return $this->dic["lti"]->getTitleForExitPage();
154  }
155  return $this->dic["lti"]->getTitle();
156  }
157  )
158  ->withPriority(self::MODIFICATION_PRIORITY);
159  }
isLTIExitMode(CalledContexts $screen_context_stack)
+ Here is the call graph for this function:

◆ isInterestedInContexts()

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

Implements ILIAS\GlobalScreen\ScreenContext\ScreenContextAwareProvider.

Definition at line 48 of file LtiViewLayoutProvider.php.

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

48  : ContextCollection
49  {
50  return $this->context_collection->lti();
51  }
+ Here is the call graph for this function:

◆ isLTIExitMode()

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

Definition at line 84 of file LtiViewLayoutProvider.php.

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().

84  : bool
85  {
86  $data_collection = $screen_context_stack->current()->getAdditionalData();
87  $is_exit_mode = $data_collection->is(self::GS_EXIT_LTI, true);
88  return $is_exit_mode;
89  }
+ 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 44 of file LtiViewLayoutProvider.php.

◆ MODIFICATION_PRIORITY

const ILIAS\LTI\Screen\LtiViewLayoutProvider::MODIFICATION_PRIORITY = 63
private

Definition at line 46 of file LtiViewLayoutProvider.php.


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