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]))
39 include_once
"Modules/Course/classes/class.ilCourseLP.php";
44 include_once
"Modules/Group/classes/class.ilGroupLP.php";
49 include_once
"Modules/Folder/classes/class.ilFolderLP.php";
57 include_once
"Modules/LearningModule/classes/class.ilLearningModuleLP.php";
62 include_once
"Modules/HTMLLearningModule/classes/class.ilHTMLLearningModuleLP.php";
67 include_once
"Modules/ScormAicc/classes/class.ilScormLP.php";
75 include_once
"Modules/Test/classes/class.ilTestLP.php";
80 include_once
"Modules/Exercise/classes/class.ilExerciseLP.php";
85 include_once
"Modules/Session/classes/class.ilSessionLP.php";
90 case $objDefinition->isPluginTypeName($type):
91 include_once
"Services/Component/classes/class.ilPluginLP.php";
97 $instance =
new self($a_obj_id);
101 $instances[$a_obj_id] = $instance;
104 return $instances[$a_obj_id];
110 $this->collection_instance = null;
136 if($this->mode === null)
143 $this->mode = (int)
$mode;
182 if($this->collection_instance === null)
184 $path =
"Services/Tracking/classes/collection/";
191 include_once
$path.
"class.ilLPCollectionOfRepositoryObjects.php";
196 include_once
$path.
"class.ilLPCollectionOfObjectives.php";
201 include_once
$path.
"class.ilLPCollectionOfSCOs.php";
207 include_once
$path.
"class.ilLPCollectionOfLMChapters.php";
212 $this->collection_instance =
false;
240 foreach(array_reverse(
$path) as $path_ref_id)
243 $all = $olp->getMembers(
false);
259 if(
sizeof($user_ids))
267 if((
bool)$a_recursive)
269 $subitems = $this->getPossibleCollectionItems();
270 if(is_array($subitems))
272 foreach($subitems as $sub_ref_id)
275 $olp->resetLPDataForUserIds($a_user_ids,
false);
282 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
285 include_once
"Services/Tracking/classes/class.ilChangeEvent.php";
289 include_once
"Services/Tracking/classes/class.ilLPStatusWrapper.php";
290 foreach($a_user_ids as $user_id)
303 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
306 include_once
"Services/Tracking/classes/class.ilChangeEvent.php";
321 $ref_ids = $tree->getSubTreeIds($a_source_ref_id);
322 $ref_ids[] = $a_source_ref_id;
325 $new_path = $tree->getPathId($a_source_ref_id);
326 array_pop($new_path);
327 $new_path = implode(
"/", $new_path);
329 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
332 $set = $ilDB->query(
"SELECT DISTINCT(ut_lp_collections.obj_id) obj_id".
333 " FROM object_reference".
334 " JOIN ut_lp_collections ON".
335 " (".$ilDB->in(
"object_reference.ref_id", $ref_ids,
"",
"integer").
336 " AND object_reference.ref_id = ut_lp_collections.item_id)");
337 while ($rec = $ilDB->fetchAssoc($set))
342 $coll_ref_id = array_pop($coll_ref_id);
345 if($coll_ref_id == $a_source_ref_id)
351 if($tree->isGrandChild($a_source_ref_id, $coll_ref_id))
357 $coll_path = $tree->getPathId($coll_ref_id);
358 $coll_path = implode(
"/", $coll_path);
361 if(!stristr($new_path, $coll_path))
364 $query =
"DELETE FROM ut_lp_collections".
365 " WHERE obj_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
366 " AND ".$ilDB->in(
"item_id", $ref_ids,
"",
"integer");
367 $ilDB->manipulate(
$query);
382 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
385 include_once
"Services/Tracking/classes/class.ilChangeEvent.php";
391 $collection->delete();
401 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
404 $set = $ilDB->query(
"SELECT ut_lp_collections.obj_id obj_id FROM ".
405 "object_reference JOIN ut_lp_collections ON ".
406 "(object_reference.obj_id = ".$ilDB->quote($this->obj_id,
"integer").
407 " AND object_reference.ref_id = ut_lp_collections.item_id)");
408 while ($rec = $ilDB->fetchAssoc($set))
413 $query =
"DELETE FROM ut_lp_collections".
414 " WHERE obj_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
415 " AND item_id = ".$ilDB->quote($this->obj_id,
"integer");
416 $ilDB->manipulate(
$query);