ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPCFileListTableGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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 
24 include_once("Services/Table/classes/class.ilTable2GUI.php");
25 
35 {
36 
37  function ilPCFileListTableGUI($a_parent_obj, $a_parent_cmd,
38  $a_file_list)
39  {
40  global $ilCtrl, $lng;
41 
42  parent::__construct($a_parent_obj, $a_parent_cmd);
43 
44  $this->addColumn("", "", "1");
45  $this->addColumn($lng->txt("cont_position"), "", "1");
46  if ($this->getParentObject()->checkStyleSelection())
47  {
48  $this->addColumn($lng->txt("cont_file"), "", "50%");
49  $this->addColumn($lng->txt("cont_characteristic"), "", "50%");
50  }
51  else
52  {
53  $this->addColumn($lng->txt("cont_file"), "", "100%");
54  }
55  $this->setEnableHeader(true);
56  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
57  $this->setRowTemplate("tpl.file_list_row.html",
58  "Services/COPage");
59 
60  $this->file_list = $a_file_list;
61  $this->setData($this->file_list->getFileList());
62  $this->setLimit(0);
63 
64  $this->addMultiCommand("deleteFileItem", $lng->txt("delete"));
65  if ($this->getParentObject()->checkStyleSelection())
66  {
67  $this->addCommandButton("savePositionsAndClasses", $lng->txt("cont_save_positions_and_classes"));
68  }
69  else
70  {
71  $this->addCommandButton("savePositions", $lng->txt("cont_save_positions"));
72  }
73  $this->addCommandButton("addFileItem", $lng->txt("cont_add_file"));
74 
75  $this->setTitle($lng->txt("cont_files"));
76  }
77 
82  protected function fillRow($a_set)
83  {
84  global $lng, $ilCtrl;
85 
86  if ($this->getParentObject()->checkStyleSelection())
87  {
88  $this->tpl->setCurrentBlock("class_sel");
89  $sel = ($a_set["class"] == "")
90  ? "FileListItem"
91  : $a_set["class"];
92  $this->tpl->setVariable("CLASS_SEL", ilUtil::formSelect($sel,
93  "class[".$a_set["hier_id"].":".$a_set["pc_id"]."]",
94  $this->getParentObject()->getCharacteristics(), false, true));
95  $this->tpl->parseCurrentBlock();
96  }
97 
98  $this->pos += 10;
99  $this->tpl->setVariable("POS", $this->pos);
100  $this->tpl->setVariable("FID", $a_set["hier_id"].":".$a_set["pc_id"]);
101  $this->tpl->setVariable("TXT_FILE", ilObject::_lookupTitle($a_set["id"]));
102  }
103 
104 }
105 ?>