• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

classes/class.ilObjFolder.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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                 // Copy learning progress settings
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                         // put reference id into tree
00094                         $this->folder_tree->insertNode($this->getRefId(), $a_parent);
00095                 }
00096                 else
00097                 {
00098                         // put object id into tree
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 } // END class.ilObjFolder
00132 ?>

Generated on Fri Dec 13 2013 17:56:47 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1