ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts Class Reference
+ Inheritance diagram for ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts:
+ Collaboration diagram for ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts:

Public Member Functions

 current ()
 
 push (ScreenContext $context)
 
 external ()
 
 clear ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection
 __construct (protected ContextRepository $repo)
 
 push (ScreenContext $context)
 
 getLast ()
 
 getStack ()
 
 getStackAsArray ()
 
 hasMatch (ContextCollection $other_collection)
 
 main ()
 
 desktop ()
 
 repository ()
 
 administration ()
 
 external ()
 
 lti ()
 

Protected Member Functions

 claim (ScreenContext $context, bool $silent=false)
 

Private Member Functions

 checkCallLocation (ScreenContext $context, bool $silent=false)
 

Private Attributes

array $call_locations = []
 

Additional Inherited Members

- Data Fields inherited from ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection
function return $this: self { $this->push($this->repo->internal())
 
- Protected Attributes inherited from ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection
array $stack = []
 

Detailed Description

Definition at line 29 of file CalledContexts.php.

Member Function Documentation

◆ checkCallLocation()

ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts::checkCallLocation ( ScreenContext  $context,
bool  $silent = false 
)
private

Definition at line 71 of file CalledContexts.php.

References ILIAS\GlobalScreen\ScreenContext\ScreenContext\getUniqueContextIdentifier().

Referenced by ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\claim().

71  : void
72  {
73  $called_classes = array_filter(
74  debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),
75  function ($item): bool {
76  if (!isset($item['class'])) {
77  return false;
78  }
79 
80  return (!in_array($item['class'], [CalledContexts::class, ContextCollection::class]));
81  }
82  );
83  array_walk(
84  $called_classes,
85  function (& $item): void {
86  $item = ($item['class'] ?? '') . ":" . ($item['line'] ?? '');
87  }
88  );
89 
90  $call_location = reset($called_classes);
91 
92  if (!$silent && isset($this->call_locations[$context->getUniqueContextIdentifier()])) {
93  $first_location = $this->call_locations[$context->getUniqueContextIdentifier()];
94  throw new LogicException("context '{$context->getUniqueContextIdentifier()}' already claimed in $first_location, second try in $call_location");
95  }
96  $this->call_locations[$context->getUniqueContextIdentifier()] = $call_location;
97  }
$context
Definition: webdav.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ claim()

ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts::claim ( ScreenContext  $context,
bool  $silent = false 
)
protected

Definition at line 61 of file CalledContexts.php.

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

Referenced by ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\external(), and ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\push().

61  : void
62  {
63  $this->checkCallLocation($context, $silent);
64 
65  if (!$silent && in_array($context, $this->stack)) {
66  throw new LogicException("A context can only be claimed once");
67  }
68  parent::push($context);
69  }
$context
Definition: webdav.php:31
checkCallLocation(ScreenContext $context, bool $silent=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts::clear ( )

Definition at line 55 of file CalledContexts.php.

55  : void
56  {
57  $this->call_locations = [];
58  $this->stack = [];
59  }

◆ current()

ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts::current ( )

Definition at line 33 of file CalledContexts.php.

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

Referenced by ilHTMLExportViewLayoutProvider\getBreadCrumbsModification(), ilLMHtmlExportViewLayoutProvider\getBreadCrumbsModification(), ilMDKeywordExposer\getContentModification(), DashboardLayoutProvider\getMainBarModification(), ilTestPlayerLayoutProvider\getMainBarModification(), ilLMHtmlExportViewLayoutProvider\getMainBarModification(), ilHTMLExportViewLayoutProvider\getMainBarModification(), ilLMHtmlExportViewLayoutProvider\getMetaBarModification(), ilHTMLExportViewLayoutProvider\getMetaBarModification(), ILIAS\components\WOPI\Embed\EmbeddedApplicationGSProvider\getMetaBarModification(), ilTestPlayerLayoutProvider\getShortTitleModification(), ilTestPlayerLayoutProvider\getTitleModification(), ilTestPlayerToolProvider\getToolsForContextStack(), ilMediaPoolGSToolProvider\getToolsForContextStack(), ilWorkspaceGSToolProvider\getToolsForContextStack(), ilAdminGSToolProvider\getToolsForContextStack(), ilExerciseGSToolProvider\getToolsForContextStack(), ilCOPageEditGSToolProvider\getToolsForContextStack(), ilLMGSToolProvider\getToolsForContextStack(), ilTaxonomyGSToolProvider\getToolsForContextStack(), ilLMEditGSToolProvider\getToolsForContextStack(), ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getToolsForContextStack(), ilSkillGSToolProvider\getToolsForContextStack(), ilTestPlayerLayoutProvider\getViewTitleModification(), ILIAS\Init\StartupSequence\StartUpSequenceLayoutProvider\isForcedStartupStep(), ILIAS\components\WOPI\Embed\EmbeddedApplicationGSProvider\isInterestedInContexts(), ilLSViewLayoutProvider\isKioskModeEnabled(), ilTestPlayerLayoutProvider\isKioskModeEnabled(), ILIAS\LTI\Screen\LtiViewLayoutProvider\isLTIExitMode(), and ILIAS\Test\Presentation\PrintLayoutProvider\isTestContextPrint().

33  : ScreenContext
34  {
35  return $this->getLast();
36  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ external()

ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts::external ( )

Definition at line 48 of file CalledContexts.php.

References ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection\$this, and ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\claim().

48  : ContextCollection
49  {
50  $this->claim($this->repo->external(), true);
51 
52  return $this;
53  }
claim(ScreenContext $context, bool $silent=false)
+ Here is the call graph for this function:

◆ push()

ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts::push ( ScreenContext  $context)

Definition at line 39 of file CalledContexts.php.

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\claim(), and ILIAS\GlobalScreen\ScreenContext\ScreenContext\getUniqueContextIdentifier().

39  : void
40  {
41  $this->claim(
42  $context,
43  $context->getUniqueContextIdentifier() === 'external'
44  ); // external can be claimed multiple times
45  }
$context
Definition: webdav.php:31
claim(ScreenContext $context, bool $silent=false)
+ Here is the call graph for this function:

Field Documentation

◆ $call_locations

array ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts::$call_locations = []
private

Definition at line 31 of file CalledContexts.php.


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