19 declare(strict_types=1);
25 protected \ilDBInterface
$db;
38 foreach ($a_ids as
$id) {
40 $id = explode(
"/", $id);
42 if (($id[1] ??
"") ==
"") {
45 $id2 = explode(
"#", ($id[2] ??
""));
46 if (($id2[0] ??
"") ==
"") {
49 if (($id2[1] ??
"") ==
"") {
54 array(
"chap" => array(
"integer", $a_chap),
55 "component" => array(
"text", $id[0]),
56 "screen_id" => array(
"text", $id[1]),
57 "screen_sub_id" => array(
"text", $id2[0]),
58 "perm" => array(
"text", $id2[1]),
59 "module_id" => array(
"integer", 0)
71 string $a_screen_sub_id,
77 array(
"chap" => array(
"integer", $a_chap),
78 "component" => array(
"text", $a_comp),
79 "screen_id" => array(
"text", $a_screen_id),
80 "screen_sub_id" => array(
"text", $a_screen_sub_id),
81 "perm" => array(
"text", $a_perm),
82 "module_id" => array(
"integer", $a_module_id)
92 $this->db->manipulate(
93 "DELETE FROM help_map WHERE " .
94 " chap = " . $this->db->quote($a_chap,
"integer") .
95 " AND module_id = " . $this->db->quote($a_module_id,
"integer")
103 $set = $this->db->query(
104 "SELECT * FROM help_map " .
105 " WHERE chap = " . $this->db->quote($a_chap,
"integer") .
106 " AND module_id = " . $this->db->quote($a_module_id,
"integer") .
107 " ORDER BY component, screen_id, screen_sub_id" 109 $screen_ids = array();
110 while ($rec = $this->db->fetchAssoc($set)) {
111 if ($rec[
"screen_id"] ==
"-") {
112 $rec[
"screen_id"] =
"";
114 if ($rec[
"screen_sub_id"] ==
"-") {
115 $rec[
"screen_sub_id"] =
"";
117 $id = $rec[
"component"] .
"/" . $rec[
"screen_id"] .
"/" . $rec[
"screen_sub_id"];
118 if ($rec[
"perm"] !=
"" && $rec[
"perm"] !=
"-") {
119 $id .=
"#" . $rec[
"perm"];
130 $sc_id = explode(
"/", $a_screen_id);
132 foreach ($module_ids as $module_id) {
133 if (($sc_id[0] ??
"") !=
"") {
134 if (($sc_id[1] ??
"") ==
"") {
137 if (($sc_id[2] ??
"") ==
"") {
140 $set = $this->db->query(
141 "SELECT chap, perm FROM help_map JOIN lm_tree" .
142 " ON (help_map.chap = lm_tree.child) " .
143 " WHERE (component = " . $this->db->quote($sc_id[0],
"text") .
144 " OR component = " . $this->db->quote(
"*",
"text") .
")" .
145 " AND screen_id = " . $this->db->quote($sc_id[1],
"text") .
146 " AND screen_sub_id = " . $this->db->quote($sc_id[2],
"text") .
147 " AND module_id = " . $this->db->quote($module_id,
"integer") .
148 " ORDER BY lm_tree.lft" 150 while ($rec = $this->db->fetchAssoc($set)) {
160 $this->db->manipulate(
"DELETE FROM help_map WHERE " .
161 " module_id = " . $this->db->quote($a_id,
"integer"));
removeScreenIdsOfChapter(int $a_chap, int $a_module_id=0)
deleteEntriesOfModule(int $a_id)
saveScreenIdsForChapter(int $a_chap, array $a_ids)
getChaptersForScreenId(string $a_screen_id, array $module_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)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(\ilDBInterface $db)
getScreenIdsOfChapter(int $a_chap, int $a_module_id=0)