ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjSAHSLearningModuleAccess Class Reference

Class ilObjContentObjectAccess. More...

+ Inheritance diagram for ilObjSAHSLearningModuleAccess:
+ Collaboration diagram for ilObjSAHSLearningModuleAccess:

Static Public Member Functions

static getConditionOperators ()
 Get possible conditions operaditors. More...
 
static checkCondition (int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
 check condition for a specific user and object More...
 
static _getCommands (?int $a_obj_id=null)
 get commands this method returns an array of all possible commands/permission combinations example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), ); More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _lookupDiskUsage (int $a_id)
 Returns the number of bytes used on the harddisk by the learning module with the specified object id. More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 
static getConditionOperators ()
 Returns an array with valid operators for the specific object type. More...
 
static checkCondition (int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
 check condition for a specific user and object More...
 

Additional Inherited Members

- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Detailed Description

Member Function Documentation

◆ _checkGoto()

static ilObjSAHSLearningModuleAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 82 of file class.ilObjSAHSLearningModuleAccess.php.

82 : bool
83 {
84 global $DIC;
85 $ilAccess = $DIC->access();
86
87 $t_arr = explode("_", $target);
88
89 if ($t_arr[0] !== "sahs" || ((int) $t_arr[1]) <= 0) {
90 return false;
91 }
92
93 if ($ilAccess->checkAccess("visible", "", (int) $t_arr[1]) || $ilAccess->checkAccess("read", "", (int) $t_arr[1])) {
94 return true;
95 }
96 return false;
97 }
global $DIC
Definition: shib_login.php:26

References $DIC.

◆ _getCommands()

static ilObjSAHSLearningModuleAccess::_getCommands ( ?int  $a_obj_id = null)
static

get commands this method returns an array of all possible commands/permission combinations example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Returns
array<int, array>

Definition at line 69 of file class.ilObjSAHSLearningModuleAccess.php.

69 : array
70 {
71 $commands = array(
72 array("permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true),
73 // array("permission" => "write", "cmd" => "editContent", "lang_var" => "edit_content"),
74 array("permission" => "write", "cmd" => "edit", "lang_var" => "settings")
75 );
76 return $commands;
77 }

◆ _lookupDiskUsage()

static ilObjSAHSLearningModuleAccess::_lookupDiskUsage ( int  $a_id)
static

Returns the number of bytes used on the harddisk by the learning module with the specified object id.

Parameters
int$a_idobject id of a file object.

Definition at line 105 of file class.ilObjSAHSLearningModuleAccess.php.

105 : int
106 {
107 $lm_data_dir = ilFileUtils::getWebspaceDir('filesystem') . "/lm_data";
108 $lm_dir = $lm_data_dir . DIRECTORY_SEPARATOR . "lm_" . $a_id;
109
110 return file_exists($lm_dir) ? ilFileUtils::dirsize($lm_dir) : 0;
111 }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static dirsize(string $directory)
get size of a directory or a file.

References ilFileUtils\dirsize(), and ilFileUtils\getWebspaceDir().

Referenced by ilObjSAHSLearningModule\getDiskUsage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCondition()

static ilObjSAHSLearningModuleAccess::checkCondition ( int  $a_trigger_obj_id,
string  $a_operator,
string  $a_value,
int  $a_usr_id 
)
static

check condition for a specific user and object

Implements ilConditionHandling.

Definition at line 41 of file class.ilObjSAHSLearningModuleAccess.php.

46 : bool {
47 switch ($a_operator) {
49 return ilLPStatus::_lookupStatus($a_trigger_obj_id, $a_usr_id) == ilLPStatus::LP_STATUS_FAILED_NUM;
50 break;
51
53 default:
54 return ilLPStatus::_hasUserCompleted($a_trigger_obj_id, $a_usr_id);
55 }
56 }
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
const LP_STATUS_FAILED_NUM

References ilLPStatus\_hasUserCompleted(), ilLPStatus\_lookupStatus(), ilLPStatus\LP_STATUS_FAILED_NUM, ilConditionHandler\OPERATOR_FAILED, and ilConditionHandler\OPERATOR_FINISHED.

+ Here is the call graph for this function:

◆ getConditionOperators()

static ilObjSAHSLearningModuleAccess::getConditionOperators ( )
static

Get possible conditions operaditors.

Returns
string[]

Implements ilConditionHandling.

Definition at line 33 of file class.ilObjSAHSLearningModuleAccess.php.

33 : array
34 {
35 return array(
38 );
39 }

References ilConditionHandler\OPERATOR_FAILED, and ilConditionHandler\OPERATOR_FINISHED.


The documentation for this class was generated from the following file: