ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCourseLP Class Reference
+ Inheritance diagram for ilCourseLP:
+ Collaboration diagram for ilCourseLP:

Public Member Functions

 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 getSettingsInfo ()
 
 getMembers ($a_search=true)
 
 getMailTemplateId ()
 
- Public Member Functions inherited from ilObjectLP
 resetCaches ()
 
 isAnonymized ()
 
 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 isActive ()
 
 getModeText ($a_mode)
 
 getModeInfoText ($a_mode)
 
 getSettingsInfo ()
 
 getCollectionInstance ()
 
 getMembers ($a_search=true)
 
 resetLPDataForCompleteObject ($a_recursive=true)
 
 resetLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 handleToTrash ()
 
 handleDelete ()
 
 getMailTemplateId ()
 

Static Public Member Functions

static getDefaultModes ($a_lp_active)
 Get available type-specific default modes (no administration needed) More...
 
- Static Public Member Functions inherited from ilObjectLP
static getInstance ($a_obj_id)
 
static getTypeClass ($a_type)
 
static isSupportedObjectType ($a_type)
 
static handleMove ($a_source_ref_id)
 
static getLPMemberships ($a_usr_id, array $a_obj_ids, $a_parent_ref_id=null, $a_mapped_ref_ids=false)
 Get all objects where given user is member (from LP POV) More...
 
static supportsSpentSeconds ($a_obj_type)
 
static supportsMark ($a_obj_type)
 
static supportsMatrixView ($a_obj_type)
 
static getDefaultModes ($a_lp_active)
 Get available type-specific default modes (no administration needed) More...
 
static saveTypeDefaults (array $a_data)
 
static getTypeDefault ($a_type)
 Get current type default. More...
 

Protected Member Functions

 checkObjectives ()
 
- Protected Member Functions inherited from ilObjectLP
 __construct ($a_obj_id)
 
 resetCustomLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 gatherLPUsers ()
 
 updateParentCollections ()
 

Static Protected Member Functions

static isLPMember (array &$a_res, $a_usr_id, $a_obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
- Static Protected Member Functions inherited from ilObjectLP
static isLPMember (array &$a_res, $a_usr_id, $a_obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
static findMembershipsByPath (array &$a_res, $a_usr_id, $a_parent_ref_id, array $a_obj_ids, $a_mapped_ref_ids=false)
 Find (lp-relevant) memberships by path. More...
 
static getTypeDefaultFromDB ($a_type)
 

Additional Inherited Members

- Protected Attributes inherited from ilObjectLP
 $tree
 
 $db
 
 $obj_id
 
 $collection_instance
 
 $mode
 
- Static Protected Attributes inherited from ilObjectLP
static $type_defaults
 

Detailed Description

Definition at line 14 of file class.ilCourseLP.php.

Member Function Documentation

◆ checkObjectives()

ilCourseLP::checkObjectives ( )
protected

Definition at line 60 of file class.ilCourseLP.php.

61 {
62 include_once "Modules/Course/classes/class.ilObjCourse.php";
64 return true;
65 }
66 return false;
67 }
const IL_CRS_VIEW_OBJECTIVE
static _lookupViewMode($a_id)
lookup view mode of container

References ilObjCourse\_lookupViewMode(), and IL_CRS_VIEW_OBJECTIVE.

Referenced by getCurrentMode(), getDefaultMode(), and getValidModes().

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

◆ getCurrentMode()

ilCourseLP::getCurrentMode ( )

Reimplemented from ilObjectLP.

Definition at line 52 of file class.ilCourseLP.php.

53 {
54 if ($this->checkObjectives()) {
56 }
57 return parent::getCurrentMode();
58 }

References checkObjectives(), and ilLPObjSettings\LP_MODE_OBJECTIVES.

+ Here is the call graph for this function:

◆ getDefaultMode()

ilCourseLP::getDefaultMode ( )

Reimplemented from ilObjectLP.

Definition at line 32 of file class.ilCourseLP.php.

References checkObjectives(), ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, and ilLPObjSettings\LP_MODE_OBJECTIVES.

+ Here is the call graph for this function:

◆ getDefaultModes()

static ilCourseLP::getDefaultModes (   $a_lp_active)
static

Get available type-specific default modes (no administration needed)

Parameters
bool$a_lp_active
Returns
array

Reimplemented from ilObjectLP.

Definition at line 16 of file class.ilCourseLP.php.

17 {
18 // objectives cannot be supported
19
20 if (!$a_lp_active) {
21 return array(
23 );
24 } else {
25 return array(
28 );
29 }
30 }

References ilLPObjSettings\LP_MODE_DEACTIVATED, and ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR.

◆ getMailTemplateId()

ilCourseLP::getMailTemplateId ( )

Reimplemented from ilObjectLP.

Definition at line 120 of file class.ilCourseLP.php.

121 {
122 include_once './Modules/Course/classes/class.ilCourseMailTemplateTutorContext.php';
124 }

References ilCourseMailTemplateTutorContext\ID.

◆ getMembers()

ilCourseLP::getMembers (   $a_search = true)

Reimplemented from ilObjectLP.

Definition at line 83 of file class.ilCourseLP.php.

84 {
85 include_once "Modules/Course/classes/class.ilCourseParticipants.php";
86 $member_obj = ilCourseParticipants::_getInstanceByObjId($this->obj_id);
87 return $member_obj->getMembers();
88 }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.

References ilCourseParticipants\_getInstanceByObjId().

+ Here is the call graph for this function:

◆ getSettingsInfo()

ilCourseLP::getSettingsInfo ( )

Reimplemented from ilObjectLP.

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

70 {
71 global $DIC;
72
73 $lng = $DIC['lng'];
74
75 // #9004
76 include_once("./Modules/Course/classes/class.ilObjCourse.php");
77 $crs = new ilObjCourse($this->obj_id, false);
78 if ($crs->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
79 return $lng->txt("crs_status_determination_lp_info");
80 }
81 }
Class ilObjCourse.
const STATUS_DETERMINATION_LP
global $DIC
Definition: saml.php:7
$lng

References $DIC, $lng, and ilObjCourse\STATUS_DETERMINATION_LP.

◆ getValidModes()

ilCourseLP::getValidModes ( )

◆ isLPMember()

static ilCourseLP::isLPMember ( array &  $a_res,
  $a_usr_id,
  $a_obj_ids 
)
staticprotected

Find (lp-relevant) members for given object ids.

Parameters
array$a_res
int$a_usr_id
array$a_obj_ids

Reimplemented from ilObjectLP.

Definition at line 90 of file class.ilCourseLP.php.

91 {
92 global $DIC;
93
94 $ilDB = $DIC['ilDB'];
95
96 // will only find objects with roles for user!
97 // see ilParticipants::_getMembershipByType()
98 $query = " SELECT DISTINCT obd.obj_id, obd.type, obd2.title" .
99 " FROM rbac_ua ua" .
100 " JOIN rbac_fa fa ON (ua.rol_id = fa.rol_id)" .
101 " JOIN object_reference obr ON (fa.parent = obr.ref_id)" .
102 " JOIN object_data obd ON (obr.obj_id = obd.obj_id)" .
103 " JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id)" .
104 " WHERE obd.type = " . $ilDB->quote("crs", "text") .
105 " AND fa.assign = " . $ilDB->quote("y", "text") .
106 " AND ua.usr_id = " . $ilDB->quote($a_usr_id, "integer") .
107 " AND " . $ilDB->in("obd.obj_id", $a_obj_ids, "", "integer");
108 $set = $ilDB->query($query);
109 while ($row = $ilDB->fetchAssoc($set)) {
110 $role = $row["title"];
111 if (!stristr($role, "il_" . $row["type"] . "_admin_") &&
112 !stristr($role, "il_" . $row["type"] . "_tutor_")) {
113 $a_res[$row["obj_id"]] = true;
114 }
115 }
116
117 return true;
118 }
$row
$query
global $ilDB

References $DIC, $ilDB, $query, and $row.


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