ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilAdvancedMDRecordExportFilesTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 }
setData(array $a_data)
setFormAction(string $a_form_action, bool $a_multipart=false)
const IL_CAL_UNIX
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct($a_parent_obj, $a_parent_cmd='')
Constructor public.
__construct(Container $dic, ilPlugin $plugin)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
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)