ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ($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, Vendor\Package\$f, and ilUserActionCollection\getInstance().

72  {
73  global $DIC;
74 
75  $ctrl = $DIC->ctrl();
76  $this->lng->loadLanguageModule("grp");
78 
79  $commands = self::getCommandAccess($this->user_id);
80  if (count($commands) == 0) {
81  return $coll;
82  }
83 
84  $f = new ilUserAction();
85  $f->setType("add_to");
86  $f->setText($this->lng->txt("grp_add_to_group"));
87  $f->setHref("#");
88  $ctrl->setParameterByClass("ilGroupAddToGroupActionGUI", "user_id", $a_target_user);
89  $f->setData(array(
90  "grp-action-add-to" => "1",
91  "url" => $ctrl->getLinkTargetByClass(array("ildashboardgui", "ilGroupUserActionsGUI", "ilGroupAddToGroupActionGUI"), "", "", true, false)
92  ));
93  $coll->addAction($f);
94 
95  return $coll;
96  }
static getInstance()
Get instance.
$DIC
Definition: xapitoken.php:46
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.

33  {
34  $this->lng->loadLanguageModule("grp");
35 
36  return array(
37  "add_to" => $this->lng->txt("grp_add_to_group")
38  );
39  }

◆ 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().

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.
+ 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 104 of file class.ilGroupUserActionProvider.php.

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

105  {
106  switch ($a_action_type) {
107  case "add_to":
108  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
109  return array(
110  "./Modules/Group/UserActions/js/GroupUserActions.js",
111  "./src/UI/templates/js/Modal/modal.js",
114  );
115  break;
116  }
117  return array();
118  }
static getLocalJsTreeJsPath()
Get local path of jsTree js.
static getLocalExplorerJsPath()
Get local path of explorer js.
+ 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: