24 include_once(
'Services/FileSystem/classes/class.ilFileSystemStorage.php');
39 public function __construct($a_container_id = 0, $a_ass_id = 0)
41 $this->ass_id = $a_ass_id;
42 parent::__construct(self::STORAGE_DATA,
true,$a_container_id);
52 if ($this->ass_id > 0)
54 $this->submission_path = $this->path.
"/subm_".$this->ass_id;
55 $this->tmp_path = $this->path.
"/tmp_".$this->ass_id;
56 $this->feedb_path = $this->path.
"/feedb_".$this->ass_id;
57 $this->multi_feedback_upload_path = $this->path.
"/mfb_up_".$this->ass_id;
58 $this->path.=
"/ass_".$this->ass_id;
96 return $this->submission_path;
104 return $this->tmp_path;
112 $path = $this->feedb_path.
"/".$a_user_id;
113 if(!file_exists(
$path))
122 $path = $this->feedb_path.
"/0";
123 if(!file_exists(
$path))
136 $path = $this->multi_feedback_upload_path.
"/".$a_user_id;
137 if(!file_exists(
$path))
154 if(!file_exists($this->submission_path))
158 if(!file_exists($this->tmp_path))
162 if(!file_exists($this->feedb_path))
175 if (!is_dir($this->path))
180 $dp = opendir($this->path);
181 while(
$file = readdir($dp))
183 if(!is_dir($this->path.
'/'.
$file))
187 'size' => filesize($this->path.
'/'.
$file),
189 'fullpath' => $this->path.
'/'.
$file);
209 function deliverFile($a_http_post_file, $user_id, $is_unziped =
false)
217 if(isset($a_http_post_file) && $a_http_post_file[
'size'])
229 $savepath .=
'/' .$user_id;
230 if(!is_dir($savepath))
236 if (!is_dir($savepath))
238 require_once
"./Services/Utilities/classes/class.ilUtil.php";
239 #ilUtil::makeDirParents($savepath); 243 $prefix = sprintf(
"%04d%02d%02d%02d%02d%02d", $now[
"year"], $now[
"mon"], $now[
"mday"], $now[
"hours"],
244 $now[
"minutes"], $now[
"seconds"]);
250 $savepath .
"/" . $prefix .
"_" .
$filename);
255 rename($a_http_post_file[
'tmp_name'],
256 $savepath .
"/" . $prefix .
"_" .
$filename);
259 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
261 if (is_file($savepath .
"/" . $prefix .
"_" .
$filename))
264 "filename" => $prefix .
"_" . $filename,
265 "fullname" => $savepath .
"/" . $prefix .
"_" . $filename,
284 while(
$file = readdir($dp))
286 if(!is_dir($this->path.
'/'.
$file) && substr(
$file, 0, 1) !=
".")
319 return $dir.
"/".$a_file;
328 if (is_array($a_files[
"name"]))
330 foreach ($a_files[
"name"] as $k => $name)
334 $type = $a_files[
"type"][$k];
335 $tmp_name = $a_files[
"tmp_name"][$k];
336 $size = $a_files[
"size"][$k];
339 $this->path.DIRECTORY_SEPARATOR.basename($name),
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getAbsoluteSubmissionPath()
Get submission path.
init()
Append ass_<ass_id> to path (assignment id)
__construct($a_container_id=0, $a_ass_id=0)
Constructor.
getFeedbackFiles($a_user_id)
Get number of feedback files.
getTempPath()
Get submission path.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getAssignmentFilePath($a_file)
Get path for assignment file.
uploadAssignmentFiles($a_files)
Upload assignment files (e.g.
getFeedbackPath($a_user_id)
Get feedback path.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
getFiles()
Get assignment files.
getAbsolutePath()
Get absolute path of storage directory.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
create()
Create directory.
getMultiFeedbackUploadPath($a_user_id)
Get multi feedback upload path (each uploader handled in a separate path)
deliverFile($a_http_post_file, $user_id, $is_unziped=false)
store delivered file in filesystem
countFeedbackFiles($a_user_id)
Count number of feedback files for a user.
getPathPostfix()
Implementation of abstract method.
getFeedbackFilePath($a_user_id, $a_file)
Get path for feedback file.
getPathPrefix()
Implementation of abstract method.