ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilUserActionAdminGUI Class Reference

User action administration GUI class. More...

+ Collaboration diagram for ilUserActionAdminGUI:

Public Member Functions

 __construct (int $ref_id)
 
 setActionContext (ilUserActionContext $a_val=null)
 
 getActionContext ()
 
 executeCommand ()
 
 show ()
 
 save ()
 Save !!!! note in the future this must depend on the context, currently we only have one. More...
 
 getActions ()
 Get actions, !!!! note in the future this must depend on the context, currently we only have one. More...
 

Private Attributes

ilRbacSystem $rbabsystem
 
int $ref_id
 
UserGUIRequest $request
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilUserActionContext $action_context
 
ilUserActionAdmin $user_action_admin
 

Detailed Description

User action administration GUI class.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 27 of file class.ilUserActionAdminGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserActionAdminGUI::__construct ( int  $ref_id)

Definition at line 38 of file class.ilUserActionAdminGUI.php.

References $DIC, $ref_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

39  {
40  global $DIC;
41 
42  $this->ctrl = $DIC->ctrl();
43  $this->lng = $DIC->language();
44  $this->tpl = $DIC["tpl"];
45  $this->ref_id = $ref_id;
46  $this->rbabsystem = $DIC->rbac()->system();
47  $this->lng->loadLanguageModule("usr");
48  $this->request = new UserGUIRequest(
49  $DIC->http(),
50  $DIC->refinery()
51  );
52  $this->user_action_admin = new ilUserActionAdmin($DIC['ilDB']);
53  }
global $DIC
Definition: feed.php:28
User action administration.
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilUserActionAdminGUI::executeCommand ( )

Definition at line 65 of file class.ilUserActionAdminGUI.php.

References ILIAS\Repository\ctrl().

65  : void
66  {
67  $next_class = $this->ctrl->getNextClass($this);
68  $cmd = $this->ctrl->getCmd("show");
69 
70  switch ($next_class) {
71  default:
72  if (in_array($cmd, ["show", "save"])) {
73  $this->$cmd();
74  }
75  }
76  }
+ Here is the call graph for this function:

◆ getActionContext()

ilUserActionAdminGUI::getActionContext ( )

Definition at line 60 of file class.ilUserActionAdminGUI.php.

References $action_context.

61  {
62  return $this->action_context;
63  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilUserActionContext $action_context

◆ getActions()

ilUserActionAdminGUI::getActions ( )

Get actions, !!!! note in the future this must depend on the context, currently we only have one.

Returns
array[]

Definition at line 118 of file class.ilUserActionAdminGUI.php.

References $data, and $id.

Referenced by save(), and show().

118  : array
119  {
120  $data = [];
121  $action_provider_factory = new ilUserActionProviderFactory();
122  foreach ($action_provider_factory->getProviders() as $p) {
123  foreach ($p->getActionTypes() as $id => $name) {
124  $data[] = [
125  "action_comp_id" => $p->getComponentId(),
126  "action_type_id" => $id,
127  "action_type_name" => $name,
128  "active" => $this->user_action_admin->isActionActive(
129  $this->action_context->getComponentId(),
130  $this->action_context->getContextId(),
131  $p->getComponentId(),
132  $id
133  )
134  ];
135  }
136  }
137  return $data;
138  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

◆ save()

ilUserActionAdminGUI::save ( )

Save !!!! note in the future this must depend on the context, currently we only have one.

Definition at line 94 of file class.ilUserActionAdminGUI.php.

References Vendor\Package\$a, ILIAS\Repository\ctrl(), getActions(), and ILIAS\Repository\lng().

94  : void
95  {
96  if (!$this->rbabsystem->checkAccess("write", $this->ref_id)) {
97  $this->ctrl->redirect($this, "show");
98  }
99 
100  $active = $this->request->getActionActive();
101  foreach ($this->getActions() as $a) {
102  $this->user_action_admin->activateAction(
103  $this->action_context->getComponentId(),
104  $this->action_context->getContextId(),
105  $a["action_comp_id"],
106  $a["action_type_id"],
107  (bool) ($active[$a["action_comp_id"] . ":" . $a["action_type_id"]] ?? false)
108  );
109  }
110  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
111  $this->ctrl->redirect($this, "show");
112  }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
getActions()
Get actions, !!!! note in the future this must depend on the context, currently we only have one...
+ Here is the call graph for this function:

◆ setActionContext()

ilUserActionAdminGUI::setActionContext ( ilUserActionContext  $a_val = null)

Definition at line 55 of file class.ilUserActionAdminGUI.php.

Referenced by ilMembershipAdministrationGUI\executeCommand().

55  : void
56  {
57  $this->action_context = $a_val;
58  }
+ Here is the caller graph for this function:

◆ show()

ilUserActionAdminGUI::show ( )

Definition at line 78 of file class.ilUserActionAdminGUI.php.

References getActions(), and ILIAS\Repository\lng().

78  : void
79  {
80  $this->tpl->setOnScreenMessage('info', $this->lng->txt("user_actions_activation_info"));
81 
82  $tab = new ilUserActionAdminTableGUI(
83  $this,
84  "show",
85  $this->getActions(),
86  $this->rbabsystem->checkAccess("write", $this->ref_id)
87  );
88  $this->tpl->setContent($tab->getHTML());
89  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getActions()
Get actions, !!!! note in the future this must depend on the context, currently we only have one...
+ Here is the call graph for this function:

Field Documentation

◆ $action_context

ilUserActionContext ilUserActionAdminGUI::$action_context
private

Definition at line 35 of file class.ilUserActionAdminGUI.php.

Referenced by getActionContext().

◆ $ctrl

ilCtrl ilUserActionAdminGUI::$ctrl
private

Definition at line 32 of file class.ilUserActionAdminGUI.php.

◆ $lng

ilLanguage ilUserActionAdminGUI::$lng
private

Definition at line 34 of file class.ilUserActionAdminGUI.php.

◆ $rbabsystem

ilRbacSystem ilUserActionAdminGUI::$rbabsystem
private

Definition at line 29 of file class.ilUserActionAdminGUI.php.

◆ $ref_id

int ilUserActionAdminGUI::$ref_id
private

Definition at line 30 of file class.ilUserActionAdminGUI.php.

Referenced by __construct().

◆ $request

UserGUIRequest ilUserActionAdminGUI::$request
private

Definition at line 31 of file class.ilUserActionAdminGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilUserActionAdminGUI::$tpl
private

Definition at line 33 of file class.ilUserActionAdminGUI.php.

◆ $user_action_admin

ilUserActionAdmin ilUserActionAdminGUI::$user_action_admin
private

Definition at line 36 of file class.ilUserActionAdminGUI.php.


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