ILIAS  release_8 Revision v8.24
class.ilLMDownloadTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
27
28 public function __construct(
29 object $a_parent_obj,
30 string $a_parent_cmd,
32 ) {
33 $this->lm = $a_lm;
34
35 parent::__construct($a_parent_obj, $a_parent_cmd);
36 $this->setData($this->lm->getPublicExportFiles());
37 $this->setTitle($this->lng->txt("download"));
38
39 $this->addColumn($this->lng->txt("cont_format"));
40 $this->addColumn($this->lng->txt("cont_file"));
41 $this->addColumn($this->lng->txt("size"));
42 $this->addColumn($this->lng->txt("date"));
43 $this->addColumn($this->lng->txt("action"));
44 $this->disable("footer");
45 $this->setMaxCount(9999);
46
47 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
48 $this->setRowTemplate("tpl.download_file_row.html", "Modules/LearningModule");
49 }
50
51 public function getDownloadFiles(): void
52 {
53 $this->setData($this->lm->getPublicExportFiles());
54 }
55
56 protected function fillRow(array $a_set): void
57 {
58 $this->tpl->setVariable("TXT_FILENAME", $a_set["file"]);
59
60 $this->tpl->setVariable("TXT_SIZE", ilUtil::formatSize($a_set["size"]));
61 $this->tpl->setVariable("TXT_FORMAT", strtoupper($a_set["type"]));
62 $this->tpl->setVariable("CHECKBOX_ID", $a_set["type"] . ":" . $a_set["file"]);
63
64 $file_arr = explode("__", $a_set["file"]);
66 $this->tpl->setVariable("TXT_DATE", ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)));
67
68 $this->tpl->setVariable("TXT_DOWNLOAD", $this->lng->txt("download"));
69 $this->ctrl->setParameter($this->parent_obj, "type", $a_set["dir_type"]);
70 $this->tpl->setVariable(
71 "LINK_DOWNLOAD",
72 $this->ctrl->getLinkTarget($this->parent_obj, "downloadExportFile")
73 );
74
75 $this->tpl->parseCurrentBlock();
76 }
77}
const IL_CAL_UNIX
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, ilObjLearningModule $a_lm)
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
disable(string $a_module_name)
setMaxCount(int $a_max_count)
set max.
static formatSize(int $size, string $a_mode='short', ?ilLanguage $a_lng=null)
Returns the specified file size value in a human friendly form.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc