ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilMemberExportFileTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Table/classes/class.ilTable2GUI.php';
5
13{
14 public function __construct($a_parent_obj, $a_parent_cmd, $a_fss_export)
15 {
16 global $DIC;
17
18 $ilCtrl = $DIC['ilCtrl'];
19
20 $this->setId('memexp');
21
22 parent::__construct($a_parent_obj, $a_parent_cmd);
23
24 $this->setTitle($this->lng->txt('ps_export_files'));
25
26 $this->addColumn('', '', 1);
27 $this->addColumn($this->lng->txt('type'), 'type');
28 $this->addColumn($this->lng->txt('ps_size'), 'size');
29 $this->addColumn($this->lng->txt('date'), 'date');
30 $this->addColumn($this->lng->txt('action'), '');
31
32 $this->setDefaultOrderField('date');
33 $this->setDefaultOrderDirection('desc');
34
35 $this->setRowTemplate('tpl.mem_export_file_row.html', 'Services/Membership');
36 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), $this->getParentCmd()));
37 $this->addMultiCommand('confirmDeleteExportFile', $this->lng->txt('delete'));
38
39 $this->setSelectAllCheckbox('id[]');
40
41 $this->getFiles($a_fss_export);
42 }
43
44 public function numericOrdering($a_field)
45 {
46 return in_array($a_field, array('size', 'date'));
47 }
48
49 protected function getFiles($a_fss_export)
50 {
51 $data = array();
52
53 foreach ($a_fss_export->getMemberExportFiles() as $exp_file) {
54 $data[] = array(
55 'id' => md5($exp_file['name']),
56 'type' => strtoupper($exp_file["type"]),
57 'date' => $exp_file['timest'],
58 'size' => $exp_file['size']
59 );
60 }
61
62 $this->setData($data);
63 }
64
65 public function fillRow($a_set)
66 {
67 global $DIC;
68
69 $ilCtrl = $DIC['ilCtrl'];
70
71 $this->tpl->setVariable('VAL_ID', $a_set['id']);
72 $this->tpl->setVariable('VAL_TYPE', $a_set['type']);
73 $this->tpl->setVariable('VAL_SIZE', ilUtil::formatSize($a_set['size']));
74 $this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set['date'], IL_CAL_UNIX)));
75
76 $ilCtrl->setParameter($this->getParentObject(), 'fl', $a_set['id']);
77 $url = $ilCtrl->getLinkTarget($this->getParentObject(), 'downloadExportFile');
78 $ilCtrl->setParameter($this->getParentObject(), 'fl', '');
79
80 $this->tpl->setVariable('URL_DOWNLOAD', $url);
81 $this->tpl->setVariable('TXT_DOWNLOAD', $this->lng->txt('download'));
82 }
83}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Table presentation of membership export files.
__construct($a_parent_obj, $a_parent_cmd, $a_fss_export)
ilTable2GUI constructor.
fillRow($a_set)
Standard Version of Fill Row.
numericOrdering($a_field)
Should this field be sorted numeric?
Class ilTable2GUI.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$url
$DIC
Definition: xapitoken.php:46