ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 $ilCtrl;
17
18 $this->setId('memexp');
19
20 parent::__construct($a_parent_obj,$a_parent_cmd);
21
22 $this->setTitle($this->lng->txt('ps_export_files'));
23
24 $this->addColumn('','',1);
25 $this->addColumn($this->lng->txt('type'),'type');
26 $this->addColumn($this->lng->txt('ps_size'),'size');
27 $this->addColumn($this->lng->txt('date'),'date');
28 $this->addColumn($this->lng->txt('action'),'');
29
30 $this->setDefaultOrderField('date');
31 $this->setDefaultOrderDirection('desc');
32
33 $this->setRowTemplate('tpl.mem_export_file_row.html','Services/Membership');
34 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(),$this->getParentCmd()));
35 $this->addMultiCommand('confirmDeleteExportFile', $this->lng->txt('delete'));
36
37 $this->setSelectAllCheckbox('id[]');
38
39 $this->getFiles($a_fss_export);
40 }
41
42 public function numericOrdering($a_field)
43 {
44 return in_array($a_field, array('size', 'date'));
45 }
46
47 protected function getFiles($a_fss_export)
48 {
49 $data = array();
50
51 foreach($a_fss_export->getMemberExportFiles() as $exp_file)
52 {
53 $data[] = array(
54 'id' => md5($exp_file['name']),
55 'type' => strtoupper($exp_file["type"]),
56 'date' => $exp_file['timest'],
57 'size' => $exp_file['size']
58 );
59 }
60
61 $this->setData($data);
62 }
63
64 public function fillRow($a_set)
65 {
66 global $ilCtrl;
67
68 $this->tpl->setVariable('VAL_ID', $a_set['id']);
69 $this->tpl->setVariable('VAL_TYPE', $a_set['type']);
70 $this->tpl->setVariable('VAL_SIZE', ilFormat::formatSize($a_set['size']));
71 $this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set['date'], IL_CAL_UNIX)));
72
73 $ilCtrl->setParameter($this->getParentObject(), 'fl', $a_set['id']);
74 $url = $ilCtrl->getLinkTarget($this->getParentObject(), 'downloadExportFile');
75 $ilCtrl->setParameter($this->getParentObject(), 'fl', '');
76
77 $this->tpl->setVariable('URL_DOWNLOAD', $url);
78 $this->tpl->setVariable('TXT_DOWNLOAD', $this->lng->txt('download'));
79 }
80}
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
Table presentation of membership export files.
__construct($a_parent_obj, $a_parent_cmd, $a_fss_export)
Constructor.
fillRow($a_set)
Standard Version of Fill Row.
numericOrdering($a_field)
Should this field be sorted numeric?
Class ilTable2GUI.
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.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
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.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18
$url
Definition: shib_logout.php:72