ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI Class Reference
+ Collaboration diagram for ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI:

Public Member Functions

 __construct (protected URI $link_to_parent, protected ilCtrlInterface $ctrl, protected ilGlobalTemplateInterface $tpl, protected UIFactory $ui_factory, protected UIRenderer $ui_renderer, protected RequestParserInterface $request_parser, protected ContentFactoryInterface $content_factory, protected PresentationUtilities $presentation_utilities, protected StateInfoFetcherInterface $state_info_fetcher, protected PublisherInterface $state_changer, protected PublishingSettings $publishing_settings, protected StaticURL $static_url, protected DataFactory $data_factory, protected ObjectHandler $object_handler)
 
 executeCommand ()
 

Protected Member Functions

 isCommandAvailable (Command $cmd)
 Includes access checks via StateInfo. More...
 
 view ()
 
 block ()
 
 unblock ()
 
 publish ()
 
 withdraw ()
 
 confirmWithdraw ()
 
 submit ()
 
 accept ()
 
 confirmAccept ()
 
 reject ()
 
 confirmReject ()
 
 getRedirectTargetAfterDeletion (int $fallback_ref_id)
 
 showSuccessMessageAfterRedirect (Action $action)
 

Protected Attributes

int $ref_id
 
int $obj_id
 
string $type
 
StateInfoInterface $state_info
 

Detailed Description

Definition at line 42 of file ControlCenterGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::__construct ( protected URI  $link_to_parent,
protected ilCtrlInterface  $ctrl,
protected ilGlobalTemplateInterface  $tpl,
protected UIFactory  $ui_factory,
protected UIRenderer  $ui_renderer,
protected RequestParserInterface  $request_parser,
protected ContentFactoryInterface  $content_factory,
protected PresentationUtilities  $presentation_utilities,
protected StateInfoFetcherInterface  $state_info_fetcher,
protected PublisherInterface  $state_changer,
protected PublishingSettings  $publishing_settings,
protected StaticURL  $static_url,
protected DataFactory  $data_factory,
protected ObjectHandler  $object_handler 
)

Definition at line 49 of file ControlCenterGUI.php.

64 {
65 $this->ref_id = $this->request_parser->fetchRefID();
66 $this->obj_id = $this->request_parser->fetchObjID();
67 $this->type = $this->request_parser->fetchType();
68 $this->state_info = $this->state_info_fetcher->getStateInfoForObjectReference(
69 $this->ref_id,
70 $this->obj_id,
71 $this->type
72 );
73 }

Member Function Documentation

◆ accept()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::accept ( )
protected

Definition at line 174 of file ControlCenterGUI.php.

174 : void
175 {
176 $content = $this->content_factory->getConfirmationContent(
177 $this->ref_id,
178 $this->obj_id,
179 $this->type,
180 Action::ACCEPT,
181 $this->object_handler->isOnlyReference($this->ref_id)
182 );
183 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->show($content));
184 exit;
185 }
exit

References exit.

◆ block()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::block ( )
protected

Definition at line 119 of file ControlCenterGUI.php.

119 : void
120 {
121 $this->state_changer->block($this->obj_id);
122 $this->showSuccessMessageAfterRedirect(Action::BLOCK);
123 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->redirect($this->link_to_parent));
124 exit;
125 }

References exit, and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\showSuccessMessageAfterRedirect().

+ Here is the call graph for this function:

◆ confirmAccept()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::confirmAccept ( )
protected

Definition at line 187 of file ControlCenterGUI.php.

187 : void
188 {
189 $this->state_changer->accept($this->obj_id, $this->type);
190
191 $this->showSuccessMessageAfterRedirect(Action::ACCEPT);
192 $link = $this->getRedirectTargetAfterDeletion($this->publishing_settings->getContainerRefIDForEditorialStep());
193 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->redirect($link));
194 exit;
195 }

References exit, ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\getRedirectTargetAfterDeletion(), and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\showSuccessMessageAfterRedirect().

+ Here is the call graph for this function:

◆ confirmReject()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::confirmReject ( )
protected

Definition at line 210 of file ControlCenterGUI.php.

210 : void
211 {
212 $this->state_changer->reject($this->obj_id);
213
215 $link = $this->getRedirectTargetAfterDeletion($this->publishing_settings->getContainerRefIDForEditorialStep());
216 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->redirect($link));
217 exit;
218 }

References exit, ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\getRedirectTargetAfterDeletion(), ILIAS\MetaData\OERHarvester\ControlCenter\State\REJECT, and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\showSuccessMessageAfterRedirect().

+ Here is the call graph for this function:

◆ confirmWithdraw()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::confirmWithdraw ( )
protected

Definition at line 156 of file ControlCenterGUI.php.

156 : void
157 {
158 $this->state_changer->withdraw($this->obj_id);
159
160 $this->showSuccessMessageAfterRedirect(Action::WITHDRAW);
161 $link = $this->getRedirectTargetAfterDeletion($this->publishing_settings->getContainerRefIDForPublishing());
162 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->redirect($link));
163 exit;
164 }

References exit, ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\getRedirectTargetAfterDeletion(), and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\showSuccessMessageAfterRedirect().

+ Here is the call graph for this function:

◆ executeCommand()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::executeCommand ( )

Definition at line 75 of file ControlCenterGUI.php.

75 : void
76 {
77 $next_class = $this->ctrl->getNextClass($this);
78
79 $cmd = Command::tryFrom($this->ctrl->getCmd());
80 switch ($next_class) {
81 default:
82 if (!$cmd || !$this->isCommandAvailable($cmd)) {
83 throw new ilPermissionException($this->presentation_utilities->txt('permission_denied'));
84 }
85 $cmd_value = $cmd->value;
86 $this->$cmd_value();
87 break;
88 }
89 }
isCommandAvailable(Command $cmd)
Includes access checks via StateInfo.

References ILIAS\Repository\ctrl(), and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\isCommandAvailable().

+ Here is the call graph for this function:

◆ getRedirectTargetAfterDeletion()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::getRedirectTargetAfterDeletion ( int  $fallback_ref_id)
protected

Definition at line 220 of file ControlCenterGUI.php.

220 : URI
221 {
222 if ($this->object_handler->doesReferenceExist($this->ref_id)) {
223 return $this->link_to_parent;
224 }
225 return $this->static_url->builder()->build('cat', $this->data_factory->refId($fallback_ref_id));
226 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35

Referenced by ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\confirmAccept(), ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\confirmReject(), and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\confirmWithdraw().

+ Here is the caller graph for this function:

◆ isCommandAvailable()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::isCommandAvailable ( Command  $cmd)
protected

Includes access checks via StateInfo.

Definition at line 94 of file ControlCenterGUI.php.

94 : bool
95 {
96 if (!$this->state_info->isPublishingRelevant()) {
97 return false;
98 }
99
100 return match ($cmd) {
101 Command::VIEW => true,
102 Command::BLOCK => $this->state_info->isActionAvailable(Action::BLOCK),
103 Command::UNBLOCK => $this->state_info->isActionAvailable(Action::UNBLOCK),
104 Command::PUBLISH => $this->state_info->isActionAvailable(Action::PUBLISH),
105 Command::WITHDRAW, Command::CONFIRM_WITHDRAW => $this->state_info->isActionAvailable(Action::WITHDRAW),
106 Command::SUBMIT => $this->state_info->isActionAvailable(Action::SUBMIT),
107 Command::ACCEPT, Command::CONFIRM_ACCEPT => $this->state_info->isActionAvailable(Action::ACCEPT),
108 Command::REJECT, Command::CONFIRM_REJECT => $this->state_info->isActionAvailable(Action::REJECT)
109 };
110 }

References ILIAS\MetaData\OERHarvester\ControlCenter\CONFIRM_REJECT, and ILIAS\MetaData\OERHarvester\ControlCenter\State\REJECT.

Referenced by ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\executeCommand().

+ Here is the caller graph for this function:

◆ publish()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::publish ( )
protected

Definition at line 135 of file ControlCenterGUI.php.

135 : void
136 {
137 $this->state_changer->publish($this->obj_id, $this->type);
138 $this->showSuccessMessageAfterRedirect(Action::PUBLISH);
139 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->redirect($this->link_to_parent));
140 exit;
141 }

References exit, and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\showSuccessMessageAfterRedirect().

+ Here is the call graph for this function:

◆ reject()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::reject ( )
protected

Definition at line 197 of file ControlCenterGUI.php.

197 : void
198 {
199 $content = $this->content_factory->getConfirmationContent(
200 $this->ref_id,
201 $this->obj_id,
202 $this->type,
204 $this->object_handler->isOnlyReference($this->ref_id)
205 );
206 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->show($content));
207 exit;
208 }

References exit, and ILIAS\MetaData\OERHarvester\ControlCenter\State\REJECT.

◆ showSuccessMessageAfterRedirect()

◆ submit()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::submit ( )
protected

Definition at line 166 of file ControlCenterGUI.php.

166 : void
167 {
168 $this->state_changer->submit($this->obj_id);
169 $this->showSuccessMessageAfterRedirect(Action::SUBMIT);
170 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->redirect($this->link_to_parent));
171 exit;
172 }

References exit, and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\showSuccessMessageAfterRedirect().

+ Here is the call graph for this function:

◆ unblock()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::unblock ( )
protected

Definition at line 127 of file ControlCenterGUI.php.

127 : void
128 {
129 $this->state_changer->unblock($this->obj_id);
130 $this->showSuccessMessageAfterRedirect(Action::UNBLOCK);
131 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->redirect($this->link_to_parent));
132 exit;
133 }

References exit, and ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI\showSuccessMessageAfterRedirect().

+ Here is the call graph for this function:

◆ view()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::view ( )
protected

Definition at line 112 of file ControlCenterGUI.php.

112 : void
113 {
114 $content = $this->content_factory->getInfoContent($this->ref_id, $this->obj_id, $this->type, $this->state_info);
115 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->show($content));
116 exit;
117 }

References exit.

◆ withdraw()

ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::withdraw ( )
protected

Definition at line 143 of file ControlCenterGUI.php.

143 : void
144 {
145 $content = $this->content_factory->getConfirmationContent(
146 $this->ref_id,
147 $this->obj_id,
148 $this->type,
149 Action::WITHDRAW,
150 $this->object_handler->isOnlyReference($this->ref_id)
151 );
152 echo $this->ui_renderer->renderAsync($this->ui_factory->prompt()->state()->show($content));
153 exit;
154 }

References exit.

Field Documentation

◆ $obj_id

int ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::$obj_id
protected

Definition at line 45 of file ControlCenterGUI.php.

◆ $ref_id

int ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::$ref_id
protected

Definition at line 44 of file ControlCenterGUI.php.

◆ $state_info

StateInfoInterface ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::$state_info
protected

Definition at line 47 of file ControlCenterGUI.php.

◆ $type

string ILIAS\MetaData\OERHarvester\ControlCenter\ControlCenterGUI::$type
protected

Definition at line 46 of file ControlCenterGUI.php.


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