ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUserActionAdmin 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 ilUserActionAdmin:

Static Public Member Functions

static activateAction (string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type, bool $a_active)
 
static lookupActive (string $a_context_comp, string $a_context_id, string $a_action_comp, string $a_action_type)
 

Static Protected Member Functions

static loadData ()
 

Static Protected Attributes

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

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 User action administration

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

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

Member Function Documentation

◆ activateAction()

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

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

References $DIC.

Referenced by ilUserActionAdminGUI\save().

34  : void {
35  global $DIC;
36 
37  $db = $DIC->database();
38  $db->replace(
39  "user_action_activation",
40  array(
41  "context_comp" => array("text", $a_context_comp),
42  "context_id" => array("text", $a_context_id),
43  "action_comp" => array("text", $a_action_comp),
44  "action_type" => array("text", $a_action_type),
45  ),
46  array(
47  "active" => array("integer", $a_active))
48  );
49 
50  self::$loaded = false;
51  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ loadData()

static ilUserActionAdmin::loadData ( )
staticprotected

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

References $data, and $DIC.

73  : void
74  {
75  global $DIC;
76 
77  $db = $DIC->database();
78 
79  $set = $db->query("SELECT * FROM user_action_activation");
80  self::$data = array();
81  while ($rec = $db->fetchAssoc($set)) {
82  self::$data[$rec["context_comp"]][$rec["context_id"]][$rec["action_comp"]][$rec["action_type"]] = (bool) $rec["active"];
83  }
84 
85  self::$loaded = true;
86  }
global $DIC
Definition: feed.php:28

◆ lookupActive()

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

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

References $data.

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

58  : bool {
59  if (!self::$loaded) {
60  self::loadData();
61  }
62  if (
63  !isset(self::$data[$a_context_comp])
64  || !isset(self::$data[$a_context_comp][$a_context_id])
65  || !isset(self::$data[$a_context_comp][$a_context_id][$a_action_comp])
66  || !isset(self::$data[$a_context_comp][$a_context_id][$a_action_comp][$a_action_type])
67  ) {
68  return false;
69  }
70  return (bool) self::$data[$a_context_comp][$a_context_id][$a_action_comp][$a_action_type];
71  }
+ Here is the caller graph for this function:

Field Documentation

◆ $data

array ilUserActionAdmin::$data = array()
staticprotected

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

◆ $loaded

bool ilUserActionAdmin::$loaded = false
staticprotected

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


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