ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\GlobalScreen\GUI\Pons Class Reference
+ Collaboration diagram for ILIAS\GlobalScreen\GUI\Pons:

Public Member Functions

 __construct (Services $http, UIServices $ui_services, private \ilCtrlInterface $ctrl, Refinery\Factory $refinery, Factory $data_factory, \ilLanguage $lng, RBACServices $rbac_services, \ilObjUser $user, \ilTabsGUI $tabs, \ilToolbarGUI $toolbar, array $language_modules=[], ?TranslationsRepository $translations_repository=null,)
 
 handle (string $entry_tab, array $post_handling_classes=[])
 
 in ()
 
 i18n ()
 
 out ()
 
 flow ()
 
 access ()
 
 tabs ()
 
 latestGUI ()
 

Static Public Member Functions

static fromDIC (array $language_modules=[], ?TranslationsRepository $translations_repository=null,)
 @description this is only for convenience, but the constructor is still public and testing is possible as well More...
 

Private Attributes

Input $input
 
Translator $translator
 
Output $output
 
Flow $flow
 
Access $access
 
Tabs $tabs
 
PonsGUI $latest_gui = null
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 43 of file Pons.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\GUI\Pons::__construct ( Services  $http,
UIServices  $ui_services,
private \ilCtrlInterface  $ctrl,
Refinery\Factory  $refinery,
Factory  $data_factory,
\ilLanguage  $lng,
RBACServices  $rbac_services,
\ilObjUser  $user,
\ilTabsGUI  $tabs,
\ilToolbarGUI  $toolbar,
array  $language_modules = [],
?TranslationsRepository  $translations_repository = null 
)

Definition at line 53 of file Pons.php.

66 {
67 $this->flow = new Flow(
68 $http,
69 $ctrl,
70 );
71
72 $this->input = new Input(
73 $http,
75 $data_factory,
76 $lng,
77 $this->flow
78 );
79
80 $this->translator = new Translator(
81 $lng,
82 $translations_repository,
83 ...$language_modules
84 );
85
86 $this->tabs = new Tabs(
87 $this->translator,
88 $ctrl,
89 $tabs,
90 $this->flow
91 );
92
93 $this->output = new Output(
94 $ui_services,
95 $http,
96 $this->translator,
97 $this->tabs,
98 $toolbar
99 );
100
101 $this->access = new Access(
102 $rbac_services,
103 $http,
104 $refinery,
105 );
106 }
$http
Definition: deliver.php:30
global $lng
Definition: privfeed.php:31

References $http, $lng, ILIAS\UI\examples\Layout\Page\Standard\$refinery, ILIAS\GlobalScreen\GUI\Pons\$tabs, ILIAS\GlobalScreen\GUI\Pons\access(), ILIAS\GlobalScreen\GUI\Pons\flow(), and ILIAS\GlobalScreen\GUI\Pons\tabs().

+ Here is the call graph for this function:

Member Function Documentation

◆ access()

ILIAS\GlobalScreen\GUI\Pons::access ( )

Definition at line 193 of file Pons.php.

193 : Access
194 {
195 return $this->access;
196 }

References ILIAS\GlobalScreen\GUI\Pons\$access.

Referenced by ILIAS\GlobalScreen\GUI\Pons\__construct(), and ILIAS\GlobalScreen\GUI\Pons\handle().

+ Here is the caller graph for this function:

◆ flow()

ILIAS\GlobalScreen\GUI\Pons::flow ( )

Definition at line 188 of file Pons.php.

188 : Flow
189 {
190 return $this->flow;
191 }

References ILIAS\GlobalScreen\GUI\Pons\$flow.

Referenced by ILIAS\GlobalScreen\GUI\Pons\__construct(), and ILIAS\GlobalScreen\GUI\Pons\handle().

+ Here is the caller graph for this function:

◆ fromDIC()

static ILIAS\GlobalScreen\GUI\Pons::fromDIC ( array  $language_modules = [],
?TranslationsRepository  $translations_repository = null 
)
static

@description this is only for convenience, but the constructor is still public and testing is possible as well

Definition at line 211 of file Pons.php.

214 : self {
215 global $DIC;
216 return new self(
217 $DIC->http(),
218 $DIC->ui(),
219 $DIC->ctrl(),
220 $DIC->refinery(),
221 new Factory(),
222 $DIC->language(),
223 $DIC->rbac(),
224 $DIC->user(),
225 $DIC['ilTabs'],
226 $DIC['ilToolbar'],
227 $language_modules,
228 $translations_repository
229 );
230 }
Builds data types.
Definition: Factory.php:36
global $DIC
Definition: shib_login.php:26

◆ handle()

ILIAS\GlobalScreen\GUI\Pons::handle ( string  $entry_tab,
array  $post_handling_classes = [] 
)

Definition at line 108 of file Pons.php.

108 : bool
109 {
110 $next_class = $this->ctrl->getNextClass();
111 $tab = $this->tabs->structure()->getById($entry_tab);
112
113 if (empty($next_class)) {
114 if ($tab === null) {
115 throw new \RuntimeException('Handling Class not found');
116 }
117
118 $this->tabs->activate($entry_tab);
119
120 return false; // we delegate this further
121 }
122 if ($next_class === strtolower(MultiLanguageGUI::class)) {
123 if ($this->latest_gui !== null) {
124 $item = $this->latest_gui->getCurrentItem();
125 $back_target = $this->flow->getTargetURI(
126 $tab?->getHandlingClass() ?? ''
127 );
128 }
129
130 $back_target ??= $this->flow->getParentAsURI('');
131 $this->ctrl->forwardCommand(
132 new MultiLanguageGUI(
133 $this,
134 $item instanceof TranslatableItem ? $item : null,
135 $back_target,
136 )
137 );
138 return true;
139 }
140
141 if (in_array(strtolower($next_class), array_map('strtolower', $post_handling_classes), true)) {
142 return false; // we delegate this further
143 }
144
145 $tab = $this->tabs->structure()->getByHandlingClass($next_class);
146
147 if ($tab === null) {
148 throw new \RuntimeException("Handling Class `$next_class` not found");
149 }
150
151 // check permissions
152 $this->access->require($tab->getPermission());
153
154 $handling_class = $tab->getHandlingClass();
155 if (is_a($handling_class, PonsGUI::class, true)) {
156 $this->latest_gui = new $handling_class($this);
157
158 // try to check access early
159 $command = $this->flow->getCommand(PonsGUI::CMD_DEFAULT);
160 if (method_exists($this->latest_gui, $command)) {
161 $method = new \ReflectionMethod($this->latest_gui, $command);
162 $attributes = $method->getAttributes(Command::class);
163 foreach ($attributes as $attribute) {
164 $instance = $attribute->newInstance();
165 $this->access->require($instance->getPermissions());
166 }
167 }
168 }
169
170 return (bool) $this->ctrl->forwardCommand($this->latest_gui);
171 }

References ILIAS\GlobalScreen\GUI\Pons\access(), ILIAS\GlobalScreen\GUI\PonsGUI\CMD_DEFAULT, ILIAS\Repository\ctrl(), ILIAS\GlobalScreen\GUI\Pons\flow(), and ILIAS\GlobalScreen\GUI\Pons\tabs().

+ Here is the call graph for this function:

◆ i18n()

ILIAS\GlobalScreen\GUI\Pons::i18n ( )

◆ in()

ILIAS\GlobalScreen\GUI\Pons::in ( )

◆ latestGUI()

ILIAS\GlobalScreen\GUI\Pons::latestGUI ( )

Definition at line 203 of file Pons.php.

203 : ?PonsGUI
204 {
205 return $this->latest_gui;
206 }

References ILIAS\GlobalScreen\GUI\Pons\$latest_gui.

◆ out()

ILIAS\GlobalScreen\GUI\Pons::out ( )

Definition at line 183 of file Pons.php.

183 : Output
184 {
185 return $this->output;
186 }

References ILIAS\GlobalScreen\GUI\Pons\$output.

Referenced by ILIAS\GlobalScreen\UI\Footer\Entries\EntriesTable\__construct(), and ILIAS\GlobalScreen\UI\Footer\Groups\GroupsTable\__construct().

+ Here is the caller graph for this function:

◆ tabs()

ILIAS\GlobalScreen\GUI\Pons::tabs ( )

Definition at line 198 of file Pons.php.

198 : Tabs
199 {
200 return $this->tabs;
201 }

References ILIAS\GlobalScreen\GUI\Pons\$tabs.

Referenced by ILIAS\GlobalScreen\GUI\Pons\__construct(), ILIAS\GlobalScreen\GUI\Pons\handle(), and ilMMItemTranslationRepository\retrieveCurrent().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

Access ILIAS\GlobalScreen\GUI\Pons::$access
private

Definition at line 49 of file Pons.php.

Referenced by ILIAS\GlobalScreen\GUI\Pons\access().

◆ $flow

Flow ILIAS\GlobalScreen\GUI\Pons::$flow
private

Definition at line 48 of file Pons.php.

Referenced by ILIAS\GlobalScreen\GUI\Pons\flow().

◆ $input

Input ILIAS\GlobalScreen\GUI\Pons::$input
private

Definition at line 45 of file Pons.php.

Referenced by ILIAS\GlobalScreen\GUI\Pons\in().

◆ $latest_gui

PonsGUI ILIAS\GlobalScreen\GUI\Pons::$latest_gui = null
private

Definition at line 51 of file Pons.php.

Referenced by ILIAS\GlobalScreen\GUI\Pons\latestGUI().

◆ $output

Output ILIAS\GlobalScreen\GUI\Pons::$output
private

Definition at line 47 of file Pons.php.

Referenced by ILIAS\GlobalScreen\GUI\Pons\out().

◆ $tabs

Tabs ILIAS\GlobalScreen\GUI\Pons::$tabs
private

◆ $translator

Translator ILIAS\GlobalScreen\GUI\Pons::$translator
private

Definition at line 46 of file Pons.php.

Referenced by ILIAS\GlobalScreen\GUI\Pons\i18n().


The documentation for this class was generated from the following file: