Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 require_once "./classes/class.ilContainer.php";
00035
00036 class ilObjFolder extends ilContainer
00037 {
00038 var $folder_tree;
00039
00046 function ilObjFolder($a_id = 0,$a_call_by_reference = true)
00047 {
00048 $this->type = "fold";
00049 $this->ilObjContainer($a_id,$a_call_by_reference);
00050 }
00051
00052 function setFolderTree($a_tree)
00053 {
00054 $this->folder_tree =& $a_tree;
00055 }
00056
00065 public function cloneObject($a_target_id,$a_copy_id)
00066 {
00067 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
00068
00069
00070 include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
00071 $obj_settings = new ilLPObjSettings($this->getId());
00072 $obj_settings->cloneSettings($new_obj->getId());
00073 unset($obj_settings);
00074
00075 return $new_obj;
00076 }
00077
00082 function putInTree($a_parent)
00083 {
00084 global $tree;
00085
00086 if (!is_object($this->folder_tree))
00087 {
00088 $this->folder_tree =& $tree;
00089 }
00090
00091 if ($this->withReferences())
00092 {
00093
00094 $this->folder_tree->insertNode($this->getRefId(), $a_parent);
00095 }
00096 else
00097 {
00098
00099 $this->folder_tree->insertNode($this->getId(), $a_parent);
00100 }
00101 }
00102
00111 public function cloneDependencies($a_target_id,$a_copy_id)
00112 {
00113 global $tree;
00114
00115 if($course_ref_id = $tree->checkForParentType($this->getRefId(),'crs') and
00116 $new_course_ref_id = $tree->checkForParentType($a_target_id,'crs'))
00117 {
00118 include_once('Modules/Course/classes/class.ilCourseItems.php');
00119 $course_obj =& ilObjectFactory::getInstanceByRefId($course_ref_id,false);
00120 $course_items = new ilCourseItems($course_obj,$this->getRefId());
00121 $course_items->cloneDependencies($a_target_id,$a_copy_id);
00122 }
00123
00124 include_once('Services/Tracking/classes/class.ilLPCollections.php');
00125 $lp_collection = new ilLPCollections($this->getId());
00126 $lp_collection->cloneCollections($a_target_id,$a_copy_id);
00127
00128 return true;
00129 }
00130
00131 }
00132 ?>