ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTableGUI.php
Go to the documentation of this file.
1 <?php
2 
26 {
27  protected string $sort_order;
28  protected string $link_params;
29  protected array $header_params;
33  protected $tpl;
34  protected ilLanguage $lng;
35 
36  public string $title = ""; // table title name
37  public string $icon = ""; // table title icon
38  public string $icon_alt = ""; // table title icon alt text
39  public string $help_page = ""; // table help name
40  public string $help_icon = ""; // table help icon
41  public string $help_icon_alt = ""; // table help icon alt text
42  public array $header_names = []; // titles of header columns
43  public array $header_vars = []; // var names of header columns
44  public array $linkbar_vars = []; // additional variables for linkbar
45  public array $data = []; // table content
46  public int $column_count = 0; // no. of columns
47  public array $column_width = []; // column width of each column
48  public int $max_count = 0; // max. count of database query
49  public int $limit = 0; // max. count of dataset per page
50  public bool $max_limit = false;
51  public int $offset = 0; // dataset offset
52  public string $order_column = ""; // order column
53  public string $order_direction = ""; // order direction
54  public string $footer_style = ""; // css format for links
55  public string $footer_previous = ""; // value of previous link
56  public string $footer_next = ""; // value of next link
57  public bool $lang_support = true; // if a lang object is included
58  public bool $global_tpl = false; // uses global tpl (true) or a local one (false)
59  public string $form_name = ""; // the name of the parent form of the table
60  public string $select_all_checkbox = ""; // the name (or the first characters if unique) of a checkbox the should be toggled with a select all button
61  public array $action_buttons = []; // action buttons in the table footer
62 
63  public string $prefix = ""; // prefix for sort and offset fields if you have two or more tables on a page that you want to sort separately
64  public string $base = ""; // base script (deprecated)
65 
66  // default settings for enabled/disabled table modules
67  public array $enabled = array( "table" => true,
68  "title" => true,
69  "icon" => true,
70  "help" => false,
71  "content" => true,
72  "action" => false,
73  "header" => true,
74  "footer" => true,
75  "linkbar" => true,
76  "numinfo" => true,
77  "numinfo_header" => false,
78  "sort" => true,
79  "hits" => false,
80  "auto_sort" => true,
81  "select_all" => false
82  );
83 
84  // tpl styles (only one so far)
85  public array $styles = array(
86  "table" => "fullwidth"
87  );
88 
93  public function __construct(
94  array $a_data = [],
95  bool $a_global_tpl = true
96  ) {
97  global $DIC;
98 
99  $tpl = $DIC->ui()->mainTemplate();
100  $lng = $DIC->language();
101 
102  $this->global_tpl = $a_global_tpl;
103  $this->header_vars = array();
104  $this->header_params = array();
105  $this->enabled["form"] = true;
106  $this->action_buttons = array();
107  if ($this->global_tpl) {
108  $this->tpl = $tpl;
109  } else {
110  $this->tpl = new ilTemplate("tpl.table.html", true, true, "Services/Table");
111  }
112 
113  $this->lng = $lng;
114 
115  if (!$this->lng) {
116  $this->lang_support = false;
117  }
118 
119  $this->setData($a_data);
120  }
121 
122  public function setTemplate(ilTemplate $a_tpl): void
123  {
124  $this->tpl = $a_tpl;
125  }
126 
127  public function getTemplateObject(): ilTemplate
128  {
129  return $this->tpl;
130  }
131 
135  public function setData(array $a_data): void
136  {
137  $this->data = $a_data;
138  }
139 
140  public function getData(): array
141  {
142  return $this->data;
143  }
144 
150  public function setTitle(string $a_title, string $a_icon = "", string $a_icon_alt = ""): void
151  {
152  $this->title = $a_title;
153  $this->icon = $a_icon;
154  $this->icon_alt = $a_icon_alt;
155 
156  if (!$this->icon) {
157  $this->enabled["icon"] = false;
158 
159  return;
160  }
161 
162  if (!$this->icon_alt) {
163  $this->icon_alt = $this->icon;
164  }
165  $this->enabled["icon"] = true;
166  }
167 
168  public function setHelp(string $a_help_page, string $a_help_icon, string $a_help_icon_alt = ""): void
169  {
170  $this->help_page = $a_help_page;
171  $this->help_icon = $a_help_icon;
172  $this->help_icon_alt = $a_help_icon_alt;
173 
174  if (!$this->help_icon_alt) {
175  $this->help_icon_alt = $this->help_icon;
176  }
177  }
178 
179  public function setHeaderNames(array $a_header_names): void
180  {
181  $this->header_names = $a_header_names;
182  $this->column_count = count($this->header_names);
183  }
184 
185  public function getColumnCount(): int
186  {
187  return $this->column_count;
188  }
189 
190  public function setHeaderVars(array $a_header_vars, array $a_header_params = []): void
191  {
192  $this->header_vars = $a_header_vars;
193  $this->header_params = $a_header_params;
194  $this->link_params = "";
195  foreach ($a_header_params as $key => $val) {
196  $this->link_params .= $key . "=" . $val . "&";
197  }
198  }
199 
203  public function setColumnWidth(array $a_column_width): void
204  {
205  $this->column_width = $a_column_width;
206  }
207 
208  public function setOneColumnWidth(string $a_column_width, int $a_column_number): void
209  {
210  $this->column_width[$a_column_number] = $a_column_width;
211  }
212 
218  public function setMaxCount(int $a_max_count): void
219  {
220  $this->max_count = $a_max_count;
221 
222  if ($this->max_limit) {
223  $this->limit = $this->max_count;
224  }
225  }
226 
230  public function setLimit(int $a_limit = 0, int $a_default_limit = 0): void
231  {
232  $this->limit = ($a_limit) ?: $a_default_limit;
233 
234  if ($this->limit == 0) {
235  $this->max_limit = true;
236  }
237  }
238 
239  public function getLimit(): int
240  {
241  return $this->limit;
242  }
243 
244 
249  public function setPrefix(string $a_prefix): void
250  {
251  $this->prefix = $a_prefix ?: "";
252  }
253 
257  public function setOffset(int $a_offset): void
258  {
259  $this->offset = ($a_offset) ?: 0;
260  }
261 
262  public function getOffset(): int
263  {
264  return $this->offset;
265  }
266 
267  public function setOrderColumn(
268  string $a_order_column = "",
269  string $a_default_column = ""
270  ): void {
271  // set default sort column to first column
272  if (empty($a_order_column)) {
273  if (!empty($a_default_column)) {
274  $oc = array_search($a_default_column, $this->header_vars);
275  } else {
276  $oc = "";
277  }
278  } else {
279  $oc = array_search($a_order_column, $this->header_vars);
280  }
281 
282  $this->order_column = $oc ?: "";
283  }
284 
285  public function getOrderColumn(): string
286  {
287  return $this->order_column;
288  }
289 
290  public function setOrderDirection(string $a_order_direction): void
291  {
292  if (strtolower($a_order_direction) == "desc") {
293  $this->order_direction = "desc";
294  $this->sort_order = "asc";
295  } else {
296  $this->order_direction = "asc"; // set default sort order to "ASC"
297  $this->sort_order = "desc";
298  }
299  }
300 
301  public function getOrderDirection(): string
302  {
303  return $this->order_direction;
304  }
305 
306  public function setFooter(
307  string $a_style,
308  string $a_previous = "",
309  string $a_next = ""
310  ): void {
311  $this->footer_style = $a_style;
312  $this->footer_previous = $a_previous ?: "<<<";
313  $this->footer_next = $a_next ?: ">>>";
314  }
315 
319  public function enable(string $a_module_name): void
320  {
321  if (!in_array($a_module_name, array_keys($this->enabled))) {
322  return;
323  }
324 
325  $this->enabled[$a_module_name] = true;
326  }
327 
331  public function disable(string $a_module_name): void
332  {
333  if (!in_array($a_module_name, array_keys($this->enabled))) {
334  return;
335  }
336 
337  $this->enabled[$a_module_name] = false;
338  }
339 
340 
341  public function sortData(): void
342  {
343  if ($this->enabled["sort"]) {
344  $this->data = ilArrayUtil::sortArray($this->data, $this->order_column, $this->order_direction);
345  }
346  $this->data = array_slice($this->data, $this->offset, $this->limit);
347  }
348 
349  public function render(): string
350  {
351  if ($this->enabled['table']) {
352  $this->tpl->setVariable("CSS_TABLE", "table table-striped" /* $this->getStyle("table") */);
353  }
354 
355  // table title icon
356  if ($this->enabled["icon"] && $this->enabled["title"]) {
357  $this->tpl->setCurrentBlock("tbl_header_title_icon");
358  $this->tpl->setVariable("TBL_TITLE_IMG", ilUtil::getImagePath($this->icon));
359  $this->tpl->setVariable("TBL_TITLE_IMG_ALT", $this->icon_alt);
360  $this->tpl->parseCurrentBlock();
361  }
362  // table title help
363  if ($this->enabled["help"] && $this->enabled["title"]) {
364  $this->tpl->setCurrentBlock("tbl_header_title_help");
365  $this->tpl->setVariable("TBL_HELP_IMG", ilUtil::getImagePath($this->help_icon));
366  $this->tpl->setVariable("TBL_HELP_LINK", $this->help_page);
367  $this->tpl->setVariable("TBL_HELP_IMG_ALT", $this->help_icon_alt);
368  $this->tpl->parseCurrentBlock();
369  }
370 
371  // hits per page selector
372  if ($this->enabled["hits"] && $this->enabled["title"]) {
373  $this->tpl->setCurrentBlock("tbl_header_hits_page");
374  $this->tpl->setVariable("HITS_PER_PAGE", $this->lng->txt("hits_per_page"));
375  $this->tpl->parseCurrentBlock();
376  }
377 
378  // table title
379  if ($this->enabled["title"]) {
380  $this->tpl->setCurrentBlock("tbl_header_title");
381  $this->tpl->setVariable("COLUMN_COUNT", $this->column_count);
382  $this->tpl->setVariable("TBL_TITLE", $this->title);
383  $this->tpl->parseCurrentBlock();
384  }
385 
386  // table header
387  if ($this->enabled["header"]) {
388  $this->renderHeader();
389  }
390 
391  // table data
392  // the table content may be skipped to use an individual template blockfile
393  // To do so don't set $this->data and parse your table content by yourself
394  // The template block name for the blockfile MUST be 'TBL_CONTENT'
395 
396  if ($this->enabled["content"]) {
397  if ($this->enabled['auto_sort']) {
398  $this->setMaxCount(count($this->data));
399  $this->sortData();
400  }
401  $count = 0;
402 
403  foreach ($this->data as $tbl_content_row) {
404  foreach ($tbl_content_row as $key => $tbl_content_cell) {
405  if (is_array($tbl_content_cell)) {
406  $this->tpl->setCurrentBlock("tbl_cell_subtitle");
407  $this->tpl->setVariable("TBL_CELL_SUBTITLE", $tbl_content_cell[1]);
408  $this->tpl->parseCurrentBlock();
409  $tbl_content_cell = "<b>" . $tbl_content_cell[0] . "</b>";
410  }
411 
412  $this->tpl->setCurrentBlock("tbl_content_cell");
413  $this->tpl->setVariable("TBL_CONTENT_CELL", $tbl_content_cell);
414  $this->tpl->parseCurrentBlock();
415  }
416 
417  $this->tpl->setCurrentBlock("tbl_content_row");
418  $this->tpl->setVariable("ROWCOLOR", " ");
419  $this->tpl->parseCurrentBlock();
420 
421  $count++;
422  }
423  }
424  // select all checkbox
425  if ($this->enabled["select_all"]) {
426  if ((strlen($this->getFormName())) && (strlen($this->getSelectAllCheckbox()))) {
427  $this->tpl->setVariable('SELECT_PREFIX', $this->prefix);
428  $this->tpl->setVariable("SELECT_ALL_TXT_SELECT_ALL", $this->lng->txt("select_all"));
429  $this->tpl->setVariable("SELECT_ALL_CHECKBOX_NAME", $this->getSelectAllCheckbox());
430  $this->tpl->setVariable("SELECT_ALL_FORM_NAME", $this->getFormName());
431  if (!($this->enabled["numinfo"] && $this->enabled["footer"])) {
432  $this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount());
433  }
434  }
435  }
436 
437  // table header numinfo
438  if ($this->enabled["numinfo_header"]) {
439  $start = $this->offset + 1; // compute num info
440  $end = $this->offset + $this->limit;
441 
442  if ($end > $this->max_count or $this->limit == 0) {
443  $end = $this->max_count;
444  }
445 
446  if ($this->lang_support) {
447  $numinfo = "(" . $this->lng->txt("dataset") . " " . $start . " - " . $end . " " . strtolower($this->lng->txt("of")) . " " . $this->max_count . ")";
448  } else {
449  $numinfo = "(Dataset " . $start . " - " . $end . " of " . $this->max_count . ")";
450  }
451  if ($this->max_count > 0) {
452  //$numinfo = $this->lng->txt("no_datasets");
453  $this->tpl->setCurrentBlock("tbl_header_numinfo");
454  $this->tpl->setVariable("NUMINFO_HEADER", $numinfo);
455  $this->tpl->setVariable("COLUMN_COUNT_HEADER", $this->getColumnCount());
456  $this->tpl->parseCurrentBlock();
457  }
458  }
459  // table footer numinfo
460  if ($this->enabled["numinfo"] && $this->enabled["footer"]) {
461  $start = $this->offset + 1; // compute num info
462  $end = $this->offset + $this->limit;
463 
464  if ($end > $this->max_count or $this->limit == 0) {
465  $end = $this->max_count;
466  }
467 
468  if ($this->lang_support) {
469  $numinfo = "(" . $this->lng->txt("dataset") . " " . $start . " - " . $end . " " . strtolower($this->lng->txt("of")) . " " . $this->max_count . ")";
470  } else {
471  $numinfo = "(Dataset " . $start . " - " . $end . " of " . $this->max_count . ")";
472  }
473  if ($this->max_count > 0) {
474  //$numinfo = $this->lng->txt("no_datasets");
475  $this->tpl->setCurrentBlock("tbl_footer_numinfo");
476  $this->tpl->setVariable("NUMINFO", $numinfo);
477  $this->tpl->parseCurrentBlock();
478  }
479  }
480  // table footer linkbar
481  if ($this->enabled["linkbar"] && $this->enabled["footer"] && $this->limit != 0
482  && $this->max_count > 0) {
483  $params = array(
484  $this->prefix . "sort_by" => $this->header_vars[$this->order_column],
485  $this->prefix . "sort_order" => $this->order_direction
486  );
487  $params = array_merge($this->header_params, $params);
488 
489  $layout = array(
490  "link" => $this->footer_style,
491  "prev" => $this->footer_previous,
492  "next" => $this->footer_next,
493  );
494 
495  $base = ($this->getBase() == "")
496  ? basename($_SERVER["PHP_SELF"])
497  : $this->getBase();
498 
499  $linkbar = $this->linkbar($base, $this->max_count, $this->limit, $this->offset, $params, $layout, $this->prefix);
500  $this->tpl->setCurrentBlock("tbl_footer_linkbar");
501  $this->tpl->setVariable("LINKBAR", $linkbar);
502  $this->tpl->parseCurrentBlock();
503  }
504 
505  // table footer
506  if ($this->enabled["footer"] && $this->max_count > 0) {
507  $this->tpl->setCurrentBlock("tbl_footer");
508  $this->tpl->setVariable("COLUMN_COUNT", $this->column_count);
509  $this->tpl->parseCurrentBlock();
510  }
511 
512  // action buttons
513  if ($this->enabled["action"]) {
514  foreach ($this->action_buttons as $button) {
515  $this->tpl->setCurrentBlock("tbl_action_btn");
516  $this->tpl->setVariable("BTN_NAME", $button["name"]);
517  $this->tpl->setVariable("BTN_VALUE", $button["value"]);
518  $this->tpl->parseCurrentBlock();
519  }
520  $this->tpl->setCurrentBlock("tbl_action_row");
521  $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("nav/arrow_downright.svg"));
522  $this->tpl->setVariable("ALT_ARROW", $this->lng->txt("arrow_downright.svg"));
523  $this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount());
524  $this->tpl->parseCurrentBlock();
525  }
526 
527  if ($this->enabled["form"]) {
528  $this->tpl->touchBlock("tbl_form_footer");
529  }
530 
531  if ($this->enabled['table']) {
532  $this->tpl->touchBlock("tbl_table_end");
533  }
534 
535  if (!$this->global_tpl) {
536  return $this->tpl->get();
537  }
538  return "";
539  }
540 
541  public static function linkbar(
542  string $AScript,
543  int $AHits,
544  int $ALimit,
545  int $AOffset,
546  array $AParams = array(),
547  array $ALayout = array(),
548  string $prefix = ''
549  ): string {
550  $LinkBar = "";
551  $params = "";
552 
553  $layout_link = "";
554  $layout_prev = "&lt;&lt;";
555  $layout_next = "&gt;&gt;";
556 
557  // layout options
558  if ((is_array($ALayout) && (count($ALayout) > 0))) {
559  if ($ALayout["link"]) {
560  $layout_link = " class=\"" . $ALayout["link"] . "\"";
561  }
562 
563  if ($ALayout["prev"]) {
564  $layout_prev = $ALayout["prev"];
565  }
566 
567  if ($ALayout["next"]) {
568  $layout_next = $ALayout["next"];
569  }
570  }
571 
572  // show links, if hits greater limit
573  // or offset > 0 (can be > 0 due to former setting)
574  if ($AHits > $ALimit || $AOffset > 0) {
575  if (!empty($AParams)) {
576  foreach ($AParams as $key => $value) {
577  $params .= $key . "=" . $value . "&";
578  }
579  }
580  // if ($params) $params = substr($params,0,-1);
581  if (strpos($AScript, '&')) {
582  $link = $AScript . "&" . $params . $prefix . "offset=";
583  } else {
584  $link = $AScript . "?" . $params . $prefix . "offset=";
585  }
586 
587  // ?bergehe "zurck"-link, wenn offset 0 ist.
588  if ($AOffset >= 1) {
589  $prevoffset = $AOffset - $ALimit;
590  if ($prevoffset < 0) {
591  $prevoffset = 0;
592  }
593  $LinkBar .= "<a" . $layout_link . " href=\"" . $link . $prevoffset . "\">" . $layout_prev . "&nbsp;</a>";
594  }
595 
596  // Ben?tigte Seitenzahl kalkulieren
597  $pages = intval($AHits / $ALimit);
598 
599  // Wenn ein Rest bleibt, addiere eine Seite
600  if (($AHits % $ALimit)) {
601  $pages++;
602  }
603 
604  // Bei Offset = 0 keine Seitenzahlen anzeigen : DEAKTIVIERT
605  // if ($AOffset != 0) {
606 
607  // ansonsten zeige Links zu den anderen Seiten an
608  for ($i = 1 ;$i <= $pages ; $i++) {
609  $newoffset = $ALimit * ($i - 1);
610 
611  if ($newoffset == $AOffset) {
612  $LinkBar .= "[" . $i . "] ";
613  } else {
614  $LinkBar .= '<a ' . $layout_link . ' href="' .
615  $link . $newoffset . '">[' . $i . ']</a> ';
616  }
617  }
618  // }
619 
620  // Checken, ob letze Seite erreicht ist
621  // Wenn nicht, gebe einen "Weiter"-Link aus
622  if (!(($AOffset / $ALimit) == ($pages - 1)) && ($pages != 1)) {
623  $newoffset = $AOffset + $ALimit;
624  $LinkBar .= "<a" . $layout_link . " href=\"" . $link . $newoffset . "\">&nbsp;" . $layout_next . "</a>";
625  }
626 
627  return $LinkBar;
628  }
629  return "";
630  }
631 
632  public function renderHeader(): void
633  {
634  foreach ($this->header_names as $key => $tbl_header_cell) {
635  if (!$this->enabled["sort"]) {
636  $this->tpl->setCurrentBlock("tbl_header_no_link");
637  if ($this->column_width[$key]) {
638  $this->tpl->setVariable("TBL_COLUMN_WIDTH_NO_LINK", " width=\"" . $this->column_width[$key] . "\"");
639  }
640  $this->tpl->setVariable("TBL_HEADER_CELL_NO_LINK", $tbl_header_cell);
641  $this->tpl->parseCurrentBlock();
642  continue;
643  }
644  if (($key == $this->order_column) && ($this->order_direction != "")) {
645  if (strcmp($this->header_vars[$key], "") != 0) {
646  $this->tpl->setCurrentBlock("tbl_order_image");
647  $this->tpl->parseCurrentBlock();
648  }
649  }
650 
651  $this->tpl->setCurrentBlock("tbl_header_cell");
652  $this->tpl->setVariable("TBL_HEADER_CELL", $tbl_header_cell);
653 
654  // only set width if a value is given for that column
655  if ($this->column_width[$key]) {
656  $this->tpl->setVariable("TBL_COLUMN_WIDTH", " width=\"" . $this->column_width[$key] . "\"");
657  }
658 
659  $lng_sort_column = ($this->lang_support) ? $this->lng->txt("sort_by_this_column") : "Sort by this column";
660  $this->tpl->setVariable("TBL_ORDER_ALT", $lng_sort_column);
661 
662  $order_dir = "asc";
663 
664  if ($key == $this->order_column) {
665  $order_dir = $this->sort_order;
666 
667  $lng_change_sort = ($this->lang_support) ? $this->lng->txt("change_sort_direction") : "Change sort direction";
668  $this->tpl->setVariable("TBL_ORDER_ALT", $lng_change_sort);
669  }
670 
671  $this->setOrderLink($key, $order_dir);
672  $this->tpl->parseCurrentBlock();
673  }
674 
675  $this->tpl->setCurrentBlock("tbl_header");
676  $this->tpl->parseCurrentBlock();
677  }
678 
679  public function setOrderLink(string $key, string $order_dir): void
680  {
681  $this->tpl->setVariable("TBL_ORDER_LINK", basename($_SERVER["PHP_SELF"]) . "?" . $this->link_params . $this->prefix . "sort_by=" . $this->header_vars[$key] . "&" . $this->prefix . "sort_order=" . $order_dir . "&" . $this->prefix . "offset=" . $this->offset);
682  }
683 
684  public function setStyle(
685  string $a_element,
686  string $a_style
687  ): void {
688  $this->styles[$a_element] = $a_style;
689  }
690 
691  public function getStyle(string $a_element): string
692  {
693  return $this->styles[$a_element];
694  }
695 
699  public function setBase(string $a_base): void
700  {
701  $this->base = $a_base;
702  }
703 
704  public function getBase(): string
705  {
706  return $this->base;
707  }
708 
712  public function getFormName(): string
713  {
714  return $this->form_name;
715  }
716 
717  public function setFormName(string $a_name = "cmd"): void
718  {
719  $this->form_name = $a_name;
720  }
721 
725  public function getSelectAllCheckbox(): string
726  {
728  }
729 
730  public function setSelectAllCheckbox(string $a_select_all_checkbox): void
731  {
732  $this->select_all_checkbox = $a_select_all_checkbox;
733  }
734 
735  public function clearActionButtons(): void
736  {
737  $this->action_buttons = array();
738  }
739 
740  public function addActionButton(string $btn_name, string $btn_value): void
741  {
742  $this->action_buttons[] = array(
743  "name" => $btn_name,
744  "value" => $btn_value
745  );
746  }
747 }
setOffset(int $a_offset)
set dataset offset
static linkbar(string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
setBase(string $a_base)
enable(string $a_module_name)
string $help_icon_alt
string $sort_order
getStyle(string $a_element)
setSelectAllCheckbox(string $a_select_all_checkbox)
string $footer_next
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
array $action_buttons
string $footer_style
string $order_column
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setHelp(string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
ilLanguage $lng
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
global $DIC
Definition: feed.php:28
setColumnWidth(array $a_column_width)
set table column widths
setStyle(string $a_element, string $a_style)
setOrderDirection(string $a_order_direction)
addActionButton(string $btn_name, string $btn_value)
setTemplate(ilTemplate $a_tpl)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
string $key
Consumer key/client ID value.
Definition: System.php:193
setOrderLink(string $key, string $order_dir)
setHeaderVars(array $a_header_vars, array $a_header_params=[])
getFormName()
get the name of the parent form
setOneColumnWidth(string $a_column_width, int $a_column_number)
string $order_direction
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
array $header_params
setData(array $a_data)
Set table data.
setFooter(string $a_style, string $a_previous="", string $a_next="")
setHeaderNames(array $a_header_names)
setFormName(string $a_name="cmd")
string $footer_previous
disable(string $a_module_name)
__construct(array $a_data=[], bool $a_global_tpl=true)
setOrderColumn(string $a_order_column="", string $a_default_column="")
string $select_all_checkbox
getSelectAllCheckbox()
get the name of the checkbox that should be toggled with a select all button
string $link_params
setMaxCount(int $a_max_count)
set max.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)