ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilMailAttachmentTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Table/classes/class.ilTable2GUI.php';
5
11{
15 protected $ctrl;
16
21 public function __construct($a_parent_obj, $a_parent_cmd)
22 {
26 global $ilCtrl;
27
28 $this->ctrl = $ilCtrl;
29
30 // Call this immediately in constructor
31 $this->setId('mail_attachments');
32
33 $this->setDefaultOrderDirection('ASC');
34 $this->setDefaultOrderField('filename');
35
36 parent::__construct($a_parent_obj, $a_parent_cmd);
37
38 $this->setTitle($this->lng->txt('attachment'));
39 $this->setNoEntriesText($this->lng->txt('marked_entries'));
40
41 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, 'applyFilter'));
42
43 $this->setSelectAllCheckbox('filename[]');
44
45 $this->setRowTemplate('tpl.mail_attachment_row.html', 'Services/Mail');
46
47 $this->addMultiCommand('saveAttachments', $this->lng->txt('adopt'));
48 $this->addMultiCommand('deleteAttachments', $this->lng->txt('delete'));
49
50 $this->addCommandButton('cancelSaveAttachments', $this->lng->txt('cancel'));
51
52 $this->addColumn($this->lng->txt(''), '', '1px', true);
53 $this->addColumn($this->lng->txt('mail_file_name'), 'filename');
54 $this->addColumn($this->lng->txt('mail_file_size'), 'filesize');
55 $this->addColumn($this->lng->txt('create_date'), 'filecreatedate');
56 // Show all attachments on one page
57 $this->setLimit(PHP_INT_MAX);
58 }
59
63 protected function fillRow($a_set)
64 {
68 $this->tpl->setVariable('VAL_CHECKBOX', ilUtil::formCheckbox($a_set['checked'], 'filename[]', urlencode($a_set['filename'])));
69 $this->tpl->setVariable('VAL_FILENAME', $this->formatValue('filename', $a_set['filename']));
70 $this->tpl->setVariable('VAL_FILESIZE', $this->formatValue('filesize', $a_set['filesize']));
71 $this->tpl->setVariable('VAL_FILECREATEDATE', $this->formatValue('filecreatedate', $a_set['filecreatedate']));
72 }
73
78 public function numericOrdering($column)
79 {
80 if($column == 'filesize' || $column == 'filecreatedate') return true;
81
82 return false;
83 }
84
90 protected function formatValue($column, $value)
91 {
92 switch($column)
93 {
94 case 'filecreatedate':
96
97 case 'filesize':
98 return ilUtil::formatSize($value);
99
100 default:
101 return $value;
102 }
103 }
104}
$column
Definition: 39dropdown.php:62
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
fillRow($a_set)
Standard Version of Fill Row.Most likely to be overwritten by derived class.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setNoEntriesText($a_text)
Set text for an empty table.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
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.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
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