ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
4 include_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', ilUtil::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 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
$url
Definition: shib_logout.php:72
const IL_CAL_UNIX
getParentCmd()
Get parent command.
getParentObject()
Get parent object.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
__construct($a_parent_obj, $a_parent_cmd, $a_fss_export)
addMultiCommand($a_cmd, $a_text)
Add Command button.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
Table presentation of membership export files.
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
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.