ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclTableViewFieldsTableGUI.php
Go to the documentation of this file.
1<?php
2
3
11{
12 public function __construct(ilDclTableViewEditGUI $a_parent_obj)
13 {
14 global $DIC;
15 $lng = $DIC['lng'];
16 $ilCtrl = $DIC['ilCtrl'];
17 parent::__construct($a_parent_obj);
18
19 $this->setId('dcl_tableviews');
20 $this->setTitle($lng->txt('dcl_tableview_fieldsettings'));
21 $this->addColumn($lng->txt('dcl_fieldtitle'), null, 'auto');
22 $this->addColumn($lng->txt('dcl_field_visible'), null, 'auto');
23 $this->addColumn($lng->txt('dcl_filter'), null, 'auto');
24 $this->addColumn($lng->txt('dcl_std_filter'), null, 'auto');
25 $this->addColumn($lng->txt('dcl_filter_changeable'), null, 'auto');
26
27
28 $ilCtrl->saveParameter($this, 'tableview_id');
29 $this->setFormAction($ilCtrl->getFormActionByClass('ildcltablevieweditgui'));
30 $this->addCommandButton('saveTable', $lng->txt('dcl_save'));
31
32 $this->setExternalSegmentation(true);
33 $this->setExternalSorting(true);
34
35 $this->setRowTemplate('tpl.tableview_fields_row.html', 'Modules/DataCollection');
36 $this->setTopCommands(true);
37 $this->setEnableHeader(true);
38 $this->setShowRowsSelector(false);
39 $this->setShowTemplates(false);
40 $this->setEnableHeader(true);
41 $this->setEnableTitle(true);
42 $this->setDefaultOrderDirection('asc');
43
44 $this->parseData($a_parent_obj->tableview->getFieldSettings());
45 }
46
47 public function parseData($data)
48 {
49 //enable/disable comments
50 if (!$this->parent_obj->table->getPublicCommentsEnabled()) {
51 foreach ($data as $key => $rec) {
52 if ($rec->getField() == 'comments') {
53 unset($data[$key]);
54 }
55 }
56 }
57 $this->setData($data);
58 }
59
63 public function fillRow($a_set)
64 {
65 $field = $a_set->getFieldObject();
66 if ($field->getId() == 'comments' && !$this->parent_obj->table->getPublicCommentsEnabled()) {
67 return;
68 }
69
70 $this->tpl->setVariable('FIELD_TITLE', $field->getTitle());
71 $this->tpl->setVariable('ID', $a_set->getId());
72 $this->tpl->setVariable('FIELD_ID', $a_set->getField());
73 $this->tpl->setVariable('VISIBLE', $a_set->isVisible() ? 'checked' : '');
74 if ($field->allowFilterInListView()) {
75 $this->tpl->setVariable('IN_FILTER', $a_set->isInFilter() ? 'checked' : '');
76 $this->tpl->setVariable('FILTER_VALUE', $this->getStandardFilterHTML($field, $a_set->getFilterValue()));
77 $this->tpl->setVariable('FILTER_CHANGEABLE', $a_set->isFilterChangeable() ? 'checked' : '');
78 } else {
79 $this->tpl->setVariable('NO_FILTER', '');
80 }
81 }
82
89 protected function getStandardFilterHTML(ilDclBaseFieldModel $field, $value)
90 {
91 $field_representation = ilDclFieldFactory::getFieldRepresentationInstance($field);
92 $field_representation->addFilterInputFieldToTable($this);
93 $filter = end($this->filters);
94 $this->filters = null;
95 $filter->setValueByArray($value);
96 return $filter->render();
97 }
98}
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldModel.
static getFieldRepresentationInstance(ilDclBaseFieldModel $field)
Returns FieldRepresentation from BaseFieldModel.
Class ilDclTableViewEditFieldsTableGUI.
getStandardFilterHTML(ilDclBaseFieldModel $field, $value)
__construct(ilDclTableViewEditGUI $a_parent_obj)
Class ilDclTableViewEditGUI.
Class ilTable2GUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setEnableHeader($a_enableheader)
Set Enable Header.
setExternalSorting($a_val)
Set external sorting.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setExternalSegmentation($a_val)
Set external segmentation.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setShowTemplates($a_value)
Toggle templates.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
$key
Definition: croninfo.php:18
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7