ILIAS  release_8 Revision v8.24
ilUserActionGUI 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 ilUserActionGUI:

Public Member Functions

 init ()
 
 renderDropDown (int $a_target_user_id)
 

Static Public Member Functions

static getInstance (ilUserActionContext $a_user_action_context, ilGlobalTemplateInterface $a_global_tpl, int $a_current_user_id)
 

Protected Member Functions

 __construct (ilUserActionContext $a_user_action_context, ilGlobalTemplateInterface $a_global_tpl, int $a_current_user_id)
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
ilUserActionContext $user_action_context
 
bool $init_done = false
 
int $current_user_id
 

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 A class that provides a collection of actions on users

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

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

Constructor & Destructor Documentation

◆ __construct()

ilUserActionGUI::__construct ( ilUserActionContext  $a_user_action_context,
ilGlobalTemplateInterface  $a_global_tpl,
int  $a_current_user_id 
)
protected

Definition at line 30 of file class.ilUserActionGUI.php.

34 {
35 $this->tpl = $a_global_tpl;
36 $this->user_action_context = $a_user_action_context;
37 $this->current_user_id = $a_current_user_id;
38 }

Member Function Documentation

◆ getInstance()

static ilUserActionGUI::getInstance ( ilUserActionContext  $a_user_action_context,
ilGlobalTemplateInterface  $a_global_tpl,
int  $a_current_user_id 
)
static

Definition at line 40 of file class.ilUserActionGUI.php.

45 return new ilUserActionGUI($a_user_action_context, $a_global_tpl, $a_current_user_id);
46 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by ilUsersGalleryGUI\addActionSection(), and ilAwarenessGUI\initJS().

+ Here is the caller graph for this function:

◆ init()

ilUserActionGUI::init ( )

Definition at line 48 of file class.ilUserActionGUI.php.

48 : void
49 {
51
53 foreach ($prov->getActionTypes() as $act_type => $txt) {
55 $this->user_action_context->getComponentId(),
56 $this->user_action_context->getContextId(),
57 $prov->getComponentId(),
58 $act_type
59 )) {
60 foreach ($prov->getJsScripts($act_type) as $script) {
61 $tpl->addJavaScript($script);
62 }
63 }
64 }
65 }
66 }
static lookupActive(string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type)
ilGlobalTemplateInterface $tpl
static getAllProviders()
Get all action providers.
$txt
Definition: error.php:13
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.

References $tpl, $txt, ilUserActionProviderFactory\getAllProviders(), and ilUserActionAdmin\lookupActive().

+ Here is the call graph for this function:

◆ renderDropDown()

ilUserActionGUI::renderDropDown ( int  $a_target_user_id)

Definition at line 68 of file class.ilUserActionGUI.php.

68 : string
69 {
70 if (!$this->init_done) {
71 $this->init();
72 }
73 $act_collector = ilUserActionCollector::getInstance($this->current_user_id, $this->user_action_context);
74 $action_collection = $act_collector->getActionsForTargetUser($a_target_user_id);
75 $list = new ilAdvancedSelectionListGUI();
76 $list->setListTitle("");
77 $list->setPullRight(false);
78 foreach ($action_collection->getActions() as $action) {
79 $list->addItem($action->getText(), "", $action->getHref(), "", "", "", "", false, "", "", "", "", true, $action->getData());
80 }
81 return $list->getHTML();
82 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_user_id, ilUserActionContext $a_context)
Get instance (for a user)

References ilUserActionCollector\getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $current_user_id

int ilUserActionGUI::$current_user_id
protected

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

◆ $init_done

bool ilUserActionGUI::$init_done = false
protected

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

◆ $tpl

ilGlobalTemplateInterface ilUserActionGUI::$tpl
protected

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

◆ $user_action_context

ilUserActionContext ilUserActionGUI::$user_action_context
protected

Definition at line 26 of file class.ilUserActionGUI.php.


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