ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSurveyQuestionPoolExportTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
10{
11 protected $confirmdelete;
12 protected $counter;
13
21 public function __construct($a_parent_obj, $a_parent_cmd, $confirmdelete = false)
22 {
23 global $DIC;
24
25 parent::__construct($a_parent_obj, $a_parent_cmd);
26
27 $lng = $DIC->language();
28 $ilCtrl = $DIC->ctrl();
29
30 $this->lng = $lng;
31 $this->ctrl = $ilCtrl;
32 $this->confirmdelete = $confirmdelete;
33 $this->counter = 0;
34
35 $this->setFormName('phrases');
36 $this->setTitle($this->lng->txt('svy_export_files'));
37 $this->setStyle('table', 'fullwidth');
38 if (!$confirmdelete) {
39 $this->addColumn('', 'f', '1%');
40 }
41 $this->addColumn($this->lng->txt("file"), 'file', '');
42 $this->addColumn($this->lng->txt("size"), 'size', '');
43 $this->addColumn($this->lng->txt("date"), 'date', '');
44
45 if ($confirmdelete) {
46 $this->addCommandButton('deleteExportFile', $this->lng->txt('confirm'));
47 $this->addCommandButton('cancelDeleteExportFile', $this->lng->txt('cancel'));
48 } else {
49 $this->addMultiCommand('downloadExportFile', $this->lng->txt('download'));
50 $this->addMultiCommand('confirmDeleteExportFile', $this->lng->txt('delete'));
51 }
52
53 $this->setRowTemplate("tpl.il_svy_qpl_export_row.html", "Modules/SurveyQuestionPool");
54
55 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
56 $this->setDefaultOrderField("file");
57 $this->setDefaultOrderDirection("asc");
58
59 if ($confirmdelete) {
60 $this->disable('sort');
61 $this->disable('select_all');
62 } else {
63 $this->setPrefix('file');
64 $this->setSelectAllCheckbox('file');
65 $this->enable('sort');
66 $this->enable('select_all');
67 }
68 $this->enable('header');
69 }
70
78 public function fillRow($data)
79 {
80 if (!$this->confirmdelete) {
81 $this->tpl->setCurrentBlock('checkbox');
82 $this->tpl->setVariable('CB_ID', $this->counter);
83 $this->tpl->setVariable('CB_FILENAME', ilUtil::prepareFormOutput($data['file']));
84 $this->tpl->parseCurrentBlock();
85 } else {
86 $this->tpl->setCurrentBlock('hidden');
87 $this->tpl->setVariable('HIDDEN_FILENAME', ilUtil::prepareFormOutput($data['file']));
88 $this->tpl->parseCurrentBlock();
89 }
90 $this->tpl->setVariable('CB_ID', $this->counter);
91 $this->tpl->setVariable("PHRASE", $data["phrase"]);
92 $this->tpl->setVariable("FILENAME", ilUtil::prepareFormOutput($data['file']));
93 $this->tpl->setVariable("SIZE", $data["size"]);
94 $this->tpl->setVariable("DATE", $data["date"]);
95 $this->counter++;
96 }
97}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_parent_obj, $a_parent_cmd, $confirmdelete=false)
Constructor.
Class ilTable2GUI.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
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.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
disable($a_module_name)
diesables particular modules of table
setStyle($a_element, $a_style)
enable($a_module_name)
enables particular modules of table
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc