ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjectLP Class Reference
+ Inheritance diagram for ilObjectLP:
+ Collaboration diagram for ilObjectLP:

Public Member Functions

 resetCaches ()
 isAnonymized ()
 getDefaultMode ()
 getValidModes ()
 getCurrentMode ()
 isActive ()
 getModeText ($a_mode)
 getModeInfoText ($a_mode)
 getCollectionInstance ()
 getMembers ($a_search=true)
 resetLPDataForCompleteObject ($a_recursive=true)
 resetLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 handleToTrash ()
 handleDelete ()

Static Public Member Functions

static getInstance ($a_obj_id)
static handleMove ($a_source_ref_id)

Protected Member Functions

 __construct ($a_obj_id)
 resetCustomLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 gatherLPUsers ()
 updateParentCollections ()

Protected Attributes

 $obj_id
 $collection_instance
 $mode

Detailed Description

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

Constructor & Destructor Documentation

ilObjectLP::__construct (   $a_obj_id)
protected

Reimplemented in ilPluginLP.

Definition at line 20 of file class.ilObjectLP.php.

{
$this->obj_id = (int)$a_obj_id;
}

Member Function Documentation

ilObjectLP::gatherLPUsers ( )
protected

Definition at line 301 of file class.ilObjectLP.php.

References ilLPMarks\_getAllUserIds(), and ilChangeEvent\_getAllUserIds().

Referenced by resetLPDataForCompleteObject().

{
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$user_ids = ilLPMarks::_getAllUserIds($this->obj_id);
include_once "Services/Tracking/classes/class.ilChangeEvent.php";
$user_ids = array_merge($user_ids, ilChangeEvent::_getAllUserIds($this->obj_id));
return $user_ids;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectLP::getCollectionInstance ( )

Definition at line 177 of file class.ilObjectLP.php.

References $collection_instance, $mode, $path, getCurrentMode(), ilLPObjSettings\LP_MODE_COLLECTION, ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilLPObjSettings\LP_MODE_COLLECTION_TLT, ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, ilLPObjSettings\LP_MODE_OBJECTIVES, and ilLPObjSettings\LP_MODE_SCORM.

Referenced by handleDelete().

{
// :TODO: factory if not plugin ?!
// => move to ilLPCollection::getInstance() ?!
if($this->collection_instance === null)
{
$path = "Services/Tracking/classes/collection/";
$mode = $this->getCurrentMode();
switch($mode)
{
include_once $path."class.ilLPCollectionOfRepositoryObjects.php";
$this->collection_instance = new ilLPCollectionOfRepositoryObjects($this->obj_id, $mode);
break;
include_once $path."class.ilLPCollectionOfObjectives.php";
$this->collection_instance = new ilLPCollectionOfObjectives($this->obj_id, $mode);
break;
include_once $path."class.ilLPCollectionOfSCOs.php";
$this->collection_instance = new ilLPCollectionOfSCOs($this->obj_id, $mode);
break;
include_once $path."class.ilLPCollectionOfLMChapters.php";
$this->collection_instance = new ilLPCollectionOfLMChapters($this->obj_id, $mode);
break;
default:
$this->collection_instance = false;
break;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectLP::getCurrentMode ( )

Reimplemented in ilPluginLP, ilScormLP, and ilCourseLP.

Definition at line 134 of file class.ilObjectLP.php.

References $mode, ilLPObjSettings\_lookupDBMode(), and getDefaultMode().

Referenced by getCollectionInstance(), and isActive().

{
if($this->mode === null)
{
if($mode === null)
{
$mode = $this->getDefaultMode();
}
$this->mode = (int)$mode;
}
return $this->mode;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectLP::getDefaultMode ( )

Reimplemented in ilPluginLP, ilCourseLP, ilExerciseLP, ilFolderLP, ilGroupLP, ilHTMLLearningModuleLP, ilLearningModuleLP, ilScormLP, ilSessionLP, and ilTestLP.

Definition at line 124 of file class.ilObjectLP.php.

References ilLPObjSettings\LP_MODE_UNDEFINED.

Referenced by getCurrentMode().

+ Here is the caller graph for this function:

static ilObjectLP::getInstance (   $a_obj_id)
static

Definition at line 25 of file class.ilObjectLP.php.

References ilObject\_lookupType().

Referenced by ilLPTableBaseGUI\__construct(), ilTrSummaryTableGUI\__construct(), ilLPProgressTableGUI\__construct(), ilLPListOfSettingsGUI\__construct(), ilLearningProgressGUI\__getNextClass(), ilLPListOfProgressGUI\__initDetails(), ilLPListOfObjectsGUI\__initDetails(), ilLearningProgressBaseGUI\__readItemStatusInfo(), ilLearningProgressBaseGUI\__setSubTabs(), ilLearningProgressBaseGUI\__showEditUser(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPStatusFactory\_getClassById(), ilLPStatusCollection\_getCompleted(), ilLPStatusCollection\_getFailed(), ilLPStatusCollection\_getInProgress(), ilLPStatusFactory\_getInstance(), ilLPStatusCollectionTLT\_getStatusInfo(), ilLPStatusCollectionManual\_getStatusInfo(), ilLPStatusSCORM\_getStatusInfo(), ilLPStatusCollection\_getStatusInfo(), ilLPStatusCollectionManual\_setObjectStatus(), ilTimingCache\_showWarning(), ilConditionHandlerInterface\assign(), ilLearningProgressAccess\checkAccess(), ilLMExplorer\checkLPIcon(), ilLMExplorerGUI\checkLPIcon(), ilContainer\cloneDependencies(), ilLPListOfProgressGUI\details(), ilLPStatusSCORM\determinePercentage(), ilLPStatusSCORM\determineStatus(), ilLPStatusCollection\determineStatus(), ilLearningProgressGUI\editManual(), ilLPProgressTableGUI\fillRow(), ilLPCronObjectStatistics\gatherCourseLPData(), ilSCORMCertificateAdapter\getCertificateVariablesDescription(), ilSCORMCertificateAdapter\getCertificateVariablesForPresentation(), ilSCORMCertificateAdapter\getCertificateVariablesForPreview(), getMembers(), ilTrUserObjectsPropsTableGUI\getObjectHierarchy(), ilTrQuery\getObjectIds(), ilTrQuery\getObjectsStatusForUser(), ilLPTableBaseGUI\getSelectableUserColumns(), ilObjSCORMInitData\getStatus(), ilTrQuery\getSubItemsStatusForUser(), ilTrQuery\getSubTree(), ilCourseAppEventListener\handleEvent(), ilTrackingAppEventListener\handleEvent(), ilSCORMOfflineMode\il2sop(), ilLearningProgressBaseGUI\ilLearningProgressBaseGUI(), ilLPObjSettings\ilLPObjSettings(), ilObjGroupGUI\initAttendanceList(), ilObjCourseGUI\initAttendanceList(), ilLearningProgressGUI\initCollectionManualForm(), ilObjCourseGUI\initEditForm(), ilTrUserObjectsPropsTableGUI\initFilter(), ilConditionHandlerInterface\initFormCondition(), ilLPStatusPlugin\initPluginObj(), ilLPTableBaseGUI\isPercentageAvailable(), ilObjGroupGUI\membersObject(), ilObjCourseGUI\membersObject(), ilLPCollectionOfRepositoryObjects\parseTableGUIItem(), ilLPTableBaseGUI\parseTitle(), ilLPStatus\preloadListGUIData(), ilObjTest\removeTestResults(), resetLPDataForUserIds(), ilLPTableBaseGUI\searchFilterListener(), ilObjContentObjectGUI\setilLMMenu(), ilInfoScreenGUI\showLearningProgress(), ilLearningProgressGUI\showtlt(), ilConditionHandlerInterface\updateCondition(), ilObjCourseGUI\updateLPFromStatus(), ilLearningProgressGUI\updateManual(), and ilLPCollectionOfRepositoryObjects\validateEntry().

{
global $objDefinition;
static $instances = array();
if(!isset($instances[$a_obj_id]))
{
$type = ilObject::_lookupType($a_obj_id);
switch($type)
{
// container
case "crs":
include_once "Modules/Course/classes/class.ilCourseLP.php";
$instance = new ilCourseLP($a_obj_id);
break;
case "grp":
include_once "Modules/Group/classes/class.ilGroupLP.php";
$instance = new ilGroupLP($a_obj_id);
break;
case "fold":
include_once "Modules/Folder/classes/class.ilFolderLP.php";
$instance = new ilFolderLP($a_obj_id);
break;
// learning resources
case "lm":
include_once "Modules/LearningModule/classes/class.ilLearningModuleLP.php";
$instance = new ilLearningModuleLP($a_obj_id);
break;
case "htlm":
include_once "Modules/HTMLLearningModule/classes/class.ilHTMLLearningModuleLP.php";
$instance = new ilHTMLLearningModuleLP($a_obj_id);
break;
case "sahs":
include_once "Modules/ScormAicc/classes/class.ilScormLP.php";
$instance = new ilScormLP($a_obj_id);
break;
// misc
case "tst":
include_once "Modules/Test/classes/class.ilTestLP.php";
$instance = new ilTestLP($a_obj_id);
break;
case "exc":
include_once "Modules/Exercise/classes/class.ilExerciseLP.php";
$instance = new ilExerciseLP($a_obj_id);
break;
case "sess":
include_once "Modules/Session/classes/class.ilSessionLP.php";
$instance = new ilSessionLP($a_obj_id);
break;
// plugin
case $objDefinition->isPluginTypeName($type):
include_once "Services/Component/classes/class.ilPluginLP.php";
$instance = new ilPluginLP($a_obj_id);
break;
default:
// :TODO: should we return anything?
$instance = new self($a_obj_id);
break;
}
$instances[$a_obj_id] = $instance;
}
return $instances[$a_obj_id];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectLP::getMembers (   $a_search = true)

Reimplemented in ilCourseLP, and ilGroupLP.

Definition at line 225 of file class.ilObjectLP.php.

References $path, $ref_id, ilObject\_getAllReferences(), ilObject\_lookupObjId(), and getInstance().

{
global $tree;
if(!$a_search)
{
return;
}
$ref_ids = ilObject::_getAllReferences($this->obj_id);
$ref_id = current($ref_ids);
// walk path to find parent with specific members
$path = $tree->getPathId($ref_id);
array_pop($path);
foreach(array_reverse($path) as $path_ref_id)
{
$all = $olp->getMembers(false);
if(is_array($all))
{
return $all;
}
}
}

+ Here is the call graph for this function:

ilObjectLP::getModeInfoText (   $a_mode)

Definition at line 167 of file class.ilObjectLP.php.

References ilLPObjSettings\_mode2InfoText().

{
}

+ Here is the call graph for this function:

ilObjectLP::getModeText (   $a_mode)

Definition at line 162 of file class.ilObjectLP.php.

References ilLPObjSettings\_mode2Text().

{
return ilLPObjSettings::_mode2Text($a_mode);
}

+ Here is the call graph for this function:

ilObjectLP::getValidModes ( )
ilObjectLP::handleDelete ( )
final

Definition at line 380 of file class.ilObjectLP.php.

References ilChangeEvent\_delete(), ilLPMarks\deleteObject(), getCollectionInstance(), and updateParentCollections().

{
include_once "Services/Tracking/classes/class.ilLPMarks.php";
ilLPMarks::deleteObject($this->obj_id);
include_once "Services/Tracking/classes/class.ilChangeEvent.php";
ilChangeEvent::_delete($this->obj_id);
$collection = $this->getCollectionInstance();
if($collection)
{
$collection->delete();
}
}

+ Here is the call graph for this function:

static ilObjectLP::handleMove (   $a_source_ref_id)
staticfinal

Definition at line 317 of file class.ilObjectLP.php.

References $query, ilObject\_getAllReferences(), ilObject\_lookupType(), and ilLPStatusWrapper\_refreshStatus().

Referenced by ilTrackingAppEventListener\handleEvent().

{
global $tree, $ilDB;
$ref_ids = $tree->getSubTreeIds($a_source_ref_id);
$ref_ids[] = $a_source_ref_id;
// get "parent" path to source node (not including source node)
$new_path = $tree->getPathId($a_source_ref_id);
array_pop($new_path);
$new_path = implode("/", $new_path);
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
// find collections with ref_ids
$set = $ilDB->query("SELECT DISTINCT(ut_lp_collections.obj_id) obj_id".
" FROM object_reference".
" JOIN ut_lp_collections ON".
" (".$ilDB->in("object_reference.ref_id", $ref_ids, "", "integer").
" AND object_reference.ref_id = ut_lp_collections.item_id)");
while ($rec = $ilDB->fetchAssoc($set))
{
if (in_array(ilObject::_lookupType($rec["obj_id"]), array("crs", "grp", "fold")))
{
$coll_ref_id = ilObject::_getAllReferences($rec["obj_id"]);
$coll_ref_id = array_pop($coll_ref_id);
// #13402
if($coll_ref_id == $a_source_ref_id)
{
continue;
}
// #17703 - collection has also been moved - nothing todo
if($tree->isGrandChild($a_source_ref_id, $coll_ref_id))
{
continue;
}
// get path to collection (including collection "parent")
$coll_path = $tree->getPathId($coll_ref_id);
$coll_path = implode("/", $coll_path);
// collection path is not inside new path
if(!stristr($new_path, $coll_path))
{
// delete all items of moved (sub-)tree
$query = "DELETE FROM ut_lp_collections".
" WHERE obj_id = ".$ilDB->quote($rec["obj_id"], "integer").
" AND ".$ilDB->in("item_id", $ref_ids, "", "integer");
$ilDB->manipulate($query);
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectLP::handleToTrash ( )
final

Definition at line 375 of file class.ilObjectLP.php.

References updateParentCollections().

{
}

+ Here is the call graph for this function:

ilObjectLP::isActive ( )

Definition at line 149 of file class.ilObjectLP.php.

References $mode, getCurrentMode(), ilLPObjSettings\LP_MODE_DEACTIVATED, and ilLPObjSettings\LP_MODE_UNDEFINED.

{
// :TODO: check LP activation?
$mode = $this->getCurrentMode();
{
return false;
}
return true;
}

+ Here is the call graph for this function:

ilObjectLP::isAnonymized ( )

Reimplemented in ilTestLP.

Definition at line 113 of file class.ilObjectLP.php.

{
// see ilLPCollectionOfRepositoryObjects::validateEntry()
return false;
}
ilObjectLP::resetCaches ( )

Definition at line 107 of file class.ilObjectLP.php.

{
$this->mode = null;
$this->collection_instance = null;
}
ilObjectLP::resetCustomLPDataForUserIds ( array  $a_user_ids,
  $a_recursive = true 
)
protected

Reimplemented in ilTestLP.

Definition at line 296 of file class.ilObjectLP.php.

Referenced by resetLPDataForUserIds().

{
// this should delete all data that is relevant for the supported LP modes
}

+ Here is the caller graph for this function:

ilObjectLP::resetLPDataForCompleteObject (   $a_recursive = true)
final

Definition at line 256 of file class.ilObjectLP.php.

References gatherLPUsers(), and resetLPDataForUserIds().

{
$user_ids = $this->gatherLPUsers();
if(sizeof($user_ids))
{
$this->resetLPDataForUserIds(array_unique($user_ids), $a_recursive);
}
}

+ Here is the call graph for this function:

ilObjectLP::resetLPDataForUserIds ( array  $a_user_ids,
  $a_recursive = true 
)
final

Definition at line 265 of file class.ilObjectLP.php.

References ilLPMarks\_deleteForUsers(), ilChangeEvent\_deleteReadEventsForUsers(), ilObject\_lookupObjId(), ilLPStatusWrapper\_updateStatus(), getInstance(), and resetCustomLPDataForUserIds().

Referenced by resetLPDataForCompleteObject().

{
if((bool)$a_recursive)
{
$subitems = $this->getPossibleCollectionItems();
if(is_array($subitems))
{
foreach($subitems as $sub_ref_id)
{
$olp->resetLPDataForUserIds($a_user_ids, false);
}
}
}
$this->resetCustomLPDataForUserIds($a_user_ids, (bool)$a_recursive);
include_once "Services/Tracking/classes/class.ilLPMarks.php";
ilLPMarks::_deleteForUsers($this->obj_id, $a_user_ids);
include_once "Services/Tracking/classes/class.ilChangeEvent.php";
ilChangeEvent::_deleteReadEventsForUsers($this->obj_id, $a_user_ids);
// update LP status to get collections up-to-date
include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
foreach($a_user_ids as $user_id)
{
ilLPStatusWrapper::_updateStatus($this->obj_id, $user_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectLP::updateParentCollections ( )
finalprotected

Definition at line 397 of file class.ilObjectLP.php.

References $query, ilObject\_lookupType(), and ilLPStatusWrapper\_refreshStatus().

Referenced by handleDelete(), and handleToTrash().

{
global $ilDB;
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
// update parent collections?
$set = $ilDB->query("SELECT ut_lp_collections.obj_id obj_id FROM ".
"object_reference JOIN ut_lp_collections ON ".
"(object_reference.obj_id = ".$ilDB->quote($this->obj_id, "integer").
" AND object_reference.ref_id = ut_lp_collections.item_id)");
while ($rec = $ilDB->fetchAssoc($set))
{
if (in_array(ilObject::_lookupType($rec["obj_id"]), array("crs", "grp", "fold")))
{
// remove from parent collection
$query = "DELETE FROM ut_lp_collections".
" WHERE obj_id = ".$ilDB->quote($rec["obj_id"], "integer").
" AND item_id = ".$ilDB->quote($this->obj_id, "integer");
$ilDB->manipulate($query);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjectLP::$collection_instance
protected

Definition at line 17 of file class.ilObjectLP.php.

Referenced by getCollectionInstance().

ilObjectLP::$mode
protected

Definition at line 18 of file class.ilObjectLP.php.

Referenced by getCollectionInstance(), getCurrentMode(), and isActive().

ilObjectLP::$obj_id
protected

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


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