39 private \ILIAS\DI\UIServices
$ui;
93 protected string $id =
"";
124 ?
object $a_parent_obj,
125 string $a_parent_cmd =
"",
126 string $a_template_context =
"" 129 $this->main_tpl = $DIC->ui()->mainTemplate();
130 $this->
ui = $DIC->ui();
132 $this->
lng = $DIC->language();
133 $this->
ctrl = $DIC->ctrl();
134 $lng = $DIC->language();
136 if (isset($DIC[
"http"])) {
137 $this->table_request = new \ILIAS\Table\TableGUIRequest(
144 $this->unique_id = md5(uniqid(
'',
true));
145 $this->parent_obj = $a_parent_obj;
146 $this->parent_cmd = $a_parent_cmd;
147 $this->buttons = array();
148 $this->header_commands = array();
149 $this->multi = array();
150 $this->hidden_inputs = array();
152 $this->tpl =
new ilTemplate(
"tpl.table2.html",
true,
true,
"components/ILIAS/Table");
156 if (!$a_template_context) {
157 $a_template_context = $this->
getId();
162 if (isset($this->table_request)) {
163 $this->export_mode = $this->table_request->getExportMode($this->prefix);
171 $this->raw_post_data = [];
172 if (isset($DIC[
"http"])) {
173 $this->raw_post_data = $DIC->http()->request()->getParsedBody();
179 if (is_null($this->table_request)) {
182 $this->requested_nav_par = $this->table_request->getNavPar($this->
getNavParameter());
183 $this->requested_nav_par1 = $this->table_request->getNavPar($this->
getNavParameter(), 1);
184 $this->requested_nav_par2 = $this->table_request->getNavPar($this->
getNavParameter(), 2);
189 $this->open_form_tag = $a_val;
199 $this->close_form_tag = $a_val;
212 if (isset($DIC[
"ilUser"])) {
213 $ilUser = $DIC[
"ilUser"];
216 if ($this->limit_determined) {
221 if (isset($this->table_request) && !is_null($this->table_request->getRows($this->prefix))) {
222 $this->
storeProperty(
"rows", $this->table_request->getRows($this->prefix));
223 $limit = $this->table_request->getRows($this->prefix) ?? 0;
237 $this->limit_determined =
true;
251 if ($this->columns_determined) {
258 if ($old_sel !=
"") {
259 $sel_fields = unserialize((
string) $old_sel);
262 if (!is_array($sel_fields)) {
264 $sel_fields = array();
267 $this->selected_columns = array();
272 if (isset($this->table_request)) {
273 $fs = $this->table_request->getFS($this->
getId());
274 $fsh = $this->table_request->getFSH($this->
getId());
278 $this->selected_column[$k] =
false;
280 $new_column = (!isset($sel_fields[$k]));
284 if (in_array($k, $fs)) {
285 $this->selected_column[$k] =
true;
287 } elseif ($stored && !$new_column) {
288 $this->selected_column[$k] = $sel_fields[$k];
293 if (isset(
$c[
"default"]) &&
$c[
"default"]) {
294 $this->selected_column[$k] =
true;
300 if (isset($this->table_request)) {
301 $ff = $this->table_request->getFF($this->
getId());
303 if (count($ff) > 0) {
305 if (in_array($k, $ff)) {
306 $this->selected_column[$k] =
true;
311 if ($old_sel != serialize($this->selected_column) && $set) {
312 $this->
storeProperty(
"selfields", serialize($this->selected_column));
315 $this->columns_determined =
true;
320 return $this->selected_column[$col] ??
false;
326 foreach ($this->selected_column as $k => $v) {
334 public function executeCommand():
bool 340 switch ($next_class) {
341 case 'ilformpropertydispatchgui':
346 $this->table_request->getPostVar()
348 $form_prop_dispatch->setItem($item);
349 return (
bool) $ilCtrl->forwardCommand($form_prop_dispatch);
354 public function resetOffset(
bool $a_in_determination =
false): void
356 if (!$this->nav_determined && !$a_in_determination) {
380 $this->top_anchor = $a_val;
390 $this->noentriestext = $a_text;
400 $this->datatable = $a_val;
410 $this->enabled[
"title"] = $a_enabletitle;
415 return $this->enabled[
"title"];
420 $this->enabled[
"header"] = $a_enableheader;
425 return $this->enabled[
"header"];
430 $this->num_info = $a_val;
441 string $a_icon_alt =
"" 443 parent::setTitle($a_title, $a_icon, $a_icon_alt);
448 $this->description = $a_val;
458 $this->order_field = $a_order_field;
466 final public function setData(array $a_data): void
468 $this->row_data = $a_data;
478 return count($this->row_data) > 0;
483 $this->prefix = $a_prefix;
494 bool $a_optional =
false 496 $a_input_item->setParentTable($this);
498 $this->filters[] = $a_input_item;
500 $this->optional_filters[] = $a_input_item;
504 if ($this->restore_filter) {
505 if (array_key_exists($a_input_item->getFieldId(), $this->restore_filter_values ?? [])) {
506 $this->
setFilterValue($a_input_item, $this->restore_filter_values[$a_input_item->getFieldId()]);
519 int $type = self::FILTER_TEXT,
520 bool $a_optional =
false,
525 $lng = $DIC->language();
532 case self::FILTER_CHECKBOX:
536 case self::FILTER_SELECT:
540 case self::FILTER_DATE:
544 case self::FILTER_TEXT:
546 $item->setMaxLength(64);
551 case self::FILTER_LANGUAGE:
554 $options = array(
"" =>
$lng->
txt(
"trac_all"));
556 $options[$lang_key] =
$lng->
txt(
"meta_l_" . $lang_key);
558 $item->setOptions($options);
561 case self::FILTER_NUMBER_RANGE:
564 $combi_item->setSize(5);
565 $item->addCombinationItem(
"from", $combi_item,
$lng->
txt(
"from"));
567 $combi_item->setSize(5);
568 $item->addCombinationItem(
"to", $combi_item,
$lng->
txt(
"to"));
574 case self::FILTER_DATE_RANGE:
577 $item->addCombinationItem(
"from", $combi_item,
$lng->
txt(
"from"));
579 $item->addCombinationItem(
"to", $combi_item,
$lng->
txt(
"to"));
583 case self::FILTER_DATETIME_RANGE:
586 $combi_item->setShowTime(
true);
587 $item->addCombinationItem(
"from", $combi_item,
$lng->
txt(
"from"));
589 $combi_item->setShowTime(
true);
590 $item->addCombinationItem(
"to", $combi_item,
$lng->
txt(
"to"));
594 case self::FILTER_DURATION_RANGE:
598 $combi_item->setShowMonths(
false);
599 $combi_item->setShowDays(
true);
600 $combi_item->setShowSeconds(
true);
601 $item->addCombinationItem(
"from", $combi_item,
$lng->
txt(
"from"));
603 $combi_item->setShowMonths(
false);
604 $combi_item->setShowDays(
true);
605 $combi_item->setShowSeconds(
true);
606 $item->addCombinationItem(
"to", $combi_item,
$lng->
txt(
"to"));
615 $item->readFromSession();
630 if ($item->getPostVar() == $a_post_var) {
635 if ($item->getPostVar() == $a_post_var) {
644 $this->filter_cols = $a_val;
654 $this->disable_filter_hiding = $a_val;
667 return (
bool) $this->selected_filter[$a_col];
673 foreach ($this->selected_filter as $k => $v) {
683 if ($this->filters_determined) {
690 if ($old_sel !=
"") {
692 unserialize((
string) $old_sel);
695 if (!is_array($sel_filters)) {
697 $sel_filters = array();
700 $this->selected_filter = array();
703 $k = $item->getPostVar();
705 $this->selected_filter[$k] =
false;
707 if ($this->table_request->getFSF($this->getId())) {
709 if (in_array($k, $this->table_request->getFF($this->getId()))) {
710 $this->selected_filter[$k] =
true;
712 $item->setValue(
null);
713 $item->writeToSession();
716 $this->selected_filter[$k] = $sel_filters[$k] ??
"";
720 if ($old_sel != serialize($this->selected_filter) && $set) {
721 $this->
storeProperty(
"selfilters", serialize($this->selected_filter));
724 $this->filters_determined =
true;
731 $this->custom_prev_next =
true;
732 $this->custom_prev = $a_prev_link;
733 $this->custom_next = $a_next_link;
737 string $a_form_action,
738 bool $a_multipart =
false 740 $this->form_action = $a_form_action;
741 $this->form_multipart = $a_multipart;
751 $this->formname = $a_name;
759 public function setId(
string $a_val): void
765 if (strlen($this->
id) > 30) {
766 throw new ilException(
"Table ID to long (max. 30 char): " . $this->
id);
777 $this->display_as_block = $a_val;
786 string $a_select_all_checkbox,
787 bool $a_select_all_on_top =
false 789 $this->select_all_checkbox = $a_select_all_checkbox;
790 $this->select_all_on_top = $a_select_all_on_top;
795 $this->ext_sort = $a_val;
805 string $a_caption =
"" 807 $this->filter_cmd = $a_val;
808 $this->filter_cmd_txt = $a_caption;
818 string $a_caption =
"" 820 $this->reset_cmd = $a_val;
821 $this->reset_cmd_txt = $a_caption;
831 $this->ext_seg = $a_val;
844 final public function setRowTemplate(
string $a_template,
string $a_template_dir =
""): void
846 $this->row_template = $a_template;
847 $this->row_template_dir = $a_template_dir;
852 $this->defaultorderfield = $a_defaultorderfield;
863 $this->defaultorderdirection = $a_defaultorderdirection;
873 $this->default_filter_visibility = $a_status;
883 $this->buttons = array();
889 string $a_onclick =
'',
893 $this->buttons[] = array(
"cmd" => $a_cmd,
"text" => $a_text,
'onclick' => $a_onclick,
894 "id" => $a_id,
"class" => $a_class);
899 $this->buttons[] = $a_button;
915 string $a_default_selection =
'' 917 $this->mi_sel_buttons[] = array(
"sel_var" => $a_sel_var,
"options" => $a_options,
"selected" => $a_default_selection,
"cmd" => $a_cmd,
"text" => $a_text);
923 $this->close_command = $a_link;
928 $this->multi[] = array(
"cmd" => $a_cmd,
"text" => $a_text);
933 $this->hidden_inputs[] = array(
"name" => $a_name,
"value" => $a_value);
939 string $a_target =
"",
942 $this->header_commands[] = array(
"href" => $a_href,
"text" => $a_text,
943 "target" => $a_target,
"img" => $a_img);
948 $this->top_commands = $a_val;
958 string $a_sort_field =
"",
959 string $a_width =
"",
960 bool $a_is_checkbox_action_column =
false,
961 string $a_class =
"",
962 string $a_tooltip =
"",
963 bool $a_tooltip_with_html =
false 965 $this->column[] = array(
967 "sort_field" => $a_sort_field,
969 "is_checkbox_action_column" => $a_is_checkbox_action_column,
971 "tooltip" => $a_tooltip,
972 "tooltip_html" => $a_tooltip_with_html
974 if ($a_sort_field !=
"") {
975 $this->sortable_fields[] = $a_sort_field;
977 $this->column_count = count($this->column);
983 return $this->prefix .
"_table_nav";
990 $ilUser = $DIC->user();
996 $old = $this->requested_nav_par ??
'';
1002 urlencode($key) .
":" . $order_dir .
":" . $this->offset
1004 $this->tpl->setVariable(
1006 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd) . $hash
1010 $ilCtrl->setParameter(
1021 $allcolumnswithwidth =
true;
1022 foreach ($this->column as $idx => $column) {
1023 if (!strlen($column[
"width"])) {
1024 $allcolumnswithwidth =
false;
1025 } elseif ($column[
"width"] ==
"1") {
1027 $this->column[$idx][
"width"] =
"1%";
1030 if ($allcolumnswithwidth) {
1031 foreach ($this->column as $column) {
1032 $this->tpl->setCurrentBlock(
"tbl_colgroup_column");
1033 $width = (is_numeric($column[
"width"]))
1034 ? $column[
"width"] .
"px" 1036 $this->tpl->setVariable(
"COLGROUP_COLUMN_WIDTH",
" style=\"width:" . $width .
"\"");
1037 $this->tpl->parseCurrentBlock();
1041 foreach ($this->column as $column) {
1044 if ($column[
'is_checkbox_action_column'] && $this->select_all_on_top) {
1045 $this->tpl->setCurrentBlock(
'tbl_header_top_select_all');
1046 $this->tpl->setVariable(
"HEAD_SELECT_ALL_TXT_SELECT_ALL",
$lng->
txt(
"select_all"));
1048 $this->tpl->setVariable(
"HEAD_SELECT_ALL_FORM_NAME", $this->
getFormName());
1049 $this->tpl->setVariable(
"HEAD_CHECKBOXNAME",
"chb_select_all_" . $this->unique_id .
'_top');
1050 $this->tpl->parseCurrentBlock();
1054 if ($column[
'is_checkbox_action_column'] && !$this->select_all_on_top) {
1055 $this->tpl->setCurrentBlock(
'tbl_header_top_select_column');
1056 if ($column[
"width"] !=
"") {
1057 $width = (is_numeric($column[
"width"]))
1058 ? $column[
"width"] .
"px" 1060 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH",
" style=\"width:" . $width .
"\"");
1062 $this->tpl->parseCurrentBlock();
1067 !$this->enabled[
"sort"] ||
1068 (($column[
"sort_field"] ==
"") &&
1069 !($column[
"is_checkbox_action_column"] && $this->select_all_on_top))
1071 $this->tpl->setCurrentBlock(
"tbl_header_no_link");
1072 if ($column[
"width"] !=
"") {
1073 $width = (is_numeric($column[
"width"]))
1074 ? $column[
"width"] .
"px" 1076 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH_NO_LINK",
" style=\"width:" . $width .
"\"");
1078 if ($column[
"class"] !=
"") {
1079 $this->tpl->setVariable(
"TBL_COLUMN_CLASS_NO_LINK",
" class=\"" . $column[
"class"] .
"\"");
1081 if (!$column[
"is_checkbox_action_column"]) {
1082 $this->tpl->setVariable(
1083 "TBL_HEADER_CELL_NO_LINK",
1087 $this->tpl->setVariable(
1088 "TBL_HEADER_CELL_NO_LINK",
1092 $this->tpl->setVariable(
"HEAD_CELL_NL_ID",
"thc_" . $this->
getId() .
"_" . $ccnt);
1093 if ($column[
"class"] !=
"") {
1094 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1096 $this->tpl->parseCurrentBlock();
1097 $this->tpl->touchBlock(
"tbl_header_th");
1100 if (($column[
"sort_field"] == $this->order_field) && ($this->order_direction !=
"")) {
1101 $this->tpl->setCurrentBlock(
"tbl_order_image");
1102 if ($this->order_direction ===
"asc") {
1103 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-up");
1104 $this->tpl->setVariable(
"ORDER_TXT", $this->
lng->txt(
"sorting_asc"));
1106 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-down");
1107 $this->tpl->setVariable(
"ORDER_TXT", $this->
lng->txt(
"sorting_desc"));
1109 $this->tpl->setVariable(
"IMG_ORDER_ALT", $this->
lng->txt(
"change_sort_direction"));
1110 $this->tpl->parseCurrentBlock();
1113 $this->tpl->setCurrentBlock(
"tbl_header_cell");
1114 $this->tpl->setVariable(
"TBL_HEADER_CELL", $column[
"text"]);
1115 $this->tpl->setVariable(
"HEAD_CELL_ID",
"thc_" . $this->
getId() .
"_" . $ccnt);
1118 if ($column[
"width"] !=
"") {
1119 $width = (is_numeric($column[
"width"]))
1120 ? $column[
"width"] .
"px" 1122 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH",
" style=\"width:" . $width .
"\"");
1124 if ($column[
"class"] !=
"") {
1125 $this->tpl->setVariable(
"TBL_COLUMN_CLASS",
" class=\"" . $column[
"class"] .
"\"");
1128 $lng_sort_column = $this->
lng->txt(
"sort_by_this_column");
1129 $this->tpl->setVariable(
"TBL_ORDER_ALT", $lng_sort_column);
1133 if ($column[
"sort_field"] == $this->order_field) {
1136 if ($order_dir ===
"asc") {
1137 $lng_change_sort = $this->
lng->txt(
"sort_ascending_long");
1139 $lng_change_sort = $this->
lng->txt(
"sort_descending_long");
1141 $this->tpl->setVariable(
"TBL_ORDER_ALT", $lng_change_sort);
1144 if ($column[
"class"] !=
"") {
1145 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1147 $this->
setOrderLink($column[
"sort_field"], $order_dir);
1148 $this->tpl->parseCurrentBlock();
1149 $this->tpl->touchBlock(
"tbl_header_th");
1152 $this->tpl->setCurrentBlock(
"tbl_header");
1153 $this->tpl->parseCurrentBlock();
1168 if (isset($DIC[
"ilUser"])) {
1169 $ilUser = $DIC[
"ilUser"];
1172 if ($this->nav_determined) {
1176 if ($this->requested_nav_par1 !=
"") {
1177 if ($this->requested_nav_par1 != ($this->requested_nav_par ??
"")) {
1180 $this->requested_nav_par2 !=
"" &&
1181 $this->requested_nav_par2 != $this->requested_nav_par
1185 } elseif ($this->requested_nav_par !=
"") {
1191 if (in_array($order, $this->sortable_fields)) {
1202 $nav = explode(
":", $this->nav_value);
1205 $req_order_field = $nav[0] ??
"";
1206 $req_order_dir = $nav[1] ??
"";
1207 $req_offset = (
int) ($nav[2] ?? 0);
1211 if (!$a_omit_offset) {
1222 if (!$a_omit_offset) {
1223 $this->nav_determined =
true;
1249 if (isset($DIC[
"ilUser"])) {
1250 $ilUser = $DIC[
"ilUser"];
1272 if ($this->form_multipart) {
1273 $this->tpl->touchBlock(
"form_multipart_bl");
1277 $this->tpl->touchBlock(
"pdfs");
1280 $this->tpl->setCurrentBlock(
"tbl_form_header");
1281 $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction() . $hash);
1282 $this->tpl->setVariable(
"FORMNAME", $this->
getFormName());
1283 $this->tpl->parseCurrentBlock();
1287 $this->tpl->touchBlock(
"tbl_form_footer");
1291 if (!$this->enabled[
'content']) {
1301 $this->
setFooter(
"tblfooter", $this->
lng->txt(
"previous"), $this->
lng->txt(
"next"));
1327 $this->tpl->addBlockFile(
1330 $this->row_template,
1331 $this->row_template_dir
1334 foreach ($data as $set) {
1335 $this->tpl->setCurrentBlock(
"tbl_content");
1336 $this->css_row = ($this->css_row !==
"tblrow1")
1339 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
1342 $this->tpl->setCurrentBlock(
"tbl_content");
1343 $this->tpl->parseCurrentBlock();
1351 $this->css_row = ($this->css_row !==
"tblrow1")
1355 $this->tpl->setCurrentBlock(
"tbl_no_entries");
1356 $this->tpl->setVariable(
'TBL_NO_ENTRY_CSS_ROW', $this->css_row);
1357 $this->tpl->setVariable(
'TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
1358 $this->tpl->setVariable(
'TBL_NO_ENTRY_TEXT', trim($no_items_text));
1359 $this->tpl->parseCurrentBlock();
1388 $this->tpl->setVariable(
"CSS_TABLE", $this->
getStyle(
"table"));
1389 if ($this->
getId() !=
"") {
1390 $this->tpl->setVariable(
"ID",
'id="' . $this->
getId() .
'"');
1395 $this->tpl->setCurrentBlock(
"tbl_header_description");
1396 $this->tpl->setVariable(
"TBL_DESCRIPTION", $this->
getDescription());
1397 $this->tpl->parseCurrentBlock();
1405 $this->tpl->touchBlock(
"outer_start_1");
1406 $this->tpl->touchBlock(
"outer_end_1");
1408 $this->tpl->touchBlock(
"outer_start_2");
1409 $this->tpl->touchBlock(
"outer_end_2");
1413 if ($this->enabled[
"title"] && ($this->title !=
"" 1414 || $this->icon !=
"" || count($this->header_commands) > 0 ||
1415 $this->headerHTML !=
"" || $this->close_command !=
"")) {
1416 if ($this->enabled[
"icon"]) {
1417 $this->tpl->setCurrentBlock(
"tbl_header_title_icon");
1419 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT", $this->icon_alt);
1420 $this->tpl->parseCurrentBlock();
1424 foreach ($this->header_commands as $command) {
1425 if ($command[
"img"] !=
"") {
1426 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1427 if ($command[
"target"] !=
"") {
1428 $this->tpl->setVariable(
1430 'target="' . $command[
"target"] .
'"' 1433 $this->tpl->setVariable(
"ALT_IMG_LINK", $command[
"text"]);
1434 $this->tpl->setVariable(
"HREF_IMG_LINK", $command[
"href"]);
1435 $this->tpl->setVariable(
1440 $this->tpl->setCurrentBlock(
"head_cmd");
1441 $this->tpl->setVariable(
"TXT_HEAD_CMD", $command[
"text"]);
1442 $this->tpl->setVariable(
"HREF_HEAD_CMD", $command[
"href"]);
1444 $this->tpl->parseCurrentBlock();
1448 if (isset($this->headerHTML)) {
1449 $this->tpl->setCurrentBlock(
"tbl_header_html");
1450 $this->tpl->setVariable(
"HEADER_HTML", $this->headerHTML);
1451 $this->tpl->parseCurrentBlock();
1455 if ($this->close_command !=
"") {
1456 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1457 $this->tpl->setVariable(
"ALT_IMG_LINK",
$lng->
txt(
"close"));
1458 $this->tpl->setVariable(
"HREF_IMG_LINK", $this->close_command);
1459 $this->tpl->parseCurrentBlock();
1462 $this->tpl->setCurrentBlock(
"tbl_header_title");
1463 $this->tpl->setVariable(
"TBL_TITLE", $this->title);
1465 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
1467 $this->tpl->parseCurrentBlock();
1471 if ($this->enabled[
"header"]) {
1475 $this->tpl->touchBlock(
"tbl_table_end");
1477 return $this->tpl->get();
1488 $main_tpl = $DIC[
"tpl"];
1493 $main_tpl->addJavascript(
"assets/js/ServiceTable.js");
1495 if (count($filter) == 0 && count($opt_filter) == 0) {
1504 if (count($filter) > 0) {
1505 foreach ($filter as $item) {
1507 $this->tpl->setCurrentBlock(
"filter_row");
1508 $this->tpl->parseCurrentBlock();
1511 $this->tpl->setCurrentBlock(
"filter_item");
1512 $this->tpl->setVariable(
1516 $this->tpl->setVariable(
1518 $item->getTableFilterLabelFor()
1520 $this->tpl->setVariable(
1522 $item->getTableFilterHTML()
1524 $this->tpl->parseCurrentBlock();
1530 if (count($opt_filter) > 0) {
1533 foreach ($opt_filter as $item) {
1536 $this->tpl->setCurrentBlock(
"filter_row");
1537 $this->tpl->parseCurrentBlock();
1540 $this->tpl->setCurrentBlock(
"filter_item");
1541 $this->tpl->setVariable(
1545 $this->tpl->setVariable(
1549 $this->tpl->setVariable(
1551 $item->getTableFilterHTML()
1553 $this->tpl->parseCurrentBlock();
1560 foreach ($opt_filter as $item) {
1561 $k = $item->getPostVar();
1562 $items[$k] = array(
"txt" => $item->getTitle(),
1567 $cb_over->setLinkTitle(
$lng->
txt(
"optional_filters"));
1568 $cb_over->setItems($items);
1571 $cb_over->setFieldVar(
"tblff" . $this->
getId());
1572 $cb_over->setHiddenVar(
"tblfsf" . $this->
getId());
1574 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
1575 $this->tpl->setCurrentBlock(
"filter_select");
1578 $this->tpl->setVariable(
"HIDDEN_CMD_APPLY", $this->filter_cmd);
1580 $this->tpl->setVariable(
"FILTER_SELECTOR", $cb_over->getHTML(
false));
1581 $this->tpl->parseCurrentBlock();
1585 if ($ccnt > 0 || count($opt_filter) > 0) {
1586 $this->tpl->setVariable(
"TXT_FILTER",
$lng->
txt(
"filter"));
1591 $this->tpl->touchBlock(
"filter_empty_cell");
1594 $this->tpl->setCurrentBlock(
"filter_row");
1595 $this->tpl->parseCurrentBlock();
1597 $this->tpl->setCurrentBlock(
"filter_buttons");
1598 $this->tpl->setVariable(
"CMD_APPLY", $this->filter_cmd);
1599 $this->tpl->setVariable(
"TXT_APPLY", $this->filter_cmd_txt
1600 ?:
$lng->
txt(
"apply_filter"));
1601 $this->tpl->setVariable(
"CMD_RESET", $this->reset_cmd);
1602 $this->tpl->setVariable(
"TXT_RESET", $this->reset_cmd_txt
1603 ?:
$lng->
txt(
"reset_filter"));
1604 } elseif (count($opt_filter) > 0) {
1605 $this->tpl->setCurrentBlock(
"optional_filter_hint");
1606 $this->tpl->setVariable(
'TXT_OPT_HINT',
$lng->
txt(
'optional_filter_hint'));
1607 $this->tpl->parseCurrentBlock();
1610 $this->tpl->setCurrentBlock(
"filter_section");
1611 $this->tpl->setVariable(
"FIL_ID", $this->
getId());
1612 $this->tpl->parseCurrentBlock();
1616 $id = $this->
getId();
1617 $this->main_tpl->addOnLoadCode(
" 1618 ilTableHideFilter['atfil_$id'] = true; 1619 ilTableHideFilter['tfil_$id'] = true; 1620 ilTableHideFilter['dtfil_$id'] = true; 1627 $this->main_tpl->addOnLoadCode(
"ilInitTableFilters()");
1637 if ($prop ===
'0' || $prop ===
'1') {
1638 return (
bool) $prop;
1651 if ($item === $a_element) {
1660 $advmd_record_gui =
null;
1661 if (method_exists($this,
"getAdvMDRecordGUI")) {
1662 $advmd_record_gui = $this->getAdvMDRecordGUI();
1666 if ($advmd_record_gui &&
1671 if ($item->checkInput()) {
1672 $item->setValueByArray($this->raw_post_data);
1673 $item->writeToSession();
1677 if ($advmd_record_gui &&
1682 if ($item->checkInput()) {
1683 $item->setValueByArray($this->raw_post_data);
1684 $item->writeToSession();
1688 if ($advmd_record_gui) {
1689 $advmd_record_gui->importFilter();
1698 foreach ($filter as $item) {
1699 if ($item->checkInput()) {
1701 $item->setValueByArray([]);
1702 $item->clearFromSession();
1705 foreach ($opt_filter as $item) {
1706 if ($item->checkInput()) {
1708 $item->setValueByArray([]);
1709 $item->clearFromSession();
1721 foreach ($a_set as $key => $value) {
1722 $this->tpl->setVariable(
"VAL_" . strtoupper($key), $value);
1731 if (isset($DIC[
"ilUser"])) {
1732 $ilUser = $DIC[
"ilUser"];
1735 $ui_factory = $this->
ui->factory();
1736 $ui_renderer = $this->
ui->renderer();
1744 $column_selector =
'';
1748 $this->tpl->setCurrentBlock(
"select_all_checkbox");
1749 $this->tpl->setVariable(
"SELECT_ALL_TXT_SELECT_ALL",
$lng->
txt(
"select_all"));
1751 $this->tpl->setVariable(
"SELECT_ALL_FORM_NAME", $this->
getFormName());
1752 $this->tpl->setVariable(
"CHECKBOXNAME",
"chb_select_all_" . $this->unique_id);
1753 $this->tpl->parseCurrentBlock();
1757 if ($this->enabled[
"numinfo"] && $this->enabled[
"footer"]) {
1758 $start = $this->offset + 1;
1764 if ($end > $this->max_count or $this->limit == 0) {
1768 if ($this->max_count > 0) {
1769 if ($this->lang_support) {
1770 $numinfo =
"(" . $start .
" - " . $end .
" " . strtolower($this->
lng->txt(
"of")) .
" " . $this->max_count .
")";
1772 $numinfo =
"(" . $start .
" - " . $end .
" of " . $this->max_count .
")";
1775 if ($this->max_count > 0) {
1777 $this->tpl->setCurrentBlock(
"tbl_footer_numinfo");
1778 $this->tpl->setVariable(
"NUMINFO", $numinfo);
1779 $this->tpl->parseCurrentBlock();
1786 if ($this->enabled[
"linkbar"] && $this->enabled[
"footer"] && $this->limit != 0
1787 && $this->max_count > 0) {
1789 $this->tpl->setCurrentBlock(
"tbl_footer_linkbar");
1790 $this->tpl->setVariable(
"LINKBAR", $linkbar);
1791 $this->tpl->parseCurrentBlock();
1800 $items[$k] = array(
"txt" =>
$c[
"txt"],
1804 $cb_over->setLinkTitle(
$lng->
txt(
"columns"));
1805 $cb_over->setItems($items);
1809 $cb_over->setFieldVar(
"tblfs" . $this->
getId());
1810 $cb_over->setHiddenVar(
"tblfsh" . $this->
getId());
1811 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
1812 $column_selector = $cb_over->getHTML();
1817 $this->tpl->setCurrentBlock(
"tbl_footer");
1818 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
1820 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
1822 $this->tpl->parseCurrentBlock();
1825 if ($numinfo !=
"" || $linkbar !=
"" || $column_selector !=
"" ||
1826 count($this->filters) > 0 || count($this->optional_filters) > 0) {
1827 if (is_object($ilUser) && (count($this->filters) || count($this->optional_filters))) {
1828 $this->tpl->setCurrentBlock(
"filter_activation");
1829 $this->tpl->setVariable(
"TXT_ACTIVATE_FILTER",
$lng->
txt(
"show_filter"));
1830 $this->tpl->setVariable(
"FILA_ID", $this->
getId());
1831 if ($this->
getId() !=
"") {
1832 $this->tpl->setVariable(
"SAVE_URLA",
"./ilias.php?baseClass=ilTablePropertiesStorageGUI&table_id=" .
1833 $this->
getId() .
"&cmd=showFilter&user_id=" . $ilUser->getId());
1835 $this->tpl->parseCurrentBlock();
1839 $this->tpl->setCurrentBlock(
"filter_deactivation");
1840 $this->tpl->setVariable(
"TXT_HIDE",
$lng->
txt(
"hide_filter"));
1841 if ($this->
getId() !=
"") {
1842 $this->tpl->setVariable(
"SAVE_URL",
"./ilias.php?baseClass=ilTablePropertiesStorageGUI&table_id=" .
1843 $this->
getId() .
"&cmd=hideFilter&user_id=" . $ilUser->getId());
1844 $this->tpl->setVariable(
"FILD_ID", $this->
getId());
1846 $this->tpl->parseCurrentBlock();
1851 $this->tpl->setCurrentBlock(
"top_numinfo");
1852 $this->tpl->setVariable(
"NUMINFO", $numinfo);
1853 $this->tpl->parseCurrentBlock();
1857 $this->tpl->setCurrentBlock(
"top_linkbar");
1858 $this->tpl->setVariable(
"LINKBAR", $linkbar);
1859 $this->tpl->parseCurrentBlock();
1863 $this->tpl->setVariable(
"COLUMN_SELECTOR", $column_selector);
1867 is_object($ilUser) &&
1869 !$this->rows_selector_off) {
1872 $options = array(5 => 5, 10 => 10, 15 => 15, 20 => 20,
1873 30 => 30, 40 => 40, 50 => 50,
1874 100 => 100, 200 => 200, 400 => 400, 800 => 800);
1875 foreach ($options as $k => $v) {
1876 $ilCtrl->setParameter($this->parent_obj, $this->prefix .
"_trows", $k);
1877 $actions[] = $ui_factory->link()->standard(
1879 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd)
1881 $ilCtrl->setParameter($this->parent_obj, $this->prefix .
"_trows",
"");
1883 $dd = $ui_factory->dropdown()->standard($actions)->withLabel(
1886 $this->tpl->setVariable(
"ROW_SELECTOR", $ui_renderer->render($dd));
1890 if (count($this->export_formats) > 0 && $this->
dataExists()) {
1892 foreach ($this->export_formats as $format => $caption_lng_id) {
1893 $ilCtrl->setParameter($this->parent_obj, $this->prefix .
"_xpt", $format);
1894 $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd);
1895 $ilCtrl->setParameter($this->parent_obj, $this->prefix .
"_xpt",
"");
1896 $actions[] = $ui_factory->link()->standard(
1901 $dd = $ui_factory->dropdown()->standard($actions)->withLabel(
$lng->
txt(
"export"));
1902 $this->tpl->setVariable(
"EXPORT_SELECTOR",
" " . $ui_renderer->render($dd));
1905 $this->tpl->setCurrentBlock(
"top_navigation");
1906 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
1908 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
1910 $this->tpl->parseCurrentBlock();
1919 $ilUser = $DIC->user();
1926 $link = $ilCtrl->getLinkTargetByClass(get_class($this->parent_obj), $this->parent_cmd) .
1931 $layout_prev =
$lng->
txt(
"previous");
1932 $layout_next =
$lng->
txt(
"next");
1935 if ($this->max_count > $this->
getLimit() || $this->custom_prev_next) {
1936 $sep =
"<span> | </span>";
1939 $pages = intval($this->max_count / $this->
getLimit());
1942 if (($this->max_count % $this->
getLimit())) {
1947 $offset_arr = array();
1948 for ($i = 1 ;$i <= $pages ; $i++) {
1949 $newoffset = $this->
getLimit() * ($i - 1);
1955 $sep =
"<span> </span>";
1958 if ($this->custom_prev_next && $this->custom_prev !=
"") {
1959 $LinkBar .=
"<a href=\"" . $this->custom_prev . $hash .
"\">" . $layout_prev .
"</a>";
1960 } elseif ($this->
getOffset() >= 1 && !$this->custom_prev_next) {
1962 $LinkBar .=
"<a href=\"" . $link . $prevoffset . $hash .
"\">" . $layout_prev .
"</a>";
1964 $LinkBar .=
'<span class="ilTableFootLight">' . $layout_prev .
"</span>";
1968 if ($a_num ==
"1") {
1969 $LinkBar .=
'<input type="hidden" name="' . $this->
getNavParameter() .
1973 $sep =
"<span> | </span>";
1977 if ($this->custom_prev_next && $this->custom_next !=
"") {
1978 $LinkBar .=
"<a href=\"" . $this->custom_next . $hash .
"\">" . $layout_next .
"</a>";
1979 } elseif (!(($this->
getOffset() / $this->
getLimit()) == ($pages - 1)) && ($pages != 1) &&
1980 !$this->custom_prev_next) {
1982 $LinkBar .=
"<a href=\"" . $link . $newoffset . $hash .
"\">" . $layout_next .
"</a>";
1984 $LinkBar .=
'<span class="ilTableFootLight">' . $layout_next .
"</span>";
1987 $sep =
"<span> </span>";
1989 if (count($offset_arr) && !$this->
getDisplayAsBlock() && !$this->custom_prev_next) {
1993 '<label for="tab_page_sel_' . $a_num .
'">' .
$lng->
txt(
"page") .
'</label> ' .
2002 array(
"id" =>
"tab_page_sel_" . $a_num,
2003 "onchange" =>
"ilTablePageSelection(this, 'cmd[" . $this->parent_cmd .
"]')")
2015 $hidden_row =
false;
2016 if (count($this->hidden_inputs)) {
2017 foreach ($this->hidden_inputs as $hidden_input) {
2018 $this->tpl->setCurrentBlock(
"tbl_hidden_field");
2019 $this->tpl->setVariable(
"FIELD_NAME", $hidden_input[
"name"]);
2020 $this->tpl->setVariable(
"FIELD_VALUE", $hidden_input[
"value"]);
2021 $this->tpl->parseCurrentBlock();
2024 $this->tpl->setCurrentBlock(
"tbl_hidden_row");
2025 $this->tpl->parseCurrentBlock();
2034 $action_row =
false;
2040 if (count($this->sel_buttons) > 0) {
2041 foreach ($this->sel_buttons as $button) {
2042 $this->tpl->setCurrentBlock(
"sel_button");
2043 $this->tpl->setVariable(
2046 $button[
"selected"],
2053 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2054 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2055 $this->tpl->parseCurrentBlock();
2058 $this->tpl->setCurrentBlock(
"sel_top_button");
2059 $this->tpl->setVariable(
2062 $button[
"selected"],
2069 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2070 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2071 $this->tpl->parseCurrentBlock();
2077 $this->sel_buttons[] = array(
"options" => [],
"cmd" =>
'',
"text" =>
'');
2080 if (count($this->buttons) > 0) {
2081 foreach ($this->buttons as $button) {
2082 if (!is_array($button)) {
2084 $this->tpl->setVariable(
'BUTTON_OBJ', $button->render());
2087 $button = clone $button;
2089 $this->tpl->setVariable(
'BUTTON_TOP_OBJ', $button->render());
2094 if (strlen($button[
'onclick'])) {
2095 $this->tpl->setCurrentBlock(
'cmdonclick');
2096 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2097 $this->tpl->parseCurrentBlock();
2099 $this->tpl->setCurrentBlock(
"plain_button");
2100 if ($button[
"id"] !=
"") {
2101 $this->tpl->setVariable(
"PBID",
' id="' . $button[
"id"] .
'" ');
2103 if ($button[
"class"] !=
"") {
2104 $this->tpl->setVariable(
"PBBT_CLASS",
' ' . $button[
"class"]);
2106 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2107 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2108 $this->tpl->parseCurrentBlock();
2111 if (strlen($button[
'onclick'])) {
2112 $this->tpl->setCurrentBlock(
'top_cmdonclick');
2113 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2114 $this->tpl->parseCurrentBlock();
2116 $this->tpl->setCurrentBlock(
"plain_top_button");
2117 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2118 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2119 if ($button[
"class"] !=
"") {
2120 $this->tpl->setVariable(
"PBBT_CLASS",
' ' . $button[
"class"]);
2122 $this->tpl->parseCurrentBlock();
2131 if (count($this->mi_sel_buttons)) {
2132 foreach ($this->mi_sel_buttons as $button) {
2133 $this->tpl->setCurrentBlock(
"mi_sel_button");
2134 $this->tpl->setVariable(
2137 $button[
"selected"],
2144 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2145 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2146 $this->tpl->parseCurrentBlock();
2149 $this->tpl->setCurrentBlock(
"mi_top_sel_button");
2150 $this->tpl->setVariable(
2153 $button[
"selected"],
2154 $button[
"sel_var"] .
"_2",
2160 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2161 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2162 $this->tpl->parseCurrentBlock();
2170 if (count($this->multi) > 1 && $this->
dataExists()) {
2171 if ($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit()) {
2172 $this->tpl->setCurrentBlock(
"tbl_cmd_select_all");
2173 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL",
$lng->
txt(
"all_objects"));
2174 $this->tpl->parseCurrentBlock();
2177 $this->tpl->setCurrentBlock(
"tbl_cmd_select");
2179 foreach ($this->multi as $mc) {
2180 $sel[$mc[
"cmd"]] = $mc[
"text"];
2182 $this->tpl->setVariable(
2186 $this->tpl->setVariable(
"TXT_EXECUTE",
$lng->
txt(
"execute"));
2187 $this->tpl->parseCurrentBlock();
2192 if ($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit()) {
2193 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select_all");
2194 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL",
$lng->
txt(
"all_objects"));
2195 $this->tpl->parseCurrentBlock();
2198 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select");
2200 foreach ($this->multi as $mc) {
2201 $sel[$mc[
"cmd"]] = $mc[
"text"];
2203 $this->tpl->setVariable(
2207 $this->tpl->setVariable(
"TXT_EXECUTE",
$lng->
txt(
"execute"));
2208 $this->tpl->parseCurrentBlock();
2210 } elseif (count($this->multi) == 1 && $this->
dataExists()) {
2211 $this->tpl->setCurrentBlock(
"tbl_single_cmd");
2212 foreach ($this->multi as $mc) {
2216 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2217 $this->tpl->setVariable(
"SINGLE_CMD", $cmd);
2218 $this->tpl->parseCurrentBlock();
2223 $this->tpl->setCurrentBlock(
"tbl_top_single_cmd");
2224 foreach ($this->multi as $mc) {
2228 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2229 $this->tpl->setVariable(
"SINGLE_CMD", $cmd);
2230 $this->tpl->parseCurrentBlock();
2235 $this->tpl->setCurrentBlock(
"tbl_action_img_arrow");
2237 $this->tpl->setVariable(
"ALT_ARROW",
$lng->
txt(
"action"));
2238 $this->tpl->parseCurrentBlock();
2241 $this->tpl->setCurrentBlock(
"tbl_top_action_img_arrow");
2243 $this->tpl->setVariable(
"ALT_ARROW",
$lng->
txt(
"action"));
2244 $this->tpl->parseCurrentBlock();
2249 $this->tpl->setCurrentBlock(
"tbl_action_row");
2250 $this->tpl->parseCurrentBlock();
2252 $this->tpl->setCurrentBlock(
"tbl_top_action_row");
2253 $this->tpl->parseCurrentBlock();
2260 $this->headerHTML = $html;
2268 if (isset($DIC[
"ilUser"])) {
2269 $ilUser = $DIC[
"ilUser"];
2272 if (is_object($ilUser) && $this->
getId() !=
"") {
2275 $tab_prop->storeProperty($this->
getId(), $ilUser->getId(), $type, $value);
2284 if (isset($DIC[
"ilUser"])) {
2285 $ilUser = $DIC[
"ilUser"];
2288 if (is_object($ilUser) && $this->
getId() !=
"") {
2291 return $tab_prop->getProperty($this->
getId(), $ilUser->getId(), $type);
2312 $result[
"rows"] = $this->
getLimit();
2320 if ($this->filters) {
2321 foreach ($this->filters as $item) {
2322 $result[
"filter_values"][$item->getFieldId()] = $this->
getFilterValue($item);
2325 if ($this->optional_filters && $result[
"selfilters"]) {
2326 foreach ($this->optional_filters as $item) {
2327 if (in_array($item->getFieldId(), $result[
"selfilters"])) {
2328 $result[
"filter_values"][$item->getFieldId()] = $this->
getFilterValue($item);
2342 if (method_exists($a_item,
"getChecked")) {
2343 return (
string) $a_item->getChecked();
2344 } elseif (method_exists($a_item,
"getValue")) {
2345 return $a_item->getValue() ?:
"";
2346 } elseif (method_exists($a_item,
"getDate")) {
2347 return $a_item->getDate()?->get(
IL_CAL_DATE) ??
"";
2358 if (method_exists($a_item,
"setChecked")) {
2359 $a_item->setChecked((
bool) $a_value);
2360 } elseif (method_exists($a_item,
"setValue")) {
2361 $a_item->setValue($a_value);
2362 } elseif (method_exists($a_item,
"setDate")) {
2365 $a_item->writeToSession();
2371 $this->context =
$id;
2385 $this->show_rows_selector = $a_value;
2398 return parent::getLimit();
2406 return parent::getOffset();
2414 $this->export_formats = array();
2417 $valid = array(self::EXPORT_EXCEL =>
"tbl_export_excel",
2418 self::EXPORT_CSV =>
"tbl_export_csv");
2420 foreach ($formats as $format) {
2421 if (array_key_exists($format,
$valid)) {
2422 $this->export_formats[$format] =
$valid[$format];
2429 $this->print_mode = $a_value;
2445 public function exportData(
int $format,
bool $send =
false): void
2462 case self::EXPORT_EXCEL:
2464 $excel->addSheet($this->title
2465 ?: $this->
lng->txt(
"export"));
2478 foreach ($this->row_data as $set) {
2491 case self::EXPORT_CSV:
2493 $csv->setSeparator(
";");
2498 foreach ($this->row_data as $set) {
2505 header(
"Content-type: text/comma-separated-values");
2506 header(
"Content-Disposition: attachment; filename=\"" .
$filename .
"\"");
2508 header(
"Cache-Control: must-revalidate, post-check=0,pre-check=0");
2509 header(
"Pragma: public");
2510 echo $csv->getCSVString();
2512 file_put_contents(
$filename, $csv->getCSVString());
2542 foreach ($this->column as $column) {
2543 $title = strip_tags($column[
"text"]);
2561 foreach ($a_set as $value) {
2562 if (is_array($value)) {
2563 $value = implode(
', ', $value);
2565 $a_excel->
setCell($a_row, $col++, $value);
2585 foreach ($this->column as $column) {
2586 $title = strip_tags($column[
"text"]);
2602 foreach ($a_set as $key => $value) {
2603 if (is_array($value)) {
2604 $value = implode(
', ', $value);
2613 $this->enable_command_for_all = $a_value;
2620 $ilClientIniFile = $DIC[
"ilClientIniFile"];
2622 $limit = $ilClientIniFile->readVariable(
"system",
"TABLE_ACTION_ALL_LIMIT");
2624 $limit = self::ACTION_ALL_LIMIT;
2642 $this->prevent_double_submission = $a_val;
2650 public function setLimit(
int $a_limit = 0,
int $a_default_limit = 0): void
2652 parent::setLimit($a_limit, $a_default_limit);
2655 if ($a_limit == 9999 &&
2656 $this->limit_determined) {
2657 $this->rows_selector_off =
true;
setNoEntriesText(string $a_text)
setOffset(int $a_offset)
set dataset offset
array $restore_filter_values
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.
string $row_selector_label
setTopCommands(bool $a_val)
bool $enable_command_for_all
fillMetaCSV(ilCSVWriter $a_csv)
Add meta information to csv export.
setExportFormats(array $formats)
Set available export formats.
addCommandButtonInstance(ilButtonBase $a_button)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getStyle(string $a_element)
bool $disable_filter_hiding
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setOrderLink(string $key, string $order_dir)
string $defaultorderdirection
string $requested_nav_par2
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
CSV Version of Fill Row.
getSelectableColumns()
Get selectable columns.
setEnableTitle(bool $a_enabletitle)
renderFilter()
Render Filter section.
ILIAS Table TableGUIRequest $table_request
loadProperty(string $type)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setResetCommand(string $a_val, string $a_caption="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
getColumnCoord(int $a_col)
Get column "name" from number.
determineSelectedColumns()
setCloseFormTag(bool $a_val)
setDescription(string $a_val)
setDisableFilterHiding(bool $a_val=true)
string $requested_nav_par1
setPrintMode(bool $a_value=false)
isAdvMDFilter(ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
Check if filter element is based on adv md.
loadLanguageModule(string $a_module)
Load language module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormName(string $a_name="")
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
const FILTER_NUMBER_RANGE
array $selectable_columns
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFilterValue(ilTableFilterItem $a_item)
Get current filter value.
getFilterItemByPostVar(string $a_post_var)
exportData(int $format, bool $send=false)
Export and optionally send current table data.
ilGlobalTemplateInterface $main_tpl
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setIsDataTable(bool $a_val)
addMultiItemSelectionButton(string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
isFilterSelected(string $a_col)
Is given filter selected?
resetOffset(bool $a_in_determination=false)
getDefaultOrderDirection()
setExternalSorting(bool $a_val)
bool $default_filter_visibility
isColumnSelected(string $col)
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setBold(string $a_coords)
Set cell(s) to bold.
getNextClass($a_gui_class=null)
fillRow(array $a_set)
Standard Version of Fill Row.
const FILTER_DATETIME_RANGE
addHiddenInput(string $a_name, string $a_value)
isFilterVisible()
Check if filter is visible: manually shown (session, db) or default value set.
setOrderDirection(string $a_order_direction)
setDefaultOrderField(string $a_defaultorderfield)
const FILTER_DURATION_RANGE
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
getExternalSegmentation()
static getAllCommandLimit()
fillMetaExcel(ilExcel $a_excel, int &$a_row)
Add meta information to excel export.
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
Excel Version of Fill Row.
setEnableAllCommand(bool $a_value)
setTopAnchor(string $a_val)
getPreventDoubleSubmission()
addHeaderCommand(string $a_href, string $a_text, string $a_target="", string $a_img="")
getInstalledLanguages()
Get installed languages.
setCloseCommand(string $a_link)
fillHeaderCSV(ilCSVWriter $a_csv)
CSV Version of Fill Header.
setOrderField(string $a_order_field)
getLinkbar(string $a_num)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFilterValue(ilTableFilterItem $a_item, $a_value)
fillHeaderExcel(ilExcel $a_excel, int &$a_row)
Excel Version of Fill Header.
determineSelectedFilters()
setRowSelectorLabel(string $row_selector_label)
setEnableNumInfo(bool $a_val)
setPreventDoubleSubmission(bool $a_val)
setFooter(string $a_style, string $a_previous="", string $a_next="")
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
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)
getCurrentState()
get current settings for order, limit, columns and filter
getFilterElements(bool $a_only_non_empty=true)
Get SQL conditions for current filter value(s)
string $requested_nav_par
__construct(?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
setDisplayAsBlock(bool $a_val)
setHeaderHTML(string $html)
string $defaultorderfield
getFilterItems(bool $a_optionals=false)
setOpenFormTag(bool $a_val)
getDefaultFilterVisibility()
setDefaultFilterVisiblity(bool $a_status)
addMultiCommand(string $a_cmd, string $a_text)
setCustomPreviousNext(string $a_prev_link, string $a_next_link)
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
determineOffsetAndOrder(bool $a_omit_offset=false)
getSelectAllCheckbox()
get the name of the checkbox that should be toggled with a select all button
storeProperty(string $type, string $value)
setEnableHeader(bool $a_enableheader)
setMaxCount(int $a_max_count)
set max.
bool $prevent_double_submission
setFilterCols(int $a_val)
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)
setPrefix(string $a_prefix)