19 declare(strict_types=1);
33 $this->ui_factory = $DIC->ui()->factory();
34 $this->renderer = $DIC->ui()->renderer();
40 $this->
setId(
'dcl_table_list');
42 $this->
addColumn($this->
lng->txt(
'dcl_order'),
"",
'30px');
44 $this->
addColumn($this->
lng->txt(
'dcl_visible'),
"",
'250px',
false,
'', $this->
lng->txt(
'dcl_visible_desc'));
46 $this->
lng->txt(
'dcl_comments'),
51 $this->
lng->txt(
'dcl_public_comments_desc')
58 $this->
setFormAction($this->
ctrl->getFormActionByClass(ilDclTableListGUI::class));
74 $this->
setTitle($this->
lng->txt(
'dcl_table_list_tables'));
77 $this->
setRowTemplate(
'tpl.table_list_row.html',
'Modules/DataCollection');
78 $this->
setStyle(
'table', $this->
getStyle(
'table') .
' ' .
'dcl_record_list');
80 $tables = $this->parent_obj->getDataCollectionObject()->getTables();
104 if ($this->form_multipart) {
105 $this->tpl->touchBlock(
"form_multipart_bl");
109 $this->tpl->touchBlock(
"pdfs");
112 $this->tpl->setCurrentBlock(
"tbl_form_header");
113 $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction() . $hash);
114 $this->tpl->setVariable(
"FORMNAME", $this->
getFormName());
115 $this->tpl->parseCurrentBlock();
119 $this->tpl->touchBlock(
"tbl_form_footer");
123 if (!$this->enabled[
'content']) {
133 $this->
setFooter(
"tblfooter", $this->
lng->txt(
"previous"), $this->
lng->txt(
"next"));
159 $this->tpl->addBlockFile(
163 $this->row_template_dir
166 foreach ($data as $set) {
167 $this->tpl->setCurrentBlock(
"tbl_content");
168 $this->css_row = ($this->css_row !==
"tblrow1")
171 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
174 $this->tpl->setCurrentBlock(
"tbl_content");
175 $this->tpl->parseCurrentBlock();
181 : $this->
lng->txt(
"no_items");
183 $this->css_row = ($this->css_row !==
"tblrow1")
187 $this->tpl->setCurrentBlock(
"tbl_no_entries");
188 $this->tpl->setVariable(
'TBL_NO_ENTRY_CSS_ROW', $this->css_row);
189 $this->tpl->setVariable(
'TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
190 $this->tpl->setVariable(
'TBL_NO_ENTRY_TEXT', trim($no_items_text));
191 $this->tpl->parseCurrentBlock();
209 $this->tpl->setVariable(
"ID", $a_set->
getId());
210 $this->tpl->setVariable(
"ORDER_NAME",
"order[{$a_set->getId()}]");
211 $this->tpl->setVariable(
"ORDER_VALUE", $a_set->
getOrder());
212 $this->tpl->setVariable(
"TITLE", $a_set->
getTitle());
214 $this->
ctrl->setParameterByClass(ilDclFieldListGUI::class,
'table_id', $a_set->
getId());
215 $this->tpl->setVariable(
"TITLE_LINK", $this->
ctrl->getLinkTargetByClass(ilDclFieldListGUI::class));
217 $this->tpl->setVariable(
"CHECKBOX_NAME_VISIBLE",
'visible[' . $a_set->
getId() .
']');
219 $this->tpl->setVariable(
"CHECKBOX_CHECKED_VISIBLE",
'checked');
221 $this->tpl->setVariable(
"CHECKBOX_NAME_COMMENTS",
'comments[' . $a_set->
getId() .
']');
223 $this->tpl->setVariable(
"CHECKBOX_CHECKED_COMMENTS",
'checked');
230 $dropdown_items = [];
232 $this->
ctrl->setParameterByClass(ilDclFieldListGUI::class,
'table_id', $id);
233 $this->
ctrl->setParameterByClass(ilDclTableViewGUI::class,
'table_id', $id);
234 $this->
ctrl->setParameterByClass(ilDclTableEditGUI::class,
'table_id', $id);
236 $dropdown_items[] = $this->ui_factory->link()->standard(
237 $this->
lng->txt(
'settings'),
238 $this->
ctrl->getLinkTargetByClass(ilDclTableEditGUI::class,
'edit')
240 $dropdown_items[] = $this->ui_factory->link()->standard(
241 $this->
lng->txt(
'dcl_list_fields'),
242 $this->
ctrl->getLinkTargetByClass(ilDclFieldListGUI::class,
'listFields')
244 $dropdown_items[] = $this->ui_factory->link()->standard(
245 $this->
lng->txt(
'dcl_tableviews'),
246 $this->
ctrl->getLinkTargetByClass(ilDclTableViewGUI::class)
248 $dropdown_items[] = $this->ui_factory->link()->standard(
249 $this->
lng->txt(
'delete'),
250 $this->
ctrl->getLinkTargetByClass(ilDclTableEditGUI::class,
'confirmDelete')
253 $dropdown = $this->ui_factory->dropdown()->standard($dropdown_items)->withLabel($this->
lng->txt(
'actions'));
255 return $this->renderer->render($dropdown);
numericOrdering(string $a_field)
Should this field be sorted numeric?
prepareOutput()
Anything that must be done before HTML is generated.
setTopCommands(bool $a_val)
getPublicCommentsEnabled()
getStyle(string $a_element)
setFormAction(string $a_form_action, bool $a_multipart=false)
fillRowFromObject(ilDclTable $a_set)
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)
ilDclTableListGUI: ilDclFieldListGUI, ilDclFieldEditGUI, ilDclTableViewGUI, ilDclTableEditGUI ...
setFormName(string $a_name="")
exportData(int $format, bool $send=false)
Export and optionally send current table data.
setStyle(string $a_element, string $a_style)
setExternalSorting(bool $a_val)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
ILIAS UI Renderer $renderer
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
getExternalSegmentation()
setDefaultOrderDirection(string $a_defaultorderdirection)
getPreventDoubleSubmission()
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(ilDclTableListGUI $parent_obj)
ilDclTableListTableGUI constructor.
setFooter(string $a_style, string $a_previous="", string $a_next="")
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
static setUseRelativeDates(bool $a_status)
set use relative dates
addMultiCommand(string $a_cmd, string $a_text)
determineOffsetAndOrder(bool $a_omit_offset=false)
setEnableHeader(bool $a_enableheader)
setMaxCount(int $a_max_count)
set max.
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)