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

A class that provides a collection of actions on users. More...

+ Collaboration diagram for ilUserActionGUI:

Public Member Functions

 init ()
 Add requried js/css for an action context. More...
 
 renderDropDown ($a_target_user_id)
 Render drop down. More...
 

Static Public Member Functions

static getInstance (ilUserActionContext $a_user_action_context, ilTemplate $a_global_tpl, $a_current_user_id)
 Get instance. More...
 

Protected Member Functions

 __construct (ilUserActionContext $a_user_action_context, ilTemplate $a_global_tpl, $a_current_user_id)
 Constructor. More...
 

Protected Attributes

 $tpl
 
 $user_action_context
 
 $init_done = false
 
 $current_user_id
 

Detailed Description

A class that provides a collection of actions on users.

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.ilUserActionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
ilUserActionContext$a_user_action_context
ilTemplate$a_global_tpl
int$a_current_user_id

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

45  {
46  $this->tpl = $a_global_tpl;
47  $this->user_action_context = $a_user_action_context;
48  $this->current_user_id = $a_current_user_id;
49  }

Member Function Documentation

◆ getInstance()

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

Get instance.

Parameters
ilUserActionContext$a_user_action_context
ilTemplate$a_global_tpl
int$a_current_user_id
Returns
ilUserActionGUI

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

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

60  {
61  return new ilUserActionGUI($a_user_action_context, $a_global_tpl, $a_current_user_id);
62  }
A class that provides a collection of actions on users.
+ Here is the caller graph for this function:

◆ init()

ilUserActionGUI::init ( )

Add requried js/css for an action context.

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

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

Referenced by renderDropDown().

68  {
69  $tpl = $this->tpl;
70 
71  include_once("./Services/User/Actions/classes/class.ilUserActionAdmin.php");
72  include_once("./Services/User/Actions/classes/class.ilUserActionProviderFactory.php");
74  foreach ($prov->getActionTypes() as $act_type => $txt) {
76  $this->user_action_context->getComponentId(),
77  $this->user_action_context->getContextId(),
78  $prov->getComponentId(),
79  $act_type
80  )) {
81  foreach ($prov->getJsScripts($act_type) as $script) {
82  $tpl->addJavascript($script);
83  }
84  foreach ($prov->getCssFiles($act_type) as $file) {
85  $tpl->addCss($file);
86  }
87  }
88  }
89  }
90  }
static getAllProviders()
Get all action providers.
static lookupActive($a_context_comp, $a_context_id, $a_action_comp, $a_action_type)
Is activated?
$txt
Definition: error.php:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderDropDown()

ilUserActionGUI::renderDropDown (   $a_target_user_id)

Render drop down.

Parameters
int$a_user_idtarget user id
Returns
string

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

References $action, $list, ilUserActionCollector\getInstance(), and init().

99  {
100  if (!$this->init_done) {
101  $this->init();
102  }
103  include_once("./Services/User/Gallery/classes/class.ilGalleryUserActionContext.php");
104  include_once("./Services/User/Actions/classes/class.ilUserActionCollector.php");
105  $act_collector = ilUserActionCollector::getInstance($this->current_user_id, $this->user_action_context);
106  $action_collection = $act_collector->getActionsForTargetUser($a_target_user_id);
107  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
109  $list->setListTitle("");
110  foreach ($action_collection->getActions() as $action) {
111  $list->addItem($action->getText(), "", $action->getHref(), "", "", "", "", false, "", "", "", "", true, $action->getData());
112  }
113  return $list->getHTML();
114  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
$action
static getInstance($a_user_id, ilUserActionContext $a_context)
Get instance (for a user)
User interface class for advanced drop-down selection lists.
init()
Add requried js/css for an action context.
+ Here is the call graph for this function:

Field Documentation

◆ $current_user_id

ilUserActionGUI::$current_user_id
protected

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

◆ $init_done

ilUserActionGUI::$init_done = false
protected

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

◆ $tpl

ilUserActionGUI::$tpl
protected

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

Referenced by init().

◆ $user_action_context

ilUserActionGUI::$user_action_context
protected

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


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