ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAdvancedMDRecordExportFilesTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
26{
33 public function __construct($a_parent_obj, $a_parent_cmd = '')
34 {
35 parent::__construct($a_parent_obj, $a_parent_cmd);
36 $this->addColumn('', 'f', '1');
37 $this->addColumn($this->lng->txt('md_adv_records'), 'records', "33%");
38 $this->addColumn($this->lng->txt('date'), 'date', "33%");
39 $this->addColumn($this->lng->txt('filesize'), 'file_size', "33%");
40
41 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
42 $this->setRowTemplate("tpl.edit_files_row.html", "components/ILIAS/AdvancedMetaData");
43 $this->setDefaultOrderField("date");
44 $this->setDefaultOrderDirection('desc');
45 }
46
52 protected function fillRow(array $a_set): void
53 {
54 $this->tpl->setVariable('VAL_ID', $a_set['id']);
55 $this->tpl->setVariable('VAL_SIZE', sprintf("%.1f KB", (string) ((int) $a_set['file_size'] / 1024)));
56 $this->tpl->setVariable(
57 'VAL_DATE',
59 );
60
61 foreach ($a_set['record_arr'] as $title) {
62 $this->tpl->setCurrentBlock('record_title');
63 $this->tpl->setVariable('REC_TITLE', $title);
64 $this->tpl->parseCurrentBlock();
65 }
66 }
67
73 public function parseFiles(array $a_file_data): void
74 {
75 $defs_arr = [];
76 foreach ($a_file_data as $id => $data) {
77 $tmp_arr['id'] = $id;
78 $tmp_arr['records'] = implode(', ', $data['name']);
79 $tmp_arr['date'] = $data['date'];
80 $tmp_arr['file_size'] = $data['size'] . ' ' . $this->lng->txt('bytes');
81 $tmp_arr['record_arr'] = $data['name'];
82 $defs_arr[] = $tmp_arr;
83 }
84 $this->setData($defs_arr);
85 }
86}
const IL_CAL_UNIX
parseFiles(array $a_file_data)
parese files @access public
__construct($a_parent_obj, $a_parent_cmd='')
Constructor @access public.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc