ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAdvancedMDRecordExportFilesTableGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
33 include_once('Services/Table/classes/class.ilTable2GUI.php');
34 
36 {
45  public function __construct($a_parent_obj, $a_parent_cmd = '')
46  {
47  global $lng,$ilCtrl;
48 
49  $this->lng = $lng;
50  $this->ctrl = $ilCtrl;
51 
52  parent::__construct($a_parent_obj, $a_parent_cmd);
53  $this->addColumn('', 'f', 1);
54  $this->addColumn($this->lng->txt('md_adv_records'), 'records', "33%");
55  $this->addColumn($this->lng->txt('date'), 'date', "33%");
56  $this->addColumn($this->lng->txt('filesize'), 'file_size', "33%");
57 
58  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
59  $this->setRowTemplate("tpl.edit_files_row.html", "Services/AdvancedMetaData");
60  $this->setDefaultOrderField("date");
61  $this->setDefaultOrderDirection('desc');
62  }
63 
64 
72  public function fillRow($a_set)
73  {
74  $this->tpl->setVariable('VAL_ID', $a_set['id']);
75  $this->tpl->setVariable('VAL_SIZE', sprintf("%.1f KB", $a_set['file_size']/1024));
76  $this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set['date'], IL_CAL_UNIX)));
77 
78  foreach ($a_set['record_arr'] as $title) {
79  $this->tpl->setCurrentBlock('record_title');
80  $this->tpl->setVariable('REC_TITLE', $title);
81  $this->tpl->parseCurrentBlock();
82  }
83  }
91  public function parseFiles($a_file_data)
92  {
93  foreach ($a_file_data as $id => $data) {
94  $tmp_arr['id'] = $id;
95  $tmp_arr['records'] = implode(', ', $data['name']);
96  $tmp_arr['date'] = $data['date'];
97  $tmp_arr['file_size'] = $data['size'] . ' ' . $this->lng->txt('bytes');
98  $tmp_arr['record_arr'] = $data['name'];
99  $defs_arr[] = $tmp_arr;
100  }
101  $this->setData($defs_arr ? $defs_arr : array());
102  }
103 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
if(!array_key_exists('StateId', $_REQUEST)) $id
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilTable2GUI.
Date and time handling
__construct($a_parent_obj, $a_parent_cmd='')
Constructor.
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.
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.