ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.assFileUploadFileTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once('./Services/Table/classes/class.ilTable2GUI.php');
5 
16 {
24  public function __construct($a_parent_obj, $a_parent_cmd, $formname = 'test_output')
25  {
26  global $lng,$ilCtrl;
27 
28  $this->lng = $lng;
29  $this->ctrl = $ilCtrl;
30 
31  parent::__construct($a_parent_obj, $a_parent_cmd);
32 
33  $this->setFormName($formname);
34  $this->setStyle('table', 'std');
35  $this->addColumn('','f','1%');
36  $this->addColumn($this->lng->txt('filename'),'filename', '70%');
37  $this->addColumn($this->lng->txt('date'),'date', '29%');
38  $this->setDisplayAsBlock(true);
39 
40  $this->setPrefix('deletefiles');
41  $this->setSelectAllCheckbox('deletefiles');
42 
43  $this->setRowTemplate("tpl.il_as_qpl_fileupload_file_row.html", "Modules/TestQuestionPool");
44 
45  $this->disable('sort');
46  $this->disable('linkbar');
47  $this->enable('header');
48  $this->enable('select_all');
49  }
50 
51  public function init()
52  {
53  if( count($this->getData()) )
54  {
55  $this->addCommandButton($this->parent_cmd, $this->lng->txt('delete'), '', '', 'ilc_qsubmit_Submit');
56  }
57  }
58 
59  // hey: uploadFileTimestamps - parse solution file versioning timestamp from storage filename
60  protected function fetchUploadTimestampFromStorageFilename($storageFilename)
61  {
62  list($prefix, $activeId, $passIndex, $versioningUploadTS) = explode(
63  '_', pathinfo($storageFilename, PATHINFO_BASENAME)
64  );
65  return $versioningUploadTS;
66  }
67  // hey.
68 
76  public function fillRow($a_set)
77  {
78  global $ilUser,$ilAccess;
79 
80  $this->tpl->setVariable('VAL_ID', $a_set['solution_id']);
81  if (strlen($a_set['webpath']))
82  {
83  $this->tpl->setVariable('VAL_FILE', '<a href="' . $a_set['webpath'] . $a_set['value1'] . '" target=\"_blank\">' . ilUtil::prepareFormOutput($a_set['value2']) . '</a>');
84  }
85  else
86  {
87  $this->tpl->setVariable('VAL_FILE', ilUtil::prepareFormOutput($a_set['value2']));
88  }
89  // hey: uploadFileTimestamps - parse solution file versioning timestamp from storage filename
90  $a_set['tstamp'] = $this->fetchUploadTimestampFromStorageFilename($a_set['value1']);
91  // hey.
93  $this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"],IL_CAL_UNIX)));
94  }
95 
96 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setFormName($a_formname)
Set Form name.
setStyle($a_element, $a_style)
setDisplayAsBlock($a_val)
Set display as block.
__construct($a_parent_obj, $a_parent_cmd, $formname='test_output')
Constructor.
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
Class ilTable2GUI.
fetchUploadTimestampFromStorageFilename($storageFilename)
enable($a_module_name)
enables particular modules of table
static formatDate(ilDateTime $date)
Format a date public.
setPrefix($a_prefix)
Date and time handling
setRowTemplate($a_template, $a_template_dir="")
Set row template.
disable($a_module_name)
diesables particular modules of table
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
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.