This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
|
static | saveScreenIdsForChapter (int $a_chap, array $a_ids) |
|
static | saveMappingEntry (int $a_chap, string $a_comp, string $a_screen_id, string $a_screen_sub_id, string $a_perm, int $a_module_id=0) |
|
static | removeScreenIdsOfChapter (int $a_chap, int $a_module_id=0) |
|
static | getScreenIdsOfChapter (int $a_chap, int $a_module_id=0) |
|
static | getHelpSectionsForId (string $a_screen_id, int $a_ref_id) |
|
static | hasScreenIdSections (string $a_screen_id) |
| Has given screen Id any sections? Note: We removed the "ref_id" parameter here, since this method should be fast. More...
|
|
static | deleteEntriesOfModule (int $a_id) |
|
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 Help mapping
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 23 of file class.ilHelpMapping.php.
◆ __construct()
ilHelpMapping::__construct |
( |
| ) |
|
◆ deleteEntriesOfModule()
static ilHelpMapping::deleteEntriesOfModule |
( |
int |
$a_id | ) |
|
|
static |
◆ getHelpSectionsForId()
static ilHelpMapping::getHelpSectionsForId |
( |
string |
$a_screen_id, |
|
|
int |
$a_ref_id |
|
) |
| |
|
static |
Definition at line 143 of file class.ilHelpMapping.php.
References $DIC, $ilDB, $ilSetting, $ilUser, ilObject\_lookupObjId(), ILIAS\Repository\int(), and SYSTEM_ROLE_ID.
Referenced by ilHelpGUI\getHelpSections(), and ilHelpGUI\showHelp().
149 $ilDB = $DIC->database();
150 $ilAccess = $DIC->access();
152 $rbacreview = $DIC->rbac()->review();
154 $ilObjDataCache = $DIC[
"ilObjDataCache"];
156 if (defined(
'OH_REF_ID') && (
int) OH_REF_ID > 0) {
165 $sc_id = explode(
"/", $a_screen_id);
167 if ($sc_id[0] !=
"") {
168 if ($sc_id[1] ==
"") {
171 if ($sc_id[2] ==
"") {
175 "SELECT chap, perm FROM help_map JOIN lm_tree" .
176 " ON (help_map.chap = lm_tree.child) " .
177 " WHERE (component = " .
$ilDB->quote($sc_id[0],
"text") .
178 " OR component = " .
$ilDB->quote(
"*",
"text") .
")" .
179 " AND screen_id = " .
$ilDB->quote($sc_id[1],
"text") .
180 " AND screen_sub_id = " .
$ilDB->quote($sc_id[2],
"text") .
181 " AND module_id = " .
$ilDB->quote($module,
"integer") .
182 " ORDER BY lm_tree.lft" 184 while ($rec =
$ilDB->fetchAssoc($set)) {
185 if ($rec[
"perm"] !=
"" && $rec[
"perm"] !=
"-") {
187 if ($rec[
"perm"] ===
"create*") {
188 $has_create_perm =
false;
192 $has_create_perm =
true;
194 $has_create_perm =
true;
195 } elseif ($ilAccess->checkAccess(
"read",
"", $a_ref_id)) {
196 $perm = $rbacreview->getUserPermissionsOnObject(
$ilUser->getId(), $a_ref_id);
197 foreach ($perm as $p) {
198 if (strpos($p,
"create_") === 0) {
199 $has_create_perm =
true;
203 if ($has_create_perm) {
204 $chaps[] = $rec[
"chap"];
206 } elseif ($ilAccess->checkAccess($rec[
"perm"],
"", $a_ref_id)) {
207 $chaps[] = $rec[
"chap"];
210 $chaps[] = $rec[
"chap"];
static _lookupObjId(int $ref_id)
◆ getScreenIdsOfChapter()
static ilHelpMapping::getScreenIdsOfChapter |
( |
int |
$a_chap, |
|
|
int |
$a_module_id = 0 |
|
) |
| |
|
static |
Definition at line 112 of file class.ilHelpMapping.php.
References $DIC, $id, and $ilDB.
Referenced by ilHelpMappingTableGUI\fillRow().
118 $ilDB = $DIC->database();
121 "SELECT * FROM help_map " .
122 " WHERE chap = " .
$ilDB->quote($a_chap,
"integer") .
123 " AND module_id = " .
$ilDB->quote($a_module_id,
"integer") .
124 " ORDER BY component, screen_id, screen_sub_id" 126 $screen_ids = array();
127 while ($rec =
$ilDB->fetchAssoc($set)) {
128 if ($rec[
"screen_id"] ==
"-") {
129 $rec[
"screen_id"] =
"";
131 if ($rec[
"screen_sub_id"] ==
"-") {
132 $rec[
"screen_sub_id"] =
"";
134 $id = $rec[
"component"] .
"/" . $rec[
"screen_id"] .
"/" . $rec[
"screen_sub_id"];
135 if ($rec[
"perm"] !=
"" && $rec[
"perm"] !=
"-") {
136 $id .=
"#" . $rec[
"perm"];
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
◆ hasScreenIdSections()
static ilHelpMapping::hasScreenIdSections |
( |
string |
$a_screen_id | ) |
|
|
static |
Has given screen Id any sections? Note: We removed the "ref_id" parameter here, since this method should be fast.
It is used to decide whether the help button should appear or not. We assume that there is at least one section for users with the "read" permission.
Definition at line 224 of file class.ilHelpMapping.php.
References $DIC, $ilDB, $ilSetting, $ilUser, and ILIAS\Repository\int().
Referenced by ilHelpGUI\hasSections().
229 $ilDB = $DIC->database();
233 if (
$ilUser->getLanguage() !==
"de") {
241 if (defined(
'OH_REF_ID') && (
int) OH_REF_ID > 0) {
250 $sc_id = explode(
"/", $a_screen_id);
251 if ($sc_id[0] !=
"") {
252 if ($sc_id[1] ==
"") {
255 if ($sc_id[2] ==
"") {
259 "SELECT chap, perm FROM help_map " .
260 " WHERE (component = " .
$ilDB->quote($sc_id[0],
"text") .
261 " OR component = " .
$ilDB->quote(
"*",
"text") .
")" .
262 " AND screen_id = " .
$ilDB->quote($sc_id[1],
"text") .
263 " AND screen_sub_id = " .
$ilDB->quote($sc_id[2],
"text") .
264 " AND module_id = " .
$ilDB->quote($module,
"integer")
266 while ($rec =
$ilDB->fetchAssoc($set)) {
◆ removeScreenIdsOfChapter()
static ilHelpMapping::removeScreenIdsOfChapter |
( |
int |
$a_chap, |
|
|
int |
$a_module_id = 0 |
|
) |
| |
|
static |
◆ saveMappingEntry()
static ilHelpMapping::saveMappingEntry |
( |
int |
$a_chap, |
|
|
string |
$a_comp, |
|
|
string |
$a_screen_id, |
|
|
string |
$a_screen_sub_id, |
|
|
string |
$a_perm, |
|
|
int |
$a_module_id = 0 |
|
) |
| |
|
static |
Definition at line 72 of file class.ilHelpMapping.php.
References $DIC, and $ilDB.
Referenced by ilHelpDataSet\importRecord().
82 $ilDB = $DIC->database();
86 array(
"chap" => array(
"integer", $a_chap),
87 "component" => array(
"text", $a_comp),
88 "screen_id" => array(
"text", $a_screen_id),
89 "screen_sub_id" => array(
"text", $a_screen_sub_id),
90 "perm" => array(
"text", $a_perm),
91 "module_id" => array(
"integer", $a_module_id)
◆ saveScreenIdsForChapter()
static ilHelpMapping::saveScreenIdsForChapter |
( |
int |
$a_chap, |
|
|
array |
$a_ids |
|
) |
| |
|
static |
Definition at line 34 of file class.ilHelpMapping.php.
References $DIC, $id, and $ilDB.
Referenced by ilObjContentObjectGUI\saveHelpMapping().
40 $ilDB = $DIC->database();
42 self::removeScreenIdsOfChapter($a_chap);
43 foreach ($a_ids as
$id) {
45 $id = explode(
"/", $id);
47 if (($id[1] ??
"") ==
"") {
50 $id2 = explode(
"#", ($id[2] ??
""));
54 if (($id2[1] ??
"") ==
"") {
59 array(
"chap" => array(
"integer", $a_chap),
60 "component" => array(
"text", $id[0]),
61 "screen_id" => array(
"text", $id[1]),
62 "screen_sub_id" => array(
"text", $id2[0]),
63 "perm" => array(
"text", $id2[1]),
64 "module_id" => array(
"integer", 0)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
◆ $db
The documentation for this class was generated from the following file: