ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPCFileListTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 
6 include_once("Services/Table/classes/class.ilTable2GUI.php");
7 
17 {
18 
19  function ilPCFileListTableGUI($a_parent_obj, $a_parent_cmd,
20  $a_file_list)
21  {
22  global $ilCtrl, $lng;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25 
26  $this->addColumn("", "", "1");
27  $this->addColumn($lng->txt("cont_position"), "", "1");
28  if ($this->getParentObject()->checkStyleSelection())
29  {
30  $this->addColumn($lng->txt("cont_file"), "", "50%");
31  $this->addColumn($lng->txt("cont_characteristic"), "", "50%");
32  }
33  else
34  {
35  $this->addColumn($lng->txt("cont_file"), "", "100%");
36  }
37  $this->setEnableHeader(true);
38  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
39  $this->setRowTemplate("tpl.file_list_row.html",
40  "Services/COPage");
41 
42  $this->file_list = $a_file_list;
43  $this->setData($this->file_list->getFileList());
44  $this->setLimit(0);
45 
46  $this->addMultiCommand("deleteFileItem", $lng->txt("delete"));
47  if (count($this->getData()) > 0)
48  {
49  if ($this->getParentObject()->checkStyleSelection())
50  {
51  $this->addCommandButton("savePositionsAndClasses", $lng->txt("cont_save_positions_and_classes"));
52  }
53  else
54  {
55  $this->addCommandButton("savePositions", $lng->txt("cont_save_positions"));
56  }
57  }
58 
59  $this->setTitle($lng->txt("cont_files"));
60  }
61 
66  protected function fillRow($a_set)
67  {
68  global $lng, $ilCtrl;
69 
70  if ($this->getParentObject()->checkStyleSelection())
71  {
72  $this->tpl->setCurrentBlock("class_sel");
73  $sel = ($a_set["class"] == "")
74  ? "FileListItem"
75  : $a_set["class"];
76  $this->tpl->setVariable("CLASS_SEL", ilUtil::formSelect($sel,
77  "class[".$a_set["hier_id"].":".$a_set["pc_id"]."]",
78  $this->getParentObject()->getCharacteristics(), false, true));
79  $this->tpl->parseCurrentBlock();
80  }
81 
82  $this->pos += 10;
83  $this->tpl->setVariable("POS", $this->pos);
84  $this->tpl->setVariable("FID", $a_set["hier_id"].":".$a_set["pc_id"]);
85  $this->tpl->setVariable("TXT_FILE", ilObject::_lookupTitle($a_set["id"]));
86  }
87 
88 }
89 ?>