5 include_once
"Services/Tracking/classes/class.ilLPObjSettings.php";
22 $this->obj_id = (int)$a_obj_id;
27 global $objDefinition;
29 static $instances = array();
31 if(!isset($instances[$a_obj_id]))
42 include_once
"Modules/Course/classes/class.ilCourseLP.php";
47 include_once
"Modules/Group/classes/class.ilGroupLP.php";
52 include_once
"Modules/Folder/classes/class.ilFolderLP.php";
60 include_once
"Modules/LearningModule/classes/class.ilLearningModuleLP.php";
65 include_once
"Modules/HTMLLearningModule/classes/class.ilHTMLLearningModuleLP.php";
70 include_once
"Modules/ScormAicc/classes/class.ilScormLP.php";
78 include_once
"Modules/Test/classes/class.ilTestLP.php";
83 include_once
"Modules/Exercise/classes/class.ilExerciseLP.php";
88 include_once
"Modules/Session/classes/class.ilSessionLP.php";
93 case $objDefinition->isPluginTypeName($type):
94 include_once
"Services/Component/classes/class.ilPluginLP.php";
100 $instance =
new self($a_obj_id);
104 $instances[$a_obj_id] = $instance;
107 return $instances[$a_obj_id];
112 global $objDefinition;
114 $valid = array(
"crs",
"grp",
"fold",
"lm",
"htlm",
"sahs",
"tst",
"exc",
"sess");
115 if(in_array($a_type,
$valid))
120 return $objDefinition->isPluginTypeName($a_type);
126 $this->collection_instance = null;
152 if($this->mode === null)
159 $this->mode = (int)
$mode;
198 if($this->collection_instance === null)
200 $path =
"Services/Tracking/classes/collection/";
207 include_once
$path.
"class.ilLPCollectionOfRepositoryObjects.php";
212 include_once
$path.
"class.ilLPCollectionOfObjectives.php";
217 include_once
$path.
"class.ilLPCollectionOfSCOs.php";
223 include_once
$path.
"class.ilLPCollectionOfLMChapters.php";
228 $this->collection_instance =
false;
256 foreach(array_reverse(
$path) as $path_ref_id)
259 $all = $olp->getMembers(
false);
275 if(
sizeof($user_ids))
283 if((
bool)$a_recursive &&
284 method_exists($this,
"getPossibleCollectionItems"))
286 $subitems = $this->getPossibleCollectionItems();
287 if(is_array($subitems))
289 foreach($subitems as $sub_ref_id)
292 $olp->resetLPDataForUserIds($a_user_ids,
false);
299 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
302 include_once
"Services/Tracking/classes/class.ilChangeEvent.php";
306 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
307 foreach($a_user_ids as $user_id)
320 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
323 include_once
"Services/Tracking/classes/class.ilChangeEvent.php";
338 $ref_ids = $tree->getSubTreeIds($a_source_ref_id);
339 $ref_ids[] = $a_source_ref_id;
342 $new_path = $tree->getPathId($a_source_ref_id);
343 array_pop($new_path);
344 $new_path = implode(
"/", $new_path);
346 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
349 $set = $ilDB->query(
"SELECT DISTINCT(ut_lp_collections.obj_id) obj_id".
350 " FROM object_reference".
351 " JOIN ut_lp_collections ON".
352 " (".$ilDB->in(
"object_reference.ref_id", $ref_ids,
"",
"integer").
353 " AND object_reference.ref_id = ut_lp_collections.item_id)");
354 while ($rec = $ilDB->fetchAssoc($set))
359 $coll_ref_id = array_pop($coll_ref_id);
362 if($coll_ref_id == $a_source_ref_id)
368 if($tree->isGrandChild($a_source_ref_id, $coll_ref_id))
374 $coll_path = $tree->getPathId($coll_ref_id);
375 $coll_path = implode(
"/", $coll_path);
378 if(!stristr($new_path, $coll_path))
381 $query =
"DELETE FROM ut_lp_collections".
382 " WHERE obj_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
383 " AND ".$ilDB->in(
"item_id", $ref_ids,
"",
"integer");
384 $ilDB->manipulate(
$query);
399 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
402 include_once
"Services/Tracking/classes/class.ilChangeEvent.php";
408 $collection->delete();
418 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
421 $set = $ilDB->query(
"SELECT ut_lp_collections.obj_id obj_id FROM ".
422 "object_reference JOIN ut_lp_collections ON ".
423 "(object_reference.obj_id = ".$ilDB->quote($this->obj_id,
"integer").
424 " AND object_reference.ref_id = ut_lp_collections.item_id)");
425 while ($rec = $ilDB->fetchAssoc($set))
430 $query =
"DELETE FROM ut_lp_collections".
431 " WHERE obj_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
432 " AND item_id = ".$ilDB->quote($this->obj_id,
"integer");
433 $ilDB->manipulate(
$query);