ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
17  function ilSubItemSelectionTableGUI($a_parent_obj, $a_parent_cmd,
18  $a_ref_id, $a_cmd = "createExportFile", $a_cmd_txt = "")
19  {
20  global $ilCtrl, $lng;
21 
22  parent::__construct($a_parent_obj, $a_parent_cmd);
23  $lng->loadLanguageModule("export");
24 
25  if ($a_cmd_txt == "")
26  {
27  $a_cmd_txt = $lng->txt("export_create_export_file");
28  }
29 
30  $this->addColumn($lng->txt("export_resource"));
31  $this->addColumn($lng->txt("export_last_export"));
32  $this->addColumn($lng->txt("export_last_export_file"), "", "20%");
33  $this->addColumn($lng->txt("export_create_new_file"), "", "20%");
34  $this->addColumn($lng->txt("export_omit_resource"), "", "20%");
35  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
36  $this->addCommandButton($a_cmd, $a_cmd_txt);
37  $this->setRowTemplate("tpl.sub_item_selection_row.html",
38  "Services/Export");
39  $this->setTitle($lng->txt("export_select_resources"));
40  include_once("./Services/Export/classes/class.ilExport.php");
41  $this->setData(ilExport::_getValidExportSubItems($a_ref_id));
42  $this->setLimit(99999);
43  }
44 
49  protected function fillRow($a_set)
50  {
51  global $lng, $ilCtrl;
52 
53  $now = new ilDateTime(time(),IL_CAL_UNIX);
54 
55  $this->tpl->setVariable("IMG_ALT", $lng->txt("obj_".$a_set["type"]));
56  $this->tpl->setVariable("IMG_SRC", ilObject::_getIcon($a_set["obj_id"],
57  "small", $a_set["type"]));
58  $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
59  $this->tpl->setVariable("ID", $a_set["ref_id"]);
60  $this->tpl->setVariable("TXT_LAST_EXPORT_FILE", $lng->txt("export_last_file"));
61  $this->tpl->setVariable("TXT_OMIT", $lng->txt("export_omit"));
62  $this->tpl->setVariable("TXT_CREATE_NEW_EXPORT_FILE", $lng->txt("export_create"));
63  $preset = "CREATE";
64  if ($a_set["timestamp"] > 0)
65  {
66  $last_export = new ilDateTime($a_set["timestamp"], IL_CAL_UNIX);
67  $this->tpl->setVariable("VAL_LAST_EXPORT",
68  ilDatePresentation::formatDate($last_export));
69  if (ilDateTime::_equals($last_export, $now, IL_CAL_DAY))
70  {
71  $preset = "LAST_FILE";
72  }
73  }
74  $this->tpl->setVariable("SEL_".$preset, ' checked="checked" ');
75  }
76 
77 }
78 ?>