19declare(strict_types=1);
25 protected \ilDBInterface
$db;
38 foreach ($a_ids as
$id) {
43 if ((
$id[1] ??
"") ==
"") {
46 $pos2 = strpos($full_id,
"/", strpos($full_id,
"/") + 1);
47 if ($pos2 ===
false) {
50 $id2 = substr($full_id, $pos2 + 1);
52 $id2 = explode(
"#", ($id2 ??
""));
53 if (($id2[0] ??
"") ==
"") {
56 if (($id2[1] ??
"") ==
"") {
60 $pos = strpos($full_id,
"#");
62 $full_id = substr($full_id, 0, $pos);
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)
84 string $a_screen_sub_id,
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)
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")
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"
124 $screen_ids = array();
125 while ($rec = $this->db->fetchAssoc($set)) {
126 if ($rec[
"screen_id"] ==
"-") {
127 $rec[
"screen_id"] =
"";
129 if ($rec[
"screen_sub_id"] ==
"-") {
130 $rec[
"screen_sub_id"] =
"";
132 $id = $rec[
"component"] .
"/" . $rec[
"screen_id"] .
"/" . $rec[
"screen_sub_id"];
133 if ($rec[
"perm"] !=
"" && $rec[
"perm"] !=
"-") {
134 $id .=
"#" . $rec[
"perm"];
136 $screen_ids[] = $rec[
"full_id"];
145 $sc_id = explode(
"/", $a_screen_id);
147 foreach ($module_ids as $module_id) {
148 if (($sc_id[0] ??
"") !=
"") {
149 if (($sc_id[1] ??
"") ==
"") {
152 if (($sc_id[2] ??
"") ==
"") {
155 $set = $this->db->query(
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"
163 while ($rec = $this->db->fetchAssoc($set)) {
173 $this->db->manipulate(
"DELETE FROM help_map WHERE " .
174 " module_id = " . $this->db->quote($a_id,
"integer"));
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getScreenIdsOfChapter(int $a_chap, int $a_module_id=0)
removeScreenIdsOfChapter(int $a_chap, int $a_module_id=0)
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="")
getChaptersForScreenId(string $a_screen_id, array $module_ids)
saveScreenIdsForChapter(int $a_chap, array $a_ids)
__construct(\ilDBInterface $db)
deleteEntriesOfModule(int $a_id)