5 require_once
"Services/Object/classes/class.ilObject2.php";
26 $this->folder_tree =& $a_tree;
37 public function doCloneObject($a_new_object, $a_target_id, $a_copy_id = 0)
64 global $rbacsystem, $tree, $ilAccess;
66 $tmpdir = $tmpdir.DIRECTORY_SEPARATOR.ilUtil::getASCIIFilename(
$title);
69 $subtree = $tree->getChildsByTypeFilter($refid, array(
"fold",
"file"));
71 foreach ($subtree as $child)
73 if (!$ilAccess->checkAccess(
"read",
"", $child[
"ref_id"]))
81 if ($child[
"type"] ==
"fold")
85 $newFilename = $tmpdir.DIRECTORY_SEPARATOR.ilUtil::getASCIIFilename($child[
"title"]);
88 if (!copy ($oldFilename, $newFilename))
90 throw new ilFileException(
"Could not copy ".$oldFilename.
" to ".$newFilename);
92 touch($newFilename, filectime($oldFilename));
99 global
$lng, $rbacsystem, $ilAccess;
100 include_once
"./Services/Utilities/classes/class.ilUtil.php";
101 include_once
'Modules/File/classes/class.ilObjFile.php';
102 include_once
'Modules/File/classes/class.ilFileException.php';
103 if (!$ilAccess->checkAccess(
"read",
"", $this->getRefId()))
105 $this->ilErr->raiseError(get_class($this).
"::downloadFolder(): missing read permission!",$this->ilErr->WARNING);
109 $this->ilErr->raiseError(get_class($this).
"::downloadFolder(): object is trashed!",$this->ilErr->WARNING);
115 $basename = ilUtil::getAsciiFilename($this->
getTitle());
116 $deliverFilename = $basename.
".zip";
117 $zipbasedir = $tmpdir.DIRECTORY_SEPARATOR.$basename;
118 $tmpzipfile = $tmpdir.DIRECTORY_SEPARATOR.$deliverFilename;