ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestExportTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
29 {
30  private \ILIAS\UI\Factory $ui_factory;
31  private \ILIAS\UI\Renderer $ui_renderer;
32 
33  public function __construct(object $a_parent_obj, string $a_parent_cmd, ilObject $a_exp_obj)
34  {
35  global $DIC;
36  $this->ui_factory = $DIC->ui()->factory();
37  $this->ui_renderer = $DIC->ui()->renderer();
38 
39  parent::__construct($a_parent_obj, $a_parent_cmd, $a_exp_obj);
40  }
41 
42  protected function formatActionsList(string $type, string $filename): string
43  {
44  $this->ctrl->setParameter($this->getParentObject(), 'file', $filename);
45  $actions[] = $this->ui_factory->link()->standard($this->lng->txt('download'), $this->ctrl->getLinkTarget($this->getParentObject(), 'download'));
46  $this->ctrl->setParameter($this->getParentObject(), 'file', '');
47  $dropdown = $this->ui_factory->dropdown()->standard($actions);
48  return $this->ui_renderer->render($dropdown);
49  }
50 
51  protected function initMultiCommands(): void
52  {
53  $this->addMultiCommand('confirmDeletion', $this->lng->txt('delete'));
54  }
55 
59  public function getExportFiles(): array
60  {
61  return array();
62  }
63 
64  protected function initColumns(): void
65  {
66  $this->addColumn($this->lng->txt(''), '', '1', true);
67  $this->addColumn($this->lng->txt('type'), 'type');
68  $this->addColumn($this->lng->txt('file'), 'file');
69  $this->addColumn($this->lng->txt('size'), 'size');
70  $this->addColumn($this->lng->txt('date'), 'timestamp');
71  }
72 
73  public function numericOrdering(string $a_field): bool
74  {
75  if (in_array($a_field, array('size', 'date'))) {
76  return true;
77  }
78 
79  return false;
80  }
81 
82  protected function getRowId(array $row): string
83  {
84  return $row['file'];
85  }
86 
87  public function resetFormats(): void
88  {
89  $this->formats = [];
90  }
91 
92  public function addFormat(string $format)
93  {
94  $this->formats[$format] = $format;
95  }
96 }
formatActionsList(string $type, string $filename)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
getExportFiles()
Overwrite method because data is passed from outside.
$filename
Definition: buildRTE.php:78
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
addMultiCommand(string $a_cmd, string $a_text)
__construct(object $a_parent_obj, string $a_parent_cmd, ilObject $a_exp_obj)