ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilUserActionAdmin.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
13 {
14  static protected $loaded = false;
15  static protected $data = array();
16 
26  public static function activateAction($a_context_comp, $a_context_id, $a_action_comp, $a_action_type, $a_active)
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  }
44 
54  public static function lookupActive($a_context_comp, $a_context_id, $a_action_comp, $a_action_type)
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  }
62 
69  protected static function loadData()
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  }
84 
85 
86 }
87 
88 ?>
$a_context_id
Definition: workflow.php:98
static lookupActive($a_context_comp, $a_context_id, $a_action_comp, $a_action_type)
Is activated?
User action administration.
static loadData()
Load data.
Create styles array
The data for the language used.
static activateAction($a_context_comp, $a_context_id, $a_action_comp, $a_action_type, $a_active)
Activate action.
global $DIC