ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilUserActionCollector Class Reference

Collects actions from all action providers. More...

+ Collaboration diagram for ilUserActionCollector:

Public Member Functions

 getActionsForTargetUser ($a_target_user)
 Collect actions. More...
 

Static Public Member Functions

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

Protected Member Functions

 __construct ($a_user_id, ilUserActionContext $a_context)
 Constructor. More...
 

Protected Attributes

 $collection
 
 $user_id
 
 $action_context
 

Static Protected Attributes

static $instances = array()
 

Detailed Description

Collects actions from all action providers.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
int$a_user_iduser id (usually the current user logged in)
ilUserActionContext$a_context

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

38  {
39  $this->user_id = $a_user_id;
40  $this->action_context = $a_context;
41  }

Member Function Documentation

◆ getActionsForTargetUser()

ilUserActionCollector::getActionsForTargetUser (   $a_target_user)

Collect actions.

Returns
ilUserActionCollection action

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

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

66  {
67  // overall collection of users
68  include_once("./Services/User/Actions/classes/class.ilUserActionCollection.php");
69  $this->collection = ilUserActionCollection::getInstance();
70 
71  include_once("./Services/User/Actions/classes/class.ilUserActionAdmin.php");
72 
73  include_once("./Services/User/Actions/classes/class.ilUserActionProviderFactory.php");
75  $prov->setUserId($this->user_id);
76  $coll = $prov->collectActionsForTargetUser($a_target_user);
77  foreach ($coll->getActions() as $action) {
79  $this->action_context->getComponentId(),
80  $this->action_context->getContextId(),
81  $prov->getComponentId(),
82  $action->getType()
83  )) {
84  $this->collection->addAction($action);
85  }
86  }
87  }
88 
89  return $this->collection;
90  }
static getInstance()
Get instance.
$action
static getAllProviders()
Get all action providers.
static lookupActive($a_context_comp, $a_context_id, $a_action_comp, $a_action_type)
Is activated?
+ Here is the call graph for this function:

◆ getInstance()

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

Get instance (for a user)

Parameters
int$a_user_iduser id
ilUserActionContext$a_context
Returns
ilUserActionCollector

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

Referenced by ilAwarenessData\__construct(), ilMyStaffGUI\addTabs(), and ilUserActionGUI\renderDropDown().

52  {
53  if (!isset(self::$instances[$a_user_id])) {
54  self::$instances[$a_user_id] = new ilUserActionCollector($a_user_id, $a_context);
55  }
56 
57  return self::$instances[$a_user_id];
58  }
Collects actions from all action providers.
+ Here is the caller graph for this function:

Field Documentation

◆ $action_context

ilUserActionCollector::$action_context
protected

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

◆ $collection

ilUserActionCollector::$collection
protected

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

Referenced by getActionsForTargetUser().

◆ $instances

ilUserActionCollector::$instances = array()
staticprotected

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

◆ $user_id

ilUserActionCollector::$user_id
protected

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


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