ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Services.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
22namespace ILIAS\GlobalScreen;
23
35
41{
43
44 private static ?Services $instance = null;
46
47 public string $resource_version = '';
48
54 public function __construct(
55 private ProviderFactory $provider_factory,
56 ?UIServices $ui = null,
57 string $resource_version = ''
58 ) {
59 global $DIC;
60 $this->resource_version = urlencode($resource_version);
61 $this->toast_services = new ToastServices($ui ?? $DIC->ui());
62 }
63
64 public function mainBar(): MainMenuItemFactory
65 {
66 return $this->get(MainMenuItemFactory::class);
67 }
68
69
70 public function metaBar(): MetaBarItemFactory
71 {
72 return $this->get(MetaBarItemFactory::class);
73 }
74
75 public function footer(): FooterItemFactory
76 {
77 return $this->get(FooterItemFactory::class);
78 }
79
84 public function tool(): ToolServices
85 {
86 return $this->get(ToolServices::class);
87 }
88
92 public function layout(): LayoutServices
93 {
94 return $this->getWithArgument(LayoutServices::class, $this->resource_version);
95 }
96
101 {
102 return $this->get(NotificationServices::class);
103 }
104
105 public function toasts(): ToastServices
106 {
108 }
109
113 public function collector(): CollectorFactory
114 {
115 return $this->getWithArgument(CollectorFactory::class, $this->provider_factory);
116 }
117
123 {
124 return $this->getWithArgument(IdentificationFactory::class, $this->provider_factory);
125 }
126}
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
Class MetaBarItemFactory This factory provides you all available types for MainMenu GlobalScreen Item...
ToastServices $toast_services
Definition: Services.php:45
__construct(private ProviderFactory $provider_factory, ?UIServices $ui=null, string $resource_version='')
Services constructor.
Definition: Services.php:54
static Services $instance
Definition: Services.php:44
trait SingletonTrait
Class SingletonTrait.
@noinspection PhpIncompatibleReturnTypeInspection
getWithArgument(string $class_name, $argument)
global $DIC
Definition: shib_login.php:26