ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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

 __construct (private int $user_id, private ilUserActionContext $action_context, private ilUserActionProviderFactory $user_action_provider_factory, private ilUserActionAdmin $user_action_admin)
 
 getActionsForTargetUser (int $target_user)
 

Protected Member Functions

 hasProviderActiveActions (ilUserActionProvider $provider)
 

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 ( private int  $user_id,
private ilUserActionContext  $action_context,
private ilUserActionProviderFactory  $user_action_provider_factory,
private ilUserActionAdmin  $user_action_admin 
)

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

30  {
31  }

Member Function Documentation

◆ getActionsForTargetUser()

ilUserActionCollector::getActionsForTargetUser ( int  $target_user)

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

References $provider, and hasProviderActiveActions().

Referenced by ilMyStaffGUI\executeCommand().

34  {
35  $collection = new ilUserActionCollection();
36  foreach ($this->user_action_provider_factory->getProviders() as $provider) {
37  if (!$this->hasProviderActiveActions($provider)) {
38  continue;
39  }
40  $provider->setUserId($this->user_id);
41  $coll = $provider->collectActionsForTargetUser($target_user);
42  foreach ($coll->getActions() as $action) {
43  if ($this->user_action_admin->isActionActive(
44  $this->action_context->getComponentId(),
45  $this->action_context->getContextId(),
46  $provider->getComponentId(),
47  $action->getType()
48  )) {
49  $collection->addAction($action);
50  }
51  }
52  }
53 
54  return $collection;
55  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$provider
Definition: ltitoken.php:80
hasProviderActiveActions(ilUserActionProvider $provider)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasProviderActiveActions()

ilUserActionCollector::hasProviderActiveActions ( ilUserActionProvider  $provider)
protected

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

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

Referenced by getActionsForTargetUser().

57  : bool
58  {
59  foreach ($provider->getActionTypes() as $act_type => $act_txt) {
60  if ($this->user_action_admin->isActionActive(
61  $this->action_context->getComponentId(),
62  $this->action_context->getContextId(),
63  $provider->getComponentId(),
64  $act_type
65  )) {
66  return true;
67  }
68  }
69  return false;
70  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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