ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilGroupUserActionProvider Class Reference

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

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

Public Member Functions

 getComponentId ()
 
 getActionTypes ()
 
 collectActionsForTargetUser ($a_target_user)
 Collect user actions. More...
 
 getJsScripts ($a_action_type)
 Get js scripts. More...
 
- Public Member Functions inherited from ilUserActionProvider
 __construct ()
 Constructor. More...
 
 setUserId ($a_val)
 Set user id. More...
 
 getUserId ()
 Get user id. More...
 
 collectActionsForTargetUser ($a_target_user)
 Collect actions for a target user. More...
 
 getComponentId ()
 
 getActionTypes ()
 
 getJsScripts ($a_action_type)
 Get js scripts. More...
 

Static Public Member Functions

static getCommandAccess ($a_user_id)
 Get command access for user. More...
 

Static Protected Attributes

static $grp_ops = array()
 

Additional Inherited Members

- Protected Attributes inherited from ilUserActionProvider
 $user_id
 
 $lng
 
 $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
Version
$Id$

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

Member Function Documentation

◆ collectActionsForTargetUser()

ilGroupUserActionProvider::collectActionsForTargetUser (   $a_target_user)

Collect user actions.

Parameters
int$a_target_usertarget user
Returns
ilUserActionCollection collection

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

References $DIC, array, and ilUserActionCollection\getInstance().

72  {
73  global $DIC;
74 
75  $ctrl = $DIC->ctrl();
76 
77  $this->lng->loadLanguageModule("grp");
78 
80 
81  $commands = self::getCommandAccess($this->user_id);
82  if (count($commands) == 0) {
83  return $coll;
84  }
85 
86  $f = new ilUserAction();
87  $f->setType("add_to");
88  $f->setText($this->lng->txt("grp_add_to_group"));
89  $f->setHref("#");
90  $ctrl->setParameterByClass("ilGroupAddToGroupActionGUI", "user_id", $a_target_user);
91  $f->setData(array(
92  "grp-action-add-to" => "1",
93  "url" => $ctrl->getLinkTargetByClass(array("ilPersonalDesktopGUI", "ilGroupUserActionsGUI", "ilGroupAddToGroupActionGUI"), "", "", true, false)
94  ));
95  $coll->addAction($f);
96 
97  return $coll;
98  }
static getInstance()
Get instance.
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.
Action that can be performed on a user.
+ Here is the call graph for this function:

◆ getActionTypes()

ilGroupUserActionProvider::getActionTypes ( )

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

References array.

33  {
34  $this->lng->loadLanguageModule("grp");
35 
36  return array(
37  "add_to" => $this->lng->txt("grp_add_to_group")
38  );
39  }
Create styles array
The data for the language used.

◆ getCommandAccess()

static ilGroupUserActionProvider::getCommandAccess (   $a_user_id)
static

Get command access for user.

Parameters
int$a_user_id
Returns
array

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

References ilUtil\_getObjectsByOperations(), and array.

Referenced by ilGroupAddToGroupActionGUI\executeCommand().

48  {
49  if (!isset(self::$grp_ops[$a_user_id])) {
50  $ops = array();
51  $o = ilUtil::_getObjectsByOperations(array("root", "crs", "cat"), "create_grp", $a_user_id, 1);
52  if (count($o) > 0) {
53  $ops[] = "create_grp";
54  }
55  $o = ilUtil::_getObjectsByOperations("grp", "manage_members", $a_user_id, 1);
56  if (count($o) > 0) {
57  $ops[] = "manage_members";
58  }
59  self::$grp_ops[$a_user_id] = $ops;
60  }
61  return self::$grp_ops[$a_user_id];
62  }
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $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.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponentId()

ilGroupUserActionProvider::getComponentId ( )

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

25  {
26  return "grp";
27  }

◆ getJsScripts()

ilGroupUserActionProvider::getJsScripts (   $a_action_type)

Get js scripts.

Parameters
string$a_action_type
Returns
array

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

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

107  {
108  switch ($a_action_type) {
109  case "add_to":
110  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
111  return array(
112  "./Modules/Group/UserActions/js/GroupUserActions.js",
113  "./src/UI/templates/js/Modal/modal.js",
116  );
117  break;
118  }
119  return array();
120  }
static getLocalJsTreeJsPath()
Get local path of jsTree js.
static getLocalExplorerJsPath()
Get local path of explorer js.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Field Documentation

◆ $grp_ops

ilGroupUserActionProvider::$grp_ops = array()
staticprotected

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


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