ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUserActionCollector Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilUserActionCollector:

Public Member Functions

 getActionsForTargetUser (int $a_target_user)
 

Static Public Member Functions

static getInstance (int $a_user_id, ilUserActionContext $a_context)
 Get instance (for a user) More...
 

Protected Member Functions

 __construct (int $a_user_id, ilUserActionContext $a_context)
 
 hasProviderActiveActions (ilUserActionProvider $prov)
 

Protected Attributes

ilUserActionCollection $collection
 
int $user_id
 
ilUserActionContext $action_context
 

Static Protected Attributes

static array $instances = array()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Collects actions from all action providers

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilUserActionCollector::__construct ( int  $a_user_id,
ilUserActionContext  $a_context 
)
protected

Definition at line 31 of file class.ilUserActionCollector.php.

32  {
33  $this->user_id = $a_user_id;
34  $this->action_context = $a_context;
35  }

Member Function Documentation

◆ getActionsForTargetUser()

ilUserActionCollector::getActionsForTargetUser ( int  $a_target_user)

Definition at line 52 of file class.ilUserActionCollector.php.

References $collection, ilUserActionProviderFactory\getAllProviders(), ilUserActionCollection\getInstance(), hasProviderActiveActions(), and ilUserActionAdmin\lookupActive().

53  {
54  // overall collection of users
55  $this->collection = ilUserActionCollection::getInstance();
57  if (!$this->hasProviderActiveActions($prov)) {
58  continue;
59  }
60  $prov->setUserId($this->user_id);
61  $coll = $prov->collectActionsForTargetUser($a_target_user);
62  foreach ($coll->getActions() as $action) {
64  $this->action_context->getComponentId(),
65  $this->action_context->getContextId(),
66  $prov->getComponentId(),
67  $action->getType()
68  )) {
69  $this->collection->addAction($action);
70  }
71  }
72  }
73 
74  return $this->collection;
75  }
static getAllProviders()
Get all action providers.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasProviderActiveActions(ilUserActionProvider $prov)
ilUserActionCollection $collection
static lookupActive(string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type)
+ Here is the call graph for this function:

◆ getInstance()

static ilUserActionCollector::getInstance ( int  $a_user_id,
ilUserActionContext  $a_context 
)
static

Get instance (for a user)

Definition at line 41 of file class.ilUserActionCollector.php.

Referenced by ILIAS\Awareness\WidgetManager\__construct(), ilMyStaffGUI\executeCommand(), and ilUserActionGUI\renderDropDown().

44  : self {
45  if (!isset(self::$instances[$a_user_id])) {
46  self::$instances[$a_user_id] = new ilUserActionCollector($a_user_id, $a_context);
47  }
48 
49  return self::$instances[$a_user_id];
50  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ hasProviderActiveActions()

ilUserActionCollector::hasProviderActiveActions ( ilUserActionProvider  $prov)
protected

Definition at line 77 of file class.ilUserActionCollector.php.

References ilUserActionProvider\getActionTypes(), ilUserActionProvider\getComponentId(), and ilUserActionAdmin\lookupActive().

Referenced by getActionsForTargetUser().

77  : bool
78  {
79  foreach ($prov->getActionTypes() as $act_type => $act_txt) {
81  $this->action_context->getComponentId(),
82  $this->action_context->getContextId(),
83  $prov->getComponentId(),
84  $act_type
85  )) {
86  return true;
87  }
88  }
89  return false;
90  }
static lookupActive(string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $action_context

ilUserActionContext ilUserActionCollector::$action_context
protected

Definition at line 29 of file class.ilUserActionCollector.php.

◆ $collection

ilUserActionCollection ilUserActionCollector::$collection
protected

Definition at line 27 of file class.ilUserActionCollector.php.

Referenced by getActionsForTargetUser().

◆ $instances

array ilUserActionCollector::$instances = array()
staticprotected

Definition at line 25 of file class.ilUserActionCollector.php.

◆ $user_id

int ilUserActionCollector::$user_id
protected

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


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