ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilUserActionAdmin Class Reference

User action administration. More...

+ Collaboration diagram for ilUserActionAdmin:

Static Public Member Functions

static activateAction ($a_context_comp, $a_context_id, $a_action_comp, $a_action_type, $a_active)
 Activate action. More...
 
static lookupActive ($a_context_comp, $a_context_id, $a_action_comp, $a_action_type)
 Is activated? More...
 

Static Protected Member Functions

static loadData ()
 Load data. More...
 

Static Protected Attributes

static $loaded = false
 
static $data = array()
 

Detailed Description

User action administration.

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

Member Function Documentation

◆ activateAction()

static ilUserActionAdmin::activateAction (   $a_context_comp,
  $a_context_id,
  $a_action_comp,
  $a_action_type,
  $a_active 
)
static

Activate action.

Parameters
string$a_context_comp
string$a_context_id
string$a_action_comp
string$a_action_type
bool$a_activeactive true/false

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

References $a_context_id, $DIC, and array.

Referenced by ilUserActionAdminGUI\save().

27  {
28  global $DIC;
29 
30  $db = $DIC->database();
31  $db->replace("user_action_activation",
32  array(
33  "context_comp" => array("text", $a_context_comp),
34  "context_id" => array("text", $a_context_id),
35  "action_comp" => array("text", $a_action_comp),
36  "action_type" => array("text", $a_action_type),
37  ),
38  array(
39  "active" => array("integer", $a_active))
40  );
41 
42  self::$loaded = false;
43  }
$a_context_id
Definition: workflow.php:98
Create styles array
The data for the language used.
global $DIC
+ Here is the caller graph for this function:

◆ loadData()

static ilUserActionAdmin::loadData ( )
staticprotected

Load data.

Parameters

Definition at line 69 of file class.ilUserActionAdmin.php.

References $data, $DIC, and array.

70  {
71  global $DIC;
72 
73  $db = $DIC->database();
74 
75  $set = $db->query("SELECT * FROM user_action_activation");
76  self::$data = array();
77  while ($rec = $db->fetchAssoc($set))
78  {
79  self::$data[$rec["context_comp"]][$rec["context_id"]][$rec["action_comp"]][$rec["action_type"]] = (bool) $rec["active"];
80  }
81 
82  self::$loaded = true;
83  }
Create styles array
The data for the language used.
global $DIC

◆ lookupActive()

static ilUserActionAdmin::lookupActive (   $a_context_comp,
  $a_context_id,
  $a_action_comp,
  $a_action_type 
)
static

Is activated?

Parameters
string$a_context_comp
string$a_context_id
string$a_action_comp
string$a_action_type
Returns
bool active true/false

Definition at line 54 of file class.ilUserActionAdmin.php.

References $a_context_id, and $data.

Referenced by ilUserActionAdminGUI\getActions(), and ilUserActionCollector\getActionsForTargetUser().

55  {
56  if (!self::$loaded)
57  {
58  self::loadData();
59  }
60  return (bool) self::$data[$a_context_comp][$a_context_id][$a_action_comp][$a_action_type];
61  }
$a_context_id
Definition: workflow.php:98
+ Here is the caller graph for this function:

Field Documentation

◆ $data

ilUserActionAdmin::$data = array()
staticprotected

Definition at line 15 of file class.ilUserActionAdmin.php.

◆ $loaded

ilUserActionAdmin::$loaded = false
staticprotected

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


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