ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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

References $context.

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

+ 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.

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 }
checkCallLocation(ScreenContext $context, bool $silent=false)

References $context, and ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\checkCallLocation().

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

+ 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(), ilHTMLExportViewLayoutProvider\getMainBarModification(), ilTestPlayerLayoutProvider\getMainBarModification(), DashboardLayoutProvider\getMainBarModification(), ilLMHtmlExportViewLayoutProvider\getMainBarModification(), ilHTMLExportViewLayoutProvider\getMetaBarModification(), ilLMHtmlExportViewLayoutProvider\getMetaBarModification(), ILIAS\WOPI\Embed\EmbeddedApplicationGSProvider\getMetaBarModification(), ilTestPlayerLayoutProvider\getShortTitleModification(), ilTestPlayerLayoutProvider\getTitleModification(), ilAdminGSToolProvider\getToolsForContextStack(), ilCOPageEditGSToolProvider\getToolsForContextStack(), ilLMEditGSToolProvider\getToolsForContextStack(), ilMediaPoolGSToolProvider\getToolsForContextStack(), ILIAS\OrgUnit\Provider\OrgUnitToolProvider\getToolsForContextStack(), ilWorkspaceGSToolProvider\getToolsForContextStack(), ilSkillGSToolProvider\getToolsForContextStack(), ilTaxonomyGSToolProvider\getToolsForContextStack(), ilTestPlayerToolProvider\getToolsForContextStack(), ilTestPlayerLayoutProvider\getViewTitleModification(), ILIAS\Init\StartupSequence\StartUpSequenceLayoutProvider\isForcedStartupStep(), ilTestPlayerLayoutProvider\isKioskModeEnabled(), ilLSViewLayoutProvider\isKioskModeEnabled(), ILIAS\LTI\Screen\LtiViewLayoutProvider\isLTIExitMode(), and ILIAS\Test\Presentation\PrintLayoutProvider\isTestContextPrint().

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

◆ external()

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

Reimplemented from ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection.

Definition at line 48 of file CalledContexts.php.

48 : ContextCollection
49 {
50 $this->claim($this->repo->external(), true);
51
52 return $this;
53 }
claim(ScreenContext $context, bool $silent=false)

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

+ Here is the call graph for this function:

◆ push()

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

Reimplemented from ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection.

Definition at line 39 of file CalledContexts.php.

39 : void
40 {
41 $this->claim(
42 $context,
43 $context->getUniqueContextIdentifier() === 'external'
44 ); // external can be claimed multiple times
45 }

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

+ 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: