ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilExAssignmentFileSystemTableGUI.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.ilFileSystemTableGUI.php');
4 
14 {
15  //this property will define if the table needs order column.
16  protected $add_order_column = true;
17  protected $child_class_name = 'ilExAssignmentFileSystemTableGUI';
18 
19  public function __construct(
20  $a_parent_obj,
21  $a_parent_cmd,
22  $a_cur_dir,
23  $a_cur_subdir,
24  $a_label_enable = false,
25  $a_file_labels,
26  $a_label_header = "",
27  $a_commands = array(),
28  $a_post_dir_path = false,
29  $a_table_id = ""
30  ) {
31  global $DIC;
32 
33  $this->lng = $DIC->language();
34 
35  parent::__construct(
36  $a_parent_obj,
37  $a_parent_cmd,
38  $a_cur_dir,
39  $a_cur_subdir,
40  $a_label_enable,
41  $a_file_labels,
42  $a_label_header,
43  $a_commands,
44  $a_post_dir_path,
45  "exc_instr_files"
46  );
47 
48  $this->setLimit(9999);
49 
50  //default template with order block
51  //$this->setRowTemplate("tpl.exc_ass_instruction_file_row.html", "Modules/Exercise");
52  $this->setDefaultOrderField("order_val");
53  $this->setDefaultOrderDirection("asc");
54  }
55 
61  public function getEntries()
62  {
63  $entries = parent::getEntries();
64  if (count($entries) > 0) {
65  $this->addCommandButton("saveFilesOrder", $this->lng->txt("exc_save_order"));
66  }
67  $ass = new ilExAssignment((int) $_GET['ass_id']);
68  return $ass->fileAddOrder($entries);
69  }
70 
77  public function numericOrdering($a_field)
78  {
79  if ($a_field == "order_val") {
80  return true;
81  }
82  return false;
83  }
84 
85 
86 
87  public function addColumns()
88  {
89  if ($this->has_multi) {
90  $this->setSelectAllCheckbox("file[]");
91  $this->addColumn("", "", "1", true);
92  }
93 
94  $this->addColumn($this->lng->txt("exc_presentation_order"), "order_val", "", false, $this->child_class_name);
95 
96  $this->addColumn("", "", "1", true); // icon
97 
98  $this->addColumn($this->lng->txt("cont_dir_file"), "name");
99  $this->addColumn($this->lng->txt("cont_size"), "size");
100 
101  if ($this->label_enable) {
102  $this->addColumn($this->label_header, "label");
103  }
104 
105  if (sizeof($this->row_commands)) {
106  $this->addColumn($this->lng->txt("actions"));
107  include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
108  }
109  }
110 
114  protected function fillRow($a_set)
115  {
116  $this->tpl->setCurrentBlock("Order");
117  if ($a_set['order_id']) {
118  $this->tpl->setVariable("ID", $a_set['order_id']);
119  }
120  if ($a_set["order_val"]) {
121  $this->tpl->setVariable("ORDER_VAL", $a_set["order_val"]);
122  }
123  $this->tpl->parseCurrentBlock();
124 
125  parent::fillRow($a_set);
126  }
127 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
Exercise assignment.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
__construct( $a_parent_obj, $a_parent_cmd, $a_cur_dir, $a_cur_subdir, $a_label_enable=false, $a_file_labels, $a_label_header="", $a_commands=array(), $a_post_dir_path=false, $a_table_id="")
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
getEntries()
Add Order Values (extension of ilFilesystemgui getEntries)
Create styles array
The data for the language used.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setLimit($a_limit=0, $a_default_limit=0)
TableGUI class for file system.