ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 */
3 include_once('./Services/FileSystem/classes/class.ilFileSystemGUI.php');
4 
14 {
15  public function __construct($a_main_directory)
16  {
17  global $DIC;
18 
19  $this->ctrl = $DIC->ctrl();
20  parent::__construct($a_main_directory);
21  }
22 
29  public function getTable($a_dir, $a_subdir)
30  {
31  include_once("./Modules/Exercise/classes/class.ilExAssignmentFileSystemTableGUI.php");
33  $this,
34  "listFiles",
35  $a_dir,
36  $a_subdir,
37  $this->label_enable,
38  $this->file_labels,
39  $this->label_header,
40  $this->commands,
41  $this->getPostDirPath(),
42  $this->getTableId()
43  );
44  }
45 
46 
52  public function uploadFile()
53  {
54  $filename = ilUtil::stripSlashes($_FILES["new_file"]["name"]);
55 
57  parent::uploadFile();
58  }
59 
63  public function saveFilesOrder()
64  {
66 
67  if ($_GET["ass_id"]) {
69  $ilCtrl->redirect($this, "listFiles");
70  }
71  }
72 
78  public function deleteFile()
79  {
80  if ($_GET["ass_id"]) {
82 
83  parent::deleteFile();
84  }
85  }
86 
90  public function renameFile()
91  {
92  if ($_GET["ass_id"]) {
93  $new_name = str_replace("..", "", ilUtil::stripSlashes($_POST["new_name"]));
94  $old_name = str_replace("/", "", $_GET["old_name"]);
95 
96  if ($new_name != $old_name) {
97  ilExAssignment::renameInstructionFile($old_name, $new_name, $_GET['ass_id']);
98  }
99  }
100  parent::renameFile();
101  }
102 }
uploadFile()
Insert into database the file order and update the file.
getTableId()
Get table id.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static instructionFileInsertOrder($a_filename, $a_ass_id, $a_order_nr=0)
Store the file order in the database.
deleteFile()
delete object file we can pass one parameter to deleteFile in fileSystemGUI, that contains the name o...
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
getPostDirPath()
Get post dir path.
static saveInstructionFilesOrderOfAssignment($a_ass_id, $a_order)
Save ordering of instruction files for an assignment.
File System Explorer GUI class.
static renameInstructionFile($a_old_name, $a_new_name, $a_ass_id)
static instructionFileDeleteOrder($a_ass_id, $a_file)
$_POST["username"]