24 include_once(
'Services/Migration/DBUpdate_5069/classes/class.ilFileSystemStorage5069.php');
37 public function __construct($a_container_id = 0, $a_ass_id = 0)
39 $this->ass_id = $a_ass_id;
40 parent::__construct(self::STORAGE_DATA,
true,$a_container_id);
50 if ($this->ass_id > 0)
52 $this->submission_path = $this->path.
"/subm_".$this->ass_id;
53 $this->tmp_path = $this->path.
"/tmp_".$this->ass_id;
54 $this->feedb_path = $this->path.
"/feedb_".$this->ass_id;
55 $this->multi_feedback_upload_path = $this->path.
"/mfb_up_".$this->ass_id;
56 $this->peer_review_upload_path = $this->path.
"/peer_up_".$this->ass_id;
57 $this->path.=
"/ass_".$this->ass_id;
95 return $this->submission_path;
103 return $this->tmp_path;
111 $path = $this->feedb_path.
"/".$a_user_id;
112 if(!file_exists(
$path))
121 $path = $this->feedb_path.
"/0";
122 if(!file_exists(
$path))
135 $path = $this->multi_feedback_upload_path.
"/".$a_user_id;
136 if(!file_exists(
$path))
149 $path = $this->peer_review_upload_path.
"/".$a_peer_id.
"/".$a_giver_id;
153 $path .= (int)$a_crit_id.
"/";
155 if(!file_exists(
$path))
171 if(!file_exists($this->submission_path))
175 if(!file_exists($this->tmp_path))
179 if(!file_exists($this->feedb_path))
192 if (!is_dir($this->path))
197 $dp = opendir($this->path);
198 while(
$file = readdir($dp))
200 if(!is_dir($this->path.
'/'.
$file))
204 'size' => filesize($this->path.
'/'.
$file),
205 'ctime' => filectime($this->path.
'/'.
$file),
206 'fullpath' => $this->path.
'/'.
$file);
226 function uploadFile($a_http_post_file, $user_id, $is_unziped =
false)
234 if(isset($a_http_post_file) && $a_http_post_file[
'size'])
246 $savepath .=
'/' .$user_id;
247 if(!is_dir($savepath))
253 if (!is_dir($savepath))
258 $prefix = sprintf(
"%04d%02d%02d%02d%02d%02d", $now[
"year"], $now[
"mon"], $now[
"mday"], $now[
"hours"],
259 $now[
"minutes"], $now[
"seconds"]);
265 $savepath .
"/" . $prefix .
"_" .
$filename);
270 rename($a_http_post_file[
'tmp_name'],
271 $savepath .
"/" . $prefix .
"_" .
$filename);
274 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
276 if (is_file($savepath .
"/" . $prefix .
"_" .
$filename))
279 "filename" => $prefix .
"_" . $filename,
280 "fullname" => $savepath .
"/" . $prefix .
"_" . $filename,
299 while(
$file = readdir($dp))
301 if(!is_dir($this->path.
'/'.
$file) && substr(
$file, 0, 1) !=
".")
334 return $dir.
"/".$a_file;
343 if (is_array($a_files[
"name"]))
345 foreach ($a_files[
"name"] as $k => $name)
349 $type = $a_files[
"type"][$k];
350 $tmp_name = $a_files[
"tmp_name"][$k];
351 $size = $a_files[
"size"][$k];
354 $this->path.DIRECTORY_SEPARATOR.basename($name),
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getFeedbackPath($a_user_id)
Get feedback path.
getPathPrefix()
Implementation of abstract method.
getPathPostfix()
Implementation of abstract method.
getFeedbackFiles($a_user_id)
Get number of feedback files.
getAbsoluteSubmissionPath()
Get submission path.
countFeedbackFiles($a_user_id)
Count number of feedback files for a user.
init()
Append ass_<ass_id> to path (assignment id)
__construct($a_container_id=0, $a_ass_id=0)
Constructor.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getPeerReviewUploadPath($a_peer_id, $a_giver_id, $a_crit_id)
Get pear review upload path (each peer handled in a separate path)
getTempPath()
Get submission path.
getAbsolutePath()
Get absolute path of storage directory.
uploadAssignmentFiles($a_files)
Upload assignment files (e.g.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Create styles array
The data for the language used.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
uploadFile($a_http_post_file, $user_id, $is_unziped=false)
store delivered file in filesystem
create()
Create directory.
getAssignmentFilePath($a_file)
Get path for assignment file.
getMultiFeedbackUploadPath($a_user_id)
Get multi feedback upload path (each uploader handled in a separate path)
getFiles()
Get assignment files.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
getFeedbackFilePath($a_user_id, $a_file)
Get path for feedback file.