ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSubItemSelectionTableGUI.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 
15 {
16  public function __construct(
17  $a_parent_obj,
18  $a_parent_cmd,
19  $a_ref_id,
20  $a_cmd = "createExportFile",
21  $a_cmd_txt = ""
22  ) {
23  global $DIC;
24 
25  $ilCtrl = $DIC['ilCtrl'];
26  $lng = $DIC['lng'];
27 
28  parent::__construct($a_parent_obj, $a_parent_cmd);
29  $lng->loadLanguageModule("export");
30 
31  if ($a_cmd_txt == "") {
32  $a_cmd_txt = $lng->txt("export_create_export_file");
33  }
34 
35  $this->addColumn($lng->txt("export_resource"));
36  $this->addColumn($lng->txt("export_last_export"));
37  $this->addColumn($lng->txt("export_last_export_file"), "", "20%");
38  $this->addColumn($lng->txt("export_create_new_file"), "", "20%");
39  $this->addColumn($lng->txt("export_omit_resource"), "", "20%");
40  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
41  $this->addCommandButton($a_cmd, $a_cmd_txt);
42  $this->setRowTemplate(
43  "tpl.sub_item_selection_row.html",
44  "Services/Export"
45  );
46  $this->setTitle($lng->txt("export_select_resources"));
47  include_once("./Services/Export/classes/class.ilExport.php");
48  $this->setData(ilExport::_getValidExportSubItems($a_ref_id));
49  $this->setLimit(99999);
50  }
51 
56  protected function fillRow($a_set)
57  {
58  global $DIC;
59 
60  $lng = $DIC['lng'];
61  $ilCtrl = $DIC['ilCtrl'];
62 
63  $now = new ilDateTime(time(), IL_CAL_UNIX);
64 
65  $this->tpl->setVariable("IMG_ALT", $lng->txt("obj_" . $a_set["type"]));
66  $this->tpl->setVariable("IMG_SRC", ilObject::_getIcon(
67  $a_set["obj_id"],
68  "small",
69  $a_set["type"]
70  ));
71  $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
72  $this->tpl->setVariable("ID", $a_set["ref_id"]);
73  $this->tpl->setVariable("TXT_LAST_EXPORT_FILE", $lng->txt("export_last_file"));
74  $this->tpl->setVariable("TXT_OMIT", $lng->txt("export_omit"));
75  $this->tpl->setVariable("TXT_CREATE_NEW_EXPORT_FILE", $lng->txt("export_create"));
76  $preset = "CREATE";
77  if ($a_set["timestamp"] > 0) {
78  $last_export = new ilDateTime($a_set["timestamp"], IL_CAL_UNIX);
79  $this->tpl->setVariable(
80  "VAL_LAST_EXPORT",
81  ilDatePresentation::formatDate($last_export)
82  );
83  if (ilDateTime::_equals($last_export, $now, IL_CAL_DAY)) {
84  $preset = "LAST_FILE";
85  }
86  }
87  $this->tpl->setVariable("SEL_" . $preset, ' checked="checked" ');
88  }
89 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
global $DIC
Definition: saml.php:7
fillRow($a_set)
Standard Version of Fill Row.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
__construct( $a_parent_obj, $a_parent_cmd, $a_ref_id, $a_cmd="createExportFile", $a_cmd_txt="")
const IL_CAL_DAY
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
Class ilTable2GUI.
static _getValidExportSubItems($a_ref_id)
Get a list of subitems of a repository resource, that implement the export.
Date and time handling
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setLimit($a_limit=0, $a_default_limit=0)