ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\GlobalScreen\Scope Namespace Reference

Namespaces

 Footer
 
 Layout
 PhpIncompatibleReturnTypeInspection
 
 MainMenu
 
 MetaBar
 
 Notification
 PhpIncompatibleReturnTypeInspection
 
 Toast
 
 Tool
 PhpIncompatibleReturnTypeInspection
 

Data Structures

interface  isDecorateable
 
interface  RenderFactory
 

Functions

 withTopics (Topic ... $topics)
 
 getTopics ()
 
 addComponentDecorator (Closure $component_decorator)
 
 getComponentDecorator ()
 
 addSymbolDecorator (Closure $symbol_decorator)
 
 getSymbolDecorator ()
 
 withVisibilityCallable (callable $is_visible)
 
 isVisible ()
 
 withAvailableCallable (callable $is_available)
 
 isAvailable ()
 
 isAlwaysAvailable ()
 

Variables

trait ComponentDecoratorTrait
 
Closure $component_decorator = null
 
Closure $triggerer_decorator = null
 
Closure $symbol_decorator = null
 
array $topics = []
 
trait VisibilityAvailabilityTrait
 
Closure $visiblility_callable = null
 
bool $is_visible_static = null
 

Function Documentation

◆ addComponentDecorator()

ILIAS\GlobalScreen\Scope\addComponentDecorator ( Closure  $component_decorator)

Definition at line 55 of file ComponentDecoratorTrait.php.

References $c, and ILIAS\GlobalScreen\Scope\$component_decorator.

55  : self
56  {
57  $this->checkClosureForSignature($component_decorator, Component::class);
58 
59  if ($this->component_decorator instanceof Closure) {
60  $existing = $this->component_decorator;
61  $this->component_decorator = static function (Component $c) use (
63  $existing
64  ): Component {
65  $component = $existing($c);
66 
67  return $component_decorator($component);
68  };
69  } else {
70  $this->component_decorator = $component_decorator;
71  }
72 
73  return $this;
74  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$c
Definition: deliver.php:9

◆ addSymbolDecorator()

ILIAS\GlobalScreen\Scope\addSymbolDecorator ( Closure  $symbol_decorator)

Definition at line 81 of file ComponentDecoratorTrait.php.

References $c, and ILIAS\GlobalScreen\Scope\$symbol_decorator.

81  : isDecorateable
82  {
83  $this->checkClosureForSignature($symbol_decorator, Symbol::class);
84 
85  if ($this->symbol_decorator instanceof Closure) {
86  $existing = $this->symbol_decorator;
87  $this->symbol_decorator = static function (Symbol $c) use ($symbol_decorator, $existing): Symbol {
88  $component = $existing($c);
89 
90  return $symbol_decorator($component);
91  };
92  } else {
93  $this->symbol_decorator = $symbol_decorator;
94  }
95 
96  return $this;
97  }
$c
Definition: deliver.php:9

◆ getComponentDecorator()

ILIAS\GlobalScreen\Scope\getComponentDecorator ( )

◆ getSymbolDecorator()

ILIAS\GlobalScreen\Scope\getSymbolDecorator ( )

Definition at line 99 of file ComponentDecoratorTrait.php.

References ILIAS\GlobalScreen\Scope\$symbol_decorator.

99  : ?Closure
100  {
102  }

◆ getTopics()

ILIAS\GlobalScreen\Scope\getTopics ( )

Definition at line 50 of file ComponentDecoratorTrait.php.

References ILIAS\GlobalScreen\Scope\$topics.

50  : array
51  {
52  return $this->topics;
53  }

◆ isAlwaysAvailable()

ILIAS\GlobalScreen\Scope\isAlwaysAvailable ( )

Definition at line 85 of file VisibilityAvailabilityTrait.php.

Referenced by ILIAS\GlobalScreen\Scope\isAvailable().

85  : bool
86  {
87  return false;
88  }
+ Here is the caller graph for this function:

◆ isAvailable()

ILIAS\GlobalScreen\Scope\isAvailable ( )

Definition at line 71 of file VisibilityAvailabilityTrait.php.

References ILIAS\GlobalScreen\Scope\isAlwaysAvailable().

Referenced by ILIAS\GlobalScreen\Scope\isVisible().

71  : bool
72  {
73  if ($this->isAlwaysAvailable() === true) {
74  return true;
75  }
76  if (is_callable($this->available_callable)) {
77  $callable = $this->available_callable;
78 
79  return (bool) $callable();
80  }
81 
82  return true;
83  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVisible()

ILIAS\GlobalScreen\Scope\isVisible ( )

Definition at line 44 of file VisibilityAvailabilityTrait.php.

References ILIAS\GlobalScreen\Scope\$is_visible_static, ILIAS\GlobalScreen\Scope\$visiblility_callable, and ILIAS\GlobalScreen\Scope\isAvailable().

Referenced by ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\isVisible(), and ilObject2GUI\isVisible().

44  : bool
45  {
46  if (isset($this->is_visible_static)) {
48  }
49  if (!$this->isAvailable()) {
50  return $this->is_visible_static = false;
51  }
52  if (is_callable($this->visiblility_callable)) {
53  $callable = $this->visiblility_callable;
54 
55  $value = (bool) $callable();
56 
57  return $this->is_visible_static = $value;
58  }
59 
60  return $this->is_visible_static = true;
61  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withAvailableCallable()

◆ withTopics()

ILIAS\GlobalScreen\Scope\withTopics ( Topic ...  $topics)

Definition at line 43 of file ComponentDecoratorTrait.php.

References ILIAS\GlobalScreen\Scope\$topics.

43  : self
44  {
45  $this->topics = $topics;
46 
47  return $this;
48  }

◆ withVisibilityCallable()

Variable Documentation

◆ $component_decorator

Closure ILIAS::GlobalScreen::Scope\$component_decorator = null
private

◆ $is_visible_static

bool ILIAS::GlobalScreen::Scope\$is_visible_static = null
private

Definition at line 33 of file VisibilityAvailabilityTrait.php.

Referenced by ILIAS\GlobalScreen\Scope\isVisible().

◆ $symbol_decorator

Closure ILIAS::GlobalScreen::Scope\$symbol_decorator = null
private

◆ $topics

◆ $triggerer_decorator

Closure ILIAS::GlobalScreen::Scope\$triggerer_decorator = null
private

Definition at line 38 of file ComponentDecoratorTrait.php.

◆ $visiblility_callable

Closure ILIAS::GlobalScreen::Scope\$visiblility_callable = null
protected

Definition at line 31 of file VisibilityAvailabilityTrait.php.

Referenced by ILIAS\GlobalScreen\Scope\isVisible().

◆ ComponentDecoratorTrait

trait ILIAS::GlobalScreen::Scope\ComponentDecoratorTrait
Initial value:
{
use CheckClosureTrait
Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 34 of file ComponentDecoratorTrait.php.

◆ VisibilityAvailabilityTrait

trait ILIAS::GlobalScreen::Scope\VisibilityAvailabilityTrait
Initial value:
{
protected ?Closure $available_callable = null
Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 29 of file VisibilityAvailabilityTrait.php.