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->peer_review_upload_path = $this->path.
"/peer_up_".$this->ass_id;
59 $this->path.=
"/ass_".$this->ass_id;
97 return $this->submission_path;
105 return $this->tmp_path;
113 $path = $this->feedb_path.
"/".$a_user_id;
114 if(!file_exists(
$path))
123 $path = $this->feedb_path.
"/0";
124 if(!file_exists(
$path))
137 $path = $this->multi_feedback_upload_path.
"/".$a_user_id;
138 if(!file_exists(
$path))
151 $path = $this->peer_review_upload_path.
"/".$a_peer_id.
"/".$a_giver_id.
"/";
155 $path .= (int)$a_crit_id.
"/";
157 if(!file_exists(
$path))
173 if(!file_exists($this->submission_path))
177 if(!file_exists($this->tmp_path))
181 if(!file_exists($this->feedb_path))
194 if (!is_dir($this->path))
199 $dp = opendir($this->path);
200 while(
$file = readdir($dp))
202 if(!is_dir($this->path.
'/'.
$file))
206 'size' => filesize($this->path.
'/'.
$file),
207 'ctime' => filectime($this->path.
'/'.
$file),
208 'fullpath' => $this->path.
'/'.
$file);
228 function uploadFile($a_http_post_file, $user_id, $is_unziped =
false)
238 if(isset($a_http_post_file) && $a_http_post_file[
'size'])
242 include_once(
"./Services/Utilities/classes/class.ilFileUtils.php");
254 $savepath .=
'/' .$user_id;
255 if(!is_dir($savepath))
261 if (!is_dir($savepath))
266 $prefix = sprintf(
"%04d%02d%02d%02d%02d%02d", $now[
"year"], $now[
"mon"], $now[
"mday"], $now[
"hours"],
267 $now[
"minutes"], $now[
"seconds"]);
272 $savepath .
"/" . $prefix .
"_" .
$filename);
277 rename($a_http_post_file[
'tmp_name'],
278 $savepath .
"/" . $prefix .
"_" .
$filename);
281 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
283 if (is_file($savepath .
"/" . $prefix .
"_" .
$filename))
286 "filename" => $prefix .
"_" . $filename,
287 "fullname" => $savepath .
"/" . $prefix .
"_" . $filename,
306 while(
$file = readdir($dp))
308 if(!is_dir($this->path.
'/'.
$file) && substr(
$file, 0, 1) !=
".")
341 return $dir.
"/".$a_file;
350 if (is_array($a_files[
"name"]))
352 foreach ($a_files[
"name"] as $k => $name)
356 $type = $a_files[
"type"][$k];
357 $tmp_name = $a_files[
"tmp_name"][$k];
358 $size = $a_files[
"size"][$k];
361 $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)
uploadFile($a_http_post_file, $user_id, $is_unziped=false)
store delivered file in filesystem
__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.
getPeerReviewUploadPath($a_peer_id, $a_giver_id, $a_crit_id)
Get pear review upload path (each peer handled in a separate path)
Create styles array
The data for the language used.
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)
countFeedbackFiles($a_user_id)
Count number of feedback files for a user.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
getPathPostfix()
Implementation of abstract method.
static getValidFilename($a_filename)
Get valid filename.
getFeedbackFilePath($a_user_id, $a_file)
Get path for feedback file.
getPathPrefix()
Implementation of abstract method.