ILIAS  release_4-4 Revision
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  {
80  $this->tpl->setCurrentBlock('record_title');
81  $this->tpl->setVariable('REC_TITLE',$title);
82  $this->tpl->parseCurrentBlock();
83  }
84  }
92  public function parseFiles($a_file_data)
93  {
94  foreach($a_file_data as $id => $data)
95  {
96  $tmp_arr['id'] = $id;
97  $tmp_arr['records'] = implode(', ',$data['name']);
98  $tmp_arr['date'] = $data['date'];
99  $tmp_arr['file_size'] = $data['size'].' '.$this->lng->txt('bytes');
100  $tmp_arr['record_arr'] = $data['name'];
101  $defs_arr[] = $tmp_arr;
102  }
103  $this->setData($defs_arr ? $defs_arr : array());
104  }
105 
106 }
107 
108 
109 ?>
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
__construct($a_parent_obj, $a_parent_cmd='')
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
global $lng
Definition: privfeed.php:40
setFormAction($a_form_action)
Set Form action parameter.