36 $request = $DIC->exercise()->internal()->gui()->request();
37 $this->requested_file_hash = $request->getFileHash();
54 return (array) glob(
$path .
"*.*");
60 $storage->
deleteDirectory($storage->getPeerReviewUploadPath($this->peer_id, $this->giver_id, $this->getId()));
69 foreach ($this->
getFiles() as $file) {
70 $existing[] = basename($file);
76 $files->setValue(implode(
"<br />", $existing));
77 $files->setAllowDeletion(
true);
78 $this->
form->addItem($files);
88 if ($this->
form->getItemByPostVar(
"prccc_file_" . $this->getId())->getDeletionFlag()) {
90 $this->
form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setValue(
"");
93 $incoming = $_FILES[
"prccc_file_" . $this->
getId()];
94 if ($incoming[
"tmp_name"]) {
95 $org_name = basename($incoming[
"name"]);
98 $incoming[
"tmp_name"],
108 return count($this->
getFiles()) > 0;
119 $this->
form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setAlert(
$lng->
txt(
"msg_input_is_required"));
132 $hash = trim($this->requested_file_hash);
134 foreach ($this->
getFiles() as $file) {
135 if (md5($file) == $hash) {
147 $crit_id = $this->
getId()
149 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fu", $this->giver_id .
"__" . $this->peer_id .
"__" . $crit_id);
152 foreach ($this->
getFiles() as $file) {
153 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf", md5($file));
154 $dl = $ilCtrl->getLinkTargetByClass(
"ilExPeerReviewGUI",
"downloadPeerReview");
155 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf",
"");
157 $files[] =
'<a href="' . $dl .
'">' . basename($file) .
'</a>';
160 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fu",
"");
162 return implode(
"<br />", $files);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
deleteDirectory(string $a_abs_name)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
string $requested_file_hash
getPeerReviewUploadPath(int $a_peer_id, int $a_giver_id, ?int $a_crit_id=null)
Get pear review upload path (each peer handled in a separate path)
addToPeerReviewForm($a_value=null)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
importFromPeerReviewForm()