ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGroupUserActionProvider Class Reference

Group user actions (add to group) More...

+ Inheritance diagram for ilGroupUserActionProvider:
+ Collaboration diagram for ilGroupUserActionProvider:

Public Member Functions

 getComponentId ()
 
 getActionTypes ()
 
 collectActionsForTargetUser (int $a_target_user)
 
 getJsScripts (string $a_action_type)
 
- Public Member Functions inherited from ilUserActionProvider
 __construct ()
 
 setUserId (int $a_val)
 
 getUserId ()
 
 collectActionsForTargetUser (int $a_target_user)
 Collect actions for a target user. More...
 
 getComponentId ()
 
 getActionTypes ()
 
 getJsScripts (string $a_action_type)
 

Static Public Member Functions

static getCommandAccess (int $a_user_id)
 

Static Protected Attributes

static $grp_ops = []
 

Additional Inherited Members

- Protected Attributes inherited from ilUserActionProvider
int $user_id
 
ilLanguage $lng
 
ilDBInterface $db
 

Detailed Description

Group user actions (add to group)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 13 of file class.ilGroupUserActionProvider.php.

Member Function Documentation

◆ collectActionsForTargetUser()

ilGroupUserActionProvider::collectActionsForTargetUser ( int  $a_target_user)

Definition at line 57 of file class.ilGroupUserActionProvider.php.

References $DIC, Vendor\Package\$f, ilUserActionCollection\getInstance(), and ILIAS\Repository\lng().

58  {
59  global $DIC;
60 
61  $ctrl = $DIC->ctrl();
62  $this->lng->loadLanguageModule("grp");
64 
65  $commands = self::getCommandAccess($this->user_id);
66  if (count($commands) == 0) {
67  return $coll;
68  }
69 
70  $f = new ilUserAction();
71  $f->setType("add_to");
72  $f->setText($this->lng->txt("grp_add_to_group"));
73  $f->setHref("#");
74  $ctrl->setParameterByClass("ilGroupAddToGroupActionGUI", "user_id", $a_target_user);
75  $f->setData(array(
76  "grp-action-add-to" => "1",
77  "url" => $ctrl->getLinkTargetByClass(array("ildashboardgui", "ilGroupUserActionsGUI", "ilGroupAddToGroupActionGUI"), "", "", true, false)
78  ));
79  $coll->addAction($f);
80 
81  return $coll;
82  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getActionTypes()

ilGroupUserActionProvider::getActionTypes ( )

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

References ILIAS\Repository\lng().

28  : array
29  {
30  $this->lng->loadLanguageModule("grp");
31 
32  return array(
33  "add_to" => $this->lng->txt("grp_add_to_group")
34  );
35  }
+ Here is the call graph for this function:

◆ getCommandAccess()

static ilGroupUserActionProvider::getCommandAccess ( int  $a_user_id)
static

Definition at line 37 of file class.ilGroupUserActionProvider.php.

References ilUtil\_getObjectsByOperations().

Referenced by ilGroupAddToGroupActionGUI\executeCommand().

37  : array
38  {
39  if (!isset(self::$grp_ops[$a_user_id])) {
40  $ops = array();
41  $o = ilUtil::_getObjectsByOperations(array("root", "crs", "cat"), "create_grp", $a_user_id, 1);
42  if (count($o) > 0) {
43  $ops[] = "create_grp";
44  }
45  $o = ilUtil::_getObjectsByOperations("grp", "manage_members", $a_user_id, 1);
46  if (count($o) > 0) {
47  $ops[] = "manage_members";
48  }
49  self::$grp_ops[$a_user_id] = $ops;
50  }
51  return self::$grp_ops[$a_user_id];
52  }
static _getObjectsByOperations( $a_obj_type, string $a_operation, int $a_usr_id=0, int $limit=0)
Get all objects of a specific type and check access This function is not recursive, instead it parses the serialized rbac_pa entries.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponentId()

ilGroupUserActionProvider::getComponentId ( )

Definition at line 20 of file class.ilGroupUserActionProvider.php.

20  : string
21  {
22  return "grp";
23  }

◆ getJsScripts()

ilGroupUserActionProvider::getJsScripts ( string  $a_action_type)

Definition at line 87 of file class.ilGroupUserActionProvider.php.

References ilExplorerBaseGUI\getLocalExplorerJsPath(), and ilExplorerBaseGUI\getLocalJsTreeJsPath().

87  : array
88  {
89  switch ($a_action_type) {
90  case "add_to":
91  return array(
92  "./Modules/Group/UserActions/js/GroupUserActions.js",
93  "./src/UI/templates/js/Modal/modal.js",
96  );
97  }
98  return array();
99  }
+ Here is the call graph for this function:

Field Documentation

◆ $grp_ops

ilGroupUserActionProvider::$grp_ops = []
staticprotected

Definition at line 15 of file class.ilGroupUserActionProvider.php.


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