ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository Class Reference
+ Collaboration diagram for ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository:

Public Member Functions

 __construct (\ilDBInterface $db)
 
 saveScreenIdsForChapter (int $a_chap, array $a_ids)
 
 saveMappingEntry (int $a_chap, string $a_comp, string $a_screen_id, string $a_screen_sub_id, string $a_perm, int $a_module_id=0, string $full_id="")
 
 removeScreenIdsOfChapter (int $a_chap, int $a_module_id=0)
 
 getScreenIdsOfChapter (int $a_chap, int $a_module_id=0)
 
 getChaptersForScreenId (string $a_screen_id, array $module_ids)
 
 deleteEntriesOfModule (int $a_id)
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 23 of file MapDBRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::__construct ( \ilDBInterface  $db)

Member Function Documentation

◆ deleteEntriesOfModule()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::deleteEntriesOfModule ( int  $a_id)

Definition at line 159 of file MapDBRepository.php.

161  : void {
162  $this->db->manipulate("DELETE FROM help_map WHERE " .
163  " module_id = " . $this->db->quote($a_id, "integer"));
164  }

◆ getChaptersForScreenId()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::getChaptersForScreenId ( string  $a_screen_id,
array  $module_ids 
)

Definition at line 130 of file MapDBRepository.php.

References $q.

133  : \Generator {
134  $sc_id = explode("/", $a_screen_id);
135  $chaps = array();
136  foreach ($module_ids as $module_id) {
137  if ($sc_id[0] != "") {
138  if ($sc_id[1] == "") {
139  $sc_id[1] = "-";
140  }
141  if ($sc_id[2] == "") {
142  $sc_id[2] = "-";
143  }
144  $set = $this->db->query(
145  $q =
146  "SELECT chap, perm FROM help_map JOIN lm_tree" .
147  " ON (help_map.chap = lm_tree.child) " .
148  " WHERE full_id = " . $this->db->quote($a_screen_id, "text") .
149  " AND module_id = " . $this->db->quote($module_id, "integer") .
150  " ORDER BY lm_tree.lft"
151  );
152  while ($rec = $this->db->fetchAssoc($set)) {
153  yield $rec;
154  }
155  }
156  }
157  }
$q
Definition: shib_logout.php:21

◆ getScreenIdsOfChapter()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::getScreenIdsOfChapter ( int  $a_chap,
int  $a_module_id = 0 
)

Definition at line 103 of file MapDBRepository.php.

References $id.

106  : array {
107  $set = $this->db->query(
108  "SELECT * FROM help_map " .
109  " WHERE chap = " . $this->db->quote($a_chap, "integer") .
110  " AND module_id = " . $this->db->quote($a_module_id, "integer") .
111  " ORDER BY component, screen_id, screen_sub_id"
112  );
113  $screen_ids = array();
114  while ($rec = $this->db->fetchAssoc($set)) {
115  if ($rec["screen_id"] == "-") {
116  $rec["screen_id"] = "";
117  }
118  if ($rec["screen_sub_id"] == "-") {
119  $rec["screen_sub_id"] = "";
120  }
121  $id = $rec["component"] . "/" . $rec["screen_id"] . "/" . $rec["screen_sub_id"];
122  if ($rec["perm"] != "" && $rec["perm"] != "-") {
123  $id .= "#" . $rec["perm"];
124  }
125  $screen_ids[] = $rec["full_id"];
126  }
127  return $screen_ids;
128  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ removeScreenIdsOfChapter()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::removeScreenIdsOfChapter ( int  $a_chap,
int  $a_module_id = 0 
)

Definition at line 92 of file MapDBRepository.php.

Referenced by ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository\saveScreenIdsForChapter().

95  : void {
96  $this->db->manipulate(
97  "DELETE FROM help_map WHERE " .
98  " chap = " . $this->db->quote($a_chap, "integer") .
99  " AND module_id = " . $this->db->quote($a_module_id, "integer")
100  );
101  }
+ Here is the caller graph for this function:

◆ saveMappingEntry()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::saveMappingEntry ( int  $a_chap,
string  $a_comp,
string  $a_screen_id,
string  $a_screen_sub_id,
string  $a_perm,
int  $a_module_id = 0,
string  $full_id = "" 
)

Definition at line 69 of file MapDBRepository.php.

77  : void {
78  $this->db->replace(
79  "help_map",
80  array("chap" => array("integer", $a_chap),
81  "component" => array("text", $a_comp),
82  "screen_id" => array("text", $a_screen_id),
83  "screen_sub_id" => array("text", $a_screen_sub_id),
84  "perm" => array("text", $a_perm),
85  "module_id" => array("integer", $a_module_id),
86  "full_id" => array("text", $full_id)
87  ),
88  array()
89  );
90  }

◆ saveScreenIdsForChapter()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::saveScreenIdsForChapter ( int  $a_chap,
array  $a_ids 
)

Definition at line 33 of file MapDBRepository.php.

References $id, and ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository\removeScreenIdsOfChapter().

36  : void {
37  $this->removeScreenIdsOfChapter($a_chap);
38  foreach ($a_ids as $id) {
39  $full_id = $id;
40  $id = trim($id);
41  $id = explode("/", $id);
42  if ($id[0] != "") {
43  if (($id[1] ?? "") == "") {
44  $id[1] = "-";
45  }
46  $id2 = explode("#", ($id[2] ?? ""));
47  if ($id2[0] == "") {
48  $id2[0] = "-";
49  }
50  if (($id2[1] ?? "") == "") {
51  $id2[1] = "-";
52  }
53  $this->db->replace(
54  "help_map",
55  array("chap" => array("integer", $a_chap),
56  "component" => array("text", $id[0]),
57  "screen_id" => array("text", $id[1]),
58  "screen_sub_id" => array("text", $id2[0]),
59  "perm" => array("text", $id2[1]),
60  "full_id" => array("text", trim($full_id)),
61  "module_id" => array("integer", 0)
62  ),
63  array()
64  );
65  }
66  }
67  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapDBRepository::$db
protected

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