ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilObjLearningModuleAccess.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
15{
16
20 public function __construct()
21 {
22 global $DIC;
24
25 $this->access = $DIC->access();
26 }
27
28
29 protected static $lm_set = null;
30
34 public static function getConditionOperators()
35 {
36 // currently only one mode "ilConditionHandler::OPERATOR_LP"
37 // which is automatically added by condition handling, if lp is activated
38 return array();
39 }
40
41
52 public static function checkCondition($a_trigger_obj_id, $a_operator, $a_value, $a_usr_id)
53 {
54 return true;
55 }
56
57
62 public static function _lookupSetting($a_set)
63 {
64 if (!is_array(self::$lm_set)) {
65 $lm_set = new ilSetting("lm");
66 self::$lm_set = $lm_set->getAll();
67 }
68
69 return self::$lm_set[$a_set];
70 }
71
84 public static function _getCommands()
85 {
86 if (self::_lookupSetting("lm_starting_point") == "first") {
87 $commands = array(
88 array("permission" => "read", "cmd" => "view", "lang_var" => "show",
89 "default" => true),
90 array("permission" => "read", "cmd" => "continue", "lang_var" => "continue_work")
91 );
92 } else {
93 $commands = array(
94 array("permission" => "read", "cmd" => "continue", "lang_var" => "continue_work", "default" => true)
95 );
96 }
97 $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "edit_content");
98 $commands[] = array("permission" => "write", "cmd" => "properties", "lang_var" => "settings");
99
100 return $commands;
101 }
102
103
109 public function canBeDelivered(ilWACPath $ilWACPath)
110 {
111 $ilAccess = $this->access;
115 preg_match("/lm_data\\/lm_([0-9]*)\\//ui", $ilWACPath->getPath(), $results);
116 foreach (ilObject2::_getAllReferences($results[1]) as $ref_id) {
117 if ($ilAccess->checkAccess('read', '', $ref_id)) {
118 return true;
119 }
120 }
121
122 return false;
123 }
124}
An exception for terminatinating execution or to throw for unit testing.
Class ilObjContentObjectAccess.
Class ilObjLearningModuleAccess.
static checkCondition($a_trigger_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
static getConditionOperators()
Get possible conditions operators.
static _getAllReferences($a_id)
get all reference ids of object
ILIAS Setting Class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface for condition handling.
Class ilWACCheckingClass.
canBeDelivered(ilWACPath $ilWACPath)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$results
$lm_set
$DIC
Definition: xapitoken.php:46