ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 53 of file ComponentDecoratorTrait.php.

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

53  : self
54  {
55  $this->checkClosureForSignature($component_decorator, Component::class);
56 
57  if ($this->component_decorator instanceof Closure) {
58  $existing = $this->component_decorator;
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

◆ addSymbolDecorator()

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

Definition at line 79 of file ComponentDecoratorTrait.php.

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

79  : isDecorateable
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  }
$c
Definition: deliver.php:25

◆ getComponentDecorator()

ILIAS\GlobalScreen\Scope\getComponentDecorator ( )

◆ getSymbolDecorator()

ILIAS\GlobalScreen\Scope\getSymbolDecorator ( )

Definition at line 97 of file ComponentDecoratorTrait.php.

References ILIAS\GlobalScreen\Scope\$symbol_decorator.

97  : ?Closure
98  {
100  }

◆ getTopics()

ILIAS\GlobalScreen\Scope\getTopics ( )

Definition at line 48 of file ComponentDecoratorTrait.php.

References ILIAS\GlobalScreen\Scope\$topics.

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

◆ 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 41 of file ComponentDecoratorTrait.php.

References ILIAS\GlobalScreen\Scope\$topics.

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

◆ 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 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 32 of file ComponentDecoratorTrait.php.

◆ VisibilityAvailabilityTrait

trait ILIAS::GlobalScreen::Scope\VisibilityAvailabilityTrait
Initial value:
{
protected ?Closure $available_callable = null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return 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.