ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilExAssignmentFileSystemGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
11{
12 public function __construct($a_main_directory)
13 {
14 global $DIC;
15
16 $this->ctrl = $DIC->ctrl();
17 parent::__construct($a_main_directory);
18 }
19
26 public function getTable($a_dir, $a_subdir)
27 {
29 $this,
30 "listFiles",
31 $a_dir,
32 $a_subdir,
33 $this->label_enable,
34 $this->file_labels,
35 $this->label_header,
36 $this->commands,
37 $this->getPostDirPath(),
38 $this->getTableId()
39 );
40 }
41
42
48 public function uploadFile()
49 {
50 $filename = ilUtil::stripSlashes($_FILES["new_file"]["name"]);
51
53 parent::uploadFile();
54 }
55
59 public function saveFilesOrder()
60 {
61 $ilCtrl = $this->ctrl;
62
63 if ($_GET["ass_id"]) {
65 $ilCtrl->redirect($this, "listFiles");
66 }
67 }
68
74 public function deleteFile()
75 {
76 if ($_GET["ass_id"]) {
78
79 parent::deleteFile();
80 }
81 }
82
86 public function renameFile()
87 {
88 if ($_GET["ass_id"]) {
89 $new_name = str_replace("..", "", ilUtil::stripSlashes($_POST["new_name"]));
90 $old_name = str_replace("/", "", $_GET["old_name"]);
91
92 if ($new_name != $old_name) {
93 ilExAssignment::renameInstructionFile($old_name, $new_name, $_GET['ass_id']);
94 }
95 }
96 parent::renameFile();
97 }
98}
$filename
Definition: buildRTE.php:89
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
deleteFile()
delete object file we can pass one parameter to deleteFile in fileSystemGUI, that contains the name o...
uploadFile()
Insert into database the file order and update the file.
static instructionFileInsertOrder($a_filename, $a_ass_id, $a_order_nr=0)
Store the file order in the database.
static saveInstructionFilesOrderOfAssignment($a_ass_id, $a_order)
Save ordering of instruction files for an assignment.
static renameInstructionFile($a_old_name, $a_new_name, $a_ass_id)
static instructionFileDeleteOrder($a_ass_id, $a_file)
File System Explorer GUI class.
getTableId()
Get table id.
getPostDirPath()
Get post dir path.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc