ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSurveyQuestionPoolExportTableGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 protected bool $confirmdelete;
25 protected int $counter;
26
27 public function __construct(
28 object $a_parent_obj,
29 string $a_parent_cmd,
30 bool $confirmdelete = false
31 ) {
32 global $DIC;
33
34 parent::__construct($a_parent_obj, $a_parent_cmd);
35
36 $lng = $DIC->language();
37 $ilCtrl = $DIC->ctrl();
38
39 $this->lng = $lng;
40 $this->ctrl = $ilCtrl;
41 $this->confirmdelete = $confirmdelete;
42 $this->counter = 0;
43
44 $this->setFormName('phrases');
45 $this->setTitle($this->lng->txt('svy_export_files'));
46 $this->setStyle('table', 'fullwidth');
47 if (!$confirmdelete) {
48 $this->addColumn('', 'f', '1%');
49 }
50 $this->addColumn($this->lng->txt("file"), 'file', '');
51 $this->addColumn($this->lng->txt("size"), 'size', '');
52 $this->addColumn($this->lng->txt("date"), 'date', '');
53
54 if ($confirmdelete) {
55 $this->addCommandButton('deleteExportFile', $this->lng->txt('confirm'));
56 $this->addCommandButton('cancelDeleteExportFile', $this->lng->txt('cancel'));
57 } else {
58 $this->addMultiCommand('downloadExportFile', $this->lng->txt('download'));
59 $this->addMultiCommand('confirmDeleteExportFile', $this->lng->txt('delete'));
60 }
61
62 $this->setRowTemplate("tpl.il_svy_qpl_export_row.html", "components/ILIAS/SurveyQuestionPool");
63
64 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
65 $this->setDefaultOrderField("file");
66 $this->setDefaultOrderDirection("asc");
67
68 if ($confirmdelete) {
69 $this->disable('sort');
70 $this->disable('select_all');
71 } else {
72 $this->setPrefix('file');
73 $this->setSelectAllCheckbox('file');
74 $this->enable('sort');
75 $this->enable('select_all');
76 }
77 $this->enable('header');
78 }
79
80 protected function fillRow(array $a_set): void
81 {
82 if (!$this->confirmdelete) {
83 $this->tpl->setCurrentBlock('checkbox');
84 $this->tpl->setVariable('CB_ID', $this->counter);
85 $this->tpl->setVariable('CB_FILENAME', ilLegacyFormElementsUtil::prepareFormOutput($a_set['file']));
86 } else {
87 $this->tpl->setCurrentBlock('hidden');
88 $this->tpl->setVariable('HIDDEN_FILENAME', ilLegacyFormElementsUtil::prepareFormOutput($a_set['file']));
89 }
90 $this->tpl->parseCurrentBlock();
91 $this->tpl->setVariable('CB_ID', $this->counter);
92 $this->tpl->setVariable("FILENAME", ilLegacyFormElementsUtil::prepareFormOutput($a_set['file']));
93 $this->tpl->setVariable("SIZE", $a_set["size"]);
94 $this->tpl->setVariable("DATE", $a_set["date"]);
95 $this->counter++;
96 }
97}
static prepareFormOutput($a_str, bool $a_strip=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, bool $confirmdelete=false)
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
ilLanguage $lng
enable(string $a_module_name)
setStyle(string $a_element, string $a_style)
disable(string $a_module_name)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26