4 require_once(
"Services/Table/classes/class.ilTableGUI.php");
84 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_template_context =
"")
88 parent::__construct(0,
false);
89 $this->unique_id = md5(uniqid());
90 $this->parent_obj = $a_parent_obj;
91 $this->parent_cmd = $a_parent_cmd;
92 $this->buttons = array();
93 $this->header_commands = array();
94 $this->multi = array();
95 $this->hidden_inputs = array();
97 $this->tpl =
new ilTemplate(
"tpl.table2.html",
true,
true,
"Services/Table");
99 $lng->loadLanguageModule(
'tbl');
101 if(!$a_template_context)
103 $a_template_context = $this->
getId();
108 if(isset(
$_GET[$this->prefix.
"_xpt"]))
110 $this->export_mode = (int)
$_GET[$this->prefix.
"_xpt"];
114 if(isset(
$_GET[$this->prefix.
"_tpl"]))
132 $this->open_form_tag = $a_val;
152 $this->close_form_tag = $a_val;
172 if ($this->limit_determined)
178 if (isset(
$_GET[$this->prefix.
"_trows"]))
194 if (is_object($ilUser))
196 $limit = $ilUser->getPref(
"hits_per_page");
206 $this->limit_determined =
true;
224 if ($this->columns_determined)
235 @unserialize($old_sel);
238 if(!is_array($sel_fields))
241 $sel_fields = array();
244 $this->selected_columns = array();
248 $this->selected_column[$k] =
false;
250 $new_column = ($sel_fields[$k] === NULL);
257 $this->selected_column[$k] =
true;
260 else if ($stored && !$new_column)
262 $this->selected_column[$k] = $sel_fields[$k];
272 $this->selected_column[$k] =
true;
277 if ($old_sel != serialize($this->selected_column) && $set)
279 $this->
storeProperty(
"selfields", serialize($this->selected_column));
282 $this->columns_determined =
true;
293 return $this->selected_column[$a_col];
305 foreach ($this->selected_column as $k => $v)
322 $next_class = $ilCtrl->getNextClass($this);
323 $cmd = $ilCtrl->getCmd();
327 case 'ilformpropertydispatchgui':
328 include_once
'./Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
332 $form_prop_dispatch->setItem($item);
333 return $ilCtrl->forwardCommand($form_prop_dispatch);
345 if (!$this->nav_determined && !$a_in_determination)
372 return $this->parent_obj;
382 return $this->parent_cmd;
392 $this->top_anchor = $a_val;
412 $this->noentriestext = $a_text;
422 return $this->noentriestext;
432 $this->datatable = $a_val;
442 return $this->datatable;
452 $this->enabled[
"title"] = $a_enabletitle;
462 return $this->enabled[
"title"];
472 $this->enabled[
"header"] = $a_enableheader;
482 return $this->enabled[
"header"];
492 $this->num_info = $a_val;
502 return $this->num_info;
508 final public function setTitle($a_title, $a_icon = 0, $a_icon_alt = 0)
510 parent::setTitle($a_title, $a_icon, $a_icon_alt);
520 $this->description = $a_val;
530 return $this->description;
540 $this->order_field = $a_order_field;
545 return $this->order_field;
552 $this->enabled[
"header"] && $this->enabled[
"sort"] &&
553 $this->columns_determined && is_array($this->column) &&
557 $check = array_keys(array_shift($check));
558 foreach($this->column as $col)
560 if($col[
"sort_field"] && !in_array($col[
"sort_field"], $check))
562 $invalid[] = $col[
"sort_field"];
577 $this->row_data = $a_data;
582 return $this->row_data;
587 if (is_array($this->row_data))
589 if (count($this->row_data) > 0)
599 $this->prefix = $a_prefix;
613 $a_input_item->setParent($this);
616 $this->filters[] = $a_input_item;
620 $this->optional_filters[] = $a_input_item;
624 if($this->restore_filter)
628 $this->setFilterValue($a_input_item, $this->restore_filter_values[$a_input_item->getFieldId()]);
632 $this->setFilterValue($a_input_item, null);
652 $caption = $lng->txt($id);
655 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
659 case self::FILTER_SELECT:
660 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
664 case self::FILTER_DATE:
665 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
670 case self::FILTER_TEXT:
671 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
673 $item->setMaxLength(64);
678 case self::FILTER_LANGUAGE:
679 $lng->loadLanguageModule(
"meta");
680 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
682 $options = array(
"" => $lng->txt(
"trac_all"));
683 foreach ($lng->getInstalledLanguages() as $lang_key)
685 $options[$lang_key] = $lng->txt(
"meta_l_".$lang_key);
690 case self::FILTER_NUMBER_RANGE:
691 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
692 include_once(
"./Services/Form/classes/class.ilNumberInputGUI.php");
695 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
697 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
699 $item->setMaxLength(7);
703 case self::FILTER_DATE_RANGE:
704 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
705 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
708 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
710 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
715 case self::FILTER_DATETIME_RANGE:
716 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
717 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
720 $combi_item->setShowTime(
true);
721 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
723 $combi_item->setShowTime(
true);
724 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
729 case self::FILTER_DURATION_RANGE:
730 $lng->loadLanguageModule(
"form");
731 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
732 include_once(
"./Services/Form/classes/class.ilDurationInputGUI.php");
735 $combi_item->setShowMonths(
false);
736 $combi_item->setShowDays(
true);
737 $combi_item->setShowSeconds(
true);
738 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
740 $combi_item->setShowMonths(
false);
741 $combi_item->setShowDays(
true);
742 $combi_item->setShowSeconds(
true);
743 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
752 $item->readFromSession();
772 if ($item->getPostVar() == $a_post_var)
779 if ($item->getPostVar() == $a_post_var)
794 $this->filter_cols = $a_val;
814 $this->disable_filter_hiding = $a_val;
835 return $this->selected_filter[$a_col];
847 foreach ($this->selected_filter as $k => $v)
865 if ($this->filters_determined)
875 @unserialize($old_sel);
878 if(!is_array($sel_filters))
881 $sel_filters = array();
884 $this->selected_filter = array();
888 $k = $item->getPostVar();
890 $this->selected_filter[$k] =
false;
897 $this->selected_filter[$k] =
true;
901 $item->setValue(NULL);
902 $item->writeToSession();
907 $this->selected_filter[$k] = $sel_filters[$k];
911 if ($old_sel != serialize($this->selected_filter) && $set)
913 $this->
storeProperty(
"selfilters", serialize($this->selected_filter));
916 $this->filters_determined =
true;
924 $this->custom_prev_next =
true;
925 $this->custom_prev = $a_prev_link;
926 $this->custom_next = $a_next_link;
937 $this->form_action = $a_form_action;
938 $this->form_multipart = (bool)$a_multipart;
948 return $this->form_action;
958 $this->formname = $a_formname;
968 return $this->formname;
1002 $this->display_as_block = $a_val;
1012 return $this->display_as_block;
1032 $this->select_all_checkbox = $a_select_all_checkbox;
1042 $this->ext_sort = $a_val;
1063 $this->filter_cmd = $a_val;
1064 $this->filter_cmd_txt = $a_caption;
1085 $this->reset_cmd = $a_val;
1086 $this->reset_cmd_txt = $a_caption;
1106 $this->ext_seg = $a_val;
1127 $this->row_template = $a_template;
1128 $this->row_template_dir = $a_template_dir;
1138 $this->defaultorderfield = $a_defaultorderfield;
1148 return $this->defaultorderfield;
1158 $this->defaultorderdirection = $a_defaultorderdirection;
1168 return $this->defaultorderdirection;
1178 $this->buttons = array();
1189 $this->buttons[] = array(
"cmd" => $a_cmd,
"text" => $a_text,
'onclick' => $a_onclick,
1190 "id" => $a_id,
"class" => $a_class);
1200 $this->buttons[] = $a_button;
1215 echo
"ilTabl2GUI->addSelectionButton() has been deprecated with 4.2. Please try to move the drop-down to ilToolbarGUI.";
1230 $this->mi_sel_buttons[] = array(
"sel_var" => $a_sel_var,
"options" => $a_options,
"selected" => $a_default_selection,
"cmd" => $a_cmd,
"text" => $a_text);
1244 $this->close_command = $a_link;
1255 $this->multi[] = array(
"cmd" => $a_cmd,
"text" => $a_text);
1266 $this->hidden_inputs[] = array(
"name" => $a_name,
"value" => $a_value);
1277 $this->header_commands[] = array(
"href" => $a_href,
"text" => $a_text,
1278 "target" => $a_target,
"img" => $a_img);
1288 $this->top_commands = $a_val;
1308 final public function addColumn($a_text, $a_sort_field =
"", $a_width =
"",
1309 $a_is_checkbox_action_column =
false, $a_class =
"", $a_tooltip =
"", $a_tooltip_with_html =
false)
1311 $this->column[] = array(
1313 "sort_field" => $a_sort_field,
1314 "width" => $a_width,
1315 "is_checkbox_action_column" => $a_is_checkbox_action_column,
1316 "class" => $a_class,
1317 "tooltip" => $a_tooltip,
1318 "tooltip_html" => (
bool)$a_tooltip_with_html
1320 if ($a_sort_field !=
"")
1322 $this->sortable_fields[] = $a_sort_field;
1324 $this->column_count = count($this->column);
1330 return $this->prefix.
"_table_nav";
1338 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
1340 $hash =
"#".$this->getTopAnchor();
1346 $ilCtrl->setParameter($this->parent_obj,
1348 $sort_field.
":".$order_dir.
":".$this->offset);
1349 $this->tpl->setVariable(
"TBL_ORDER_LINK",
1350 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd).$hash);
1353 $ilCtrl->setParameter($this->parent_obj,
1361 $allcolumnswithwidth =
true;
1362 foreach ((array) $this->column as $idx => $column)
1364 if (!strlen($column[
"width"]))
1366 $allcolumnswithwidth =
false;
1368 else if($column[
"width"] ==
"1")
1371 $this->column[$idx][
"width"] =
"1%";
1374 if ($allcolumnswithwidth)
1376 foreach ((array) $this->column as $column)
1378 $this->tpl->setCurrentBlock(
"tbl_colgroup_column");
1379 $this->tpl->setVariable(
"COLGROUP_COLUMN_WIDTH", $column[
"width"]);
1380 $this->tpl->parseCurrentBlock();
1384 foreach ((array) $this->column as $column)
1388 if ($column[
"tooltip"] !=
"")
1390 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1392 "",
"bottom center",
"top center", !$column[
"tooltip_html"]);
1394 if (!$this->enabled[
"sort"] || $column[
"sort_field"] ==
"" || $column[
"is_checkbox_action_column"])
1396 $this->tpl->setCurrentBlock(
"tbl_header_no_link");
1397 if ($column[
"width"] !=
"")
1399 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH_NO_LINK",
" width=\"".$column[
"width"].
"\"");
1401 if ($column[
"class"] !=
"")
1403 $this->tpl->setVariable(
"TBL_COLUMN_CLASS_NO_LINK",
" class=\"".$column[
"class"].
"\"");
1405 if (!$column[
"is_checkbox_action_column"])
1407 $this->tpl->setVariable(
"TBL_HEADER_CELL_NO_LINK",
1412 $this->tpl->setVariable(
"TBL_HEADER_CELL_NO_LINK",
1415 $this->tpl->setVariable(
"HEAD_CELL_NL_ID",
"thc_".$this->
getId().
"_".$ccnt);
1416 if ($column[
"class"] !=
"")
1418 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1420 $this->tpl->parseCurrentBlock();
1421 $this->tpl->touchBlock(
"tbl_header_th");
1424 if (($column[
"sort_field"] == $this->order_field) && ($this->order_direction !=
""))
1426 $this->tpl->setCurrentBlock(
"tbl_order_image");
1427 if ($this->order_direction ==
"asc")
1429 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-up");
1433 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-down");
1435 $this->tpl->setVariable(
"IMG_ORDER_ALT", $this->lng->txt(
"change_sort_direction"));
1436 $this->tpl->parseCurrentBlock();
1439 $this->tpl->setCurrentBlock(
"tbl_header_cell");
1440 $this->tpl->setVariable(
"TBL_HEADER_CELL", $column[
"text"]);
1441 $this->tpl->setVariable(
"HEAD_CELL_ID",
"thc_".$this->
getId().
"_".$ccnt);
1444 if ($column[
"width"] !=
"")
1446 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH",
" width=\"".$column[
"width"].
"\"");
1448 if ($column[
"class"] !=
"")
1450 $this->tpl->setVariable(
"TBL_COLUMN_CLASS",
" class=\"".$column[
"class"].
"\"");
1453 $lng_sort_column = $this->lng->txt(
"sort_by_this_column");
1454 $this->tpl->setVariable(
"TBL_ORDER_ALT",$lng_sort_column);
1458 if ($column[
"sort_field"] == $this->order_field)
1460 $order_dir = $this->sort_order;
1462 $lng_change_sort = $this->lng->txt(
"change_sort_direction");
1463 $this->tpl->setVariable(
"TBL_ORDER_ALT",$lng_change_sort);
1466 if ($column[
"class"] !=
"")
1468 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1470 $this->
setOrderLink($column[
"sort_field"], $order_dir);
1471 $this->tpl->parseCurrentBlock();
1472 $this->tpl->touchBlock(
"tbl_header_th");
1475 $this->tpl->setCurrentBlock(
"tbl_header");
1476 $this->tpl->parseCurrentBlock();
1494 if ($this->nav_determined)
1519 if ($this->nav_value ==
"" && $this->
getId() !=
"" && $ilUser->getId() != ANONYMOUS_USER_ID)
1522 if (in_array($order, $this->sortable_fields))
1536 $nav = explode(
":", $this->nav_value);
1542 if (!$a_omit_offset)
1559 if (!$a_omit_offset)
1561 $this->nav_determined =
true;
1597 if (is_object($ilCtrl) && $this->
getId() ==
"")
1608 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
1610 $hash =
"#".$this->getTopAnchor();
1613 if((
bool)$this->form_multipart)
1615 $this->tpl->touchBlock(
"form_multipart_bl");
1620 $this->tpl->touchBlock(
"pdfs");
1623 $this->tpl->setCurrentBlock(
"tbl_form_header");
1624 $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction().$hash);
1625 $this->tpl->setVariable(
"FORMNAME", $this->
getFormName());
1626 $this->tpl->parseCurrentBlock();
1631 $this->tpl->touchBlock(
"tbl_form_footer");
1635 if(!$this->enabled[
'content'])
1647 $this->
setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1674 $this->tpl->addBlockFile(
"TBL_CONTENT",
"tbl_content", $this->row_template,
1675 $this->row_template_dir);
1677 foreach($data as $set)
1679 $this->tpl->setCurrentBlock(
"tbl_content");
1680 $this->css_row = ($this->css_row !=
"tblrow1")
1683 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
1686 $this->tpl->setCurrentBlock(
"tbl_content");
1687 $this->tpl->parseCurrentBlock();
1695 : $lng->txt(
"no_items");
1697 $this->css_row = ($this->css_row !=
"tblrow1")
1701 $this->tpl->setCurrentBlock(
"tbl_no_entries");
1702 $this->tpl->setVariable(
'TBL_NO_ENTRY_CSS_ROW', $this->css_row);
1703 $this->tpl->setVariable(
'TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
1704 $this->tpl->setVariable(
'TBL_NO_ENTRY_TEXT', trim($no_items_text));
1705 $this->tpl->parseCurrentBlock();
1741 $this->tpl->setVariable(
"CSS_TABLE",$this->
getStyle(
"table"));
1742 $this->tpl->setVariable(
"DATA_TABLE", (
int) $this->
getIsDataTable());
1743 if ($this->
getId() !=
"")
1745 $this->tpl->setVariable(
"ID",
'id="'.$this->
getId().
'"');
1751 $this->tpl->setCurrentBlock(
"tbl_header_description");
1752 $this->tpl->setVariable(
"TBL_DESCRIPTION", $this->
getDescription());
1753 $this->tpl->parseCurrentBlock();
1763 $this->tpl->touchBlock(
"outer_start_1");
1764 $this->tpl->touchBlock(
"outer_end_1");
1768 $this->tpl->touchBlock(
"outer_start_2");
1769 $this->tpl->touchBlock(
"outer_end_2");
1773 if ($this->enabled[
"title"] && ($this->title !=
"" 1774 || $this->icon !=
"" || count($this->header_commands) > 0 ||
1775 $this->headerHTML !=
"" || $this->close_command !=
""))
1777 if ($this->enabled[
"icon"])
1779 $this->tpl->setCurrentBlock(
"tbl_header_title_icon");
1781 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->icon_alt);
1782 $this->tpl->parseCurrentBlock();
1787 foreach($this->header_commands as $command)
1789 if ($command[
"img"] !=
"")
1791 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1792 if ($command[
"target"] !=
"")
1794 $this->tpl->setVariable(
"TARGET_IMG_LINK",
1795 'target="'.$command[
"target"].
'"');
1797 $this->tpl->setVariable(
"ALT_IMG_LINK", $command[
"text"]);
1798 $this->tpl->setVariable(
"HREF_IMG_LINK", $command[
"href"]);
1799 $this->tpl->setVariable(
"SRC_IMG_LINK",
1801 $this->tpl->parseCurrentBlock();
1805 $this->tpl->setCurrentBlock(
"head_cmd");
1806 $this->tpl->setVariable(
"TXT_HEAD_CMD", $command[
"text"]);
1807 $this->tpl->setVariable(
"HREF_HEAD_CMD", $command[
"href"]);
1808 $this->tpl->parseCurrentBlock();
1813 if (isset ($this->headerHTML)) {
1814 $this->tpl->setCurrentBlock(
"tbl_header_html");
1815 $this->tpl->setVariable (
"HEADER_HTML", $this->headerHTML);
1816 $this->tpl->parseCurrentBlock();
1820 if ($this->close_command !=
"")
1822 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1823 $this->tpl->setVariable(
"ALT_IMG_LINK",$lng->txt(
"close"));
1824 $this->tpl->setVariable(
"HREF_IMG_LINK",$this->close_command);
1825 $this->tpl->parseCurrentBlock();
1828 $this->tpl->setCurrentBlock(
"tbl_header_title");
1829 $this->tpl->setVariable(
"TBL_TITLE",$this->title);
1830 $this->tpl->setVariable(
"TOP_ANCHOR",$this->
getTopAnchor());
1833 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
1835 $this->tpl->parseCurrentBlock();
1839 if ($this->enabled[
"header"])
1844 $this->tpl->touchBlock(
"tbl_table_end");
1846 return $this->tpl->get();
1859 $tpl->addJavascript(
"./Services/Table/js/ServiceTable.js");
1861 if (count($filter) == 0 && count($opt_filter) == 0)
1866 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1872 if (count($filter) > 0)
1874 foreach ($filter as $item)
1878 $this->tpl->setCurrentBlock(
"filter_row");
1879 $this->tpl->parseCurrentBlock();
1882 $this->tpl->setCurrentBlock(
"filter_item");
1883 $this->tpl->setVariable(
"OPTION_NAME",
1885 $this->tpl->setVariable(
"F_INPUT_ID",
1886 $item->getFieldId());
1887 $this->tpl->setVariable(
"INPUT_HTML",
1888 $item->getTableFilterHTML());
1889 $this->tpl->parseCurrentBlock();
1895 if (count($opt_filter) > 0)
1899 foreach ($opt_filter as $item)
1905 $this->tpl->setCurrentBlock(
"filter_row");
1906 $this->tpl->parseCurrentBlock();
1909 $this->tpl->setCurrentBlock(
"filter_item");
1910 $this->tpl->setVariable(
"OPTION_NAME",
1912 $this->tpl->setVariable(
"F_INPUT_ID",
1913 $item->getFieldId());
1914 $this->tpl->setVariable(
"INPUT_HTML",
1915 $item->getTableFilterHTML());
1916 $this->tpl->parseCurrentBlock();
1923 foreach ($opt_filter as $item)
1925 $k = $item->getPostVar();
1926 $items[$k] = array(
"txt" => $item->getTitle(),
1930 include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
1932 $cb_over->setLinkTitle($lng->txt(
"optional_filters"));
1933 $cb_over->setItems($items);
1936 $cb_over->setFieldVar(
"tblff".$this->
getId());
1937 $cb_over->setHiddenVar(
"tblfsf".$this->
getId());
1939 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
1940 $this->tpl->setCurrentBlock(
"filter_select");
1943 $this->tpl->setVariable(
"HIDDEN_CMD_APPLY", $this->filter_cmd);
1945 $this->tpl->setVariable(
"FILTER_SELECTOR", $cb_over->getHTML());
1946 $this->tpl->parseCurrentBlock();
1950 if($ccnt > 0 || count($opt_filter) > 0)
1952 $this->tpl->setVariable(
"TXT_FILTER", $lng->txt(
"filter"));
1960 $this->tpl->touchBlock(
"filter_empty_cell");
1963 $this->tpl->setCurrentBlock(
"filter_row");
1964 $this->tpl->parseCurrentBlock();
1966 $this->tpl->setCurrentBlock(
"filter_buttons");
1967 $this->tpl->setVariable(
"CMD_APPLY", $this->filter_cmd);
1968 $this->tpl->setVariable(
"TXT_APPLY", $this->filter_cmd_txt
1969 ? $this->filter_cmd_txt
1970 : $lng->txt(
"apply_filter"));
1971 $this->tpl->setVariable(
"CMD_RESET", $this->reset_cmd);
1972 $this->tpl->setVariable(
"TXT_RESET", $this->reset_cmd_txt
1973 ? $this->reset_cmd_txt
1974 : $lng->txt(
"reset_filter"));
1976 else if(count($opt_filter) > 0)
1978 $this->tpl->setCurrentBlock(
"optional_filter_hint");
1979 $this->tpl->setVariable(
'TXT_OPT_HINT', $lng->txt(
'optional_filter_hint'));
1980 $this->tpl->parseCurrentBlock();
1983 $this->tpl->setCurrentBlock(
"filter_section");
1984 $this->tpl->setVariable(
"FIL_ID", $this->
getId());
1985 $this->tpl->parseCurrentBlock();
1992 $this->tpl->setCurrentBlock(
"filter_hidden");
1993 $this->tpl->setVariable(
"FI_ID", $this->
getId());
1994 $this->tpl->parseCurrentBlock();
2011 if($item === $a_element)
2024 $advmd_record_gui = null;
2025 if(method_exists($this,
"getAdvMDRecordGUI"))
2027 $advmd_record_gui = $this->getAdvMDRecordGUI();
2032 if($advmd_record_gui &&
2038 if ($item->checkInput())
2040 $item->setValueByArray(
$_POST);
2041 $item->writeToSession();
2046 if($advmd_record_gui &&
2052 if ($item->checkInput())
2054 $item->setValueByArray(
$_POST);
2055 $item->writeToSession();
2059 if($advmd_record_gui)
2061 $advmd_record_gui->importFilter();
2079 foreach ($filter as $item)
2081 if ($item->checkInput())
2083 $item->setValueByArray(
$_POST);
2084 $item->clearFromSession();
2087 foreach ($opt_filter as $item)
2089 if ($item->checkInput())
2091 $item->setValueByArray(
$_POST);
2092 $item->clearFromSession();
2109 foreach ($a_set as $key => $value)
2111 $this->tpl->setVariable(
"VAL_".strtoupper($key), $value);
2127 $this->tpl->setCurrentBlock(
"select_all_checkbox");
2128 $this->tpl->setVariable(
"SELECT_ALL_TXT_SELECT_ALL", $lng->txt(
"select_all"));
2130 $this->tpl->setVariable(
"SELECT_ALL_FORM_NAME", $this->
getFormName());
2131 $this->tpl->setVariable(
"CHECKBOXNAME",
"chb_select_all_" . $this->unique_id);
2132 $this->tpl->parseCurrentBlock();
2136 if ($this->enabled[
"numinfo"] && $this->enabled[
"footer"])
2138 $start = $this->offset + 1;
2145 if ($end > $this->max_count or $this->limit == 0)
2150 if ($this->max_count > 0)
2152 if ($this->lang_support)
2154 $numinfo =
"(".$start.
" - ".$end.
" ".strtolower($this->lng->txt(
"of")).
" ".$this->max_count.
")";
2158 $numinfo =
"(".$start.
" - ".$end.
" of ".$this->max_count.
")";
2161 if ($this->max_count > 0)
2165 $this->tpl->setCurrentBlock(
"tbl_footer_numinfo");
2166 $this->tpl->setVariable(
"NUMINFO", $numinfo);
2167 $this->tpl->parseCurrentBlock();
2174 if ($this->enabled[
"linkbar"] && $this->enabled[
"footer"] && $this->limit != 0
2175 && $this->max_count > 0)
2178 "link" => $this->footer_style,
2179 "prev" => $this->footer_previous,
2180 "next" => $this->footer_next,
2185 $this->tpl->setCurrentBlock(
"tbl_footer_linkbar");
2186 $this->tpl->setVariable(
"LINKBAR", $linkbar);
2187 $this->tpl->parseCurrentBlock();
2199 $items[$k] = array(
"txt" => $c[
"txt"],
2202 include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
2204 $cb_over->setLinkTitle($lng->txt(
"columns"));
2205 $cb_over->setItems($items);
2209 $cb_over->setFieldVar(
"tblfs".$this->
getId());
2210 $cb_over->setHiddenVar(
"tblfsh".$this->
getId());
2211 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
2212 $column_selector = $cb_over->getHTML();
2234 $create_id =
"template_create_overlay_".$this->getId();
2235 $delete_id =
"template_delete_overlay_".$this->getId();
2236 $list_id =
"template_stg_".$this->getId();
2238 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
2240 $templates = $storage->getNames($this->
getContext(), $ilUser->getId());
2242 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
2245 if(
sizeof($templates))
2248 $overlay->setTrigger($list_id.
"_delete");
2249 $overlay->setAnchor(
"ilAdvSelListAnchorElement_".$list_id);
2250 $overlay->setAutoHide(
false);
2253 $lng->loadLanguageModule(
"form");
2254 $this->tpl->setCurrentBlock(
"template_editor_delete_item");
2255 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE",
"");
2256 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION",
"- ".$lng->txt(
"form_please_select").
" -");
2257 $this->tpl->parseCurrentBlock();
2258 foreach($templates as $name)
2260 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE", $name);
2261 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION", $name);
2262 $this->tpl->parseCurrentBlock();
2265 $this->tpl->setCurrentBlock(
"template_editor_delete");
2266 $this->tpl->setVariable(
"TEMPLATE_DELETE_ID", $delete_id);
2267 $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE", $lng->txt(
"tbl_template_delete"));
2268 $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE_SUBMIT", $lng->txt(
"delete"));
2269 $this->tpl->setVariable(
"TEMPLATE_DELETE_CMD", $this->parent_cmd);
2270 $this->tpl->parseCurrentBlock();
2276 $overlay->setTrigger($list_id.
"_create");
2277 $overlay->setAnchor(
"ilAdvSelListAnchorElement_".$list_id);
2278 $overlay->setAutoHide(
false);
2281 $this->tpl->setCurrentBlock(
"template_editor");
2282 $this->tpl->setVariable(
"TEMPLATE_CREATE_ID", $create_id);
2283 $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE", $lng->txt(
"tbl_template_create"));
2284 $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE_SUBMIT", $lng->txt(
"save"));
2285 $this->tpl->setVariable(
"TEMPLATE_CREATE_CMD", $this->parent_cmd);
2286 $this->tpl->parseCurrentBlock();
2289 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2291 $alist->setId($list_id);
2292 $alist->addItem($lng->txt(
"tbl_template_create"),
"create",
"#");
2293 if(
sizeof($templates))
2295 $alist->addItem($lng->txt(
"tbl_template_delete"),
"delete",
"#");
2296 foreach($templates as $name)
2298 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_tpl", urlencode($name));
2299 $alist->addItem($name, $name, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
2300 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_tpl",
"");
2303 $alist->setListTitle($lng->txt(
"tbl_templates"));
2305 $this->tpl->setVariable(
"TEMPLATE_SELECTOR",
" ".$alist->getHTML());
2310 $this->tpl->setCurrentBlock(
"tbl_footer");
2311 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
2314 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
2316 $this->tpl->parseCurrentBlock();
2319 if ($numinfo !=
"" || $linkbar !=
"" || $column_selector !=
"" ||
2320 count($this->filters) > 0 || count($this->optional_filters) > 0)
2322 if (is_object($ilUser) && (count($this->filters) || count($this->optional_filters)))
2324 $this->tpl->setCurrentBlock(
"filter_activation");
2325 $this->tpl->setVariable(
"TXT_ACTIVATE_FILTER", $lng->txt(
"show_filter"));
2326 $this->tpl->setVariable(
"FILA_ID", $this->
getId());
2327 if ($this->
getId() !=
"")
2329 $this->tpl->setVariable(
"SAVE_URLA",
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
2330 $this->
getId().
"&cmd=showFilter&user_id=".$ilUser->getId());
2332 $this->tpl->parseCurrentBlock();
2337 $this->tpl->setCurrentBlock(
"filter_deactivation");
2338 $this->tpl->setVariable(
"TXT_HIDE", $lng->txt(
"hide_filter"));
2339 if ($this->
getId() !=
"")
2341 $this->tpl->setVariable(
"SAVE_URL",
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
2342 $this->
getId().
"&cmd=hideFilter&user_id=".$ilUser->getId());
2343 $this->tpl->setVariable(
"FILD_ID", $this->
getId());
2345 $this->tpl->parseCurrentBlock();
2352 $this->tpl->setCurrentBlock(
"top_numinfo");
2353 $this->tpl->setVariable(
"NUMINFO", $numinfo);
2354 $this->tpl->parseCurrentBlock();
2359 $this->tpl->setCurrentBlock(
"top_linkbar");
2360 $this->tpl->setVariable(
"LINKBAR", $linkbar);
2361 $this->tpl->parseCurrentBlock();
2365 $this->tpl->setVariable(
"COLUMN_SELECTOR", $column_selector);
2369 is_object($ilUser) &&
2371 !$this->rows_selector_off)
2373 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2376 $alist->setId(
"sellst_rows_".$this->
getId());
2377 $hpp = ($ilUser->getPref(
"hits_per_page") != 9999)
2378 ? $ilUser->getPref(
"hits_per_page")
2379 : $lng->txt(
"unlimited");
2381 $options = array(0 => $lng->txt(
"default").
" (".$hpp.
")",5 => 5, 10 => 10, 15 => 15, 20 => 20,
2382 30 => 30, 40 => 40, 50 => 50,
2383 100 => 100, 200 => 200, 400 => 400, 800 => 800);
2386 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_trows", $k);
2387 $alist->addItem($v, $k, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
2388 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_trows",
"");
2391 $this->tpl->setVariable(
"ROW_SELECTOR", $alist->getHTML());
2395 if(
sizeof($this->export_formats) && $this->
dataExists())
2397 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2400 $alist->setId(
"sellst_xpt");
2401 foreach($this->export_formats as $format => $caption_lng_id)
2403 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_xpt", $format);
2404 $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd);
2405 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_xpt",
"");
2406 $alist->addItem($lng->txt($caption_lng_id), $format,
$url);
2408 $alist->setListTitle($lng->txt(
"export"));
2409 $this->tpl->setVariable(
"EXPORT_SELECTOR",
" ".$alist->getHTML());
2412 $this->tpl->setCurrentBlock(
"top_navigation");
2413 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
2416 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
2418 $this->tpl->parseCurrentBlock();
2435 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
2437 $hash =
"#".$this->getTopAnchor();
2440 $link = $ilCtrl->getLinkTargetByClass(get_class($this->parent_obj), $this->parent_cmd).
2441 "&".$this->getNavParameter().
"=".
2445 $layout_prev = $lng->txt(
"previous");
2446 $layout_next = $lng->txt(
"next");
2449 if ($this->max_count > $this->
getLimit() || $this->custom_prev_next)
2451 $sep =
"<span> | </span>";
2454 $pages = intval($this->max_count / $this->
getLimit());
2457 if (($this->max_count % $this->
getLimit()))
2461 $offset_arr = array();
2462 for ($i = 1 ;$i <= $pages ; $i++)
2464 $newoffset = $this->
getLimit() * ($i-1);
2467 $offset_arr[$nav_value] = $i;
2470 $sep =
"<span> </span>";
2473 if ($this->custom_prev_next && $this->custom_prev !=
"")
2477 $LinkBar .=
"<a href=\"".$this->custom_prev.$hash.
"\">".$layout_prev.
"</a>";
2479 else if ($this->
getOffset() >= 1 && !$this->custom_prev_next)
2484 $LinkBar .=
"<a href=\"".$link.$prevoffset.$hash.
"\">".$layout_prev.
"</a>";
2490 $LinkBar .=
'<span class="ilTableFootLight">'.$layout_prev.
"</span>";
2496 $LinkBar .=
'<input type="hidden" name="'.$this->getNavParameter().
2500 $sep =
"<span> | </span>";
2503 if ($this->custom_prev_next && $this->custom_next !=
"")
2507 $LinkBar .=
"<a href=\"".$this->custom_next.$hash.
"\">".$layout_next.
"</a>";
2509 else if (! ( ($this->
getOffset() / $this->
getLimit())==($pages-1) ) && ($pages!=1) &&
2510 !$this->custom_prev_next)
2515 $LinkBar .=
"<a href=\"".$link.$newoffset.$hash.
"\">".$layout_next.
"</a>";
2521 $LinkBar .=
'<span class="ilTableFootLight">'.$layout_next.
"</span>";
2524 $sep =
"<span> </span>";
2526 if (count($offset_arr) && !$this->
getDisplayAsBlock() && !$this->custom_prev_next)
2531 '<label for="tab_page_sel_'.$a_num.
'">'.$lng->txt(
"page").
'</label> '.
2533 $this->
getNavParameter().$a_num, $offset_arr,
false,
true, 0,
"small",
2534 array(
"id" =>
"tab_page_sel_".$a_num,
2535 "onchange" =>
"ilTablePageSelection(this, 'cmd[".$this->parent_cmd.
"]')"));
2550 $hidden_row =
false;
2551 if(count($this->hidden_inputs))
2553 foreach ($this->hidden_inputs as $hidden_input)
2555 $this->tpl->setCurrentBlock(
"tbl_hidden_field");
2556 $this->tpl->setVariable(
"FIELD_NAME", $hidden_input[
"name"]);
2557 $this->tpl->setVariable(
"FIELD_VALUE", $hidden_input[
"value"]);
2558 $this->tpl->parseCurrentBlock();
2561 $this->tpl->setCurrentBlock(
"tbl_hidden_row");
2562 $this->tpl->parseCurrentBlock();
2574 $action_row =
false;
2578 if (count($this->sel_buttons) > 0)
2580 foreach ($this->sel_buttons as $button)
2582 $this->tpl->setCurrentBlock(
"sel_button");
2583 $this->tpl->setVariable(
"SBUTTON_SELECT",
2585 $button[
"options"],
false,
true));
2586 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2587 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2588 $this->tpl->parseCurrentBlock();
2592 $this->tpl->setCurrentBlock(
"sel_top_button");
2593 $this->tpl->setVariable(
"SBUTTON_SELECT",
2595 $button[
"options"],
false,
true));
2596 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2597 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2598 $this->tpl->parseCurrentBlock();
2604 $this->sel_buttons[] = array(
"options" => $a_options,
"cmd" => $a_cmd,
"text" => $a_text);
2607 if (count($this->buttons) > 0)
2609 foreach ($this->buttons as $button)
2611 if(!is_array($button))
2615 $this->tpl->setVariable(
'BUTTON_OBJ', $button->render());
2618 $button = clone $button;
2620 $this->tpl->setVariable(
'BUTTON_TOP_OBJ', $button->render());
2625 if (strlen($button[
'onclick']))
2627 $this->tpl->setCurrentBlock(
'cmdonclick');
2628 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2629 $this->tpl->parseCurrentBlock();
2631 $this->tpl->setCurrentBlock(
"plain_button");
2632 if ($button[
"id"] !=
"")
2634 $this->tpl->setVariable(
"PBID",
' id="'.$button[
"id"].
'" ');
2636 if ($button[
"class"] !=
"")
2638 $this->tpl->setVariable(
"PBBT_CLASS",
' '.$button[
"class"]);
2640 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2641 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2642 $this->tpl->parseCurrentBlock();
2646 if (strlen($button[
'onclick']))
2648 $this->tpl->setCurrentBlock(
'top_cmdonclick');
2649 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2650 $this->tpl->parseCurrentBlock();
2652 $this->tpl->setCurrentBlock(
"plain_top_button");
2653 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2654 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2655 if ($button[
"class"] !=
"")
2657 $this->tpl->setVariable(
"PBBT_CLASS",
' '.$button[
"class"]);
2659 $this->tpl->parseCurrentBlock();
2668 if(count($this->mi_sel_buttons))
2670 foreach ($this->mi_sel_buttons as $button)
2672 $this->tpl->setCurrentBlock(
"mi_sel_button");
2673 $this->tpl->setVariable(
"MI_BUTTON_SELECT",
2675 $button[
"options"],
false,
true));
2676 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2677 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2678 $this->tpl->parseCurrentBlock();
2682 $this->tpl->setCurrentBlock(
"mi_top_sel_button");
2683 $this->tpl->setVariable(
"MI_BUTTON_SELECT",
2685 $button[
"options"],
false,
true));
2686 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2687 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2688 $this->tpl->parseCurrentBlock();
2697 if (count($this->multi) > 1 && $this->
dataExists())
2699 if($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit())
2701 $this->tpl->setCurrentBlock(
"tbl_cmd_select_all");
2702 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", $lng->txt(
"all_objects"));
2703 $this->tpl->parseCurrentBlock();
2706 $this->tpl->setCurrentBlock(
"tbl_cmd_select");
2708 foreach ($this->multi as $mc)
2710 $sel[$mc[
"cmd"]] = $mc[
"text"];
2712 $this->tpl->setVariable(
"SELECT_CMDS",
2714 $this->tpl->setVariable(
"TXT_EXECUTE", $lng->txt(
"execute"));
2715 $this->tpl->parseCurrentBlock();
2721 if($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit())
2723 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select_all");
2724 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", $lng->txt(
"all_objects"));
2725 $this->tpl->parseCurrentBlock();
2728 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select");
2730 foreach ($this->multi as $mc)
2732 $sel[$mc[
"cmd"]] = $mc[
"text"];
2734 $this->tpl->setVariable(
"SELECT_CMDS",
2736 $this->tpl->setVariable(
"TXT_EXECUTE", $lng->txt(
"execute"));
2737 $this->tpl->parseCurrentBlock();
2740 elseif(count($this->multi) == 1 && $this->
dataExists())
2742 $this->tpl->setCurrentBlock(
"tbl_single_cmd");
2744 foreach ($this->multi as $mc)
2749 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2750 $this->tpl->setVariable(
"SINGLE_CMD",
$cmd);
2751 $this->tpl->parseCurrentBlock();
2757 $this->tpl->setCurrentBlock(
"tbl_top_single_cmd");
2759 foreach ($this->multi as $mc)
2764 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2765 $this->tpl->setVariable(
"SINGLE_CMD",
$cmd);
2766 $this->tpl->parseCurrentBlock();
2772 $this->tpl->setCurrentBlock(
"tbl_action_img_arrow");
2774 $this->tpl->setVariable(
"ALT_ARROW", $lng->txt(
"action"));
2775 $this->tpl->parseCurrentBlock();
2779 $this->tpl->setCurrentBlock(
"tbl_top_action_img_arrow");
2781 $this->tpl->setVariable(
"ALT_ARROW", $lng->txt(
"action"));
2782 $this->tpl->parseCurrentBlock();
2788 $this->tpl->setCurrentBlock(
"tbl_action_row");
2789 $this->tpl->parseCurrentBlock();
2792 $this->tpl->setCurrentBlock(
"tbl_top_action_row");
2793 $this->tpl->parseCurrentBlock();
2805 $this->headerHTML =
$html;
2818 if(is_object($ilUser) && $this->
getId() !=
"")
2820 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
2823 $tab_prop->storeProperty($this->
getId(), $ilUser->getId(), $type, $value);
2837 if(is_object($ilUser) && $this->
getId() !=
"")
2839 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
2842 return $tab_prop->getProperty($this->
getId(), $ilUser->getId(), $type);
2874 foreach($this->filters as $item)
2879 if($this->optional_filters &&
$result[
"selfilters"])
2881 foreach($this->optional_filters as $item)
2883 if(in_array($item->getFieldId(),
$result[
"selfilters"]))
2901 if(method_exists($a_item,
"getChecked"))
2903 return $a_item->getChecked();
2905 else if(method_exists($a_item,
"getValue"))
2907 return $a_item->getValue();
2909 else if(method_exists($a_item,
"getDate"))
2923 if(method_exists($a_item,
"setChecked"))
2925 $a_item->setChecked($a_value);
2927 else if(method_exists($a_item,
"setValue"))
2929 $a_item->setValue($a_value);
2931 else if(method_exists($a_item,
"setDate"))
2947 $this->context = $id;
2968 $this->show_rows_selector = (bool)$a_value;
2988 $this->show_templates = (bool)$a_value;
3013 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3015 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3018 $data = $storage->load($this->
getContext(), $ilUser->getId(), $a_name);
3021 foreach(
$data as $property => $value)
3027 $data[
"filter_values"] = unserialize(
$data[
"filter_values"]);
3028 if(
$data[
"filter_values"])
3030 $this->restore_filter_values =
$data[
"filter_values"];
3033 $this->restore_filter =
true;
3052 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3054 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3058 $state[
"filter_values"] = serialize($state[
"filter_values"]);
3059 $state[
"selfields"] = serialize($state[
"selfields"]);
3060 $state[
"selfilters"] = serialize($state[
"selfilters"]);
3062 $storage->store($this->
getContext(), $ilUser->getId(), $a_name, $state);
3080 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3082 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3084 $storage->delete($this->
getContext(), $ilUser->getId(), $a_name);
3099 return parent::getLimit();
3111 return parent::getOffset();
3121 $this->export_formats = array();
3124 $valid = array(self::EXPORT_EXCEL =>
"tbl_export_excel",
3125 self::EXPORT_CSV =>
"tbl_export_csv");
3127 foreach($formats as $format)
3129 if(array_key_exists($format,
$valid))
3131 $this->export_formats[$format] =
$valid[$format];
3142 $this->print_mode = (bool)$a_value;
3186 case self::EXPORT_EXCEL:
3187 include_once
"./Services/Excel/classes/class.ilExcelUtils.php";
3188 include_once
"./Services/Excel/classes/class.ilExcelWriterAdapter.php";
3190 $workbook = $adapter->getWorkbook();
3191 $worksheet = $workbook->addWorksheet();
3205 foreach($this->row_data as $set)
3215 case self::EXPORT_CSV:
3216 include_once
"./Services/Utilities/classes/class.ilCSVWriter.php";
3218 $csv->setSeparator(
";");
3223 foreach($this->row_data as $set)
3232 header(
"Content-type: text/comma-separated-values");
3233 header(
"Content-Disposition: attachment; filename=\"".
$filename.
"\"");
3234 header(
"Expires: 0");
3235 header(
"Cache-Control: must-revalidate, post-check=0,pre-check=0");
3236 header(
"Pragma: public");
3237 echo $csv->getCSVString();
3242 file_put_contents(
$filename, $csv->getCSVString());
3276 foreach ($this->column as $column)
3278 $title = strip_tags($column[
"text"]);
3281 $worksheet->write($a_row, $col,
$title);
3298 foreach ($a_set as $key => $value)
3300 if(is_array($value))
3302 $value = implode(
', ', $value);
3304 $a_worksheet->write($a_row, $col, strip_tags($value));
3328 foreach ($this->column as $column)
3330 $title = strip_tags($column[
"text"]);
3333 $a_csv->addColumn(
$title);
3348 foreach ($a_set as $key => $value)
3350 if(is_array($value))
3352 $value = implode(
', ', $value);
3354 $a_csv->addColumn(strip_tags($value));
3366 $this->enable_command_for_all = (bool)$a_value;
3376 global $ilClientIniFile;
3378 $limit = $ilClientIniFile->readVariable(
"system",
"TABLE_ACTION_ALL_LIMIT");
3381 $limit = self::ACTION_ALL_LIMIT;
3411 $this->prevent_double_submission = $a_val;
3426 parent::setLimit($a_limit, $a_default_limit);
3429 if($a_limit == 9999 &&
3430 $this->limit_determined)
3432 $this->rows_selector_off =
true;
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setRowSelectorLabel($row_selector_label)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setDescription($a_val)
Set description.
getExternalSorting()
Get external sorting.
setFormName($a_formname)
Set Form name.
prepareOutput()
Anything that must be done before HTML is generated.
setExternalSorting($a_val)
Set external sorting.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
Constructor.
getDefaultOrderField()
Get Default order field.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExportFormats(array $formats)
Set available export formats.
addHiddenInput($a_name, $a_value)
Add Hidden Input field.
getTopAnchor()
Get top anchor.
getTopCommands()
Get top commands (display command buttons on top of table, too)
addCommandButtonInstance(ilButtonBase $a_button)
Add Command button instance.
Helper class to generate CSV files.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
getColumnCount()
Returns the column count based on the number of the header row columns public.
setDisplayAsBlock($a_val)
Set display as block.
getSelectAllCheckbox()
Get the name of the checkbox that should be toggled with a select all button.
getFilterCommand()
Get filter command.
getSelectableColumns()
Get selectable columns.
setOffset($a_offset)
set dataset offset public
setPrintMode($a_value=false)
Toogle print mode.
renderFilter()
Render Filter section.
$prevent_double_submission
setShowTemplates($a_value)
Toggle templates.
storeProperty($type, $value)
Store table property.
getIsDataTable()
Get is data table.
setEnableNumInfo($a_val)
Set enable num info.
getFilterValue(ilFormPropertyGUI $a_item)
Get current filter value.
setFilterCols($a_val)
Set filter columns.
static initConnection()
Init YUI Connection module.
fillHeaderExcel($worksheet, &$a_row)
Excel Version of Fill Header.
setExternalSegmentation($a_val)
Set external segmentation.
determineSelectedColumns()
Determine selected columns.
exportData($format, $send=false)
Export and optionally send current table data.
resetOffset($a_in_determination=false)
Reset offset.
getFilterItemByPostVar($a_post_var)
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static setUseRelativeDates($a_status)
set use relative dates
setIsDataTable($a_val)
Set is data table.
getFormName()
Get Form name.
Saves (mostly asynchronously) user properties of tables (e.g.
setFooter($a_style, $a_previous=0, $a_next=0)
set order direction public
determineLimit()
Determine the limit.
getOpenFormTag()
Get open form tag.
deleteTemplate($a_name)
Delete template.
getParentCmd()
Get parent command.
getOrderDirection()
Get order direction.
getLinkbar($a_num)
Get previous/next linkbar.
setNoEntriesText($a_text)
Set text for an empty table.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
fillFooter()
Fill footer row.
getParentObject()
Get parent object.
const FILTER_NUMBER_RANGE
getDescription()
Get description.
saveTemplate($a_name)
Save current state as template.
getDisplayAsBlock()
Get display as block.
addHeaderCommand($a_href, $a_text, $a_target="", $a_img="")
Add Header Command (Link) (Image needed for now)
Saves (mostly asynchronously) user properties of tables (e.g.
Class ilExcelWriterAdapter.
fillActionRow()
Fill Action Row.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
getShowRowsSelector()
Get rows-per-page selector state.
getDefaultOrderDirection()
Get Default order direction.
fillRowExcel($a_worksheet, &$a_row, $a_set)
Excel Version of Fill Row.
setOrderLink($sort_field, $order_dir)
getFilterElements($a_only_non_empty=true)
Get SQL conditions for current filter value(s)
getShowTemplates()
Get template state.
setOrderDirection($a_order_direction)
set order direction public
setOrderField($a_order_field)
set order column
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
const FILTER_DATETIME_RANGE
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
if(!is_array($argv)) $options
fillMetaCSV($a_csv)
Add meta information to csv export.
getDisableFilterHiding()
Get disable filter hiding.
restoreTemplate($a_name)
Restore state from template.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
const FILTER_DURATION_RANGE
special template class to simplify handling of ITX/PEAR
numericOrdering($a_field)
Should this field be sorted numeric?
getExternalSegmentation()
Get external segmentation.
addMultiCommand($a_cmd, $a_text)
Add Command button.
static getAllCommandLimit()
Get maximum number of entries to enable actions for all.
This is a utility class for the yui overlays.
setCustomPreviousNext($a_prev_link, $a_next_link)
Set custom previous/next links.
This class represents a text property in a property form.
setHeaderHTML($html)
set header html
User interface class for a checkbox list overlay.
getSelectedColumns()
Get selected columns.
getFormAction()
Get Form action parameter.
isAdvMDFilter(ilAdvancedMDRecordGUI $a_gui, $a_element)
Check if filter element is based on adv md.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
getPreventDoubleSubmission()
Get prevent double submission.
getEnableHeader()
Get Enable Header.
SetFilterValue(ilFormPropertyGUI $a_item, $a_value)
Set current filter value.
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
addSelectionButton($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
Add Selection List + Command button.
getEnableTitle()
Get Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
getNoEntriesText()
Get text for an empty table.
writeFilterToSession()
Write filter values to session.
& executeCommand()
Execute command.
isColumnSelected($a_col)
Is given column selected?
isFilterSelected($a_col)
Is given filter selected?
render()
render table public
addMultiItemSelectionButton($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
Add Selection List + Command button for selected items.
getResetCommand()
Get reset filter command.
setContext($id)
Set context.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
User interface class for advanced drop-down selection lists.
determineSelectedFilters()
Determine selected filters.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
getEnableNumInfo()
Get enable num info.
getSelectedFilters()
Get selected filters.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
getFilterCols()
Get filter columns.
fillMetaExcel($worksheet, &$a_row)
Add meta information to excel export.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
getPrintMode()
Get print mode.
getCurrentState()
get current settings for order, limit, columns and filter
setOpenFormTag($a_val)
Set open form tag.
setEnableHeader($a_enableheader)
Set Enable Header.
loadProperty($type)
Load table property.
fillRow($a_set)
Standard Version of Fill Row.
setCloseCommand($a_link)
Add command for closing table.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
fillHeaderCSV($a_csv)
CSV Version of Fill Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setMaxCount($a_max_count)
set max.
getCloseFormTag()
Get close form tag.
getExportMode()
Was export activated?
getFilterItems($a_optionals=false)
Get filter items.
setEnableTitle($a_enabletitle)
Set Enable Title.
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.
resetFilter()
Reset filter.
setPreventDoubleSubmission($a_val)
Set prevent double submission.
setTopAnchor($a_val)
Set top anchor.
setCloseFormTag($a_val)
Set close form tag.
setLimit($a_limit=0, $a_default_limit=0)
fillRowCSV($a_csv, $a_set)
CSV Version of Fill Row.
setFilterCommand($a_val, $a_caption=null)
Set filter command.