ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUserActionAdminGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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...
 

Protected Attributes

ilRbacSystem $rbabsystem
 
int $ref_id
 
ILIAS User StandardGUIRequest $request
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilUserActionContext $action_context
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning User action administration GUI class

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

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

Constructor & Destructor Documentation

◆ __construct()

ilUserActionAdminGUI::__construct ( int  $ref_id)

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

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

34  {
35  global $DIC;
36 
37  $this->ctrl = $DIC->ctrl();
38  $this->lng = $DIC->language();
39  $this->tpl = $DIC["tpl"];
40  $this->ref_id = $ref_id;
41  $this->rbabsystem = $DIC->rbac()->system();
42 
43  $this->lng->loadLanguageModule("usr");
44  $this->request = new \ILIAS\User\StandardGUIRequest(
45  $DIC->http(),
46  $DIC->refinery()
47  );
48  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilUserActionAdminGUI::executeCommand ( )

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

References ILIAS\Repository\ctrl().

60  : void
61  {
62  $next_class = $this->ctrl->getNextClass($this);
63  $cmd = $this->ctrl->getCmd("show");
64 
65  switch ($next_class) {
66  default:
67  if (in_array($cmd, array("show", "save"))) {
68  $this->$cmd();
69  }
70  }
71  }
+ Here is the call graph for this function:

◆ getActionContext()

ilUserActionAdminGUI::getActionContext ( )

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

References $action_context.

56  {
57  return $this->action_context;
58  }
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 113 of file class.ilUserActionAdminGUI.php.

References $data, $id, $name, ilUserActionProviderFactory\getAllProviders(), and ilUserActionAdmin\lookupActive().

Referenced by save(), and show().

113  : array
114  {
115  $data = array();
117  foreach ($p->getActionTypes() as $id => $name) {
118  $data[] = array(
119  "action_comp_id" => $p->getComponentId(),
120  "action_type_id" => $id,
121  "action_type_name" => $name,
123  $this->action_context->getComponentId(),
124  $this->action_context->getContextId(),
125  $p->getComponentId(),
126  $id
127  )
128  );
129  }
130  }
131  return $data;
132  }
static getAllProviders()
Get all action providers.
if($format !==null) $name
Definition: metadata.php:247
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static lookupActive(string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type)
+ Here is the call graph for this function:
+ 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 89 of file class.ilUserActionAdminGUI.php.

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

89  : void
90  {
91  if (!$this->rbabsystem->checkAccess("write", $this->ref_id)) {
92  $this->ctrl->redirect($this, "show");
93  }
94 
95  $active = $this->request->getActionActive();
96  foreach ($this->getActions() as $a) {
98  $this->action_context->getComponentId(),
99  $this->action_context->getContextId(),
100  $a["action_comp_id"],
101  $a["action_type_id"],
102  (bool) ($active[$a["action_comp_id"] . ":" . $a["action_type_id"]] ?? false)
103  );
104  }
105  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
106  $this->ctrl->redirect($this, "show");
107  }
static activateAction(string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type, bool $a_active)
$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 50 of file class.ilUserActionAdminGUI.php.

Referenced by ilMembershipAdministrationGUI\executeCommand().

50  : void
51  {
52  $this->action_context = $a_val;
53  }
+ Here is the caller graph for this function:

◆ show()

ilUserActionAdminGUI::show ( )

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

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

73  : void
74  {
75  $this->tpl->setOnScreenMessage('info', $this->lng->txt("user_actions_activation_info"));
76 
77  $tab = new ilUserActionAdminTableGUI(
78  $this,
79  "show",
80  $this->getActions(),
81  $this->rbabsystem->checkAccess("write", $this->ref_id)
82  );
83  $this->tpl->setContent($tab->getHTML());
84  }
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
protected

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

Referenced by getActionContext().

◆ $ctrl

ilCtrl ilUserActionAdminGUI::$ctrl
protected

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

◆ $lng

ilLanguage ilUserActionAdminGUI::$lng
protected

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

◆ $rbabsystem

ilRbacSystem ilUserActionAdminGUI::$rbabsystem
protected

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

◆ $ref_id

int ilUserActionAdminGUI::$ref_id
protected

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

Referenced by __construct().

◆ $request

ILIAS User StandardGUIRequest ilUserActionAdminGUI::$request
protected

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

◆ $tpl

ilGlobalTemplateInterface ilUserActionAdminGUI::$tpl
protected

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


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