ILIAS  release_8 Revision v8.24
class.ilExAssignmentFileSystemGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected int $requested_ass_id;
27 protected string $requested_old_name;
28 protected string $requested_new_name;
29 protected array $requested_order;
31 protected array $requested_file;
32
33 public function __construct(string $main_absolute_directory)
34 {
36 global $DIC;
37
38 $request = $DIC->exercise()->internal()->gui()->request();
39 $this->requested_ass_id = $request->getAssId();
40 $this->requested_old_name = $request->getOldName();
41 $this->requested_new_name = $request->getNewName();
42 $this->requested_order = $request->getOrder();
43 $this->requested_file = $request->getInstructionFilesToDelete();
44 $this->ctrl = $DIC->ctrl();
45 parent::__construct($main_absolute_directory);
46 }
47
48 public function getTable(
49 string $a_dir,
50 string $a_subdir
53 $this,
54 "listFiles",
55 $a_dir,
56 $a_subdir,
57 $this->label_enable,
58 $this->file_labels,
59 "",
60 $this->getActionCommands(),
61 $this->getPostDirPath()
62 );
63 }
64
65
66 public function uploadFile(): void
67 {
68 $filename = ilUtil::stripSlashes($_FILES["new_file"]["name"]);
69
71 parent::uploadFile();
72 }
73
74 public function saveFilesOrder(): void
75 {
76 $ilCtrl = $this->ctrl;
77
78 if ($this->requested_ass_id > 0) {
79 ilExAssignment::saveInstructionFilesOrderOfAssignment($this->requested_ass_id, $this->requested_order);
80 $ilCtrl->redirect($this, "listFiles");
81 }
82 }
83
84 public function deleteFile(): void
85 {
86 if ($this->requested_ass_id > 0) {
87 ilExAssignment::instructionFileDeleteOrder($this->requested_ass_id, $this->requested_file);
88
89 parent::deleteFile();
90 }
91 }
92
96 public function renameFile(): void
97 {
98 if ($this->requested_ass_id > 0) {
99 $new_name = str_replace("..", "", ilUtil::stripSlashes($this->requested_new_name));
100 $old_name = str_replace("/", "", $this->requested_old_name);
101
102 if ($new_name != $old_name) {
103 ilExAssignment::renameInstructionFile($old_name, $new_name, $this->requested_ass_id);
104 }
105 }
106 parent::renameFile();
107 }
108}
$filename
Definition: buildRTE.php:78
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTable(string $a_dir, string $a_subdir)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static saveInstructionFilesOrderOfAssignment(int $a_ass_id, array $a_order)
static instructionFileDeleteOrder(int $a_ass_id, array $a_file)
static renameInstructionFile(string $a_old_name, string $a_new_name, int $a_ass_id)
static instructionFileInsertOrder(string $a_filename, int $a_ass_id, int $a_order_nr=0)
File System Explorer GUI class.
__construct(string $main_absolute_directory)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc