19 declare(strict_types=1);
35 $this->ui_factory = $DIC->ui()->factory();
36 $this->renderer = $DIC->ui()->renderer();
40 $this->parent_obj = $a_parent_obj;
42 $this->table->showInvalidFields(
true);
44 $this->
setId(
'dcl_field_list');
46 $this->
addColumn($this->
lng->txt(
'dcl_order'),
'',
'30px');
47 $this->
addColumn($this->
lng->txt(
'dcl_fieldtitle'),
'',
'auto');
48 $this->
addColumn($this->
lng->txt(
'dcl_in_export'),
'',
'30px');
49 $this->
addColumn($this->
lng->txt(
'dcl_description'),
'',
'auto');
50 $this->
addColumn($this->
lng->txt(
'dcl_field_datatype'),
'',
'auto');
51 $this->
addColumn($this->
lng->txt(
'dcl_unique'),
'',
'auto');
54 if (count($this->table->getRecordFields())) {
59 $this->
ctrl->setParameterByClass(
'ildclfieldeditgui',
'table_id', $this->parent_obj->getTableId());
60 $this->
ctrl->setParameterByClass(
'ildclfieldlistgui',
'table_id', $this->parent_obj->getTableId());
80 $this->
setTitle($this->table->getTitle());
81 $this->
setRowTemplate(
'tpl.field_list_row.html',
'components/ILIAS/DataCollection');
82 $this->
setStyle(
'table', $this->
getStyle(
'table') .
' ' .
'dcl_record_list');
84 $this->
setData($this->table->getFields());
107 if ($this->form_multipart) {
108 $this->tpl->touchBlock(
"form_multipart_bl");
112 $this->tpl->touchBlock(
"pdfs");
115 $this->tpl->setCurrentBlock(
"tbl_form_header");
116 $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction() . $hash);
117 $this->tpl->setVariable(
"FORMNAME", $this->
getFormName());
118 $this->tpl->parseCurrentBlock();
122 $this->tpl->touchBlock(
"tbl_form_footer");
126 if (!$this->enabled[
'content']) {
136 $this->
setFooter(
"tblfooter", $this->
lng->txt(
"previous"), $this->
lng->txt(
"next"));
162 $this->tpl->addBlockFile(
166 $this->row_template_dir
169 foreach ($data as $set) {
170 $this->tpl->setCurrentBlock(
"tbl_content");
171 $this->css_row = ($this->css_row !==
"tblrow1")
174 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
177 $this->tpl->setCurrentBlock(
"tbl_content");
178 $this->tpl->parseCurrentBlock();
184 : $this->
lng->txt(
"no_items");
186 $this->css_row = ($this->css_row !==
"tblrow1")
190 $this->tpl->setCurrentBlock(
"tbl_no_entries");
191 $this->tpl->setVariable(
'TBL_NO_ENTRY_CSS_ROW', $this->css_row);
192 $this->tpl->setVariable(
'TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
193 $this->tpl->setVariable(
'TBL_NO_ENTRY_TEXT', trim($no_items_text));
194 $this->tpl->parseCurrentBlock();
213 $this->tpl->setVariable(
'FIELD_ID', $a_set->
getId());
216 $this->tpl->setVariable(
'NAME',
'order[' . $a_set->
getId() .
']');
217 $this->tpl->setVariable(
'VALUE', $this->order);
220 $show_exportable =
true;
222 if ($a_set->
getId() ==
'comments') {
223 $show_exportable =
false;
226 if ($show_exportable) {
227 $this->tpl->setVariable(
'CHECKBOX_EXPORTABLE',
'exportable[' . $a_set->
getId() .
']');
229 $this->tpl->setVariable(
'CHECKBOX_EXPORTABLE_CHECKED',
'checked');
232 $this->tpl->setVariable(
'NO_FILTER_EXPORTABLE');
235 $this->order = $this->order + 10;
236 $this->tpl->setVariable(
'ORDER_NAME',
'order[' . $a_set->
getId() .
']');
237 $this->tpl->setVariable(
'ORDER_VALUE', $this->order);
239 $this->tpl->setVariable(
'TITLE', $a_set->
getTitle());
249 $this->tpl->setVariable(
'ICON_UNIQUE', $this->renderer->render(
$icon));
251 $this->tpl->setVariable(
'NO_UNIQUE');
254 $this->
ctrl->setParameterByClass(
'ildclfieldeditgui',
'field_id', $a_set->
getId());
258 $this->parent_obj->getDataCollectionObject()->getRefId(),
259 $this->table->getId()
261 $dropdown_items = [];
263 $dropdown_items[] = $this->ui_factory->link()->standard(
264 $this->
lng->txt(
'edit'),
265 $this->
ctrl->getLinkTargetByClass(ilDclFieldEditGUI::class,
'edit')
268 $dropdown_items[] = $this->ui_factory->link()->standard(
269 $this->
lng->txt(
'delete'),
270 $this->
ctrl->getLinkTargetByClass(ilDclFieldEditGUI::class,
'confirmDelete')
272 $dropdown = $this->ui_factory->dropdown()->standard($dropdown_items)->withLabel($this->
lng->txt(
'actions'));
274 $this->tpl->setVariable(
'ACTIONS', $this->renderer->render($dropdown));
276 $this->tpl->setVariable(
'ACTIONS');
numericOrdering(string $a_field)
Should this field be sorted numeric?
static array static setUseRelativeDates(bool $a_status)
set use relative dates
prepareOutput()
Anything that must be done before HTML is generated.
setTopCommands(bool $a_val)
getStyle(string $a_element)
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setShowTemplates(bool $a_value)
setFormName(string $a_name="")
exportData(int $format, bool $send=false)
Export and optionally send current table data.
fillRowFromObject(ilDclBaseFieldModel $a_set)
setStyle(string $a_element, string $a_style)
static hasAccessToFields(int $ref_id, int $table_id)
setExternalSorting(bool $a_val)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
static getTableCache(int $table_id=null)
static getAllDatatype(bool $force=false)
Get all possible Datatypes.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
getExternalSegmentation()
ILIAS UI Renderer $renderer
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setDefaultOrderDirection(string $a_defaultorderdirection)
getPreventDoubleSubmission()
getDescription()
Get description.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFooter(string $a_style, string $a_previous="", string $a_next="")
__construct(Container $dic, ilPlugin $plugin)
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)
ILIAS UI Factory $ui_factory
addMultiCommand(string $a_cmd, string $a_text)
__construct(ilDclFieldListGUI $a_parent_obj, string $a_parent_cmd, int $table_id)
determineOffsetAndOrder(bool $a_omit_offset=false)
setEnableHeader(bool $a_enableheader)
setMaxCount(int $a_max_count)
set max.
getDatatypeId()
Get datatype_id.
setExternalSegmentation(bool $a_val)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)