ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 170 of file MapDBRepository.php.

172  : void {
173  $this->db->manipulate("DELETE FROM help_map WHERE " .
174  " module_id = " . $this->db->quote($a_id, "integer"));
175  }

◆ getChaptersForScreenId()

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

Definition at line 141 of file MapDBRepository.php.

References $q.

144  : \Generator {
145  $sc_id = explode("/", $a_screen_id);
146  $chaps = array();
147  foreach ($module_ids as $module_id) {
148  if (($sc_id[0] ?? "") != "") {
149  if (($sc_id[1] ?? "") == "") {
150  $sc_id[1] = "-";
151  }
152  if (($sc_id[2] ?? "") == "") {
153  $sc_id[2] = "-";
154  }
155  $set = $this->db->query(
156  $q =
157  "SELECT chap, perm FROM help_map JOIN lm_tree" .
158  " ON (help_map.chap = lm_tree.child) " .
159  " WHERE full_id = " . $this->db->quote($a_screen_id, "text") .
160  " AND module_id = " . $this->db->quote($module_id, "integer") .
161  " ORDER BY lm_tree.lft"
162  );
163  while ($rec = $this->db->fetchAssoc($set)) {
164  yield $rec;
165  }
166  }
167  }
168  }
$q
Definition: shib_logout.php:18

◆ getScreenIdsOfChapter()

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

Definition at line 114 of file MapDBRepository.php.

References $id.

117  : array {
118  $set = $this->db->query(
119  "SELECT * FROM help_map " .
120  " WHERE chap = " . $this->db->quote($a_chap, "integer") .
121  " AND module_id = " . $this->db->quote($a_module_id, "integer") .
122  " ORDER BY component, screen_id, screen_sub_id"
123  );
124  $screen_ids = array();
125  while ($rec = $this->db->fetchAssoc($set)) {
126  if ($rec["screen_id"] == "-") {
127  $rec["screen_id"] = "";
128  }
129  if ($rec["screen_sub_id"] == "-") {
130  $rec["screen_sub_id"] = "";
131  }
132  $id = $rec["component"] . "/" . $rec["screen_id"] . "/" . $rec["screen_sub_id"];
133  if ($rec["perm"] != "" && $rec["perm"] != "-") {
134  $id .= "#" . $rec["perm"];
135  }
136  $screen_ids[] = $rec["full_id"];
137  }
138  return $screen_ids;
139  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24

◆ removeScreenIdsOfChapter()

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

Definition at line 103 of file MapDBRepository.php.

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

106  : void {
107  $this->db->manipulate(
108  "DELETE FROM help_map WHERE " .
109  " chap = " . $this->db->quote($a_chap, "integer") .
110  " AND module_id = " . $this->db->quote($a_module_id, "integer")
111  );
112  }
+ 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 80 of file MapDBRepository.php.

88  : void {
89  $this->db->replace(
90  "help_map",
91  array("chap" => array("integer", $a_chap),
92  "component" => array("text", $a_comp),
93  "screen_id" => array("text", $a_screen_id),
94  "screen_sub_id" => array("text", $a_screen_sub_id),
95  "perm" => array("text", $a_perm),
96  "module_id" => array("integer", $a_module_id),
97  "full_id" => array("text", $full_id)
98  ),
99  array()
100  );
101  }

◆ 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 = trim($id);
40  $id = trim($id);
41  $id = explode("/", $id);
42  if ($id[0] != "") {
43  if (($id[1] ?? "") == "") {
44  $id[1] = "-";
45  }
46  $pos2 = strpos($full_id, "/", strpos($full_id, "/") + 1);
47  if ($pos2 === false) {
48  $id2 = "";
49  } else {
50  $id2 = substr($full_id, $pos2 + 1);
51  }
52  $id2 = explode("#", ($id2 ?? ""));
53  if (($id2[0] ?? "") == "") {
54  $id2[0] = "-";
55  }
56  if (($id2[1] ?? "") == "") {
57  $id2[1] = "-";
58  }
59  // strip perm from full id
60  $pos = strpos($full_id, "#");
61  if ($pos !== false) {
62  $full_id = substr($full_id, 0, $pos);
63  }
64  $this->db->replace(
65  "help_map",
66  array("chap" => array("integer", $a_chap),
67  "component" => array("text", $id[0]),
68  "screen_id" => array("text", $id[1]),
69  "screen_sub_id" => array("text", $id2[0]),
70  "perm" => array("text", $id2[1]),
71  "full_id" => array("text", trim($full_id)),
72  "module_id" => array("integer", 0)
73  ),
74  array()
75  );
76  }
77  }
78  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ 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: