ILIAS  release_8 Revision v8.24
class.ilSurveyPhrasesTableGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 protected bool $confirmdelete;
25
26 public function __construct(
27 object $a_parent_obj,
28 string $a_parent_cmd,
29 bool $confirmdelete = false
30 ) {
31 global $DIC;
32
33 parent::__construct($a_parent_obj, $a_parent_cmd);
34
35 $lng = $DIC->language();
36 $ilCtrl = $DIC->ctrl();
37
38 $this->lng = $lng;
39 $this->ctrl = $ilCtrl;
40 $this->confirmdelete = $confirmdelete;
41
42 $this->setFormName('phrases');
43 $this->setStyle('table', 'fullwidth');
44 if (!$confirmdelete) {
45 $this->addColumn('', 'f', '1%');
46 }
47 $this->addColumn($this->lng->txt("phrase"), 'phrase', '');
48 $this->addColumn($this->lng->txt("answers"), 'answers', '');
49
50 if ($confirmdelete) {
51 $this->addCommandButton('confirmDeletePhrase', $this->lng->txt('confirm'));
52 $this->addCommandButton('cancelDeletePhrase', $this->lng->txt('cancel'));
53 } else {
54 $this->addMultiCommand('editPhrase', $this->lng->txt('edit'));
55 $this->addMultiCommand('deletePhrase', $this->lng->txt('delete'));
56 }
57
58 $this->setRowTemplate("tpl.il_svy_qpl_phrase_row.html", "Modules/SurveyQuestionPool");
59
60 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
61 $this->setDefaultOrderField("phrase");
62 $this->setDefaultOrderDirection("asc");
63
64 if ($confirmdelete) {
65 $this->disable('sort');
66 $this->disable('select_all');
67 } else {
68 $this->setPrefix('phrase');
69 $this->setSelectAllCheckbox('phrase');
70 $this->enable('sort');
71 $this->enable('select_all');
72 }
73 $this->enable('header');
74 }
75
76 protected function fillRow(array $a_set): void
77 {
78 if (!$this->confirmdelete) {
79 $this->tpl->setCurrentBlock('checkbox');
80 $this->tpl->setVariable('CB_PHRASE_ID', $a_set["phrase_id"]);
81 } else {
82 $this->tpl->setCurrentBlock('hidden');
83 $this->tpl->setVariable('HIDDEN_PHRASE_ID', $a_set["phrase_id"]);
84 }
85 $this->tpl->parseCurrentBlock();
86 $this->tpl->setVariable('PHRASE_ID', $a_set["phrase_id"]);
87 $this->tpl->setVariable("PHRASE", $a_set["phrase"]);
88 $this->tpl->setVariable("ANSWERS", $a_set["answers"]);
89 }
90}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd, bool $confirmdelete=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc