ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\GlobalScreen\Scope Namespace Reference

Namespaces

namespace  Layout
 @noinspection PhpIncompatibleReturnTypeInspection
 
namespace  Notification
 @noinspection PhpIncompatibleReturnTypeInspection
 
namespace  Toast
 
namespace  Tool
 @noinspection 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 53 of file ComponentDecoratorTrait.php.

53 : self
54 {
55 $this->checkClosureForSignature($component_decorator, Component::class);
56
57 if ($this->component_decorator instanceof Closure) {
59 $this->component_decorator = static function (Component $c) use (
61 $existing
62 ): Component {
63 $component = $existing($c);
64
65 return $component_decorator($component);
66 };
67 } else {
68 $this->component_decorator = $component_decorator;
69 }
70
71 return $this;
72 }
$c
Definition: deliver.php:25

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

◆ addSymbolDecorator()

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

Definition at line 79 of file ComponentDecoratorTrait.php.

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

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

◆ getComponentDecorator()

ILIAS\GlobalScreen\Scope\getComponentDecorator ( )

Definition at line 74 of file ComponentDecoratorTrait.php.

74 : ?Closure
75 {
77 }

References ILIAS\GlobalScreen\Scope\$component_decorator.

◆ getSymbolDecorator()

ILIAS\GlobalScreen\Scope\getSymbolDecorator ( )

Definition at line 97 of file ComponentDecoratorTrait.php.

97 : ?Closure
98 {
100 }

References ILIAS\GlobalScreen\Scope\$symbol_decorator.

◆ getTopics()

ILIAS\GlobalScreen\Scope\getTopics ( )

Definition at line 48 of file ComponentDecoratorTrait.php.

48 : array
49 {
50 return $this->topics;
51 }

References ILIAS\GlobalScreen\Scope\$topics.

◆ isAlwaysAvailable()

ILIAS\GlobalScreen\Scope\isAlwaysAvailable ( )

Definition at line 85 of file VisibilityAvailabilityTrait.php.

85 : bool
86 {
87 return false;
88 }

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

+ Here is the caller graph for this function:

◆ isAvailable()

ILIAS\GlobalScreen\Scope\isAvailable ( )

Definition at line 71 of file VisibilityAvailabilityTrait.php.

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 }

References ILIAS\GlobalScreen\Scope\isAlwaysAvailable().

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

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

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)) {
54
55 $value = (bool) $callable();
56
57 return $this->is_visible_static = $value;
58 }
59
60 return $this->is_visible_static = true;
61 }

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

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

◆ withAvailableCallable()

ILIAS\GlobalScreen\Scope\withAvailableCallable ( callable  $is_available)

Definition at line 63 of file VisibilityAvailabilityTrait.php.

63 : self
64 {
65 $clone = clone($this);
66 $clone->available_callable = $is_available;
67
68 return $clone;
69 }

Referenced by ILIAS\Notifications\Provider\NotificationCenterProvider\getMetaBarItems(), ILIAS\Chatroom\Provider\ChatMainBarProvider\getStaticSubItems(), and ILIAS\MainMenu\Provider\StandardTopItemsProvider\getStaticTopItems().

+ Here is the caller graph for this function:

◆ withTopics()

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

Definition at line 41 of file ComponentDecoratorTrait.php.

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

References ILIAS\GlobalScreen\Scope\$topics.

◆ withVisibilityCallable()

ILIAS\GlobalScreen\Scope\withVisibilityCallable ( callable  $is_visible)

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 36 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 31 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 28 of file VisibilityAvailabilityTrait.php.