ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilGroupUserActionProvider Class Reference
+ Inheritance diagram for ilGroupUserActionProvider:
+ Collaboration diagram for ilGroupUserActionProvider:

Public Member Functions

 getComponentId ()
 
Returns
string component id as defined in services.xml/module.xml
More...
 
 getActionTypes ()
 
Returns
array[string] keys must be unique action ids (strings), values should be the names of the actions (from ilLanguage)
More...
 
 collectActionsForTargetUser (int $a_target_user)
 @inheritDoc More...
 
 getJsScripts (string $a_action_type)
 @inheritDoc More...
 
- 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
 
Language $lng
 
ilDBInterface $db
 

Detailed Description

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

Member Function Documentation

◆ collectActionsForTargetUser()

ilGroupUserActionProvider::collectActionsForTargetUser ( int  $a_target_user)

@inheritDoc

Reimplemented from ilUserActionProvider.

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

66 {
67 global $DIC;
68
69 $ctrl = $DIC->ctrl();
70 $this->lng->loadLanguageModule("grp");
71 $coll = new ilUserActionCollection();
72
73 $commands = self::getCommandAccess($this->user_id);
74 if (count($commands) == 0) {
75 return $coll;
76 }
77
78 $f = new ilUserAction();
79 $f->setType("add_to");
80 $f->setText($this->lng->txt("grp_add_to_group"));
81 $f->setHref("#");
82 $ctrl->setParameterByClass("ilGroupAddToGroupActionGUI", "user_id", $a_target_user);
83 $f->setData(array(
84 "grp-action-add-to" => "1",
85 "url" => $ctrl->getLinkTargetByClass(array("ildashboardgui", "ilGroupUserActionsGUI", "ilGroupAddToGroupActionGUI"), "", "", true, false)
86 ));
87 $coll->addAction($f);
88
89 return $coll;
90 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

◆ getActionTypes()

ilGroupUserActionProvider::getActionTypes ( )

Returns
array[string] keys must be unique action ids (strings), values should be the names of the actions (from ilLanguage)

Reimplemented from ilUserActionProvider.

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

36 : array
37 {
38 $this->lng->loadLanguageModule("grp");
39
40 return array(
41 "add_to" => $this->lng->txt("grp_add_to_group")
42 );
43 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getCommandAccess()

static ilGroupUserActionProvider::getCommandAccess ( int  $a_user_id)
static

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

45 : array
46 {
47 if (!isset(self::$grp_ops[$a_user_id])) {
48 $ops = array();
49 $o = ilUtil::_getObjectsByOperations(array("root", "crs", "cat"), "create_grp", $a_user_id, 1);
50 if (count($o) > 0) {
51 $ops[] = "create_grp";
52 }
53 $o = ilUtil::_getObjectsByOperations("grp", "manage_members", $a_user_id, 1);
54 if (count($o) > 0) {
55 $ops[] = "manage_members";
56 }
57 self::$grp_ops[$a_user_id] = $ops;
58 }
59 return self::$grp_ops[$a_user_id];
60 }
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,...

References ilUtil\_getObjectsByOperations().

Referenced by collectActionsForTargetUser(), and ilGroupAddToGroupActionGUI\executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponentId()

ilGroupUserActionProvider::getComponentId ( )

Returns
string component id as defined in services.xml/module.xml

Reimplemented from ilUserActionProvider.

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

28 : string
29 {
30 return "grp";
31 }

◆ getJsScripts()

ilGroupUserActionProvider::getJsScripts ( string  $a_action_type)

@inheritDoc

Reimplemented from ilUserActionProvider.

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

95 : array
96 {
97 global $DIC;
98 $gui = $DIC->repository()->internal()->gui();
99 switch ($a_action_type) {
100 case "add_to":
101 return array(
102 "assets/js/GroupUserActions.js",
103 "assets/js/modal.min.js",
106 );
107 }
108 return array();
109 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $grp_ops

ilGroupUserActionProvider::$grp_ops = []
staticprotected

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


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