ILIAS  release_8 Revision v8.24
class.ilTestPersonalDefaultSettingsTableGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 public function __construct($parentObj, $cmd)
25 {
29 global $DIC;
30 $ilCtrl = $DIC['ilCtrl'];
31
32 $this->setId('tst_pers_def_set_' . $parentObj->getObject()->getId());
33
34 parent::__construct($parentObj, $cmd);
35
36 $this->setTitle($this->lng->txt('tst_defaults_available'));
37 $this->setNoEntriesText($this->lng->txt('tst_defaults_not_defined'));
38 $this->setFormAction($ilCtrl->getFormAction($parentObj, $cmd));
39
40 $this->setRowTemplate('tpl.il_as_tst_defaults_row.html', 'Modules/Test');
41
42 $this->setShowRowsSelector(true);
43 $this->setSelectAllCheckbox('chb_defaults');
44 $this->setFormName('formDefaults');
45 $this->addMultiCommand('deleteDefaults', $this->lng->txt('delete'));
46 $this->addMultiCommand('applyDefaults', $this->lng->txt('apply_def_settings_to_tst'));
47 $this->initColumns();
48 }
49
50 private function initColumns(): void
51 {
52 $this->addColumn('', '', '1px', true);
53 $this->addColumn($this->lng->txt('title'), 'name', '80%');
54 $this->addColumn($this->lng->txt('date'), 'tstamp', '19%');
55 }
56
57 public function fillRow(array $a_set): void
58 {
59 parent::fillRow(array(
60 'name' => $a_set['name'],
61 'checkbox' => ilLegacyFormElementsUtil::formCheckbox(false, 'chb_defaults[]', $a_set['test_defaults_id']),
62 'tstamp' => ilDatePresentation::formatDate(new ilDateTime($a_set['tstamp'], IL_CAL_UNIX))
63 ));
64 }
65
66 public function numericOrdering(string $a_field): bool
67 {
68 return in_array($a_field, array(
69 'tstamp'
70 ));
71 }
72}
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=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="", string $a_template_context="")
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
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)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setNoEntriesText(string $a_text)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
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?
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc