ILIAS  release_8 Revision v8.24
ilGroupUserActionProvider Class Reference

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

+ 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
 
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)

@inheritDoc

Reimplemented from ilUserActionProvider.

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

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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

References $DIC, Vendor\Package\$f, getCommandAccess(), ilUserActionCollection\getInstance(), 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 28 of file class.ilGroupUserActionProvider.php.

28 : array
29 {
30 $this->lng->loadLanguageModule("grp");
31
32 return array(
33 "add_to" => $this->lng->txt("grp_add_to_group")
34 );
35 }

References ILIAS\Repository\lng().

+ 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.

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,...

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

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

◆ getJsScripts()

ilGroupUserActionProvider::getJsScripts ( string  $a_action_type)

@inheritDoc

Reimplemented from ilUserActionProvider.

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

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 }

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

+ 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: