19declare(strict_types=1);
26use Psr\Http\Message\ServerRequestInterface;
50 $this->
ctrl = $DIC[
'ilCtrl'];
51 $this->
lng = $DIC[
'lng'];
52 $this->tpl =
$DIC[
'tpl'];
53 $this->rbabsystem =
$DIC[
'rbacsystem'];
54 $this->ui_factory =
$DIC[
'ui.factory'];
55 $this->ui_renderer =
$DIC[
'ui.renderer'];
56 $this->request =
$DIC[
'http']->request();
62 $this->
lng->loadLanguageModule(
'usr');
67 $this->action_context = $a_val;
77 $next_class = $this->
ctrl->getNextClass($this);
78 $cmd = $this->
ctrl->getCmd(
'show');
80 switch ($next_class) {
82 if (in_array($cmd, [
'show',
'save'])) {
88 public function show(): void
90 if (!$this->rbabsystem->checkAccess(
'read', $this->ref_id)) {
91 $this->
ctrl->redirectByClass(ilObjRootFolderGUI::class);
94 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'user_actions_activation_info'));
96 $this->tpl->setContent(
97 $this->ui_renderer->render(
108 $inputs[
"{$action['action_comp_id']}:{$action['action_type_id']}"] =
109 $this->ui_factory->input()->field()->checkbox($action[
"action_type_name"])
111 !$this->rbabsystem->checkAccess(
'write', $this->ref_id)
112 )->withValue($action[
'active']);
115 return $this->ui_factory->input()->container()->form()->standard(
116 $this->
ctrl->getFormActionByClass(self::class,
'save'),
123 if (!$this->rbabsystem->checkAccess(
'write', $this->ref_id)) {
124 $this->tpl->setOnScreenMessage(
126 $this->
lng->txt(
'no_permission'),
129 $this->
ctrl->redirectByClass(self::class,
'show');
132 $form = $this->
buildForm()->withRequest($this->request);
133 $data = $form->getData();
134 if (
$data ===
null) {
135 $this->tpl->setContent($this->ui_renderer->render($form));
140 $this->user_action_admin->activateAction(
141 $this->action_context->getComponentId(),
142 $this->action_context->getContextId(),
143 $action[
'action_comp_id'],
144 $action[
'action_type_id'],
145 $data[
"{$action['action_comp_id']}:{$action['action_type_id']}"] ??
false
148 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
155 foreach ($p->getActionTypes() as
$id => $name) {
157 'action_comp_id' => $p->getComponentId(),
158 'action_type_id' =>
$id,
159 'action_type_name' => $name,
160 'active' => $this->user_action_admin->isActionActive(
161 $this->action_context->getComponentId(),
162 $this->action_context->getContextId(),
163 $p->getComponentId(),
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Builds a Color from either hex- or rgb values.
Class ilCtrl provides processing control methods.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
User action administration GUI class.
ilUserActionAdmin $user_action_admin
setActionContext(?ilUserActionContext $a_val=null)
ServerRequestInterface $request
ilUserActionContext $action_context
ilGlobalTemplateInterface $tpl
User action administration.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An entity that renders components to a string output.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
@ FAILURE
The progress of the process/task cannot be calculated (yet), but it has started processing.