4 require_once(
"Services/Table/classes/class.ilTableGUI.php");
83 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_template_context =
"")
88 $this->unique_id = md5(uniqid());
89 $this->parent_obj = $a_parent_obj;
90 $this->parent_cmd = $a_parent_cmd;
91 $this->buttons = array();
92 $this->header_commands = array();
93 $this->multi = array();
94 $this->hidden_inputs = array();
96 $this->tpl =
new ilTemplate(
"tpl.table2.html",
true,
true,
"Services/Table");
98 $lng->loadLanguageModule(
'tbl');
100 if(!$a_template_context)
102 $a_template_context = $this->
getId();
107 if(isset(
$_GET[$this->prefix.
"_xpt"]))
109 $this->export_mode = (int)
$_GET[$this->prefix.
"_xpt"];
113 if(isset(
$_GET[$this->prefix.
"_tpl"]))
131 $this->open_form_tag = $a_val;
151 $this->close_form_tag = $a_val;
171 if ($this->limit_determined)
177 if (isset(
$_GET[$this->prefix.
"_trows"]))
193 if (is_object($ilUser))
195 $limit = $ilUser->getPref(
"hits_per_page");
205 $this->limit_determined =
true;
223 if ($this->columns_determined)
234 @unserialize($old_sel);
237 if(!is_array($sel_fields))
240 $sel_fields = array();
243 $this->selected_columns = array();
247 $this->selected_column[$k] =
false;
249 $new_column = ($sel_fields[$k] === NULL);
256 $this->selected_column[$k] =
true;
259 else if ($stored && !$new_column)
261 $this->selected_column[$k] = $sel_fields[$k];
271 $this->selected_column[$k] =
true;
276 if ($old_sel != serialize($this->selected_column) && $set)
278 $this->
storeProperty(
"selfields", serialize($this->selected_column));
281 $this->columns_determined =
true;
292 return $this->selected_column[$a_col];
304 foreach ($this->selected_column as $k => $v)
321 $next_class = $ilCtrl->getNextClass($this);
322 $cmd = $ilCtrl->getCmd();
326 case 'ilformpropertydispatchgui':
327 include_once
'./Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
331 $form_prop_dispatch->setItem($item);
332 return $ilCtrl->forwardCommand($form_prop_dispatch);
344 if (!$this->nav_determined && !$a_in_determination)
371 return $this->parent_obj;
381 return $this->parent_cmd;
391 $this->top_anchor = $a_val;
411 $this->noentriestext = $a_text;
421 return $this->noentriestext;
431 $this->datatable = $a_val;
441 return $this->datatable;
451 $this->enabled[
"title"] = $a_enabletitle;
461 return $this->enabled[
"title"];
471 $this->enabled[
"header"] = $a_enableheader;
481 return $this->enabled[
"header"];
491 $this->num_info = $a_val;
501 return $this->num_info;
507 final public function setTitle($a_title, $a_icon = 0, $a_icon_alt = 0)
519 $this->description = $a_val;
529 return $this->description;
539 $this->order_field = $a_order_field;
544 return $this->order_field;
551 $this->enabled[
"header"] && $this->enabled[
"sort"] &&
552 $this->columns_determined && is_array($this->column) &&
556 $check = array_keys(array_shift($check));
557 foreach($this->column as $col)
559 if($col[
"sort_field"] && !in_array($col[
"sort_field"], $check))
561 $invalid[] = $col[
"sort_field"];
576 $this->row_data = $a_data;
581 return $this->row_data;
586 if (is_array($this->row_data))
588 if (count($this->row_data) > 0)
598 $this->prefix = $a_prefix;
612 $a_input_item->setParent($this);
615 $this->filters[] = $a_input_item;
619 $this->optional_filters[] = $a_input_item;
623 if($this->restore_filter)
627 $this->setFilterValue($a_input_item, $this->restore_filter_values[$a_input_item->getFieldId()]);
631 $this->setFilterValue($a_input_item, null);
651 $caption = $lng->txt($id);
654 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
658 case self::FILTER_SELECT:
659 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
663 case self::FILTER_DATE:
664 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
669 case self::FILTER_TEXT:
670 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
672 $item->setMaxLength(64);
677 case self::FILTER_LANGUAGE:
678 $lng->loadLanguageModule(
"meta");
679 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
681 $options = array(
"" => $lng->txt(
"trac_all"));
682 foreach ($lng->getInstalledLanguages() as $lang_key)
684 $options[$lang_key] = $lng->txt(
"meta_l_".$lang_key);
689 case self::FILTER_NUMBER_RANGE:
690 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
691 include_once(
"./Services/Form/classes/class.ilNumberInputGUI.php");
694 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
696 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
698 $item->setMaxLength(7);
702 case self::FILTER_DATE_RANGE:
703 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
704 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
707 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
709 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
714 case self::FILTER_DATETIME_RANGE:
715 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
716 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
719 $combi_item->setShowTime(
true);
720 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
722 $combi_item->setShowTime(
true);
723 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
728 case self::FILTER_DURATION_RANGE:
729 $lng->loadLanguageModule(
"form");
730 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
731 include_once(
"./Services/Form/classes/class.ilDurationInputGUI.php");
734 $combi_item->setShowMonths(
false);
735 $combi_item->setShowDays(
true);
736 $combi_item->setShowSeconds(
true);
737 $item->addCombinationItem(
"from", $combi_item, $lng->txt(
"from"));
739 $combi_item->setShowMonths(
false);
740 $combi_item->setShowDays(
true);
741 $combi_item->setShowSeconds(
true);
742 $item->addCombinationItem(
"to", $combi_item, $lng->txt(
"to"));
751 $item->readFromSession();
771 if ($item->getPostVar() == $a_post_var)
778 if ($item->getPostVar() == $a_post_var)
793 $this->filter_cols = $a_val;
813 $this->disable_filter_hiding = $a_val;
834 return $this->selected_filter[$a_col];
846 foreach ($this->selected_filter as $k => $v)
864 if ($this->filters_determined)
874 @unserialize($old_sel);
877 if(!is_array($sel_filters))
880 $sel_filters = array();
883 $this->selected_filter = array();
887 $k = $item->getPostVar();
889 $this->selected_filter[$k] =
false;
896 $this->selected_filter[$k] =
true;
900 $item->setValue(NULL);
901 $item->writeToSession();
906 $this->selected_filter[$k] = $sel_filters[$k];
910 if ($old_sel != serialize($this->selected_filter) && $set)
912 $this->
storeProperty(
"selfilters", serialize($this->selected_filter));
915 $this->filters_determined =
true;
923 $this->custom_prev_next =
true;
924 $this->custom_prev = $a_prev_link;
925 $this->custom_next = $a_next_link;
936 $this->form_action = $a_form_action;
937 $this->form_multipart = (bool)$a_multipart;
947 return $this->form_action;
957 $this->formname = $a_formname;
967 return $this->formname;
1001 $this->display_as_block = $a_val;
1011 return $this->display_as_block;
1031 $this->select_all_checkbox = $a_select_all_checkbox;
1041 $this->ext_sort = $a_val;
1062 $this->filter_cmd = $a_val;
1063 $this->filter_cmd_txt = $a_caption;
1084 $this->reset_cmd = $a_val;
1085 $this->reset_cmd_txt = $a_caption;
1105 $this->ext_seg = $a_val;
1126 $this->row_template = $a_template;
1127 $this->row_template_dir = $a_template_dir;
1137 $this->defaultorderfield = $a_defaultorderfield;
1147 return $this->defaultorderfield;
1157 $this->defaultorderdirection = $a_defaultorderdirection;
1167 return $this->defaultorderdirection;
1177 $this->buttons = array();
1188 $this->buttons[] = array(
"cmd" => $a_cmd,
"text" => $a_text,
'onclick' => $a_onclick,
1189 "id" => $a_id,
"class" => $a_class);
1199 $this->buttons[] = $a_button;
1214 echo
"ilTabl2GUI->addSelectionButton() has been deprecated with 4.2. Please try to move the drop-down to ilToolbarGUI.";
1229 $this->mi_sel_buttons[] = array(
"sel_var" => $a_sel_var,
"options" => $a_options,
"selected" => $a_default_selection,
"cmd" => $a_cmd,
"text" => $a_text);
1243 $this->close_command = $a_link;
1254 $this->multi[] = array(
"cmd" => $a_cmd,
"text" => $a_text);
1265 $this->hidden_inputs[] = array(
"name" => $a_name,
"value" => $a_value);
1276 $this->header_commands[] = array(
"href" => $a_href,
"text" => $a_text,
1277 "target" => $a_target,
"img" => $a_img);
1287 $this->top_commands = $a_val;
1307 final public function addColumn($a_text, $a_sort_field =
"", $a_width =
"",
1308 $a_is_checkbox_action_column =
false, $a_class =
"", $a_tooltip =
"")
1310 $this->column[] = array(
1312 "sort_field" => $a_sort_field,
1313 "width" => $a_width,
1314 "is_checkbox_action_column" => $a_is_checkbox_action_column,
1315 "class" => $a_class,
1316 "tooltip" => $a_tooltip
1318 if ($a_sort_field !=
"")
1320 $this->sortable_fields[] = $a_sort_field;
1322 $this->column_count = count($this->column);
1328 return $this->prefix.
"_table_nav";
1336 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
1338 $hash =
"#".$this->getTopAnchor();
1344 $ilCtrl->setParameter($this->parent_obj,
1346 $sort_field.
":".$order_dir.
":".$this->offset);
1347 $this->tpl->setVariable(
"TBL_ORDER_LINK",
1348 $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd).$hash);
1351 $ilCtrl->setParameter($this->parent_obj,
1359 $allcolumnswithwidth =
true;
1360 foreach ((array) $this->column as $idx => $column)
1362 if (!strlen($column[
"width"]))
1364 $allcolumnswithwidth =
false;
1366 else if($column[
"width"] ==
"1")
1369 $this->column[$idx][
"width"] =
"1%";
1372 if ($allcolumnswithwidth)
1374 foreach ((array) $this->column as $column)
1376 $this->tpl->setCurrentBlock(
"tbl_colgroup_column");
1377 $this->tpl->setVariable(
"COLGROUP_COLUMN_WIDTH", $column[
"width"]);
1378 $this->tpl->parseCurrentBlock();
1382 foreach ((array) $this->column as $column)
1387 if ($column[
"tooltip"] !=
"")
1389 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1392 if (!$this->enabled[
"sort"] || $column[
"sort_field"] ==
"" || $column[
"is_checkbox_action_column"])
1394 $this->tpl->setCurrentBlock(
"tbl_header_no_link");
1395 if ($column[
"width"] !=
"")
1397 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH_NO_LINK",
" width=\"".$column[
"width"].
"\"");
1399 if (!$column[
"is_checkbox_action_column"])
1401 $this->tpl->setVariable(
"TBL_HEADER_CELL_NO_LINK",
1406 $this->tpl->setVariable(
"TBL_HEADER_CELL_NO_LINK",
1409 $this->tpl->setVariable(
"HEAD_CELL_NL_ID",
"thc_".$this->
getId().
"_".$ccnt);
1411 if ($column[
"class"] !=
"")
1413 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1415 $this->tpl->parseCurrentBlock();
1416 $this->tpl->touchBlock(
"tbl_header_th");
1419 if (($column[
"sort_field"] == $this->order_field) && ($this->order_direction !=
""))
1421 $this->tpl->setCurrentBlock(
"tbl_order_image");
1422 if ($this->order_direction ==
"asc")
1424 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-up");
1428 $this->tpl->setVariable(
"ORDER_CLASS",
"glyphicon glyphicon-arrow-down");
1430 $this->tpl->setVariable(
"IMG_ORDER_ALT", $this->lng->txt(
"change_sort_direction"));
1431 $this->tpl->parseCurrentBlock();
1434 $this->tpl->setCurrentBlock(
"tbl_header_cell");
1435 $this->tpl->setVariable(
"TBL_HEADER_CELL", $column[
"text"]);
1436 $this->tpl->setVariable(
"HEAD_CELL_ID",
"thc_".$this->
getId().
"_".$ccnt);
1439 if ($column[
"width"] !=
"")
1441 $this->tpl->setVariable(
"TBL_COLUMN_WIDTH",
" width=\"".$column[
"width"].
"\"");
1444 $lng_sort_column = $this->lng->txt(
"sort_by_this_column");
1445 $this->tpl->setVariable(
"TBL_ORDER_ALT",$lng_sort_column);
1449 if ($column[
"sort_field"] == $this->order_field)
1451 $order_dir = $this->sort_order;
1453 $lng_change_sort = $this->lng->txt(
"change_sort_direction");
1454 $this->tpl->setVariable(
"TBL_ORDER_ALT",$lng_change_sort);
1457 if ($column[
"class"] !=
"")
1459 $this->tpl->setVariable(
"TBL_HEADER_CLASS",
" " . $column[
"class"]);
1461 $this->
setOrderLink($column[
"sort_field"], $order_dir);
1462 $this->tpl->parseCurrentBlock();
1463 $this->tpl->touchBlock(
"tbl_header_th");
1466 $this->tpl->setCurrentBlock(
"tbl_header");
1467 $this->tpl->parseCurrentBlock();
1485 if ($this->nav_determined)
1510 if ($this->nav_value ==
"" && $this->
getId() !=
"" && $ilUser->getId() != ANONYMOUS_USER_ID)
1513 if (in_array($order, $this->sortable_fields))
1527 $nav = explode(
":", $this->nav_value);
1533 if (!$a_omit_offset)
1550 if (!$a_omit_offset)
1552 $this->nav_determined =
true;
1588 if (is_object($ilCtrl) && $this->
getId() ==
"")
1599 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
1601 $hash =
"#".$this->getTopAnchor();
1604 if((
bool)$this->form_multipart)
1606 $this->tpl->touchBlock(
"form_multipart_bl");
1611 $this->tpl->touchBlock(
"pdfs");
1614 $this->tpl->setCurrentBlock(
"tbl_form_header");
1615 $this->tpl->setVariable(
"FORMACTION", $this->
getFormAction().$hash);
1616 $this->tpl->setVariable(
"FORMNAME", $this->
getFormName());
1617 $this->tpl->parseCurrentBlock();
1622 $this->tpl->touchBlock(
"tbl_form_footer");
1626 if(!$this->enabled[
'content'])
1638 $this->
setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1665 $this->tpl->addBlockFile(
"TBL_CONTENT",
"tbl_content", $this->row_template,
1666 $this->row_template_dir);
1668 foreach($data as $set)
1670 $this->tpl->setCurrentBlock(
"tbl_content");
1671 $this->css_row = ($this->css_row !=
"tblrow1")
1674 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
1677 $this->tpl->setCurrentBlock(
"tbl_content");
1678 $this->tpl->parseCurrentBlock();
1686 : $lng->txt(
"no_items");
1688 $this->css_row = ($this->css_row !=
"tblrow1")
1692 $this->tpl->setCurrentBlock(
"tbl_no_entries");
1693 $this->tpl->setVariable(
'TBL_NO_ENTRY_CSS_ROW', $this->css_row);
1694 $this->tpl->setVariable(
'TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
1695 $this->tpl->setVariable(
'TBL_NO_ENTRY_TEXT', trim($no_items_text));
1696 $this->tpl->parseCurrentBlock();
1732 $this->tpl->setVariable(
"CSS_TABLE",$this->
getStyle(
"table"));
1733 $this->tpl->setVariable(
"DATA_TABLE", (
int) $this->
getIsDataTable());
1734 if ($this->
getId() !=
"")
1736 $this->tpl->setVariable(
"ID",
'id="'.$this->
getId().
'"');
1742 $this->tpl->setCurrentBlock(
"tbl_header_description");
1743 $this->tpl->setVariable(
"TBL_DESCRIPTION", $this->
getDescription());
1744 $this->tpl->parseCurrentBlock();
1754 $this->tpl->touchBlock(
"outer_start_1");
1755 $this->tpl->touchBlock(
"outer_end_1");
1759 $this->tpl->touchBlock(
"outer_start_2");
1760 $this->tpl->touchBlock(
"outer_end_2");
1764 if ($this->enabled[
"title"] && ($this->title !=
""
1765 || $this->icon !=
"" || count($this->header_commands) > 0 ||
1766 $this->headerHTML !=
"" || $this->close_command !=
""))
1768 if ($this->enabled[
"icon"])
1770 $this->tpl->setCurrentBlock(
"tbl_header_title_icon");
1772 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->icon_alt);
1773 $this->tpl->parseCurrentBlock();
1778 foreach($this->header_commands as $command)
1780 if ($command[
"img"] !=
"")
1782 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1783 if ($command[
"target"] !=
"")
1785 $this->tpl->setVariable(
"TARGET_IMG_LINK",
1786 'target="'.$command[
"target"].
'"');
1788 $this->tpl->setVariable(
"ALT_IMG_LINK", $command[
"text"]);
1789 $this->tpl->setVariable(
"HREF_IMG_LINK", $command[
"href"]);
1790 $this->tpl->setVariable(
"SRC_IMG_LINK",
1792 $this->tpl->parseCurrentBlock();
1796 $this->tpl->setCurrentBlock(
"head_cmd");
1797 $this->tpl->setVariable(
"TXT_HEAD_CMD", $command[
"text"]);
1798 $this->tpl->setVariable(
"HREF_HEAD_CMD", $command[
"href"]);
1799 $this->tpl->parseCurrentBlock();
1804 if (isset ($this->headerHTML)) {
1805 $this->tpl->setCurrentBlock(
"tbl_header_html");
1806 $this->tpl->setVariable (
"HEADER_HTML", $this->headerHTML);
1807 $this->tpl->parseCurrentBlock();
1811 if ($this->close_command !=
"")
1813 $this->tpl->setCurrentBlock(
"tbl_header_img_link");
1814 $this->tpl->setVariable(
"ALT_IMG_LINK",$lng->txt(
"close"));
1815 $this->tpl->setVariable(
"HREF_IMG_LINK",$this->close_command);
1816 $this->tpl->parseCurrentBlock();
1819 $this->tpl->setCurrentBlock(
"tbl_header_title");
1820 $this->tpl->setVariable(
"TBL_TITLE",$this->title);
1821 $this->tpl->setVariable(
"TOP_ANCHOR",$this->
getTopAnchor());
1824 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
1826 $this->tpl->parseCurrentBlock();
1830 if ($this->enabled[
"header"])
1835 $this->tpl->touchBlock(
"tbl_table_end");
1837 return $this->tpl->get();
1850 $tpl->addJavascript(
"./Services/Table/js/ServiceTable.js");
1852 if (count($filter) == 0 && count($opt_filter) == 0)
1857 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
1863 if (count($filter) > 0)
1865 foreach ($filter as $item)
1869 $this->tpl->setCurrentBlock(
"filter_row");
1870 $this->tpl->parseCurrentBlock();
1873 $this->tpl->setCurrentBlock(
"filter_item");
1874 $this->tpl->setVariable(
"OPTION_NAME",
1876 $this->tpl->setVariable(
"F_INPUT_ID",
1877 $item->getFieldId());
1878 $this->tpl->setVariable(
"INPUT_HTML",
1879 $item->getTableFilterHTML());
1880 $this->tpl->parseCurrentBlock();
1886 if (count($opt_filter) > 0)
1890 foreach ($opt_filter as $item)
1896 $this->tpl->setCurrentBlock(
"filter_row");
1897 $this->tpl->parseCurrentBlock();
1900 $this->tpl->setCurrentBlock(
"filter_item");
1901 $this->tpl->setVariable(
"OPTION_NAME",
1903 $this->tpl->setVariable(
"F_INPUT_ID",
1904 $item->getFieldId());
1905 $this->tpl->setVariable(
"INPUT_HTML",
1906 $item->getTableFilterHTML());
1907 $this->tpl->parseCurrentBlock();
1914 foreach ($opt_filter as $item)
1916 $k = $item->getPostVar();
1917 $items[$k] = array(
"txt" => $item->getTitle(),
1921 include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
1923 $cb_over->setLinkTitle($lng->txt(
"optional_filters"));
1924 $cb_over->setItems($items);
1927 $cb_over->setFieldVar(
"tblff".$this->
getId());
1928 $cb_over->setHiddenVar(
"tblfsf".$this->
getId());
1930 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
1931 $this->tpl->setCurrentBlock(
"filter_select");
1934 $this->tpl->setVariable(
"HIDDEN_CMD_APPLY", $this->filter_cmd);
1936 $this->tpl->setVariable(
"FILTER_SELECTOR", $cb_over->getHTML());
1937 $this->tpl->parseCurrentBlock();
1941 if($ccnt > 0 || count($opt_filter) > 0)
1943 $this->tpl->setVariable(
"TXT_FILTER", $lng->txt(
"filter"));
1951 $this->tpl->touchBlock(
"filter_empty_cell");
1954 $this->tpl->setCurrentBlock(
"filter_row");
1955 $this->tpl->parseCurrentBlock();
1957 $this->tpl->setCurrentBlock(
"filter_buttons");
1958 $this->tpl->setVariable(
"CMD_APPLY", $this->filter_cmd);
1959 $this->tpl->setVariable(
"TXT_APPLY", $this->filter_cmd_txt
1960 ? $this->filter_cmd_txt
1961 : $lng->txt(
"apply_filter"));
1962 $this->tpl->setVariable(
"CMD_RESET", $this->reset_cmd);
1963 $this->tpl->setVariable(
"TXT_RESET", $this->reset_cmd_txt
1964 ? $this->reset_cmd_txt
1965 : $lng->txt(
"reset_filter"));
1967 else if(count($opt_filter) > 0)
1969 $this->tpl->setCurrentBlock(
"optional_filter_hint");
1970 $this->tpl->setVariable(
'TXT_OPT_HINT', $lng->txt(
'optional_filter_hint'));
1971 $this->tpl->parseCurrentBlock();
1974 $this->tpl->setCurrentBlock(
"filter_section");
1975 $this->tpl->setVariable(
"FIL_ID", $this->
getId());
1976 $this->tpl->parseCurrentBlock();
1983 $this->tpl->setCurrentBlock(
"filter_hidden");
1984 $this->tpl->setVariable(
"FI_ID", $this->
getId());
1985 $this->tpl->parseCurrentBlock();
2001 foreach ($filter as $item)
2003 if ($item->checkInput())
2005 $item->setValueByArray(
$_POST);
2006 $item->writeToSession();
2009 foreach ($opt_filter as $item)
2011 if ($item->checkInput())
2013 $item->setValueByArray(
$_POST);
2014 $item->writeToSession();
2033 foreach ($filter as $item)
2035 if ($item->checkInput())
2037 $item->setValueByArray(
$_POST);
2038 $item->clearFromSession();
2041 foreach ($opt_filter as $item)
2043 if ($item->checkInput())
2045 $item->setValueByArray(
$_POST);
2046 $item->clearFromSession();
2063 foreach ($a_set as $key => $value)
2065 $this->tpl->setVariable(
"VAL_".strtoupper($key), $value);
2081 $this->tpl->setCurrentBlock(
"select_all_checkbox");
2082 $this->tpl->setVariable(
"SELECT_ALL_TXT_SELECT_ALL", $lng->txt(
"select_all"));
2084 $this->tpl->setVariable(
"SELECT_ALL_FORM_NAME", $this->
getFormName());
2085 $this->tpl->setVariable(
"CHECKBOXNAME",
"chb_select_all_" . $this->unique_id);
2086 $this->tpl->parseCurrentBlock();
2090 if ($this->enabled[
"numinfo"] && $this->enabled[
"footer"])
2092 $start = $this->offset + 1;
2099 if ($end > $this->max_count or $this->limit == 0)
2104 if ($this->max_count > 0)
2106 if ($this->lang_support)
2108 $numinfo =
"(".$start.
" - ".$end.
" ".strtolower($this->lng->txt(
"of")).
" ".$this->max_count.
")";
2112 $numinfo =
"(".$start.
" - ".$end.
" of ".$this->max_count.
")";
2115 if ($this->max_count > 0)
2119 $this->tpl->setCurrentBlock(
"tbl_footer_numinfo");
2120 $this->tpl->setVariable(
"NUMINFO", $numinfo);
2121 $this->tpl->parseCurrentBlock();
2128 if ($this->enabled[
"linkbar"] && $this->enabled[
"footer"] && $this->limit != 0
2129 && $this->max_count > 0)
2132 "link" => $this->footer_style,
2133 "prev" => $this->footer_previous,
2134 "next" => $this->footer_next,
2139 $this->tpl->setCurrentBlock(
"tbl_footer_linkbar");
2140 $this->tpl->setVariable(
"LINKBAR", $linkbar);
2141 $this->tpl->parseCurrentBlock();
2153 $items[$k] = array(
"txt" => $c[
"txt"],
2156 include_once(
"./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php");
2158 $cb_over->setLinkTitle($lng->txt(
"columns"));
2159 $cb_over->setItems($items);
2163 $cb_over->setFieldVar(
"tblfs".$this->
getId());
2164 $cb_over->setHiddenVar(
"tblfsh".$this->
getId());
2165 $cb_over->setSelectionHeaderClass(
"ilTableMenuItem");
2166 $column_selector = $cb_over->getHTML();
2188 $create_id =
"template_create_overlay_".$this->getId();
2189 $delete_id =
"template_delete_overlay_".$this->getId();
2190 $list_id =
"template_stg_".$this->getId();
2192 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
2194 $templates = $storage->getNames($this->
getContext(), $ilUser->getId());
2196 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
2199 if(
sizeof($templates))
2202 $overlay->setTrigger($list_id.
"_delete");
2203 $overlay->setAnchor(
"ilAdvSelListAnchorElement_".$list_id);
2204 $overlay->setAutoHide(
false);
2207 $lng->loadLanguageModule(
"form");
2208 $this->tpl->setCurrentBlock(
"template_editor_delete_item");
2209 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE",
"");
2210 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION",
"- ".$lng->txt(
"form_please_select").
" -");
2211 $this->tpl->parseCurrentBlock();
2212 foreach($templates as $name)
2214 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION_VALUE", $name);
2215 $this->tpl->setVariable(
"TEMPLATE_DELETE_OPTION", $name);
2216 $this->tpl->parseCurrentBlock();
2219 $this->tpl->setCurrentBlock(
"template_editor_delete");
2220 $this->tpl->setVariable(
"TEMPLATE_DELETE_ID", $delete_id);
2221 $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE", $lng->txt(
"tbl_template_delete"));
2222 $this->tpl->setVariable(
"TXT_TEMPLATE_DELETE_SUBMIT", $lng->txt(
"delete"));
2223 $this->tpl->setVariable(
"TEMPLATE_DELETE_CMD", $this->parent_cmd);
2224 $this->tpl->parseCurrentBlock();
2230 $overlay->setTrigger($list_id.
"_create");
2231 $overlay->setAnchor(
"ilAdvSelListAnchorElement_".$list_id);
2232 $overlay->setAutoHide(
false);
2235 $this->tpl->setCurrentBlock(
"template_editor");
2236 $this->tpl->setVariable(
"TEMPLATE_CREATE_ID", $create_id);
2237 $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE", $lng->txt(
"tbl_template_create"));
2238 $this->tpl->setVariable(
"TXT_TEMPLATE_CREATE_SUBMIT", $lng->txt(
"save"));
2239 $this->tpl->setVariable(
"TEMPLATE_CREATE_CMD", $this->parent_cmd);
2240 $this->tpl->parseCurrentBlock();
2243 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2245 $alist->setId($list_id);
2246 $alist->addItem($lng->txt(
"tbl_template_create"),
"create",
"#");
2247 if(
sizeof($templates))
2249 $alist->addItem($lng->txt(
"tbl_template_delete"),
"delete",
"#");
2250 foreach($templates as $name)
2252 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_tpl", urlencode($name));
2253 $alist->addItem($name, $name, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
2254 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_tpl",
"");
2257 $alist->setListTitle($lng->txt(
"tbl_templates"));
2259 $this->tpl->setVariable(
"TEMPLATE_SELECTOR",
" ".$alist->getHTML());
2264 $this->tpl->setCurrentBlock(
"tbl_footer");
2265 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
2268 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
2270 $this->tpl->parseCurrentBlock();
2273 if ($numinfo !=
"" || $linkbar !=
"" || $column_selector !=
"" ||
2274 count($this->filters) > 0 || count($this->optional_filters) > 0)
2276 if (is_object($ilUser) && (count($this->filters) || count($this->optional_filters)))
2278 $this->tpl->setCurrentBlock(
"filter_activation");
2279 $this->tpl->setVariable(
"TXT_ACTIVATE_FILTER", $lng->txt(
"show_filter"));
2280 $this->tpl->setVariable(
"FILA_ID", $this->
getId());
2281 if ($this->
getId() !=
"")
2283 $this->tpl->setVariable(
"SAVE_URLA",
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
2284 $this->
getId().
"&cmd=showFilter&user_id=".$ilUser->getId());
2286 $this->tpl->parseCurrentBlock();
2291 $this->tpl->setCurrentBlock(
"filter_deactivation");
2292 $this->tpl->setVariable(
"TXT_HIDE", $lng->txt(
"hide_filter"));
2293 if ($this->
getId() !=
"")
2295 $this->tpl->setVariable(
"SAVE_URL",
"./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
2296 $this->
getId().
"&cmd=hideFilter&user_id=".$ilUser->getId());
2297 $this->tpl->setVariable(
"FILD_ID", $this->
getId());
2299 $this->tpl->parseCurrentBlock();
2306 $this->tpl->setCurrentBlock(
"top_numinfo");
2307 $this->tpl->setVariable(
"NUMINFO", $numinfo);
2308 $this->tpl->parseCurrentBlock();
2313 $this->tpl->setCurrentBlock(
"top_linkbar");
2314 $this->tpl->setVariable(
"LINKBAR", $linkbar);
2315 $this->tpl->parseCurrentBlock();
2319 $this->tpl->setVariable(
"COLUMN_SELECTOR", $column_selector);
2323 is_object($ilUser) &&
2327 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2330 $alist->setId(
"sellst_rows_".$this->
getId());
2331 $hpp = ($ilUser->getPref(
"hits_per_page") != 9999)
2332 ? $ilUser->getPref(
"hits_per_page")
2333 : $lng->txt(
"unlimited");
2335 $options = array(0 => $lng->txt(
"default").
" (".$hpp.
")",5 => 5, 10 => 10, 15 => 15, 20 => 20,
2336 30 => 30, 40 => 40, 50 => 50,
2337 100 => 100, 200 => 200, 400 => 400, 800 => 800);
2340 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_trows", $k);
2341 $alist->addItem($v, $k, $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
2342 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_trows",
"");
2345 $this->tpl->setVariable(
"ROW_SELECTOR", $alist->getHTML());
2349 if(
sizeof($this->export_formats) && $this->
dataExists())
2351 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
2354 $alist->setId(
"sellst_xpt");
2355 foreach($this->export_formats as $format => $caption_lng_id)
2357 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_xpt", $format);
2358 $url = $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd);
2359 $ilCtrl->setParameter($this->parent_obj, $this->prefix.
"_xpt",
"");
2360 $alist->addItem($lng->txt($caption_lng_id), $format, $url);
2362 $alist->setListTitle($lng->txt(
"export"));
2363 $this->tpl->setVariable(
"EXPORT_SELECTOR",
" ".$alist->getHTML());
2366 $this->tpl->setCurrentBlock(
"top_navigation");
2367 $this->tpl->setVariable(
"COLUMN_COUNT", $this->
getColumnCount());
2370 $this->tpl->setVariable(
"BLK_CLASS",
"Block");
2372 $this->tpl->parseCurrentBlock();
2389 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
2391 $hash =
"#".$this->getTopAnchor();
2394 $link = $ilCtrl->getLinkTargetByClass(get_class($this->parent_obj), $this->parent_cmd).
2395 "&".$this->getNavParameter().
"=".
2399 $layout_prev = $lng->txt(
"previous");
2400 $layout_next = $lng->txt(
"next");
2403 if ($this->max_count > $this->
getLimit() || $this->custom_prev_next)
2405 $sep =
"<span> | </span>";
2408 $pages = intval($this->max_count / $this->
getLimit());
2411 if (($this->max_count % $this->
getLimit()))
2415 $offset_arr = array();
2416 for ($i = 1 ;$i <= $pages ; $i++)
2418 $newoffset = $this->
getLimit() * ($i-1);
2421 $offset_arr[$nav_value] = $i;
2424 $sep =
"<span> </span>";
2427 if ($this->custom_prev_next && $this->custom_prev !=
"")
2431 $LinkBar .=
"<a href=\"".$this->custom_prev.$hash.
"\">".$layout_prev.
"</a>";
2433 else if ($this->
getOffset() >= 1 && !$this->custom_prev_next)
2438 $LinkBar .=
"<a href=\"".$link.$prevoffset.$hash.
"\">".$layout_prev.
"</a>";
2444 $LinkBar .=
'<span class="ilTableFootLight">'.$layout_prev.
"</span>";
2450 $LinkBar .=
'<input type="hidden" name="'.$this->getNavParameter().
2454 $sep =
"<span> | </span>";
2457 if ($this->custom_prev_next && $this->custom_next !=
"")
2461 $LinkBar .=
"<a href=\"".$this->custom_next.$hash.
"\">".$layout_next.
"</a>";
2463 else if (! ( ($this->
getOffset() / $this->
getLimit())==($pages-1) ) && ($pages!=1) &&
2464 !$this->custom_prev_next)
2469 $LinkBar .=
"<a href=\"".$link.$newoffset.$hash.
"\">".$layout_next.
"</a>";
2475 $LinkBar .=
'<span class="ilTableFootLight">'.$layout_next.
"</span>";
2478 $sep =
"<span> </span>";
2480 if (count($offset_arr) && !$this->
getDisplayAsBlock() && !$this->custom_prev_next)
2485 '<label for="tab_page_sel_'.$a_num.
'">'.$lng->txt(
"page").
'</label> '.
2487 $this->
getNavParameter().$a_num, $offset_arr,
false,
true, 0,
"small",
2488 array(
"id" =>
"tab_page_sel_".$a_num,
2489 "onchange" =>
"ilTablePageSelection(this, 'cmd[".$this->parent_cmd.
"]')"));
2504 $hidden_row =
false;
2505 if(count($this->hidden_inputs))
2507 foreach ($this->hidden_inputs as $hidden_input)
2509 $this->tpl->setCurrentBlock(
"tbl_hidden_field");
2510 $this->tpl->setVariable(
"FIELD_NAME", $hidden_input[
"name"]);
2511 $this->tpl->setVariable(
"FIELD_VALUE", $hidden_input[
"value"]);
2512 $this->tpl->parseCurrentBlock();
2515 $this->tpl->setCurrentBlock(
"tbl_hidden_row");
2516 $this->tpl->parseCurrentBlock();
2528 $action_row =
false;
2532 if (count($this->sel_buttons) > 0)
2534 foreach ($this->sel_buttons as $button)
2536 $this->tpl->setCurrentBlock(
"sel_button");
2537 $this->tpl->setVariable(
"SBUTTON_SELECT",
2539 $button[
"options"],
false,
true));
2540 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2541 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2542 $this->tpl->parseCurrentBlock();
2546 $this->tpl->setCurrentBlock(
"sel_top_button");
2547 $this->tpl->setVariable(
"SBUTTON_SELECT",
2549 $button[
"options"],
false,
true));
2550 $this->tpl->setVariable(
"SBTN_NAME", $button[
"cmd"]);
2551 $this->tpl->setVariable(
"SBTN_VALUE", $button[
"text"]);
2552 $this->tpl->parseCurrentBlock();
2558 $this->sel_buttons[] = array(
"options" => $a_options,
"cmd" => $a_cmd,
"text" => $a_text);
2561 if (count($this->buttons) > 0)
2563 foreach ($this->buttons as $button)
2565 if(!is_array($button))
2569 $this->tpl->setVariable(
'BUTTON_OBJ', $button->render());
2572 $button = clone $button;
2574 $this->tpl->setVariable(
'BUTTON_TOP_OBJ', $button->render());
2579 if (strlen($button[
'onclick']))
2581 $this->tpl->setCurrentBlock(
'cmdonclick');
2582 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2583 $this->tpl->parseCurrentBlock();
2585 $this->tpl->setCurrentBlock(
"plain_button");
2586 if ($button[
"id"] !=
"")
2588 $this->tpl->setVariable(
"PBID",
' id="'.$button[
"id"].
'" ');
2590 if ($button[
"class"] !=
"")
2592 $this->tpl->setVariable(
"PBBT_CLASS",
' '.$button[
"class"]);
2594 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2595 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2596 $this->tpl->parseCurrentBlock();
2600 if (strlen($button[
'onclick']))
2602 $this->tpl->setCurrentBlock(
'top_cmdonclick');
2603 $this->tpl->setVariable(
'CMD_ONCLICK', $button[
'onclick']);
2604 $this->tpl->parseCurrentBlock();
2606 $this->tpl->setCurrentBlock(
"plain_top_button");
2607 $this->tpl->setVariable(
"PBTN_NAME", $button[
"cmd"]);
2608 $this->tpl->setVariable(
"PBTN_VALUE", $button[
"text"]);
2609 if ($button[
"class"] !=
"")
2611 $this->tpl->setVariable(
"PBBT_CLASS",
' '.$button[
"class"]);
2613 $this->tpl->parseCurrentBlock();
2622 if(count($this->mi_sel_buttons))
2624 foreach ($this->mi_sel_buttons as $button)
2626 $this->tpl->setCurrentBlock(
"mi_sel_button");
2627 $this->tpl->setVariable(
"MI_BUTTON_SELECT",
2629 $button[
"options"],
false,
true));
2630 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2631 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2632 $this->tpl->parseCurrentBlock();
2636 $this->tpl->setCurrentBlock(
"mi_top_sel_button");
2637 $this->tpl->setVariable(
"MI_BUTTON_SELECT",
2639 $button[
"options"],
false,
true));
2640 $this->tpl->setVariable(
"MI_BTN_NAME", $button[
"cmd"]);
2641 $this->tpl->setVariable(
"MI_BTN_VALUE", $button[
"text"]);
2642 $this->tpl->parseCurrentBlock();
2651 if (count($this->multi) > 1 && $this->
dataExists())
2653 if($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit())
2655 $this->tpl->setCurrentBlock(
"tbl_cmd_select_all");
2656 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", $lng->txt(
"all_objects"));
2657 $this->tpl->parseCurrentBlock();
2660 $this->tpl->setCurrentBlock(
"tbl_cmd_select");
2662 foreach ($this->multi as $mc)
2664 $sel[$mc[
"cmd"]] = $mc[
"text"];
2666 $this->tpl->setVariable(
"SELECT_CMDS",
2668 $this->tpl->setVariable(
"TXT_EXECUTE", $lng->txt(
"execute"));
2669 $this->tpl->parseCurrentBlock();
2675 if($this->enable_command_for_all && $this->max_count <= self::getAllCommandLimit())
2677 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select_all");
2678 $this->tpl->setVariable(
"TXT_SELECT_CMD_ALL", $lng->txt(
"all_objects"));
2679 $this->tpl->parseCurrentBlock();
2682 $this->tpl->setCurrentBlock(
"tbl_top_cmd_select");
2684 foreach ($this->multi as $mc)
2686 $sel[$mc[
"cmd"]] = $mc[
"text"];
2688 $this->tpl->setVariable(
"SELECT_CMDS",
2690 $this->tpl->setVariable(
"TXT_EXECUTE", $lng->txt(
"execute"));
2691 $this->tpl->parseCurrentBlock();
2694 elseif(count($this->multi) == 1 && $this->
dataExists())
2696 $this->tpl->setCurrentBlock(
"tbl_single_cmd");
2698 foreach ($this->multi as $mc)
2703 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2704 $this->tpl->setVariable(
"SINGLE_CMD",
$cmd);
2705 $this->tpl->parseCurrentBlock();
2711 $this->tpl->setCurrentBlock(
"tbl_top_single_cmd");
2713 foreach ($this->multi as $mc)
2718 $this->tpl->setVariable(
"TXT_SINGLE_CMD",
$txt);
2719 $this->tpl->setVariable(
"SINGLE_CMD",
$cmd);
2720 $this->tpl->parseCurrentBlock();
2726 $this->tpl->setCurrentBlock(
"tbl_action_img_arrow");
2728 $this->tpl->setVariable(
"ALT_ARROW", $lng->txt(
"action"));
2729 $this->tpl->parseCurrentBlock();
2733 $this->tpl->setCurrentBlock(
"tbl_top_action_img_arrow");
2735 $this->tpl->setVariable(
"ALT_ARROW", $lng->txt(
"action"));
2736 $this->tpl->parseCurrentBlock();
2742 $this->tpl->setCurrentBlock(
"tbl_action_row");
2743 $this->tpl->parseCurrentBlock();
2746 $this->tpl->setCurrentBlock(
"tbl_top_action_row");
2747 $this->tpl->parseCurrentBlock();
2759 $this->headerHTML = $html;
2772 if(is_object($ilUser) && $this->
getId() !=
"")
2774 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
2777 $tab_prop->storeProperty($this->
getId(), $ilUser->getId(), $type, $value);
2791 if(is_object($ilUser) && $this->
getId() !=
"")
2793 include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
2796 return $tab_prop->getProperty($this->
getId(), $ilUser->getId(), $type);
2828 foreach($this->filters as $item)
2833 if($this->optional_filters &&
$result[
"selfilters"])
2835 foreach($this->optional_filters as $item)
2837 if(in_array($item->getFieldId(),
$result[
"selfilters"]))
2855 if(method_exists($a_item,
"getChecked"))
2857 return $a_item->getChecked();
2859 else if(method_exists($a_item,
"getValue"))
2861 return $a_item->getValue();
2863 else if(method_exists($a_item,
"getDate"))
2877 if(method_exists($a_item,
"setChecked"))
2879 $a_item->setChecked($a_value);
2881 else if(method_exists($a_item,
"setValue"))
2883 $a_item->setValue($a_value);
2885 else if(method_exists($a_item,
"setDate"))
2901 $this->context = $id;
2922 $this->show_rows_selector = (bool)$a_value;
2942 $this->show_templates = (bool)$a_value;
2967 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
2969 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
2972 $data = $storage->load($this->
getContext(), $ilUser->getId(), $a_name);
2975 foreach(
$data as $property => $value)
2981 $data[
"filter_values"] = unserialize(
$data[
"filter_values"]);
2982 if(
$data[
"filter_values"])
2984 $this->restore_filter_values =
$data[
"filter_values"];
2987 $this->restore_filter =
true;
3006 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3008 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3012 $state[
"filter_values"] = serialize($state[
"filter_values"]);
3013 $state[
"selfields"] = serialize($state[
"selfields"]);
3014 $state[
"selfilters"] = serialize($state[
"selfilters"]);
3016 $storage->store($this->
getContext(), $ilUser->getId(), $a_name, $state);
3034 if(trim($a_name) && $this->
getContext() !=
"" && is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID)
3036 include_once(
"./Services/Table/classes/class.ilTableTemplatesStorage.php");
3038 $storage->delete($this->
getContext(), $ilUser->getId(), $a_name);
3075 $this->export_formats = array();
3078 $valid = array(self::EXPORT_EXCEL =>
"tbl_export_excel",
3079 self::EXPORT_CSV =>
"tbl_export_csv");
3081 foreach($formats as $format)
3083 if(array_key_exists($format,
$valid))
3085 $this->export_formats[$format] =
$valid[$format];
3096 $this->print_mode = (bool)$a_value;
3140 case self::EXPORT_EXCEL:
3141 include_once
"./Services/Excel/classes/class.ilExcelUtils.php";
3142 include_once
"./Services/Excel/classes/class.ilExcelWriterAdapter.php";
3144 $workbook = $adapter->getWorkbook();
3145 $worksheet = $workbook->addWorksheet();
3159 foreach($this->row_data as $set)
3169 case self::EXPORT_CSV:
3170 include_once
"./Services/Utilities/classes/class.ilCSVWriter.php";
3172 $csv->setSeparator(
";");
3177 foreach($this->row_data as $set)
3186 header(
"Content-type: text/comma-separated-values");
3187 header(
"Content-Disposition: attachment; filename=\"".
$filename.
"\"");
3188 header(
"Expires: 0");
3189 header(
"Cache-Control: must-revalidate, post-check=0,pre-check=0");
3190 header(
"Pragma: public");
3191 echo $csv->getCSVString();
3196 file_put_contents(
$filename, $csv->getCSVString());
3230 foreach ($this->column as $column)
3232 $title = strip_tags($column[
"text"]);
3235 $worksheet->write($a_row, $col,
$title);
3252 foreach ($a_set as $key => $value)
3254 if(is_array($value))
3256 $value = implode(
', ', $value);
3258 $a_worksheet->write($a_row, $col, strip_tags($value));
3282 foreach ($this->column as $column)
3284 $title = strip_tags($column[
"text"]);
3287 $a_csv->addColumn(
$title);
3302 foreach ($a_set as $key => $value)
3304 if(is_array($value))
3306 $value = implode(
', ', $value);
3308 $a_csv->addColumn(strip_tags($value));
3320 $this->enable_command_for_all = (bool)$a_value;
3330 global $ilClientIniFile;
3332 $limit = $ilClientIniFile->readVariable(
"system",
"TABLE_ACTION_ALL_LIMIT");
3365 $this->prevent_double_submission = $a_val;