ILIAS
Release_3_10_x_branch Revision 61812
|
Handles conditions for accesses to different ILIAS objects. More...
Public Member Functions | |
ilConditionHandler () | |
constructor public | |
setReferenceHandlingType ($a_type) | |
set reference handling type | |
getReferenceHandlingType () | |
get reference handling type | |
setErrorMessage ($a_msg) | |
getErrorMessage () | |
setTargetRefId ($a_target_ref_id) | |
set target ref id | |
getTargetRefId () | |
get target ref id | |
setTargetObjId ($a_target_obj_id) | |
set target object id | |
getTargetObjId () | |
get target obj id | |
setTargetType ($a_target_type) | |
set target object type | |
getTargetType () | |
get target obj type | |
setTriggerRefId ($a_trigger_ref_id) | |
set trigger ref id | |
getTriggerRefId () | |
get target ref id | |
setTriggerObjId ($a_trigger_obj_id) | |
set trigger object id | |
getTriggerObjId () | |
get trigger obj id | |
setTriggerType ($a_trigger_type) | |
set trigger object type | |
getTriggerType () | |
get trigger obj type | |
setOperator ($a_operator) | |
set operator | |
getOperator () | |
get operator | |
setValue ($a_value) | |
set value | |
getValue () | |
get value | |
enableAutomaticValidation ($a_validate=true) | |
enable automated validation | |
getTriggerTypes () | |
get all possible trigger types NOT STATIC public | |
getOperatorsByTargetType ($a_type) | |
storeCondition () | |
store new condition in database NOT STATIC public | |
checkExists () | |
updateCondition ($a_id) | |
update condition | |
delete ($a_ref_id) | |
delete all trigger and target entries This method is called from ilObject::delete() if an object os removed from trash | |
deleteByObjId ($a_obj_id) | |
delete all trigger and target entries This method is called from ilObject::delete() if an object is removed from trash | |
deleteCondition ($a_id) | |
delete condition | |
_getCondition ($a_id) | |
_checkCondition ($a_id, $a_usr_id=0) | |
checks wether a single condition is fulfilled every trigger object type must implement a static method _checkCondition($a_operator, $a_value) | |
_checkAllConditionsOfTarget ($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0) | |
checks wether all conditions of a target object are fulfilled | |
validate () | |
checkCircle ($a_ref_id, $a_obj_id) |
Static Public Member Functions | |
static | _isReferenceHandlingOptional ($a_type) |
is reference handling optional | |
static | _adjustMovedObjectConditions ($a_ref_id) |
In the moment it is not allowed to create preconditions on objects that are located outside of a course. | |
static | _getDistinctTargetRefIds () |
Get all target ref ids. | |
static | _deleteTargetConditionsByRefId ($a_target_ref_id) |
Delete conditions by target ref id Note: only conditions on the target type are deleted Conditions on e.g chapters are not handled. | |
_getConditionsOfTrigger ($a_trigger_obj_type, $a_trigger_id) | |
get all conditions of trigger object | |
_getConditionsOfTarget ($a_target_ref_id, $a_target_obj_id, $a_target_type="") | |
get all conditions of target object |
Data Fields | |
const | UNIQUE_CONDITIONS = 1 |
const | SHARED_CONDITIONS = 0 |
$db | |
$lng | |
$error_message | |
$target_obj_id | |
$target_ref_id | |
$target_type | |
$trigger_obj_id | |
$trigger_ref_id | |
$trigger_type | |
$operator | |
$value | |
$validation | |
$conditions |
Handles conditions for accesses to different ILIAS objects.
A condition consists of four elements:
If a condition is fulfilled for a certain user, (s)he may access the target object. This first implementation handles only one access type per object, which is usually "read" access. A possible future extension may implement different access types.
The condition data is stored in the database table "condition" (Note: This table must not be accessed directly from other classes. The data should be accessed via the interface of class ilCondition.) cond_id INT condition id trigger_obj_type VARCHAR(10) "crs" | "tst" | "qst", ... trigger_id INT obj id of trigger object operator varchar(10 "=", "<", ">", ">=", "<=", "passed", "contains", ... value VARCHAR(10) optional value target_obj_type VARCHAR(10) "lm" | "frm" | "st" | "pg", ... target_id object or reference id of target object
Trigger objects are always stored with their object id (if a test has been passed by a user, he doesn't need to repeat it in other contexts. But target objects are usually stored with their reference id if available, otherwise, if they are non-referenced objects (e.g. (survey) questions) they are stored with their object id.
Stefan Meyer 10-08-2004 In addition we store the ref_id of the trigger object to allow the target object to link to the triggered object. But it's not possible to assign two or more linked (same obj_id) triggered objects to a target object
Examples:
Learning module 5 may only be accessed, if test 6 has been passed: trigger_obj_type "tst" trigger_id 6 (object id) trigger_ref_id 117 operator "passed" value target_obj_type "lm" target_id 5 (reference id)
Survey question 10 should only be presented, if survey question 8 is answered with a value greater than 4. trigger_obj_type "qst" trigger_id 8 (question (instance) object id) trigger_ref_id 117 operator ">" value "4" target_obj_type "lm" target_id 10 (question (instance) object id)
Definition at line 86 of file class.ilConditionHandler.php.
|
static |
In the moment it is not allowed to create preconditions on objects that are located outside of a course.
Therefore, after moving an object: check for parent type 'crs'. if that fails delete preconditions
public
int | reference id of moved object |
Definition at line 153 of file class.ilConditionHandler.php.
References $conditions, _deleteTargetConditionsByRefId(), and _getDistinctTargetRefIds().
Referenced by ilSoapObjectAdministration\moveObject(), and ilContainerGUI\pasteObject().
ilConditionHandler::_checkAllConditionsOfTarget | ( | $a_target_ref_id, | |
$a_target_id, | |||
$a_target_type = "" , |
|||
$a_usr_id = 0 |
|||
) |
checks wether all conditions of a target object are fulfilled
Definition at line 707 of file class.ilConditionHandler.php.
References $ilBench, _checkCondition(), and _getConditionsOfTarget().
Referenced by ilCourseObjectivePresentationGUI\__showLearningMaterials(), ilCourseObjectivePresentationGUI\__showOtherResources(), ilCourseObjectivePresentationGUI\__showTests(), ilObjContentObject\_checkPreconditionsOfPage(), ilAccessHandler\doConditionCheck(), ilObjCourseListGUI\initItem(), ilObjCourseReferenceListGUI\initItem(), ilRepositoryExplorer\isClickable(), ilRepositoryExplorer\showChilds(), ilCourseContentGUI\showStartObjects(), and ilObjCourseGUI\showStartObjects().
ilConditionHandler::_checkCondition | ( | $a_id, | |
$a_usr_id = 0 |
|||
) |
checks wether a single condition is fulfilled every trigger object type must implement a static method _checkCondition($a_operator, $a_value)
Definition at line 663 of file class.ilConditionHandler.php.
References ilLPStatusWrapper\_getCompleted(), and _getCondition().
Referenced by _checkAllConditionsOfTarget(), ilObjContentObject\_getMissingPreconditionsOfPage(), ilObjContentObject\_getMissingPreconditionsTopChapter(), and ilObjectListGUI\insertPreconditions().
|
static |
Delete conditions by target ref id Note: only conditions on the target type are deleted Conditions on e.g chapters are not handled.
public
int | ref id of target |
Definition at line 207 of file class.ilConditionHandler.php.
Referenced by _adjustMovedObjectConditions().
ilConditionHandler::_getCondition | ( | $a_id | ) |
Definition at line 630 of file class.ilConditionHandler.php.
References $res, and DB_FETCHMODE_OBJECT.
Referenced by _checkCondition(), ilConditionHandlerInterface\edit(), ilConditionHandlerInterface\initFormCondition(), and ilConditionHandlerInterface\updateCondition().
|
static |
get all conditions of target object
$a_target_ref_id | target reference id |
$a_target_obj_id | target object id |
$a_target_type | target object type (must be provided only if object is not derived from ilObject and therefore stored in object_data; this is e.g. the case for chapters (type = "st")) |
Definition at line 584 of file class.ilConditionHandler.php.
References $conditions, $ilBench, $res, ilObject\_lookupType(), and DB_FETCHMODE_OBJECT.
Referenced by ilConditionHandlerInterface\__getConditionsOfTarget(), _checkAllConditionsOfTarget(), ilObjCourseGrouping\_checkGroupingDependencies(), ilObjCourseGrouping\_getGroupingCourseIds(), ilObjCourseGrouping\_getGroupingItems(), ilObjContentObject\_getMissingPreconditionsOfPage(), ilObjContentObject\_getMissingPreconditionsTopChapter(), checkCircle(), ilAccessHandler\doConditionCheck(), ilObjectListGUI\insertPreconditions(), and ilConditionHandlerInterface\listConditions().
|
static |
get all conditions of trigger object
Definition at line 545 of file class.ilConditionHandler.php.
References $conditions, $res, and DB_FETCHMODE_OBJECT.
Referenced by ilObjCourseGrouping\_checkGroupingDependencies(), ilLPObjSettings\_checkSCORMPreconditions(), ilObjCourseGrouping\_getGroupingCourseIds(), ilObjCourseGrouping\_getGroupingItems(), ilObjCourseGrouping\deassign(), and ilObjCourseGrouping\getAssignedItems().
|
static |
Get all target ref ids.
public
Definition at line 184 of file class.ilConditionHandler.php.
References $res, and DB_FETCHMODE_OBJECT.
Referenced by _adjustMovedObjectConditions().
|
static |
is reference handling optional
public
string | target type ILIAS obj type |
Definition at line 131 of file class.ilConditionHandler.php.
Referenced by ilConditionHandlerInterface\initFormCondition().
ilConditionHandler::checkCircle | ( | $a_ref_id, | |
$a_obj_id | |||
) |
Definition at line 764 of file class.ilConditionHandler.php.
References _getConditionsOfTarget(), and getOperator().
Referenced by validate().
ilConditionHandler::checkExists | ( | ) |
Definition at line 458 of file class.ilConditionHandler.php.
References $res, getOperator(), getTargetObjId(), getTargetRefId(), getTriggerObjId(), and getTriggerRefId().
ilConditionHandler::delete | ( | $a_ref_id | ) |
delete all trigger and target entries This method is called from ilObject::delete() if an object os removed from trash
Definition at line 497 of file class.ilConditionHandler.php.
References $res.
ilConditionHandler::deleteByObjId | ( | $a_obj_id | ) |
delete all trigger and target entries This method is called from ilObject::delete() if an object is removed from trash
Definition at line 513 of file class.ilConditionHandler.php.
References $res.
ilConditionHandler::deleteCondition | ( | $a_id | ) |
delete condition
Definition at line 529 of file class.ilConditionHandler.php.
References $res.
Referenced by storeCondition().
ilConditionHandler::enableAutomaticValidation | ( | $a_validate = true | ) |
enable automated validation
Definition at line 382 of file class.ilConditionHandler.php.
ilConditionHandler::getErrorMessage | ( | ) |
Definition at line 246 of file class.ilConditionHandler.php.
References $error_message.
ilConditionHandler::getOperator | ( | ) |
get operator
Definition at line 358 of file class.ilConditionHandler.php.
References $operator.
Referenced by checkCircle(), checkExists(), storeCondition(), and updateCondition().
ilConditionHandler::getOperatorsByTargetType | ( | $a_type | ) |
Definition at line 398 of file class.ilConditionHandler.php.
ilConditionHandler::getReferenceHandlingType | ( | ) |
get reference handling type
public
Definition at line 236 of file class.ilConditionHandler.php.
Referenced by storeCondition(), and updateCondition().
ilConditionHandler::getTargetObjId | ( | ) |
get target obj id
Definition at line 278 of file class.ilConditionHandler.php.
References $target_obj_id.
Referenced by checkExists(), and storeCondition().
ilConditionHandler::getTargetRefId | ( | ) |
get target ref id
Definition at line 262 of file class.ilConditionHandler.php.
References $target_ref_id.
Referenced by checkExists(), storeCondition(), updateCondition(), and validate().
ilConditionHandler::getTargetType | ( | ) |
get target obj type
Definition at line 294 of file class.ilConditionHandler.php.
References $target_type.
Referenced by storeCondition().
ilConditionHandler::getTriggerObjId | ( | ) |
get trigger obj id
Definition at line 326 of file class.ilConditionHandler.php.
References $trigger_obj_id.
Referenced by checkExists(), and storeCondition().
ilConditionHandler::getTriggerRefId | ( | ) |
get target ref id
Definition at line 310 of file class.ilConditionHandler.php.
References $trigger_ref_id.
Referenced by checkExists(), storeCondition(), and validate().
ilConditionHandler::getTriggerType | ( | ) |
get trigger obj type
Definition at line 342 of file class.ilConditionHandler.php.
References $trigger_type.
Referenced by storeCondition().
ilConditionHandler::getTriggerTypes | ( | ) |
get all possible trigger types NOT STATIC public
Definition at line 392 of file class.ilConditionHandler.php.
ilConditionHandler::getValue | ( | ) |
get value
Definition at line 374 of file class.ilConditionHandler.php.
References $value.
Referenced by storeCondition(), and updateCondition().
ilConditionHandler::ilConditionHandler | ( | ) |
ilConditionHandler::setErrorMessage | ( | $a_msg | ) |
Definition at line 242 of file class.ilConditionHandler.php.
Referenced by validate().
ilConditionHandler::setOperator | ( | $a_operator | ) |
set operator
Definition at line 350 of file class.ilConditionHandler.php.
ilConditionHandler::setReferenceHandlingType | ( | $a_type | ) |
set reference handling type
int | public |
Definition at line 225 of file class.ilConditionHandler.php.
ilConditionHandler::setTargetObjId | ( | $a_target_obj_id | ) |
set target object id
Definition at line 270 of file class.ilConditionHandler.php.
ilConditionHandler::setTargetRefId | ( | $a_target_ref_id | ) |
set target ref id
Definition at line 254 of file class.ilConditionHandler.php.
ilConditionHandler::setTargetType | ( | $a_target_type | ) |
set target object type
Definition at line 286 of file class.ilConditionHandler.php.
ilConditionHandler::setTriggerObjId | ( | $a_trigger_obj_id | ) |
set trigger object id
Definition at line 318 of file class.ilConditionHandler.php.
ilConditionHandler::setTriggerRefId | ( | $a_trigger_ref_id | ) |
set trigger ref id
Definition at line 302 of file class.ilConditionHandler.php.
ilConditionHandler::setTriggerType | ( | $a_trigger_type | ) |
set trigger object type
Definition at line 334 of file class.ilConditionHandler.php.
ilConditionHandler::setValue | ( | $a_value | ) |
set value
Definition at line 366 of file class.ilConditionHandler.php.
ilConditionHandler::storeCondition | ( | ) |
store new condition in database NOT STATIC public
Definition at line 428 of file class.ilConditionHandler.php.
References $res, DB_FETCHMODE_OBJECT, deleteCondition(), getOperator(), getReferenceHandlingType(), getTargetObjId(), getTargetRefId(), getTargetType(), getTriggerObjId(), getTriggerRefId(), getTriggerType(), getValue(), and validate().
ilConditionHandler::updateCondition | ( | $a_id | ) |
update condition
Definition at line 476 of file class.ilConditionHandler.php.
References $res, getOperator(), getReferenceHandlingType(), getTargetRefId(), and getValue().
ilConditionHandler::validate | ( | ) |
Definition at line 728 of file class.ilConditionHandler.php.
References $res, checkCircle(), ilObjectFactory\getInstanceByRefId(), getTargetRefId(), getTriggerRefId(), and setErrorMessage().
Referenced by storeCondition().
ilConditionHandler::$conditions |
Definition at line 107 of file class.ilConditionHandler.php.
Referenced by _adjustMovedObjectConditions(), _getConditionsOfTarget(), and _getConditionsOfTrigger().
ilConditionHandler::$db |
Definition at line 91 of file class.ilConditionHandler.php.
ilConditionHandler::$error_message |
Definition at line 95 of file class.ilConditionHandler.php.
Referenced by getErrorMessage().
ilConditionHandler::$lng |
Definition at line 92 of file class.ilConditionHandler.php.
Referenced by ilConditionHandler().
ilConditionHandler::$operator |
Definition at line 103 of file class.ilConditionHandler.php.
Referenced by getOperator().
ilConditionHandler::$target_obj_id |
Definition at line 97 of file class.ilConditionHandler.php.
Referenced by getTargetObjId().
ilConditionHandler::$target_ref_id |
Definition at line 98 of file class.ilConditionHandler.php.
Referenced by getTargetRefId().
ilConditionHandler::$target_type |
Definition at line 99 of file class.ilConditionHandler.php.
Referenced by getTargetType().
ilConditionHandler::$trigger_obj_id |
Definition at line 100 of file class.ilConditionHandler.php.
Referenced by getTriggerObjId().
ilConditionHandler::$trigger_ref_id |
Definition at line 101 of file class.ilConditionHandler.php.
Referenced by getTriggerRefId().
ilConditionHandler::$trigger_type |
Definition at line 102 of file class.ilConditionHandler.php.
Referenced by getTriggerType().
ilConditionHandler::$validation |
Definition at line 105 of file class.ilConditionHandler.php.
ilConditionHandler::$value |
Definition at line 104 of file class.ilConditionHandler.php.
Referenced by getValue().
const ilConditionHandler::SHARED_CONDITIONS = 0 |
Definition at line 89 of file class.ilConditionHandler.php.
Referenced by ilConditionHandlerInterface\initFormCondition().
const ilConditionHandler::UNIQUE_CONDITIONS = 1 |
Definition at line 88 of file class.ilConditionHandler.php.
Referenced by ilConditionHandlerInterface\assign(), ilConditionHandlerInterface\initFormCondition(), and ilConditionHandlerInterface\updateCondition().