ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilTestPersonalDefaultSettingsTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Table/classes/class.ilTable2GUI.php';
5
10{
11 public function __construct($parentObj, $cmd)
12 {
16 global $DIC;
17 $ilCtrl = $DIC['ilCtrl'];
18
19 $this->setId('tst_pers_def_set_' . $parentObj->object->getId());
20
21 parent::__construct($parentObj, $cmd);
22
23 $this->setTitle($this->lng->txt('tst_defaults_available'));
24 $this->setNoEntriesText($this->lng->txt('tst_defaults_not_defined'));
25 $this->setFormAction($ilCtrl->getFormAction($parentObj, $cmd));
26
27 $this->setRowTemplate('tpl.il_as_tst_defaults_row.html', 'Modules/Test');
28
29 $this->setShowRowsSelector(true);
30 $this->setSelectAllCheckbox('chb_defaults');
31 $this->setFormName('formDefaults');
32 $this->addMultiCommand('deleteDefaults', $this->lng->txt('delete'));
33 $this->addMultiCommand('applyDefaults', $this->lng->txt('apply_def_settings_to_tst'));
34 $this->initColumns();
35 }
36
40 private function initColumns()
41 {
42 $this->addColumn('', '', '1px', true);
43 $this->addColumn($this->lng->txt('title'), 'name', '80%');
44 $this->addColumn($this->lng->txt('date'), 'tstamp', '19%');
45 }
46
50 public function fillRow($row)
51 {
52 parent::fillRow(array(
53 'name' => $row['name'],
54 'checkbox' => ilUtil::formCheckbox(false, 'chb_defaults[]', $row['test_defaults_id']),
55 'tstamp' => ilDatePresentation::formatDate(new ilDateTime($row['tstamp'], IL_CAL_UNIX))
56 ));
57 }
58
62 public function numericOrdering($field)
63 {
64 return in_array($field, array(
65 'tstamp'
66 ));
67 }
68}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Class ilTable2GUI.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setNoEntriesText($a_text)
Set text for an empty table.
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.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
ilTable2GUI constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
setId($a_val)
Set id.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc