4 require_once(
"Services/Table/classes/class.ilTableGUI.php");
89 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_template_context =
"")
93 parent::__construct(0,
false);
94 $this->unique_id = md5(uniqid());
95 $this->parent_obj = $a_parent_obj;
96 $this->parent_cmd = $a_parent_cmd;
97 $this->buttons =
array();
98 $this->header_commands =
array();
99 $this->multi =
array();
100 $this->hidden_inputs =
array();
102 $this->tpl =
new ilTemplate(
"tpl.table2.html",
true,
true,
"Services/Table");
104 $lng->loadLanguageModule(
'tbl');
106 if(!$a_template_context)
108 $a_template_context = $this->
getId();
113 if(isset(
$_GET[$this->prefix.
"_xpt"]))
115 $this->export_mode = (int)
$_GET[$this->prefix.
"_xpt"];
119 if(isset(
$_GET[$this->prefix.
"_tpl"]))
137 $this->open_form_tag = $a_val;
157 $this->close_form_tag = $a_val;
177 if ($this->limit_determined)
183 if (isset(
$_GET[$this->prefix.
"_trows"]))
199 if (is_object($ilUser))
201 $limit = $ilUser->getPref(
"hits_per_page");
211 $this->limit_determined =
true;
229 if ($this->columns_determined)
240 @unserialize($old_sel);
243 if(!is_array($sel_fields))
246 $sel_fields =
array();
249 $this->selected_columns =
array();
253 $this->selected_column[$k] =
false;
255 $new_column = ($sel_fields[$k] === NULL);
262 $this->selected_column[$k] =
true;
265 else if ($stored && !$new_column)
267 $this->selected_column[$k] = $sel_fields[$k];
277 $this->selected_column[$k] =
true;
282 if ($old_sel != serialize($this->selected_column) && $set)
284 $this->
storeProperty(
"selfields", serialize($this->selected_column));
287 $this->columns_determined =
true;
298 return $this->selected_column[$a_col];
310 foreach ($this->selected_column as $k => $v)
327 $next_class = $ilCtrl->getNextClass($this);
328 $cmd = $ilCtrl->getCmd();
332 case 'ilformpropertydispatchgui':
333 include_once
'./Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
337 $form_prop_dispatch->setItem($item);
338 return $ilCtrl->forwardCommand($form_prop_dispatch);
350 if (!$this->nav_determined && !$a_in_determination)
377 return $this->parent_obj;
387 return $this->parent_cmd;
397 $this->top_anchor = $a_val;
417 $this->noentriestext = $a_text;
427 return $this->noentriestext;
437 $this->datatable = $a_val;
447 return $this->datatable;
457 $this->enabled[
"title"] = $a_enabletitle;
467 return $this->enabled[
"title"];
477 $this->enabled[
"header"] = $a_enableheader;
487 return $this->enabled[
"header"];
497 $this->num_info = $a_val;
507 return $this->num_info;
513 final public function setTitle($a_title, $a_icon = 0, $a_icon_alt = 0)
515 parent::setTitle($a_title, $a_icon, $a_icon_alt);
525 $this->description = $a_val;
535 return $this->description;
545 $this->order_field = $a_order_field;
550 return $this->order_field;
557 $this->enabled[
"header"] && $this->enabled[
"sort"] &&
558 $this->columns_determined && is_array($this->
column) &&
562 $check = array_keys(array_shift($check));
563 foreach($this->
column as $col)
565 if($col[
"sort_field"] && !in_array($col[
"sort_field"], $check))
567 $invalid[] = $col[
"sort_field"];
582 $this->row_data = $a_data;
587 return $this->row_data;
592 if (is_array($this->row_data))
594 if (count($this->row_data) > 0)
604 $this->prefix = $a_prefix;
618 $a_input_item->setParent($this);
621 $this->filters[] = $a_input_item;
625 $this->optional_filters[] = $a_input_item;
629 if($this->restore_filter)
633 $this->setFilterValue($a_input_item, $this->restore_filter_values[$a_input_item->getFieldId()]);
637 $this->setFilterValue($a_input_item, null);
657 $caption = $lng->txt($id);
660 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
664 case self::FILTER_SELECT:
665 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
669 case self::FILTER_DATE:
670 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
674 case self::FILTER_TEXT:
675 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
677 $item->setMaxLength(64);
682 case self::FILTER_LANGUAGE:
683 $lng->loadLanguageModule(
"meta");
684 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
687 foreach ($lng->getInstalledLanguages() as $lang_key)
689 $options[$lang_key] = $lng->txt(
"meta_l_".$lang_key);
694 case self::FILTER_NUMBER_RANGE:
695 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
696 include_once(
"./Services/Form/classes/class.ilNumberInputGUI.php");
699 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
701 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
703 $item->setMaxLength(7);
707 case self::FILTER_DATE_RANGE:
708 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
709 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
712 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
714 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
718 case self::FILTER_DATETIME_RANGE:
719 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
720 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
723 $combi_item->setShowTime(
true);
724 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
726 $combi_item->setShowTime(
true);
727 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
731 case self::FILTER_DURATION_RANGE:
732 $lng->loadLanguageModule(
"form");
733 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
734 include_once(
"./Services/Form/classes/class.ilDurationInputGUI.php");
737 $combi_item->setShowMonths(
false);
738 $combi_item->setShowDays(
true);
739 $combi_item->setShowSeconds(
true);
740 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
742 $combi_item->setShowMonths(
false);
743 $combi_item->setShowDays(
true);
744 $combi_item->setShowSeconds(
true);
745 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
754 $item->readFromSession();
774 if ($item->getPostVar() == $a_post_var)
781 if ($item->getPostVar() == $a_post_var)
796 $this->filter_cols = $a_val;
816 $this->disable_filter_hiding = $a_val;
837 return $this->selected_filter[$a_col];
849 foreach ($this->selected_filter as $k => $v)
867 if ($this->filters_determined)
877 @unserialize($old_sel);
880 if(!is_array($sel_filters))
883 $sel_filters =
array();
886 $this->selected_filter =
array();
890 $k = $item->getPostVar();
892 $this->selected_filter[$k] =
false;
899 $this->selected_filter[$k] =
true;
903 $item->setValue(NULL);
904 $item->writeToSession();
909 $this->selected_filter[$k] = $sel_filters[$k];
913 if ($old_sel != serialize($this->selected_filter) && $set)
915 $this->
storeProperty(
"selfilters", serialize($this->selected_filter));
918 $this->filters_determined =
true;
926 $this->custom_prev_next =
true;
927 $this->custom_prev = $a_prev_link;
928 $this->custom_next = $a_next_link;
939 $this->form_action = $a_form_action;
940 $this->form_multipart = (bool)$a_multipart;
950 return $this->form_action;
960 $this->formname = $a_formname;
970 return $this->formname;
1004 $this->display_as_block = $a_val;
1014 return $this->display_as_block;
1034 $this->select_all_checkbox = $a_select_all_checkbox;
1044 $this->ext_sort = $a_val;
1065 $this->filter_cmd = $a_val;
1066 $this->filter_cmd_txt = $a_caption;
1087 $this->reset_cmd = $a_val;
1088 $this->reset_cmd_txt = $a_caption;
1108 $this->ext_seg = $a_val;
1129 $this->row_template = $a_template;
1130 $this->row_template_dir = $a_template_dir;
1140 $this->defaultorderfield = $a_defaultorderfield;
1150 return $this->defaultorderfield;
1160 $this->defaultorderdirection = $a_defaultorderdirection;
1170 return $this->defaultorderdirection;
1179 $this->default_filter_visibility = $a_status;
1198 $this->buttons =
array();
1209 $this->buttons[] =
array(
"cmd" => $a_cmd,
"text" => $a_text,
'onclick' => $a_onclick,
1210 "id" => $a_id,
"class" => $a_class);
1220 $this->buttons[] = $a_button;
1235 echo "ilTabl2GUI->addSelectionButton() has been deprecated with 4.2. Please try to move the drop-down to ilToolbarGUI.";
1250 $this->mi_sel_buttons[] =
array(
"sel_var" => $a_sel_var,
"options" => $a_options,
"selected" => $a_default_selection,
"cmd" => $a_cmd,
"text" => $a_text);
1264 $this->close_command = $a_link;
1275 $this->multi[] =
array(
"cmd" => $a_cmd,
"text" => $a_text);
1286 $this->hidden_inputs[] =
array(
"name" => $a_name,
"value" => $a_value);
1297 $this->header_commands[] =
array(
"href" => $a_href,
"text" => $a_text,
1298 "target" => $a_target,
"img" => $a_img);
1308 $this->top_commands = $a_val;
1328 final public function addColumn($a_text, $a_sort_field =
"", $a_width =
"",
1329 $a_is_checkbox_action_column =
false, $a_class =
"", $a_tooltip =
"", $a_tooltip_with_html =
false)
1333 "sort_field" => $a_sort_field,
1334 "width" => $a_width,
1335 "is_checkbox_action_column" => $a_is_checkbox_action_column,
1336 "class" => $a_class,
1337 "tooltip" => $a_tooltip,
1338 "tooltip_html" => (
bool)$a_tooltip_with_html
1340 if ($a_sort_field !=
"")
1342 $this->sortable_fields[] = $a_sort_field;
1344 $this->column_count = count($this->
column);
1350 return $this->prefix.
"_table_nav";
1358 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
1360 $hash =
"#".$this->getTopAnchor();
1366 $ilCtrl->setParameter($this->parent_obj,
1368 $sort_field.
":".$order_dir.
":".$this->offset);
1369 $this->tpl->setVariable(
"TBL_ORDER_LINK",
1370 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd).$hash);
1373 $ilCtrl->setParameter($this->parent_obj,
1381 $allcolumnswithwidth =
true;
1384 if (!strlen(
$column[
"width"]))
1386 $allcolumnswithwidth =
false;
1388 else if(
$column[
"width"] ==
"1")
1391 $this->
column[$idx][
"width"] =
"1%";
1394 if ($allcolumnswithwidth)
1398 $this->tpl->setCurrentBlock(
"tbl_colgroup_column");
1399 $this->tpl->setVariable(
"COLGROUP_COLUMN_WIDTH", $column[
"width"]);
1400 $this->tpl->parseCurrentBlock();
1408 if ($column[
"tooltip"] !=
"")
1410 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1412 "",
"bottom center",
"top center", !$column[
"tooltip_html"]);
1414 if (!$this->enabled[
"sort"] || $column[
"sort_field"] ==
"" || $column[
"is_checkbox_action_column"])
1416 $this->tpl->setCurrentBlock(
"tbl_header_no_link");
1417 if ($column[
"width"] !=
"")
1419 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH_NO_LINK",
" width=\"".$column[
"width"].
"\"");
1421 if ($column[
"class"] !=
"")
1423 $this->tpl->setVariable(
"TBL_COLUMN_CLASS_NO_LINK",
" class=\"".$column[
"class"].
"\"");
1425 if (!$column[
"is_checkbox_action_column"])
1427 $this->tpl->setVariable(
"TBL_HEADER_CELL_NO_LINK",
1432 $this->tpl->setVariable(
"TBL_HEADER_CELL_NO_LINK",
1435 $this->tpl->setVariable(
"HEAD_CELL_NL_ID",
"thc_".$this->
getId().
"_".$ccnt);
1436 if ($column[
"class"] !=
"")
1438 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1440 $this->tpl->parseCurrentBlock();
1441 $this->tpl->touchBlock(
"tbl_header_th");
1444 if (($column[
"sort_field"] == $this->order_field) && ($this->order_direction !=
""))
1446 $this->tpl->setCurrentBlock(
"tbl_order_image");
1447 if ($this->order_direction ==
"asc")
1449 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-up");
1453 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-down");
1455 $this->tpl->setVariable(
"IMG_ORDER_ALT", $this->lng->txt(
"change_sort_direction"));
1456 $this->tpl->parseCurrentBlock();
1459 $this->tpl->setCurrentBlock(
"tbl_header_cell");
1460 $this->tpl->setVariable(
"TBL_HEADER_CELL", $column[
"text"]);
1461 $this->tpl->setVariable(
"HEAD_CELL_ID",
"thc_".$this->
getId().
"_".$ccnt);
1464 if ($column[
"width"] !=
"")
1466 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH",
" width=\"".$column[
"width"].
"\"");
1468 if ($column[
"class"] !=
"")
1470 $this->tpl->setVariable(
"TBL_COLUMN_CLASS",
" class=\"".$column[
"class"].
"\"");
1473 $lng_sort_column = $this->lng->txt(
"sort_by_this_column");
1474 $this->tpl->setVariable(
"TBL_ORDER_ALT",$lng_sort_column);
1478 if ($column[
"sort_field"] == $this->order_field)
1480 $order_dir = $this->sort_order;
1482 $lng_change_sort = $this->lng->txt(
"change_sort_direction");
1483 $this->tpl->setVariable(
"TBL_ORDER_ALT",$lng_change_sort);
1486 if ($column[
"class"] !=
"")
1488 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1490 $this->
setOrderLink($column[
"sort_field"], $order_dir);
1491 $this->tpl->parseCurrentBlock();
1492 $this->tpl->touchBlock(
"tbl_header_th");
1495 $this->tpl->setCurrentBlock(
"tbl_header");
1496 $this->tpl->parseCurrentBlock();
1514 if ($this->nav_determined)
1539 if ($this->nav_value ==
"" && $this->
getId() !=
"" && $ilUser->getId() != ANONYMOUS_USER_ID)
1542 if (in_array($order, $this->sortable_fields))
1556 $nav = explode(
":", $this->nav_value);
1562 if (!$a_omit_offset)
1579 if (!$a_omit_offset)
1581 $this->nav_determined =
true;
1617 if (is_object($ilCtrl) && $this->
getId() ==
"")
1628 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
1630 $hash =
"#".$this->getTopAnchor();
1633 if((
bool)$this->form_multipart)
1635 $this->tpl->touchBlock(
"form_multipart_bl");
1640 $this->tpl->touchBlock(
"pdfs");
1643 $this->tpl->setCurrentBlock(
"tbl_form_header");
1644 $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction().$hash);
1645 $this->tpl->setVariable(
"FORMNAME", $this->
getFormName());
1646 $this->tpl->parseCurrentBlock();
1651 $this->tpl->touchBlock(
"tbl_form_footer");
1655 if(!$this->enabled[
'content'])
1667 $this->
setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1694 $this->tpl->addBlockFile(
"TBL_CONTENT",
"tbl_content", $this->row_template,
1695 $this->row_template_dir);
1697 foreach($data as $set)
1699 $this->tpl->setCurrentBlock(
"tbl_content");
1700 $this->css_row = ($this->css_row !=
"tblrow1")
1703 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
1706 $this->tpl->setCurrentBlock(
"tbl_content");
1707 $this->tpl->parseCurrentBlock();
1715 : $lng->txt(
"no_items");
1717 $this->css_row = ($this->css_row !=
"tblrow1")
1721 $this->tpl->setCurrentBlock(
"tbl_no_entries");
1722 $this->tpl->setVariable(
'TBL_NO_ENTRY_CSS_ROW', $this->css_row);
1723 $this->tpl->setVariable(
'TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
1724 $this->tpl->setVariable(
'TBL_NO_ENTRY_TEXT', trim($no_items_text));
1725 $this->tpl->parseCurrentBlock();
1761 $this->tpl->setVariable(
"CSS_TABLE",$this->
getStyle(
"table"));
1762 $this->tpl->setVariable(
"DATA_TABLE", (
int) $this->
getIsDataTable());
1763 if ($this->
getId() !=
"")
1765 $this->tpl->setVariable(
"ID",
'id="'.$this->
getId().
'"');
1771 $this->tpl->setCurrentBlock(
"tbl_header_description");
1772 $this->tpl->setVariable(
"TBL_DESCRIPTION", $this->
getDescription());
1773 $this->tpl->parseCurrentBlock();
1783 $this->tpl->touchBlock(
"outer_start_1");
1784 $this->tpl->touchBlock(
"outer_end_1");
1788 $this->tpl->touchBlock(
"outer_start_2");
1789 $this->tpl->touchBlock(
"outer_end_2");
1793 if ($this->enabled[
"title"] && ($this->title !=
"" 1794 || $this->icon !=
"" || count($this->header_commands) > 0 ||
1795 $this->headerHTML !=
"" || $this->close_command !=
""))
1797 if ($this->enabled[
"icon"])
1799 $this->tpl->setCurrentBlock(
"tbl_header_title_icon");
1801 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->icon_alt);
1802 $this->tpl->parseCurrentBlock();
1807 foreach($this->header_commands as $command)
1809 if ($command[
"img"] !=
"")
1811 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1812 if ($command[
"target"] !=
"")
1814 $this->tpl->setVariable(
"TARGET_IMG_LINK",
1815 'target="'.$command[
"target"].
'"');
1817 $this->tpl->setVariable(
"ALT_IMG_LINK", $command[
"text"]);
1818 $this->tpl->setVariable(
"HREF_IMG_LINK", $command[
"href"]);
1819 $this->tpl->setVariable(
"SRC_IMG_LINK",
1821 $this->tpl->parseCurrentBlock();
1825 $this->tpl->setCurrentBlock(
"head_cmd");
1826 $this->tpl->setVariable(
"TXT_HEAD_CMD", $command[
"text"]);
1827 $this->tpl->setVariable(
"HREF_HEAD_CMD", $command[
"href"]);
1828 $this->tpl->parseCurrentBlock();
1833 if (isset ($this->headerHTML)) {
1834 $this->tpl->setCurrentBlock(
"tbl_header_html");
1835 $this->tpl->setVariable (
"HEADER_HTML", $this->headerHTML);
1836 $this->tpl->parseCurrentBlock();
1840 if ($this->close_command !=
"")
1842 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1843 $this->tpl->setVariable(
"ALT_IMG_LINK",$lng->txt(
"close"));
1844 $this->tpl->setVariable(
"HREF_IMG_LINK",$this->close_command);
1845 $this->tpl->parseCurrentBlock();
1848 $this->tpl->setCurrentBlock(
"tbl_header_title");
1849 $this->tpl->setVariable(
"TBL_TITLE",$this->title);
1850 $this->tpl->setVariable(
"TOP_ANCHOR",$this->
getTopAnchor());
1853 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
1855 $this->tpl->parseCurrentBlock();
1859 if ($this->enabled[
"header"])
1864 $this->tpl->touchBlock(
"tbl_table_end");
1866 return $this->tpl->get();
1879 $tpl->addJavascript(
"./Services/Table/js/ServiceTable.js");
1881 if (count($filter) == 0 && count($opt_filter) == 0)
1886 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1892 if (count($filter) > 0)
1894 foreach ($filter as $item)
1898 $this->tpl->setCurrentBlock(
"filter_row");
1899 $this->tpl->parseCurrentBlock();
1902 $this->tpl->setCurrentBlock(
"filter_item");
1903 $this->tpl->setVariable(
"OPTION_NAME",
1905 $this->tpl->setVariable(
"F_INPUT_ID",
1906 $item->getFieldId());
1907 $this->tpl->setVariable(
"INPUT_HTML",
1908 $item->getTableFilterHTML());
1909 $this->tpl->parseCurrentBlock();
1915 if (count($opt_filter) > 0)
1919 foreach ($opt_filter as $item)
1925 $this->tpl->setCurrentBlock(
"filter_row");
1926 $this->tpl->parseCurrentBlock();
1929 $this->tpl->setCurrentBlock(
"filter_item");
1930 $this->tpl->setVariable(
"OPTION_NAME",
1932 $this->tpl->setVariable(
"F_INPUT_ID",
1933 $item->getFieldId());
1934 $this->tpl->setVariable(
"INPUT_HTML",
1935 $item->getTableFilterHTML());
1936 $this->tpl->parseCurrentBlock();
1943 foreach ($opt_filter as $item)
1945 $k = $item->getPostVar();
1946 $items[$k] =
array(
"txt" => $item->getTitle(),
1950 include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
1952 $cb_over->setLinkTitle($lng->txt(
"optional_filters"));
1953 $cb_over->setItems($items);
1956 $cb_over->setFieldVar(
"tblff".$this->
getId());
1957 $cb_over->setHiddenVar(
"tblfsf".$this->
getId());
1959 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
1960 $this->tpl->setCurrentBlock(
"filter_select");
1963 $this->tpl->setVariable(
"HIDDEN_CMD_APPLY", $this->filter_cmd);
1965 $this->tpl->setVariable(
"FILTER_SELECTOR", $cb_over->getHTML());
1966 $this->tpl->parseCurrentBlock();
1970 if($ccnt > 0 || count($opt_filter) > 0)
1972 $this->tpl->setVariable(
"TXT_FILTER", $lng->txt(
"filter"));
1980 $this->tpl->touchBlock(
"filter_empty_cell");
1983 $this->tpl->setCurrentBlock(
"filter_row");
1984 $this->tpl->parseCurrentBlock();
1986 $this->tpl->setCurrentBlock(
"filter_buttons");
1987 $this->tpl->setVariable(
"CMD_APPLY", $this->filter_cmd);
1988 $this->tpl->setVariable(
"TXT_APPLY", $this->filter_cmd_txt
1989 ? $this->filter_cmd_txt
1990 : $lng->txt(
"apply_filter"));
1991 $this->tpl->setVariable(
"CMD_RESET", $this->reset_cmd);
1992 $this->tpl->setVariable(
"TXT_RESET", $this->reset_cmd_txt
1993 ? $this->reset_cmd_txt
1994 : $lng->txt(
"reset_filter"));
1996 else if(count($opt_filter) > 0)
1998 $this->tpl->setCurrentBlock(
"optional_filter_hint");
1999 $this->tpl->setVariable(
'TXT_OPT_HINT', $lng->txt(
'optional_filter_hint'));
2000 $this->tpl->parseCurrentBlock();
2003 $this->tpl->setCurrentBlock(
"filter_section");
2004 $this->tpl->setVariable(
"FIL_ID", $this->
getId());
2005 $this->tpl->parseCurrentBlock();
2012 $this->tpl->setCurrentBlock(
"filter_hidden");
2013 $this->tpl->setVariable(
"FI_ID", $this->
getId());
2014 $this->tpl->parseCurrentBlock();
2027 if($prop ===
'0' || $prop ===
'1')
2029 return (
bool) $prop;
2045 if($item === $a_element)
2058 $advmd_record_gui = null;
2059 if(method_exists($this,
"getAdvMDRecordGUI"))
2061 $advmd_record_gui = $this->getAdvMDRecordGUI();
2066 if($advmd_record_gui &&
2072 if ($item->checkInput())
2074 $item->setValueByArray(
$_POST);
2075 $item->writeToSession();
2080 if($advmd_record_gui &&
2086 if ($item->checkInput())
2088 $item->setValueByArray(
$_POST);
2089 $item->writeToSession();
2093 if($advmd_record_gui)
2095 $advmd_record_gui->importFilter();
2099 unset($_REQUEST[
"tbltplcrt"]);
2100 unset($_REQUEST[
"tbltpldel"]);
2113 foreach ($filter as $item)
2115 if ($item->checkInput())
2117 $item->setValueByArray(
$_POST);
2118 $item->clearFromSession();
2121 foreach ($opt_filter as $item)
2123 if ($item->checkInput())
2125 $item->setValueByArray(
$_POST);
2126 $item->clearFromSession();
2131 unset($_REQUEST[
"tbltplcrt"]);
2132 unset($_REQUEST[
"tbltpldel"]);
2143 foreach ($a_set as $key => $value)
2145 $this->tpl->setVariable(
"VAL_".strtoupper($key), $value);
2161 $this->tpl->setCurrentBlock(
"select_all_checkbox");
2162 $this->tpl->setVariable(
"SELECT_ALL_TXT_SELECT_ALL", $lng->txt(
"select_all"));
2164 $this->tpl->setVariable(
"SELECT_ALL_FORM_NAME", $this->
getFormName());
2165 $this->tpl->setVariable(
"CHECKBOXNAME",
"chb_select_all_" . $this->unique_id);
2166 $this->tpl->parseCurrentBlock();
2170 if ($this->enabled[
"numinfo"] && $this->enabled[
"footer"])
2172 $start = $this->offset + 1;
2179 if ($end > $this->max_count
or $this->limit == 0)
2184 if ($this->max_count > 0)
2186 if ($this->lang_support)
2188 $numinfo =
"(".$start.
" - ".$end.
" ".strtolower($this->lng->txt(
"of")).
" ".$this->max_count.
")";
2192 $numinfo =
"(".$start.
" - ".$end.
" of ".$this->max_count.
")";
2195 if ($this->max_count > 0)
2199 $this->tpl->setCurrentBlock(
"tbl_footer_numinfo");
2200 $this->tpl->setVariable(
"NUMINFO", $numinfo);
2201 $this->tpl->parseCurrentBlock();
2208 if ($this->enabled[
"linkbar"] && $this->enabled[
"footer"] && $this->limit != 0
2209 && $this->max_count > 0)
2212 "link" => $this->footer_style,
2213 "prev" => $this->footer_previous,
2214 "next" => $this->footer_next,
2219 $this->tpl->setCurrentBlock(
"tbl_footer_linkbar");
2220 $this->tpl->setVariable(
"LINKBAR", $linkbar);
2221 $this->tpl->parseCurrentBlock();
2233 $items[$k] =
array(
"txt" => $c[
"txt"],
2236 include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
2238 $cb_over->setLinkTitle($lng->txt(
"columns"));
2239 $cb_over->setItems($items);
2243 $cb_over->setFieldVar(
"tblfs".$this->
getId());
2244 $cb_over->setHiddenVar(
"tblfsh".$this->
getId());
2245 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
2246 $column_selector = $cb_over->getHTML();
2253 if(isset($_REQUEST[
"tbltplcrt"]) && $_REQUEST[
"tbltplcrt"])
2260 else if(isset($_REQUEST[
"tbltpldel"]) && $_REQUEST[
"tbltpldel"])
2268 $create_id =
"template_create_overlay_".$this->getId();
2269 $delete_id =
"template_delete_overlay_".$this->getId();
2270 $list_id =
"template_stg_".$this->getId();
2272 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
2274 $templates = $storage->getNames($this->
getContext(), $ilUser->getId());
2276 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
2279 if(
sizeof($templates))
2282 $overlay->setTrigger($list_id.
"_delete");
2283 $overlay->setAnchor(
"ilAdvSelListAnchorElement_".$list_id);
2284 $overlay->setAutoHide(
false);
2287 $lng->loadLanguageModule(
"form");
2288 $this->tpl->setCurrentBlock(
"template_editor_delete_item");
2289 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE",
"");
2290 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION",
"- ".$lng->txt(
"form_please_select").
" -");
2291 $this->tpl->parseCurrentBlock();
2292 foreach($templates as $name)
2294 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE", $name);
2295 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION", $name);
2296 $this->tpl->parseCurrentBlock();
2299 $this->tpl->setCurrentBlock(
"template_editor_delete");
2300 $this->tpl->setVariable(
"TEMPLATE_DELETE_ID", $delete_id);
2301 $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE", $lng->txt(
"tbl_template_delete"));
2302 $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE_SUBMIT", $lng->txt(
"delete"));
2303 $this->tpl->setVariable(
"TEMPLATE_DELETE_CMD", $this->parent_cmd);
2304 $this->tpl->parseCurrentBlock();
2310 $overlay->setTrigger($list_id.
"_create");
2311 $overlay->setAnchor(
"ilAdvSelListAnchorElement_".$list_id);
2312 $overlay->setAutoHide(
false);
2315 $this->tpl->setCurrentBlock(
"template_editor");
2316 $this->tpl->setVariable(
"TEMPLATE_CREATE_ID", $create_id);
2317 $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE", $lng->txt(
"tbl_template_create"));
2318 $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE_SUBMIT", $lng->txt(
"save"));
2319 $this->tpl->setVariable(
"TEMPLATE_CREATE_CMD", $this->parent_cmd);
2320 $this->tpl->parseCurrentBlock();
2323 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2325 $alist->setId($list_id);
2326 $alist->addItem($lng->txt(
"tbl_template_create"),
"create",
"#");
2327 if(
sizeof($templates))
2329 $alist->addItem($lng->txt(
"tbl_template_delete"),
"delete",
"#");
2330 foreach($templates as $name)
2332 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_tpl", urlencode($name));
2333 $alist->addItem($name, $name, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
2334 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_tpl",
"");
2337 $alist->setListTitle($lng->txt(
"tbl_templates"));
2339 $this->tpl->setVariable(
"TEMPLATE_SELECTOR",
" ".$alist->getHTML());
2344 $this->tpl->setCurrentBlock(
"tbl_footer");
2345 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
2348 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
2350 $this->tpl->parseCurrentBlock();
2353 if ($numinfo !=
"" || $linkbar !=
"" || $column_selector !=
"" ||
2354 count($this->filters) > 0 || count($this->optional_filters) > 0)
2356 if (is_object($ilUser) && (count($this->filters) || count($this->optional_filters)))
2358 $this->tpl->setCurrentBlock(
"filter_activation");
2359 $this->tpl->setVariable(
"TXT_ACTIVATE_FILTER", $lng->txt(
"show_filter"));
2360 $this->tpl->setVariable(
"FILA_ID", $this->
getId());
2361 if ($this->
getId() !=
"")
2363 $this->tpl->setVariable(
"SAVE_URLA",
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
2364 $this->
getId().
"&cmd=showFilter&user_id=".$ilUser->getId());
2366 $this->tpl->parseCurrentBlock();
2371 $this->tpl->setCurrentBlock(
"filter_deactivation");
2372 $this->tpl->setVariable(
"TXT_HIDE", $lng->txt(
"hide_filter"));
2373 if ($this->
getId() !=
"")
2375 $this->tpl->setVariable(
"SAVE_URL",
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
2376 $this->
getId().
"&cmd=hideFilter&user_id=".$ilUser->getId());
2377 $this->tpl->setVariable(
"FILD_ID", $this->
getId());
2379 $this->tpl->parseCurrentBlock();
2386 $this->tpl->setCurrentBlock(
"top_numinfo");
2387 $this->tpl->setVariable(
"NUMINFO", $numinfo);
2388 $this->tpl->parseCurrentBlock();
2393 $this->tpl->setCurrentBlock(
"top_linkbar");
2394 $this->tpl->setVariable(
"LINKBAR", $linkbar);
2395 $this->tpl->parseCurrentBlock();
2399 $this->tpl->setVariable(
"COLUMN_SELECTOR", $column_selector);
2403 is_object($ilUser) &&
2405 !$this->rows_selector_off)
2407 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2410 $alist->setId(
"sellst_rows_".$this->
getId());
2411 $hpp = ($ilUser->getPref(
"hits_per_page") != 9999)
2412 ? $ilUser->getPref(
"hits_per_page")
2413 : $lng->txt(
"no_limit");
2415 $options =
array(0 => $lng->txt(
"default").
" (".$hpp.
")",5 => 5, 10 => 10, 15 => 15, 20 => 20,
2416 30 => 30, 40 => 40, 50 => 50,
2417 100 => 100, 200 => 200, 400 => 400, 800 => 800);
2420 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_trows", $k);
2421 $alist->addItem($v, $k, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
2422 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_trows",
"");
2425 $this->tpl->setVariable(
"ROW_SELECTOR", $alist->getHTML());
2429 if(
sizeof($this->export_formats) && $this->
dataExists())
2431 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2434 $alist->setId(
"sellst_xpt");
2435 foreach($this->export_formats as $format => $caption_lng_id)
2437 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_xpt", $format);
2438 $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd);
2439 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_xpt",
"");
2440 $alist->addItem($lng->txt($caption_lng_id), $format,
$url);
2442 $alist->setListTitle($lng->txt(
"export"));
2443 $this->tpl->setVariable(
"EXPORT_SELECTOR",
" ".$alist->getHTML());
2446 $this->tpl->setCurrentBlock(
"top_navigation");
2447 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
2450 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
2452 $this->tpl->parseCurrentBlock();
2469 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
2471 $hash =
"#".$this->getTopAnchor();
2474 $link = $ilCtrl->getLinkTargetByClass(get_class($this->parent_obj), $this->parent_cmd).
2475 "&".$this->getNavParameter().
"=".
2479 $layout_prev = $lng->txt(
"previous");
2480 $layout_next = $lng->txt(
"next");
2483 if ($this->max_count > $this->
getLimit() || $this->custom_prev_next)
2485 $sep =
"<span> | </span>";
2488 $pages = intval($this->max_count / $this->
getLimit());
2491 if (($this->max_count % $this->
getLimit()))
2495 $offset_arr =
array();
2496 for ($i = 1 ;$i <= $pages ; $i++)
2498 $newoffset = $this->
getLimit() * ($i-1);
2501 $offset_arr[$nav_value] = $i;
2504 $sep =
"<span> </span>";
2507 if ($this->custom_prev_next && $this->custom_prev !=
"")
2511 $LinkBar .=
"<a href=\"".$this->custom_prev.$hash.
"\">".$layout_prev.
"</a>";
2513 else if ($this->
getOffset() >= 1 && !$this->custom_prev_next)
2518 $LinkBar .=
"<a href=\"".$link.$prevoffset.$hash.
"\">".$layout_prev.
"</a>";
2524 $LinkBar .=
'<span class="ilTableFootLight">'.$layout_prev.
"</span>";
2530 $LinkBar .=
'<input type="hidden" name="'.$this->getNavParameter().
2534 $sep =
"<span> | </span>";
2537 if ($this->custom_prev_next && $this->custom_next !=
"")
2541 $LinkBar .=
"<a href=\"".$this->custom_next.$hash.
"\">".$layout_next.
"</a>";
2543 else if (! ( ($this->
getOffset() / $this->
getLimit())==($pages-1) ) && ($pages!=1) &&
2544 !$this->custom_prev_next)
2549 $LinkBar .=
"<a href=\"".$link.$newoffset.$hash.
"\">".$layout_next.
"</a>";
2555 $LinkBar .=
'<span class="ilTableFootLight">'.$layout_next.
"</span>";
2558 $sep =
"<span> </span>";
2560 if (count($offset_arr) && !$this->
getDisplayAsBlock() && !$this->custom_prev_next)
2565 '<label for="tab_page_sel_'.$a_num.
'">'.$lng->txt(
"page").
'</label> '.
2567 $this->
getNavParameter().$a_num, $offset_arr,
false,
true, 0,
"small",
2568 array(
"id" =>
"tab_page_sel_".$a_num,
2569 "onchange" =>
"ilTablePageSelection(this, 'cmd[".$this->parent_cmd.
"]')"));
2584 $hidden_row =
false;
2585 if(count($this->hidden_inputs))
2587 foreach ($this->hidden_inputs as $hidden_input)
2589 $this->tpl->setCurrentBlock(
"tbl_hidden_field");
2590 $this->tpl->setVariable(
"FIELD_NAME", $hidden_input[
"name"]);
2591 $this->tpl->setVariable(
"FIELD_VALUE", $hidden_input[
"value"]);
2592 $this->tpl->parseCurrentBlock();
2595 $this->tpl->setCurrentBlock(
"tbl_hidden_row");
2596 $this->tpl->parseCurrentBlock();
2608 $action_row =
false;
2612 if (count($this->sel_buttons) > 0)
2614 foreach ($this->sel_buttons as $button)
2616 $this->tpl->setCurrentBlock(
"sel_button");
2617 $this->tpl->setVariable(
"SBUTTON_SELECT",
2619 $button[
"options"],
false,
true));
2620 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2621 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2622 $this->tpl->parseCurrentBlock();
2626 $this->tpl->setCurrentBlock(
"sel_top_button");
2627 $this->tpl->setVariable(
"SBUTTON_SELECT",
2629 $button[
"options"],
false,
true));
2630 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2631 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2632 $this->tpl->parseCurrentBlock();
2638 $this->sel_buttons[] =
array(
"options" => $a_options,
"cmd" => $a_cmd,
"text" => $a_text);
2641 if (count($this->buttons) > 0)
2643 foreach ($this->buttons as $button)
2645 if(!is_array($button))
2649 $this->tpl->setVariable(
'BUTTON_OBJ', $button->render());
2652 $button = clone $button;
2654 $this->tpl->setVariable(
'BUTTON_TOP_OBJ', $button->render());
2659 if (strlen($button[
'onclick']))
2661 $this->tpl->setCurrentBlock(
'cmdonclick');
2662 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2663 $this->tpl->parseCurrentBlock();
2665 $this->tpl->setCurrentBlock(
"plain_button");
2666 if ($button[
"id"] !=
"")
2668 $this->tpl->setVariable(
"PBID",
' id="'.$button[
"id"].
'" ');
2670 if ($button[
"class"] !=
"")
2672 $this->tpl->setVariable(
"PBBT_CLASS",
' '.$button[
"class"]);
2674 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2675 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2676 $this->tpl->parseCurrentBlock();
2680 if (strlen($button[
'onclick']))
2682 $this->tpl->setCurrentBlock(
'top_cmdonclick');
2683 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2684 $this->tpl->parseCurrentBlock();
2686 $this->tpl->setCurrentBlock(
"plain_top_button");
2687 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2688 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2689 if ($button[
"class"] !=
"")
2691 $this->tpl->setVariable(
"PBBT_CLASS",
' '.$button[
"class"]);
2693 $this->tpl->parseCurrentBlock();
2702 if(count($this->mi_sel_buttons))
2704 foreach ($this->mi_sel_buttons as $button)
2706 $this->tpl->setCurrentBlock(
"mi_sel_button");
2707 $this->tpl->setVariable(
"MI_BUTTON_SELECT",
2709 $button[
"options"],
false,
true));
2710 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2711 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2712 $this->tpl->parseCurrentBlock();
2716 $this->tpl->setCurrentBlock(
"mi_top_sel_button");
2717 $this->tpl->setVariable(
"MI_BUTTON_SELECT",
2719 $button[
"options"],
false,
true));
2720 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2721 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2722 $this->tpl->parseCurrentBlock();
2731 if (count($this->multi) > 1 && $this->
dataExists())
2733 if($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit())
2735 $this->tpl->setCurrentBlock(
"tbl_cmd_select_all");
2736 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", $lng->txt(
"all_objects"));
2737 $this->tpl->parseCurrentBlock();
2740 $this->tpl->setCurrentBlock(
"tbl_cmd_select");
2742 foreach ($this->multi as $mc)
2744 $sel[$mc[
"cmd"]] = $mc[
"text"];
2746 $this->tpl->setVariable(
"SELECT_CMDS",
2748 $this->tpl->setVariable(
"TXT_EXECUTE", $lng->txt(
"execute"));
2749 $this->tpl->parseCurrentBlock();
2755 if($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit())
2757 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select_all");
2758 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", $lng->txt(
"all_objects"));
2759 $this->tpl->parseCurrentBlock();
2762 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select");
2764 foreach ($this->multi as $mc)
2766 $sel[$mc[
"cmd"]] = $mc[
"text"];
2768 $this->tpl->setVariable(
"SELECT_CMDS",
2770 $this->tpl->setVariable(
"TXT_EXECUTE", $lng->txt(
"execute"));
2771 $this->tpl->parseCurrentBlock();
2774 elseif(count($this->multi) == 1 && $this->
dataExists())
2776 $this->tpl->setCurrentBlock(
"tbl_single_cmd");
2778 foreach ($this->multi as $mc)
2783 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2784 $this->tpl->setVariable(
"SINGLE_CMD",
$cmd);
2785 $this->tpl->parseCurrentBlock();
2791 $this->tpl->setCurrentBlock(
"tbl_top_single_cmd");
2793 foreach ($this->multi as $mc)
2798 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2799 $this->tpl->setVariable(
"SINGLE_CMD",
$cmd);
2800 $this->tpl->parseCurrentBlock();
2806 $this->tpl->setCurrentBlock(
"tbl_action_img_arrow");
2808 $this->tpl->setVariable(
"ALT_ARROW", $lng->txt(
"action"));
2809 $this->tpl->parseCurrentBlock();
2813 $this->tpl->setCurrentBlock(
"tbl_top_action_img_arrow");
2815 $this->tpl->setVariable(
"ALT_ARROW", $lng->txt(
"action"));
2816 $this->tpl->parseCurrentBlock();
2822 $this->tpl->setCurrentBlock(
"tbl_action_row");
2823 $this->tpl->parseCurrentBlock();
2826 $this->tpl->setCurrentBlock(
"tbl_top_action_row");
2827 $this->tpl->parseCurrentBlock();
2839 $this->headerHTML =
$html;
2852 if(is_object($ilUser) && $this->
getId() !=
"")
2854 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
2857 $tab_prop->storeProperty($this->
getId(), $ilUser->getId(), $type, $value);
2871 if(is_object($ilUser) && $this->
getId() !=
"")
2873 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
2876 return $tab_prop->getProperty($this->
getId(), $ilUser->getId(), $type);
2909 foreach($this->filters as $item)
2914 if($this->optional_filters &&
$result[
"selfilters"])
2916 foreach($this->optional_filters as $item)
2918 if(in_array($item->getFieldId(),
$result[
"selfilters"]))
2936 if(method_exists($a_item,
"getChecked"))
2938 return $a_item->getChecked();
2940 else if(method_exists($a_item,
"getValue"))
2942 return $a_item->getValue();
2944 else if(method_exists($a_item,
"getDate"))
2958 if(method_exists($a_item,
"setChecked"))
2960 $a_item->setChecked($a_value);
2962 else if(method_exists($a_item,
"setValue"))
2964 $a_item->setValue($a_value);
2966 else if(method_exists($a_item,
"setDate"))
2982 $this->context = $id;
3003 $this->show_rows_selector = (bool)$a_value;
3023 $this->show_templates = (bool)$a_value;
3048 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3050 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3053 $data = $storage->load($this->
getContext(), $ilUser->getId(), $a_name);
3056 foreach(
$data as $property => $value)
3062 $data[
"filter_values"] = unserialize(
$data[
"filter_values"]);
3063 if(
$data[
"filter_values"])
3065 $this->restore_filter_values =
$data[
"filter_values"];
3068 $this->restore_filter =
true;
3087 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3089 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3093 $state[
"filter_values"] = serialize($state[
"filter_values"]);
3094 $state[
"selfields"] = serialize($state[
"selfields"]);
3095 $state[
"selfilters"] = serialize($state[
"selfilters"]);
3097 $storage->store($this->
getContext(), $ilUser->getId(), $a_name, $state);
3115 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3117 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3119 $storage->delete($this->
getContext(), $ilUser->getId(), $a_name);
3134 return parent::getLimit();
3146 return parent::getOffset();
3156 $this->export_formats =
array();
3159 $valid =
array(self::EXPORT_EXCEL =>
"tbl_export_excel",
3160 self::EXPORT_CSV =>
"tbl_export_csv");
3162 foreach($formats as $format)
3164 if(array_key_exists($format,
$valid))
3166 $this->export_formats[$format] =
$valid[$format];
3177 $this->print_mode = (bool)$a_value;
3221 case self::EXPORT_EXCEL:
3222 include_once
"./Services/Excel/classes/class.ilExcel.php";
3224 $excel->addSheet($this->title
3226 : $this->lng->txt(
"export"));
3240 foreach($this->row_data as $set)
3257 case self::EXPORT_CSV:
3258 include_once
"./Services/Utilities/classes/class.ilCSVWriter.php";
3260 $csv->setSeparator(
";");
3265 foreach($this->row_data as $set)
3274 header(
"Content-type: text/comma-separated-values");
3275 header(
"Content-Disposition: attachment; filename=\"".
$filename.
"\"");
3277 header(
"Cache-Control: must-revalidate, post-check=0,pre-check=0");
3278 header(
"Pragma: public");
3279 echo $csv->getCSVString();
3284 file_put_contents(
$filename, $csv->getCSVString());
3320 $title = strip_tags($column[
"text"]);
3340 foreach ($a_set as $value)
3342 if(is_array($value))
3344 $value = implode(
', ', $value);
3346 $a_excel->
setCell($a_row, $col++, $value);
3371 $title = strip_tags($column[
"text"]);
3374 $a_csv->addColumn(
$title);
3389 foreach ($a_set as $key => $value)
3391 if(is_array($value))
3393 $value = implode(
', ', $value);
3395 $a_csv->addColumn(strip_tags($value));
3407 $this->enable_command_for_all = (bool)$a_value;
3417 global $ilClientIniFile;
3419 $limit = $ilClientIniFile->readVariable(
"system",
"TABLE_ACTION_ALL_LIMIT");
3422 $limit = self::ACTION_ALL_LIMIT;
3452 $this->prevent_double_submission = $a_val;
3467 parent::setLimit($a_limit, $a_default_limit);
3470 if($a_limit == 9999 &&
3471 $this->limit_determined)
3473 $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.
fillHeaderExcel(ilExcel $a_excel, &$a_row)
Excel Version of Fill Header.
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.
fillRowExcel(ilExcel $a_excel, &$a_row, $a_set)
Excel Version of Fill Row.
$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.
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.
setDefaultFilterVisiblity($a_status)
Set default filter visiblity.
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.
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.
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
isFilterVisible()
Check if filter is visible: manually shown (session, db) or default value set.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
getColumnCoord($a_col)
Get column "name" from number.
if(!is_array($argv)) $options
setBold($a_coords)
Set cell(s) to bold.
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.
$default_filter_visibility
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.
Add a drawing to the header
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.
Create styles array
The data for the language used.
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.
setCell($a_row, $a_col, $a_value)
Set cell value.
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.
setFormName($a_formname="")
Set Form name.
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.
fillHeaderCSV($a_csv)
CSV Version of Fill Header.
Set thin black border outline around column
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.
fillMetaExcel(ilExcel $a_excel, &$a_row)
Add meta information to excel export.
getExportMode()
Was export activated?
getFilterItems($a_optionals=false)
Get filter items.
setEnableTitle($a_enabletitle)
Set Enable Title.
getDefaultFilterVisibility()
Get default filter visibility.
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.