ILIAS  release_8 Revision v8.24
class.ilExAssignmentFileSystemTableGUI.php
Go to the documentation of this file.
1<?php
2
24{
25 //this property will define if the table needs order column.
26 protected bool $add_order_column = true;
27 protected string $child_class_name = 'ilExAssignmentFileSystemTableGUI';
28 protected int $requested_ass_id;
29
30 public function __construct(
31 object $a_parent_obj,
32 string $a_parent_cmd,
33 string $a_cur_dir,
34 string $a_cur_subdir,
35 bool $a_label_enable,
36 ?array $a_file_labels,
37 ?string $a_label_header = "",
38 ?array $a_commands = array(),
39 ?bool $a_post_dir_path = false
40 ) {
42 global $DIC;
43
44 $request = $DIC->exercise()->internal()->gui()->request();
45 $this->requested_ass_id = $request->getAssId();
46
47 $this->lng = $DIC->language();
48
50 $a_parent_obj,
51 $a_parent_cmd,
52 $a_cur_dir,
53 $a_cur_subdir,
54 $a_label_enable,
55 $a_file_labels,
56 $a_label_header,
57 $a_commands,
58 $a_post_dir_path,
59 "exc_instr_files"
60 );
61
62 $this->setLimit(9999);
63
64 //default template with order block
65 //$this->setRowTemplate("tpl.exc_ass_instruction_file_row.html", "Modules/Exercise");
66 $this->setDefaultOrderField("order_val");
67 $this->setDefaultOrderDirection("asc");
68 }
69
74 public function getEntries(): array
75 {
76 $entries = parent::getEntries();
77 if ($entries !== []) {
78 $this->addCommandButton("saveFilesOrder", $this->lng->txt("exc_save_order"));
79 }
80 $ass = new ilExAssignment($this->requested_ass_id);
81 return $ass->fileAddOrder($entries);
82 }
83
84 public function numericOrdering(string $a_field): bool
85 {
86 if ($a_field == "order_val") {
87 return true;
88 }
89 return false;
90 }
91
92 public function addColumns(): void
93 {
94 if ($this->has_multi) {
95 $this->setSelectAllCheckbox("file[]");
96 $this->addColumn("", "", "1", true);
97 }
98
99 $this->addColumn($this->lng->txt("exc_presentation_order"), "order_val", "", false, $this->child_class_name);
100
101 $this->addColumn("", "", "1", true); // icon
102
103 $this->addColumn($this->lng->txt("cont_dir_file"), "name");
104 $this->addColumn($this->lng->txt("cont_size"), "size");
105
106 if ($this->label_enable) {
107 $this->addColumn($this->label_header, "label");
108 }
109
110 if ($this->row_commands !== []) {
111 $this->addColumn($this->lng->txt("actions"));
112 }
113 }
114
115 protected function fillRow(array $a_set): void
116 {
117 $this->tpl->setCurrentBlock("Order");
118 $this->tpl->setVariable("ID", (string) $a_set['order_id']);
119 $this->tpl->setVariable("ORDER_VAL", (string) $a_set["order_val"]);
120 $this->tpl->parseCurrentBlock();
121
122 parent::fillRow($a_set);
123 }
124}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
numericOrdering(string $a_field)
Should this field be sorted numeric?
getEntries()
Add Order Values (extension of ilFilesystemgui getEntries)
Exercise assignment.
__construct(ilFileSystemGUI $a_parent_obj, string $a_parent_cmd, string $a_cur_dir, string $a_cur_subdir, bool $a_label_enable, ?array $a_file_labels=[], ?string $a_label_header="", ?array $a_commands=[], ?bool $a_post_dir_path=false, ?string $a_table_id="")
Constructor.
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setDefaultOrderDirection(string $a_defaultorderdirection)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc