ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTable2GUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once("Services/Table/classes/class.ilTableGUI.php");
5 
15 class ilTable2GUI extends ilTableGUI
16 {
17  protected $close_command = "";
18  private $unique_id;
19  private $headerHTML;
20  protected $top_anchor = "il_table_top";
21  protected $filters = array();
22  protected $optional_filters = array();
23  protected $filter_cmd = 'applyFilter';
24  protected $reset_cmd = 'resetFilter';
25  protected $filter_cols = 4;
26  protected $ext_sort = false;
27  protected $ext_seg = false;
28 
29  protected $mi_sel_buttons = null;
30  protected $disable_filter_hiding = false;
31  protected $top_commands = false;
32 
37  public function __construct($a_parent_obj, $a_parent_cmd = "")
38  {
39  global $ilUser;
40 
41  parent::__construct(0, false);
42  $this->unique_id = md5(uniqid());
43  $this->parent_obj = $a_parent_obj;
44  $this->parent_cmd = $a_parent_cmd;
45  $this->buttons = array();
46  $this->header_commands = array();
47  $this->multi = array();
48  $this->hidden_inputs = array();
49  $this->formname = "table_" . $this->unique_id;
50  $this->tpl = new ilTemplate("tpl.table2.html", true, true, "Services/Table");
51 
52  if (is_object($ilUser))
53  {
54  $this->setLimit($ilUser->getPref("hits_per_page"));
55  }
56  $this->setIsDataTable(true);
57  $this->setEnableNumInfo(true);
58  }
59 
60 
64  function &executeCommand()
65  {
66  global $ilCtrl;
67 
68  $next_class = $ilCtrl->getNextClass($this);
69  $cmd = $ilCtrl->getCmd();
70 
71  switch($next_class)
72  {
73  case 'ilformpropertydispatchgui':
74  include_once './Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
75  $form_prop_dispatch = new ilFormPropertyDispatchGUI();
76  $this->initFilter();
77  $item = $this->getFilterItemByPostVar($_GET["postvar"]);
78  $form_prop_dispatch->setItem($item);
79  return $ilCtrl->forwardCommand($form_prop_dispatch);
80  break;
81 
82  }
83  return false;
84  }
85 
89  function resetOffset($a_in_determination = false)
90  {
91  if (!$this->nav_determined && !$a_in_determination)
92  {
93  $this->determineOffsetAndOrder();
94  }
95  $this->nav_value = $this->getOrderField().":".$this->getOrderDirection().":0";
96  $_GET[$this->getNavParameter()] =
97  $_POST[$this->getNavParameter()."1"] =
98  $this->nav_value;
99 //echo $this->nav_value;
100  $this->setOffset(0);
101  }
102 
107  function initFilter()
108  {
109  }
110 
116  public function getParentObject()
117  {
118  return $this->parent_obj;
119  }
120 
126  public function getParentCmd()
127  {
128  return $this->parent_cmd;
129  }
130 
136  function setTopAnchor($a_val)
137  {
138  $this->top_anchor = $a_val;
139  }
140 
146  function getTopAnchor()
147  {
148  return $this->top_anchor;
149  }
150 
156  function setNoEntriesText($a_text)
157  {
158  $this->noentriestext = $a_text;
159  }
160 
166  function getNoEntriesText()
167  {
168  return $this->noentriestext;
169  }
170 
176  function setIsDataTable($a_val)
177  {
178  $this->datatable = $a_val;
179  }
180 
186  function getIsDataTable()
187  {
188  return $this->datatable;
189  }
190 
196  function setEnableTitle($a_enabletitle)
197  {
198  $this->enabled["title"] = $a_enabletitle;
199  }
200 
206  function getEnableTitle()
207  {
208  return $this->enabled["title"];
209  }
210 
216  function setEnableHeader($a_enableheader)
217  {
218  $this->enabled["header"] = $a_enableheader;
219  }
220 
226  function getEnableHeader()
227  {
228  return $this->enabled["header"];
229  }
230 
236  function setEnableNumInfo($a_val)
237  {
238  $this->num_info = $a_val;
239  }
240 
246  function getEnableNumInfo()
247  {
248  return $this->num_info;
249  }
250 
254  final public function setTitle($a_title, $a_icon = 0, $a_icon_alt = 0)
255  {
256  parent::setTitle($a_title, $a_icon, $a_icon_alt);
257  }
258 
264  function setDescription($a_val)
265  {
266  $this->description = $a_val;
267  }
268 
274  function getDescription()
275  {
276  return $this->description;
277  }
278 
284  function setOrderField($a_order_field)
285  {
286  $this->order_field = $a_order_field;
287  }
288 
289  function getOrderField()
290  {
291  return $this->order_field;
292  }
293 
294  final public function setData($a_data)
295  {
296  $this->row_data = $a_data;
297  }
298 
299  final public function getData()
300  {
301  return $this->row_data;
302  }
303 
304  final public function dataExists()
305  {
306  if (is_array($this->row_data))
307  {
308  if (count($this->row_data) > 0)
309  {
310  return true;
311  }
312  }
313  return false;
314  }
315 
316  final public function setPrefix($a_prefix)
317  {
318  $this->prefix = $a_prefix;
319  }
320 
321  final public function getPrefix()
322  {
323  return $this->prefix;
324  }
325 
330  final function addFilterItem($a_input_item, $a_optional = false)
331  {
332  $a_input_item->setParent($this);
333  if (!$a_optional)
334  {
335  $this->filters[] = $a_input_item;
336  }
337  else
338  {
339  $this->optional_filters[] = $a_input_item;
340  }
341  }
342 
346  final function getFilterItems($a_optionals = false)
347  {
348  if (!$a_optionals)
349  {
350  return $this->filters;
351  }
353  }
354 
355  final function getFilterItemByPostVar($a_post_var)
356  {
357  foreach ($this->getFilterItems() as $item)
358  {
359  if ($item->getPostVar() == $a_post_var)
360  {
361  return $item;
362  }
363  }
364  foreach ($this->getFilterItems(true) as $item)
365  {
366  if ($item->getPostVar() == $a_post_var)
367  {
368  return $item;
369  }
370  }
371  return false;
372  }
373 
379  function setFilterCols($a_val)
380  {
381  $this->filter_cols = $a_val;
382  }
383 
389  function getFilterCols()
390  {
391  return $this->filter_cols;
392  }
393 
399  function setDisableFilterHiding($a_val = true)
400  {
401  $this->disable_filter_hiding = $a_val;
402  }
403 
410  {
412  }
413 
417  function setCustomPreviousNext($a_prev_link, $a_next_link)
418  {
419  $this->custom_prev_next = true;
420  $this->custom_prev = $a_prev_link;
421  $this->custom_next = $a_next_link;
422  }
423 
424 
430  final public function setFormAction($a_form_action)
431  {
432  $this->form_action = $a_form_action;
433  }
434 
440  final public function getFormAction()
441  {
442  return $this->form_action;
443  }
444 
450  function setFormName($a_formname)
451  {
452  $this->formname = $a_formname;
453  }
454 
460  function getFormName()
461  {
462  return $this->formname;
463  }
464 
470  function setId($a_val)
471  {
472  $this->id = $a_val;
473  if ($this->getPrefix() == "")
474  {
475  $this->setPrefix($a_val);
476  }
477  }
478 
484  function getId()
485  {
486  return $this->id;
487  }
488 
494  function setDisplayAsBlock($a_val)
495  {
496  $this->display_as_block = $a_val;
497  }
498 
504  function getDisplayAsBlock()
505  {
506  return $this->display_as_block;
507  }
508 
515  {
517  }
518 
524  function setSelectAllCheckbox($a_select_all_checkbox)
525  {
526  $this->select_all_checkbox = $a_select_all_checkbox;
527  }
528 
534  function setExternalSorting($a_val)
535  {
536  $this->ext_sort = $a_val;
537  }
538 
545  {
546  return $this->ext_sort;
547  }
548 
554  function setFilterCommand($a_val)
555  {
556  $this->filter_cmd = $a_val;
557  }
558 
564  function getFilterCommand()
565  {
566  return $this->filter_cmd;
567  }
568 
574  function setResetCommand($a_val)
575  {
576  $this->reset_cmd = $a_val;
577  }
578 
584  function getResetCommand()
585  {
586  return $this->reset_cmd;
587  }
588 
594  function setExternalSegmentation($a_val)
595  {
596  $this->ext_seg = $a_val;
597  }
598 
605  {
606  return $this->ext_seg;
607  }
608 
615  final public function setRowTemplate($a_template, $a_template_dir = "")
616  {
617  $this->row_template = $a_template;
618  $this->row_template_dir = $a_template_dir;
619  }
620 
626  function setDefaultOrderField($a_defaultorderfield)
627  {
628  $this->defaultorderfield = $a_defaultorderfield;
629  }
630 
637  {
638  return $this->defaultorderfield;
639  }
640 
646  function setDefaultOrderDirection($a_defaultorderdirection)
647  {
648  $this->defaultorderdirection = $a_defaultorderdirection;
649  }
650 
657  {
658  return $this->defaultorderdirection;
659  }
660 
661  /*
662  * Removes all command buttons from the table
663  *
664  * @access public
665  */
666  public function clearCommandButtons()
667  {
668  $this->buttons = array();
669  }
670 
677  function addCommandButton($a_cmd, $a_text, $a_onclick = '')
678  {
679  $this->buttons[] = array("cmd" => $a_cmd, "text" => $a_text, 'onclick' => $a_onclick);
680  }
681 
690  function addSelectionButton($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection = '')
691  {
692  $this->sel_buttons[] = array("sel_var" => $a_sel_var, "options" => $a_options, "selected" => $a_default_selection, "cmd" => $a_cmd, "text" => $a_text);
693  }
694 
704  public function addMultiItemSelectionButton($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection = '')
705  {
706  $this->mi_sel_buttons[] = array("sel_var" => $a_sel_var, "options" => $a_options, "selected" => $a_default_selection, "cmd" => $a_cmd, "text" => $a_text);
707  }
708 
709 
710 
716  function setCloseCommand($a_link)
717  {
718  $this->close_command = $a_link;
719  }
720 
727  function addMultiCommand($a_cmd, $a_text)
728  {
729  $this->multi[] = array("cmd" => $a_cmd, "text" => $a_text);
730  }
731 
738  public function addHiddenInput($a_name, $a_value)
739  {
740  $this->hidden_inputs[] = array("name" => $a_name, "value" => $a_value);
741  }
742 
749  function addHeaderCommand($a_href, $a_text, $a_target = "", $a_img = "")
750  {
751  $this->header_commands[] = array("href" => $a_href, "text" => $a_text,
752  "target" => $a_target, "img" => $a_img);
753  }
754 
760  function setTopCommands($a_val)
761  {
762  $this->top_commands = $a_val;
763  }
764 
770  function getTopCommands()
771  {
772  return $this->top_commands;
773  }
774 
782  final public function addColumn($a_text, $a_sort_field = "", $a_width = "",
783  $a_is_checkbox_action_column = false, $a_class = "")
784  {
785  $this->column[] = array(
786  "text" => $a_text,
787  "sort_field" => $a_sort_field,
788  "width" => $a_width,
789  "is_checkbox_action_column" => $a_is_checkbox_action_column,
790  "class" => $a_class
791  );
792  $this->column_count = count($this->column);
793  }
794 
795  final public function getNavParameter()
796  {
797  return $this->prefix."_table_nav";
798  }
799 
800  function setOrderLink($sort_field, $order_dir)
801  {
802  global $ilCtrl, $ilUser;
803 
804  $hash = "";
805  if (is_object($ilUser) && $ilUser->prefs["screen_reader_optimization"])
806  {
807  $hash = "#".$this->getTopAnchor();
808  }
809 
810  $old = $_GET[$this->getNavParameter()];
811 
812  // set order link
813  $ilCtrl->setParameter($this->parent_obj,
814  $this->getNavParameter(),
815  $sort_field.":".$order_dir.":".$this->offset);
816  $this->tpl->setVariable("TBL_ORDER_LINK",
817  $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd).$hash);
818 
819  // set old value of nav variable
820  $ilCtrl->setParameter($this->parent_obj,
821  $this->getNavParameter(), $old);
822  }
823 
824  function fillHeader()
825  {
826  global $lng;
827 
828  $allcolumnswithwidth = true;
829  foreach ($this->column as $column)
830  {
831  if (!strlen($column["width"])) $allcolumnswithwidth = false;
832  }
833  if ($allcolumnswithwidth)
834  {
835  foreach ($this->column as $column)
836  {
837  $this->tpl->setCurrentBlock("tbl_colgroup_column");
838  $this->tpl->setVariable("COLGROUP_COLUMN_WIDTH", $column["width"]);
839  $this->tpl->parseCurrentBlock();
840  }
841  }
842  foreach ($this->column as $column)
843  {
844  if (!$this->enabled["sort"] || $column["sort_field"] == "" || $column["is_checkbox_action_column"])
845  {
846  $this->tpl->setCurrentBlock("tbl_header_no_link");
847  if ($column["width"] != "")
848  {
849  $this->tpl->setVariable("TBL_COLUMN_WIDTH_NO_LINK"," width=\"".$column["width"]."\"");
850  }
851  if (!$column["is_checkbox_action_column"])
852  {
853  $this->tpl->setVariable("TBL_HEADER_CELL_NO_LINK",
854  $column["text"]);
855  }
856  else
857  {
858  $this->tpl->setVariable("TBL_HEADER_CELL_NO_LINK",
859  ilUtil::img(ilUtil::getImagePath("spacer.gif"), $lng->txt("action")));
860  }
861 
862  if ($column["class"] != "")
863  {
864  $this->tpl->setVariable("TBL_HEADER_CLASS"," " . $column["class"]);
865  }
866  $this->tpl->parseCurrentBlock();
867  $this->tpl->touchBlock("tbl_header_th");
868  continue;
869  }
870  if (($column["sort_field"] == $this->order_field) && ($this->order_direction != ""))
871  {
872  $this->tpl->setCurrentBlock("tbl_order_image");
873  $this->tpl->setVariable("IMG_ORDER_DIR",ilUtil::getImagePath($this->order_direction."_order.gif"));
874  $this->tpl->setVariable("IMG_ORDER_ALT", $this->lng->txt("change_sort_direction"));
875  $this->tpl->parseCurrentBlock();
876  }
877 
878  $this->tpl->setCurrentBlock("tbl_header_cell");
879  $this->tpl->setVariable("TBL_HEADER_CELL", $column["text"]);
880 
881  // only set width if a value is given for that column
882  if ($column["width"] != "")
883  {
884  $this->tpl->setVariable("TBL_COLUMN_WIDTH"," width=\"".$column["width"]."\"");
885  }
886 
887  $lng_sort_column = $this->lng->txt("sort_by_this_column");
888  $this->tpl->setVariable("TBL_ORDER_ALT",$lng_sort_column);
889 
890  $order_dir = "asc";
891 
892  if ($column["sort_field"] == $this->order_field)
893  {
894  $order_dir = $this->sort_order;
895 
896  $lng_change_sort = $this->lng->txt("change_sort_direction");
897  $this->tpl->setVariable("TBL_ORDER_ALT",$lng_change_sort);
898  }
899 
900  if ($column["class"] != "")
901  {
902  $this->tpl->setVariable("TBL_HEADER_CLASS"," " . $column["class"]);
903  }
904  $this->setOrderLink($column["sort_field"], $order_dir);
905  $this->tpl->parseCurrentBlock();
906  $this->tpl->touchBlock("tbl_header_th");
907  }
908 
909  $this->tpl->setCurrentBlock("tbl_header");
910  $this->tpl->parseCurrentBlock();
911  }
912 
916  protected function prepareOutput()
917  {
918  }
919 
920 
924  function determineOffsetAndOrder($a_omit_offset = false)
925  {
926  global $ilUser;
927 
928 //echo "<br>";
929 
930  if ($_POST[$this->getNavParameter()."1"] != "")
931  {
932  if ($_POST[$this->getNavParameter()."1"] != $_POST[$this->getNavParameter()])
933  {
934 //echo "1";
935  $this->nav_value = $_POST[$this->getNavParameter()."1"];
936  }
937  else if ($_POST[$this->getNavParameter()."2"] != $_POST[$this->getNavParameter()])
938  {
939 //echo "2";
940  $this->nav_value = $_POST[$this->getNavParameter()."2"];
941  }
942  }
943  elseif($_GET[$this->getNavParameter()])
944  {
945 //echo "3";
946  $this->nav_value = $_GET[$this->getNavParameter()];
947  }
948  elseif($_SESSION[$this->getNavParameter()] != "")
949  {
950 //echo "4";
951  $this->nav_value = $_SESSION[$this->getNavParameter()];
952  }
953 
954  if ($this->nav_value == "" && $this->getId() != "" && $ilUser->getId() != ANONYMOUS_USER_ID)
955  {
956 //echo "5";
957  // get order and direction from db
958  include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
959  $tab_prop = new ilTablePropertiesStorage();
960  $this->nav_value =
961  $tab_prop->getProperty($this->getId(), $ilUser->getId(), "order").":".
962  $tab_prop->getProperty($this->getId(), $ilUser->getId(), "direction").":".
963  $tab_prop->getProperty($this->getId(), $ilUser->getId(), "offset");
964  }
965 //echo "+".$this->nav_value;
966  $nav = explode(":", $this->nav_value);
967 
968  // $nav[0] is order by
969  $this->setOrderField(($nav[0] != "") ? $nav[0] : $this->getDefaultOrderField());
970  $this->setOrderDirection(($nav[1] != "") ? $nav[1] : $this->getDefaultOrderDirection());
971  if (!$a_omit_offset)
972  {
973 //echo "-".$nav[2]."-".$this->max_count."-";
974  if (!$this->getExternalSegmentation() && $nav[2] >= $this->max_count)
975  {
976  $this->resetOffset(true);
977  }
978  else
979  {
980  $this->setOffset($nav[2]);
981  }
982  }
983 
984  $this->nav_determined = true;
985  }
986 
987  function storeNavParameter()
988  {
989  global $ilUser;
990 
991  if ($this->getId() != "" && $ilUser->getId() != ANONYMOUS_USER_ID)
992  {
993  include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
994  $tab_prop = new ilTablePropertiesStorage();
995  if ($this->getOrderField() != "")
996  {
997  $tab_prop->storeProperty($this->getId(), $ilUser->getId(), "order",
998  $this->getOrderField());
999  }
1000  if ($this->getOrderDirection() != "")
1001  {
1002  $tab_prop->storeProperty($this->getId(), $ilUser->getId(), "direction",
1003  $this->getOrderDirection());
1004  }
1005 //echo "-".$this->getOffset()."-";
1006  if ($this->getOffset() !== "")
1007  {
1008  $tab_prop->storeProperty($this->getId(), $ilUser->getId(), "offset",
1009  $this->getOffset());
1010  }
1011  }
1012  }
1013 
1014 
1018  final public function getHTML()
1019  {
1020  global $lng, $ilCtrl, $ilUser;
1021 
1022  $this->prepareOutput();
1023 
1024  if (is_object($ilCtrl) && $this->getId() == "")
1025  {
1026  $ilCtrl->saveParameter($this->getParentObject(), $this->getNavParameter());
1027  }
1028 
1029  if(!$this->enabled['content'])
1030  {
1031  return $this->render();
1032  }
1033 
1034  if (!$this->getExternalSegmentation())
1035  {
1036  $this->setMaxCount(count($this->row_data));
1037  }
1038 
1039  $this->determineOffsetAndOrder();
1040 
1041  $this->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
1042 
1043  // sort
1044  $data = $this->getData();
1045  if (!$this->getExternalSorting())
1046  {
1047  $data = ilUtil::sortArray($data, $this->getOrderField(),
1048  $this->getOrderDirection(), $this->numericOrdering($this->getOrderField()));
1049  }
1050 
1051  // slice
1052  if (!$this->getExternalSegmentation())
1053  {
1054  $data = array_slice($data, $this->getOffset(), $this->getLimit());
1055  }
1056 
1057  // fill rows
1058  if(count($data) > 0)
1059  {
1060  $this->tpl->addBlockFile("TBL_CONTENT", "tbl_content", $this->row_template,
1061  $this->row_template_dir);
1062 
1063  foreach($data as $set)
1064  {
1065  $this->tpl->setCurrentBlock("tbl_content");
1066  $this->css_row = ($this->css_row != "tblrow1")
1067  ? "tblrow1"
1068  : "tblrow2";
1069  $this->tpl->setVariable("CSS_ROW", $this->css_row);
1070 
1071  $this->fillRow($set);
1072  $this->tpl->setCurrentBlock("tbl_content");
1073  $this->tpl->parseCurrentBlock();
1074  }
1075  }
1076  else
1077  {
1078  // add standard no items text (please tell me, if it messes something up, alex, 29.8.2008)
1079  $no_items_text = (trim($this->getNoEntriesText()) != '')
1080  ? $this->getNoEntriesText()
1081  : $lng->txt("no_items");
1082 
1083  $this->css_row = ($this->css_row != "tblrow1")
1084  ? "tblrow1"
1085  : "tblrow2";
1086 
1087  $this->tpl->setCurrentBlock("tbl_no_entries");
1088  $this->tpl->setVariable('TBL_NO_ENTRY_CSS_ROW', $this->css_row);
1089  $this->tpl->setVariable('TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
1090  $this->tpl->setVariable('TBL_NO_ENTRY_TEXT', trim($no_items_text));
1091  $this->tpl->parseCurrentBlock();
1092  }
1093 
1094  // set form action
1095  if ($this->form_action != "")
1096  {
1097  $hash = "";
1098  if (is_object($ilUser) && $ilUser->prefs["screen_reader_optimization"])
1099  {
1100  $hash = "#".$this->getTopAnchor();
1101  }
1102 
1103  $this->tpl->setCurrentBlock("tbl_form_header");
1104  $this->tpl->setVariable("FORMACTION", $this->getFormAction().$hash);
1105  $this->tpl->setVariable("FORMNAME", $this->getFormName());
1106  $this->tpl->parseCurrentBlock();
1107  $this->tpl->touchBlock("tbl_form_footer");
1108  }
1109 
1110  $this->fillFooter();
1111 
1112  $this->fillHiddenRow();
1113 
1114  $this->fillActionRow();
1115 
1116  $this->storeNavParameter();
1117 
1118  return $this->render();
1119  }
1120 
1126  function numericOrdering($a_field)
1127  {
1128  return false;
1129  }
1130 
1135  function render()
1136  {
1137  global $lng;
1138 
1139  $this->tpl->setVariable("CSS_TABLE",$this->getStyle("table"));
1140  $this->tpl->setVariable("DATA_TABLE", (int) $this->getIsDataTable());
1141  if ($this->getId() != "")
1142  {
1143  $this->tpl->setVariable("ID", 'id="'.$this->getId().'"');
1144  }
1145 
1146  // description
1147  if ($this->getDescription() != "")
1148  {
1149  $this->tpl->setCurrentBlock("tbl_header_description");
1150  $this->tpl->setVariable("TBL_DESCRIPTION", $this->getDescription());
1151  $this->tpl->parseCurrentBlock();
1152  }
1153 
1154  $this->renderFilter();
1155 
1156  if ($this->getDisplayAsBlock())
1157  {
1158  $this->tpl->touchBlock("outer_start_1");
1159  $this->tpl->touchBlock("outer_end_1");
1160  }
1161  else
1162  {
1163  $this->tpl->touchBlock("outer_start_2");
1164  $this->tpl->touchBlock("outer_end_2");
1165  }
1166 
1167  // table title and icon
1168  if ($this->enabled["title"] && ($this->title != ""
1169  || $this->icon != "" || count($this->header_commands) > 0 ||
1170  $this->headerHTML != "" || $this->close_command != ""))
1171  {
1172  if ($this->enabled["icon"])
1173  {
1174  $this->tpl->setCurrentBlock("tbl_header_title_icon");
1175  $this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath($this->icon));
1176  $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->icon_alt);
1177  $this->tpl->parseCurrentBlock();
1178  }
1179 
1180  foreach($this->header_commands as $command)
1181  {
1182  if ($command["img"] != "")
1183  {
1184  $this->tpl->setCurrentBlock("tbl_header_img_link");
1185  if ($command["target"] != "")
1186  {
1187  $this->tpl->setVariable("TARGET_IMG_LINK",
1188  'target="'.$command["target"].'"');
1189  }
1190  $this->tpl->setVariable("ALT_IMG_LINK", $command["text"]);
1191  $this->tpl->setVariable("HREF_IMG_LINK", $command["href"]);
1192  $this->tpl->setVariable("SRC_IMG_LINK",
1193  $command["img"]);
1194  $this->tpl->parseCurrentBlock();
1195  }
1196  else
1197  {
1198  $this->tpl->setCurrentBlock("head_cmd");
1199  $this->tpl->setVariable("TXT_HEAD_CMD", $command["text"]);
1200  $this->tpl->setVariable("HREF_HEAD_CMD", $command["href"]);
1201  $this->tpl->parseCurrentBlock();
1202  }
1203  }
1204 
1205  if (isset ($this->headerHTML)) {
1206  $this->tpl->setCurrentBlock("tbl_header_html");
1207  $this->tpl->setVariable ("HEADER_HTML", $this->headerHTML);
1208  $this->tpl->parseCurrentBlock();
1209  }
1210 
1211  // close command
1212  if ($this->close_command != "")
1213  {
1214  $this->tpl->setCurrentBlock("tbl_header_img_link");
1215  $this->tpl->setVariable("ALT_IMG_LINK",$lng->txt("close"));
1216  $this->tpl->setVariable("HREF_IMG_LINK",$this->close_command);
1217  $this->tpl->setVariable("SRC_IMG_LINK",ilUtil::getImagePath("icon_close2.gif"));
1218  $this->tpl->parseCurrentBlock();
1219  }
1220 
1221  $this->tpl->setCurrentBlock("tbl_header_title");
1222  $this->tpl->setVariable("TBL_TITLE",$this->title);
1223  $this->tpl->setVariable("TOP_ANCHOR",$this->getTopAnchor());
1224  if ($this->getDisplayAsBlock())
1225  {
1226  $this->tpl->setVariable("BLK_CLASS", "Block");
1227  }
1228  $this->tpl->parseCurrentBlock();
1229  }
1230 
1231  // table header
1232  if ($this->enabled["header"])
1233  {
1234  $this->fillHeader();
1235  }
1236 
1237  $this->tpl->touchBlock("tbl_table_end");
1238 
1239  return $this->tpl->get();
1240  }
1241 
1245  private function renderFilter()
1246  {
1247  global $lng, $tpl, $ilUser;
1248 
1249  $filter = $this->getFilterItems();
1250  $opt_filter = $this->getFilterItems(true);
1251 
1252  if (count($filter) == 0 && count($opt_filter) == 0)
1253  {
1254  return;
1255  }
1256 
1257  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
1259 
1260  $tpl->addJavascript("./Services/Table/js/ServiceTable.js");
1261 
1262  // render standard filter
1263  if (count($filter) > 0)
1264  {
1265  $ccnt = 0;
1266  foreach ($filter as $item)
1267  {
1268  if ($ccnt >= $this->getFilterCols())
1269  {
1270  $this->tpl->setCurrentBlock("filter_row");
1271  $this->tpl->parseCurrentBlock();
1272  $ccnt = 0;
1273  }
1274  $this->tpl->setCurrentBlock("filter_item");
1275  $this->tpl->setVariable("OPTION_NAME",
1276  $item->getTitle());
1277  $this->tpl->setVariable("F_INPUT_ID",
1278  $item->getFieldId());
1279  $this->tpl->setVariable("INPUT_HTML",
1280  $item->getTableFilterHTML());
1281  $this->tpl->parseCurrentBlock();
1282  $ccnt++;
1283  }
1284  if ($ccnt < $this->getFilterCols())
1285  {
1286  for($i = $ccnt; $i<=$this->getFilterCols(); $i++)
1287  {
1288  $this->tpl->touchBlock("filter_empty_cell");
1289  }
1290  }
1291  $this->tpl->setCurrentBlock("filter_row");
1292  $this->tpl->parseCurrentBlock();
1293 
1294  $this->tpl->setVariable("TXT_FILTER", $lng->txt("filter"));
1295  if (!$this->getDisableFilterHiding())
1296  {
1297  $this->tpl->setVariable("TXT_HIDE", $lng->txt("hide"));
1298  }
1299  $this->tpl->setVariable("CMD_APPLY", $this->filter_cmd);
1300  $this->tpl->setVariable("TXT_APPLY", $lng->txt("apply_filter"));
1301  $this->tpl->setVariable("CMD_RESET", $this->reset_cmd);
1302  $this->tpl->setVariable("TXT_RESET", $lng->txt("reset_filter"));
1303 
1304  $this->tpl->setCurrentBlock("filter_section");
1305  $this->tpl->setVariable("FIL_ID", $this->getId());
1306  if ($this->getId() != "")
1307  {
1308  $this->tpl->setVariable("SAVE_URL", "./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
1309  $this->getId()."&cmd=hideFilter&user_id=".$ilUser->getId());
1310  }
1311  $this->tpl->parseCurrentBlock();
1312 
1313  // filter hidden?
1314  include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
1315  $tprop = new ilTablePropertiesStorage();
1316  if ($tprop->getProperty($this->getId(), $ilUser->getId(), "filter") != 1)
1317  {
1318  if (!$this->getDisableFilterHiding())
1319  {
1320  $this->tpl->setCurrentBlock("filter_hidden");
1321  $this->tpl->setVariable("FI_ID", $this->getId());
1322  $this->tpl->parseCurrentBlock();
1323  }
1324  }
1325 
1326  $this->tpl->setCurrentBlock("filter_activation");
1327  $this->tpl->setVariable("TXT_ACTIVATE_FILTER", $lng->txt("show_filter"));
1328  $this->tpl->setVariable("FILA_ID", $this->getId());
1329  if ($this->getId() != "")
1330  {
1331  $this->tpl->setVariable("SAVE_URLA", "./ilias.php?baseClass=ilTablePropertiesStorage&table_id=".
1332  $this->getId()."&cmd=showFilter&user_id=".$ilUser->getId());
1333  }
1334  $this->tpl->parseCurrentBlock();
1335  }
1336  }
1337 
1341  public function writeFilterToSession()
1342  {
1343  global $lng;
1344 
1345  $filter = $this->getFilterItems();
1346  $opt_filter = $this->getFilterItems(true);
1347 
1348  foreach ($filter as $item)
1349  {
1350  if ($item->checkInput())
1351  {
1352  $item->setValueByArray($_POST);
1353  $item->writeToSession();
1354  }
1355  }
1356  foreach ($opt_filter as $item)
1357  {
1358  if ($item->checkInput())
1359  {
1360  $item->setValueByArray($_POST);
1361  $item->writeToSession();
1362  }
1363  }
1364  }
1365 
1369  public function resetFilter()
1370  {
1371  global $lng;
1372 
1373  $filter = $this->getFilterItems();
1374  $opt_filter = $this->getFilterItems(true);
1375 
1376  foreach ($filter as $item)
1377  {
1378  if ($item->checkInput())
1379  {
1380  $item->setValueByArray($_POST);
1381  $item->clearFromSession();
1382  }
1383  }
1384  foreach ($opt_filter as $item)
1385  {
1386  if ($item->checkInput())
1387  {
1388  $item->setValueByArray($_POST);
1389  $item->clearFromSession();
1390  }
1391  }
1392  }
1393 
1400  protected function fillRow($a_set)
1401  {
1402  foreach ($a_set as $key => $value)
1403  {
1404  $this->tpl->setVariable("VAL_".strtoupper($key), $value);
1405  }
1406  }
1407 
1411  function fillFooter()
1412  {
1413  global $lng, $ilCtrl;
1414 
1415  $footer = false;
1416 
1417  // select all checkbox
1418  if ((strlen($this->getFormName())) && (strlen($this->getSelectAllCheckbox())) && $this->dataExists())
1419  {
1420  $this->tpl->setCurrentBlock("select_all_checkbox");
1421  $this->tpl->setVariable("SELECT_ALL_TXT_SELECT_ALL", $lng->txt("select_all"));
1422  $this->tpl->setVariable("SELECT_ALL_CHECKBOX_NAME", $this->getSelectAllCheckbox());
1423  $this->tpl->setVariable("SELECT_ALL_FORM_NAME", $this->getFormName());
1424  $this->tpl->setVariable("CHECKBOXNAME", "chb_select_all_" . $this->unique_id);
1425  $this->tpl->parseCurrentBlock();
1426  }
1427 
1428  // table footer numinfo
1429  if ($this->enabled["numinfo"] && $this->enabled["footer"])
1430  {
1431  $start = $this->offset + 1; // compute num info
1432  if (!$this->dataExists())
1433  {
1434  $start = 0;
1435  }
1436  $end = $this->offset + $this->limit;
1437 
1438  if ($end > $this->max_count or $this->limit == 0)
1439  {
1440  $end = $this->max_count;
1441  }
1442 
1443  if ($this->max_count > 0)
1444  {
1445  if ($this->lang_support)
1446  {
1447  $numinfo = "(".$start." - ".$end." ".strtolower($this->lng->txt("of"))." ".$this->max_count.")";
1448  }
1449  else
1450  {
1451  $numinfo = "(".$start." - ".$end." of ".$this->max_count.")";
1452  }
1453  }
1454  if ($this->max_count > 0)
1455  {
1456  if ($this->getEnableNumInfo())
1457  {
1458  $this->tpl->setCurrentBlock("tbl_footer_numinfo");
1459  $this->tpl->setVariable("NUMINFO", $numinfo);
1460  $this->tpl->parseCurrentBlock();
1461  }
1462  }
1463  $footer = true;
1464  }
1465 
1466  // table footer linkbar
1467  if ($this->enabled["linkbar"] && $this->enabled["footer"] && $this->limit != 0
1468  && $this->max_count > 0)
1469  {
1470  $layout = array(
1471  "link" => $this->footer_style,
1472  "prev" => $this->footer_previous,
1473  "next" => $this->footer_next,
1474  );
1475  if (!$this->getDisplayAsBlock())
1476  {
1477  $linkbar = $this->getLinkbar("1");
1478  $this->tpl->setCurrentBlock("tbl_footer_linkbar");
1479  $this->tpl->setVariable("LINKBAR", $linkbar);
1480  $this->tpl->parseCurrentBlock();
1481  }
1482  $linkbar = true;
1483  $footer = true;
1484  }
1485 
1486  if ($footer)
1487  {
1488  $this->tpl->setCurrentBlock("tbl_footer");
1489  $this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount());
1490  if ($this->getDisplayAsBlock())
1491  {
1492  $this->tpl->setVariable("BLK_CLASS", "Block");
1493  }
1494  $this->tpl->parseCurrentBlock();
1495 
1496  // top navigation, if number info or linkbar given
1497  if ($numinfo != "" || $linkbar != "")
1498  {
1499  if ($numinfo != "" && $this->getEnableNumInfo())
1500  {
1501  $this->tpl->setCurrentBlock("top_numinfo");
1502  $this->tpl->setVariable("NUMINFO", $numinfo);
1503  $this->tpl->parseCurrentBlock();
1504  }
1505  if ($linkbar != "")
1506  {
1507  $linkbar = $this->getLinkbar("2");
1508  $this->tpl->setCurrentBlock("top_linkbar");
1509  $this->tpl->setVariable("LINKBAR", $linkbar);
1510  $this->tpl->parseCurrentBlock();
1511  }
1512  $this->tpl->setCurrentBlock("top_navigation");
1513  $this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount());
1514  if ($this->getDisplayAsBlock())
1515  {
1516  $this->tpl->setVariable("BLK_CLASS", "Block");
1517  }
1518  $this->tpl->parseCurrentBlock();
1519  }
1520  }
1521  }
1522 
1530  function getLinkbar($a_num)
1531  {
1532  global $ilCtrl, $lng, $ilUser;
1533 
1534  $hash = "";
1535  if (is_object($ilUser) && $ilUser->prefs["screen_reader_optimization"])
1536  {
1537  $hash = "#".$this->getTopAnchor();
1538  }
1539 
1540  $link = $ilCtrl->getLinkTargetByClass(get_class($this->parent_obj), $this->parent_cmd).
1541  "&".$this->getNavParameter()."=".
1542  $this->getOrderField().":".$this->getOrderDirection().":";
1543 
1544  $LinkBar = "";
1545  $layout_prev = $lng->txt("previous");
1546  $layout_next = $lng->txt("next");
1547 
1548  // if more entries then entries per page -> show link bar
1549  if ($this->max_count > $this->getLimit() || $this->custom_prev_next)
1550  {
1551  // previous link
1552  if ($this->custom_prev_next && $this->custom_prev != "")
1553  {
1554  $LinkBar .= "<a href=\"".$this->custom_prev.$hash."\">".$layout_prev."&nbsp;</a>";
1555  }
1556  else if ($this->getOffset() >= 1 && !$this->custom_prev_next)
1557  {
1558  $prevoffset = $this->getOffset() - $this->getLimit();
1559  $LinkBar .= "<a href=\"".$link.$prevoffset.$hash."\">".$layout_prev."&nbsp;</a>";
1560  }
1561  else
1562  {
1563  $LinkBar .= '<span class="ilTableFootLight">'.$layout_prev."&nbsp;</span>";
1564  }
1565 
1566  // current value
1567  if ($a_num == "1")
1568  {
1569  $LinkBar .= '<input type="hidden" name="'.$this->getNavParameter().
1570  '" value="'.$this->getOrderField().":".$this->getOrderDirection().":".$this->getOffset().'" />';
1571  }
1572 
1573  // calculate number of pages
1574  $pages = intval($this->max_count / $this->getLimit());
1575 
1576  // add a page if a rest remains
1577  if (($this->max_count % $this->getLimit()))
1578  $pages++;
1579 
1580  // links to other pages
1581  $offset_arr = array();
1582  for ($i = 1 ;$i <= $pages ; $i++)
1583  {
1584  $newoffset = $this->getLimit() * ($i-1);
1585 
1586  $nav_value = $this->getOrderField().":".$this->getOrderDirection().":".$newoffset;
1587  $offset_arr[$nav_value] = $i;
1588  if ($newoffset == $this->getOffset())
1589  {
1590  // $LinkBar .= "[".$i."] ";
1591  }
1592  else
1593  {
1594  // $LinkBar .= '<a '.$layout_link.' href="'.
1595  // $link.$newoffset.'">['.$i.']</a> ';
1596  }
1597  }
1598 
1599  // show next link (if not last page)
1600  if ($this->custom_prev_next && $this->custom_next != "")
1601  {
1602  if ($LinkBar != "")
1603  $LinkBar .= "<span> | </span>";
1604  $LinkBar .= "<a href=\"".$this->custom_next.$hash."\">&nbsp;".$layout_next."</a>";
1605  }
1606  else if (! ( ($this->getOffset() / $this->getLimit())==($pages-1) ) && ($pages!=1) &&
1607  !$this->custom_prev_next)
1608  {
1609  if ($LinkBar != "")
1610  $LinkBar .= "<span> | </span>";
1611  $newoffset = $this->getOffset() + $this->getLimit();
1612  $LinkBar .= "<a href=\"".$link.$newoffset.$hash."\">&nbsp;".$layout_next."</a>";
1613  }
1614  else
1615  {
1616  if ($LinkBar != "")
1617  $LinkBar .= "<span > | </span>";
1618  $LinkBar .= '<span class="ilTableFootLight">&nbsp;'.$layout_next."</span>";
1619  }
1620 
1621  if (count($offset_arr) && !$this->getDisplayAsBlock() && !$this->custom_prev_next)
1622  {
1623  $LinkBar .= "&nbsp;&nbsp;&nbsp;&nbsp;".
1624  '<label for="tab_page_sel_'.$a_num.'">'.$lng->txt("select_page").'</label> '.
1625  ilUtil::formSelect($this->nav_value,
1626  $this->getNavParameter().$a_num, $offset_arr, false, true, 0, "ilEditSelect",
1627  array("id" => "tab_page_sel_".$a_num)).
1628  ' <input class="ilEditSubmit" type="submit" name="cmd['.$this->parent_cmd.']" value="'.
1629  $lng->txt("ok").'" /> ';
1630  }
1631 
1632  return $LinkBar;
1633  }
1634  else
1635  {
1636  return false;
1637  }
1638  }
1639 
1640  function fillHiddenRow()
1641  {
1642  $hidden_row = false;
1643  if(count($this->hidden_inputs))
1644  {
1645  foreach ($this->hidden_inputs as $hidden_input)
1646  {
1647  $this->tpl->setCurrentBlock("tbl_hidden_field");
1648  $this->tpl->setVariable("FIELD_NAME", $hidden_input["name"]);
1649  $this->tpl->setVariable("FIELD_VALUE", $hidden_input["value"]);
1650  $this->tpl->parseCurrentBlock();
1651  }
1652 
1653  $this->tpl->setCurrentBlock("tbl_hidden_row");
1654  $this->tpl->parseCurrentBlock();
1655  }
1656  }
1657 
1661  function fillActionRow()
1662  {
1663  global $lng;
1664 
1665  // action row
1666  $action_row = false;
1667  $arrow = false;
1668 
1669  // add selection buttons
1670  if (count($this->sel_buttons) > 0)
1671  {
1672  foreach ($this->sel_buttons as $button)
1673  {
1674  $this->tpl->setCurrentBlock("sel_button");
1675  $this->tpl->setVariable("SBUTTON_SELECT",
1676  ilUtil::formSelect($button["selected"], $button["sel_var"],
1677  $button["options"], false, true));
1678  $this->tpl->setVariable("SBTN_NAME", $button["cmd"]);
1679  $this->tpl->setVariable("SBTN_VALUE", $button["text"]);
1680  $this->tpl->parseCurrentBlock();
1681 
1682  if ($this->getTopCommands())
1683  {
1684  $this->tpl->setCurrentBlock("sel_top_button");
1685  $this->tpl->setVariable("SBUTTON_SELECT",
1686  ilUtil::formSelect($button["selected"], $button["sel_var"],
1687  $button["options"], false, true));
1688  $this->tpl->setVariable("SBTN_NAME", $button["cmd"]);
1689  $this->tpl->setVariable("SBTN_VALUE", $button["text"]);
1690  $this->tpl->parseCurrentBlock();
1691  }
1692  }
1693  $buttons = true;
1694  $action_row = true;
1695  }
1696  $this->sel_buttons[] = array("options" => $a_options, "cmd" => $a_cmd, "text" => $a_text);
1697 
1698  // add buttons
1699  if (count($this->buttons) > 0)
1700  {
1701  foreach ($this->buttons as $button)
1702  {
1703  if (strlen($button['onclick']))
1704  {
1705  $this->tpl->setCurrentBlock('cmdonclick');
1706  $this->tpl->setVariable('CMD_ONCLICK', $button['onclick']);
1707  $this->tpl->parseCurrentBlock();
1708  }
1709  $this->tpl->setCurrentBlock("plain_button");
1710  $this->tpl->setVariable("PBTN_NAME", $button["cmd"]);
1711  $this->tpl->setVariable("PBTN_VALUE", $button["text"]);
1712  $this->tpl->parseCurrentBlock();
1713 
1714  if ($this->getTopCommands())
1715  {
1716  if (strlen($button['onclick']))
1717  {
1718  $this->tpl->setCurrentBlock('top_cmdonclick');
1719  $this->tpl->setVariable('CMD_ONCLICK', $button['onclick']);
1720  $this->tpl->parseCurrentBlock();
1721  }
1722  $this->tpl->setCurrentBlock("plain_top_button");
1723  $this->tpl->setVariable("PBTN_NAME", $button["cmd"]);
1724  $this->tpl->setVariable("PBTN_VALUE", $button["text"]);
1725  $this->tpl->parseCurrentBlock();
1726  }
1727  }
1728 
1729  $buttons = true;
1730  $action_row = true;
1731  }
1732 
1733  // multi selection
1734  if(count($this->mi_sel_buttons))
1735  {
1736  foreach ($this->mi_sel_buttons as $button)
1737  {
1738  $this->tpl->setCurrentBlock("mi_sel_button");
1739  $this->tpl->setVariable("MI_BUTTON_SELECT",
1740  ilUtil::formSelect($button["selected"], $button["sel_var"],
1741  $button["options"], false, true));
1742  $this->tpl->setVariable("MI_BTN_NAME", $button["cmd"]);
1743  $this->tpl->setVariable("MI_BTN_VALUE", $button["text"]);
1744  $this->tpl->parseCurrentBlock();
1745 
1746  if ($this->getTopCommands())
1747  {
1748  $this->tpl->setCurrentBlock("mi_top_sel_button");
1749  $this->tpl->setVariable("MI_BUTTON_SELECT",
1750  ilUtil::formSelect($button["selected"], $button["sel_var"],
1751  $button["options"], false, true));
1752  $this->tpl->setVariable("MI_BTN_NAME", $button["cmd"]);
1753  $this->tpl->setVariable("MI_BTN_VALUE", $button["text"]);
1754  $this->tpl->parseCurrentBlock();
1755  }
1756 
1757  }
1758  $arrow = true;
1759  $action_row = true;
1760  }
1761 
1762 
1763  if (count($this->multi) > 1 && $this->dataExists())
1764  {
1765  $this->tpl->setCurrentBlock("tbl_cmd_select");
1766  $sel = array();
1767  foreach ($this->multi as $mc)
1768  {
1769  $sel[$mc["cmd"]] = $mc["text"];
1770  }
1771  $this->tpl->setVariable("SELECT_CMDS",
1772  ilUtil::formSelect("", "selected_cmd", $sel, false, true));
1773  $this->tpl->setVariable("TXT_EXECUTE", $lng->txt("execute"));
1774  $this->tpl->parseCurrentBlock();
1775  $arrow = true;
1776  $action_row = true;
1777 
1778  if ($this->getTopCommands())
1779  {
1780  $this->tpl->setCurrentBlock("tbl_top_cmd_select");
1781  $sel = array();
1782  foreach ($this->multi as $mc)
1783  {
1784  $sel[$mc["cmd"]] = $mc["text"];
1785  }
1786  $this->tpl->setVariable("SELECT_CMDS",
1787  ilUtil::formSelect("", "selected_cmd2", $sel, false, true));
1788  $this->tpl->setVariable("TXT_EXECUTE", $lng->txt("execute"));
1789  $this->tpl->parseCurrentBlock();
1790  }
1791  }
1792  elseif(count($this->multi) == 1 && $this->dataExists())
1793  {
1794  $this->tpl->setCurrentBlock("tbl_single_cmd");
1795  $sel = array();
1796  foreach ($this->multi as $mc)
1797  {
1798  $cmd = $mc['cmd'];
1799  $txt = $mc['text'];
1800  }
1801  $this->tpl->setVariable("TXT_SINGLE_CMD",$txt);
1802  $this->tpl->setVariable("SINGLE_CMD",$cmd);
1803  $this->tpl->parseCurrentBlock();
1804  $arrow = true;
1805  $action_row = true;
1806 
1807  if ($this->getTopCommands())
1808  {
1809  $this->tpl->setCurrentBlock("tbl_top_single_cmd");
1810  $sel = array();
1811  foreach ($this->multi as $mc)
1812  {
1813  $cmd = $mc['cmd'];
1814  $txt = $mc['text'];
1815  }
1816  $this->tpl->setVariable("TXT_SINGLE_CMD",$txt);
1817  $this->tpl->setVariable("SINGLE_CMD",$cmd);
1818  $this->tpl->parseCurrentBlock();
1819  }
1820  }
1821 
1822  if ($arrow)
1823  {
1824  $this->tpl->setCurrentBlock("tbl_action_img_arrow");
1825  $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
1826  $this->tpl->setVariable("ALT_ARROW", $lng->txt("action"));
1827  $this->tpl->parseCurrentBlock();
1828 
1829  if ($this->getTopCommands())
1830  {
1831  $this->tpl->setCurrentBlock("tbl_top_action_img_arrow");
1832  $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_upright.gif"));
1833  $this->tpl->setVariable("ALT_ARROW", $lng->txt("action"));
1834  $this->tpl->parseCurrentBlock();
1835  }
1836  }
1837 
1838  if ($action_row)
1839  {
1840  $this->tpl->setCurrentBlock("tbl_action_row");
1841  $this->tpl->parseCurrentBlock();
1842  if ($this->getTopCommands())
1843  {
1844  $this->tpl->setCurrentBlock("tbl_top_action_row");
1845  $this->tpl->parseCurrentBlock();
1846  }
1847  }
1848  }
1849 
1856  public function setHeaderHTML($html)
1857  {
1858  $this->headerHTML = $html;
1859  }
1860 }
1861 ?>