ILIAS  release_7 Revision v7.30-3-g800a261c036
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 */
11{
12 //this property will define if the table needs order column.
13 protected $add_order_column = true;
14 protected $child_class_name = 'ilExAssignmentFileSystemTableGUI';
15
16 public function __construct(
17 $a_parent_obj,
18 $a_parent_cmd,
19 $a_cur_dir,
20 $a_cur_subdir,
21 $a_label_enable = false,
22 $a_file_labels,
23 $a_label_header = "",
24 $a_commands = array(),
25 $a_post_dir_path = false,
26 $a_table_id = ""
27 ) {
28 global $DIC;
29
30 $this->lng = $DIC->language();
31
33 $a_parent_obj,
34 $a_parent_cmd,
35 $a_cur_dir,
36 $a_cur_subdir,
37 $a_label_enable,
38 $a_file_labels,
39 $a_label_header,
40 $a_commands,
41 $a_post_dir_path,
42 "exc_instr_files"
43 );
44
45 $this->setLimit(9999);
46
47 //default template with order block
48 //$this->setRowTemplate("tpl.exc_ass_instruction_file_row.html", "Modules/Exercise");
49 $this->setDefaultOrderField("order_val");
50 $this->setDefaultOrderDirection("asc");
51 }
52
58 public function getEntries()
59 {
60 $entries = parent::getEntries();
61 if (count($entries) > 0) {
62 $this->addCommandButton("saveFilesOrder", $this->lng->txt("exc_save_order"));
63 }
64 $ass = new ilExAssignment((int) $_GET['ass_id']);
65 return $ass->fileAddOrder($entries);
66 }
67
74 public function numericOrdering($a_field)
75 {
76 if ($a_field == "order_val") {
77 return true;
78 }
79 return false;
80 }
81
82
83
84 public function addColumns()
85 {
86 if ($this->has_multi) {
87 $this->setSelectAllCheckbox("file[]");
88 $this->addColumn("", "", "1", true);
89 }
90
91 $this->addColumn($this->lng->txt("exc_presentation_order"), "order_val", "", false, $this->child_class_name);
92
93 $this->addColumn("", "", "1", true); // icon
94
95 $this->addColumn($this->lng->txt("cont_dir_file"), "name");
96 $this->addColumn($this->lng->txt("cont_size"), "size");
97
98 if ($this->label_enable) {
99 $this->addColumn($this->label_header, "label");
100 }
101
102 if (sizeof($this->row_commands)) {
103 $this->addColumn($this->lng->txt("actions"));
104 }
105 }
106
110 protected function fillRow($a_set)
111 {
112 $this->tpl->setCurrentBlock("Order");
113 if ($a_set['order_id']) {
114 $this->tpl->setVariable("ID", $a_set['order_id']);
115 }
116 if ($a_set["order_val"]) {
117 $this->tpl->setVariable("ORDER_VAL", $a_set["order_val"]);
118 }
119 $this->tpl->parseCurrentBlock();
120
121 parent::fillRow($a_set);
122 }
123}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
__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="")
Constructor.
getEntries()
Add Order Values (extension of ilFilesystemgui getEntries)
Exercise assignment.
TableGUI class for file system.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setLimit($a_limit=0, $a_default_limit=0)
set max.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
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.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc