ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
6include_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?>
static _lookupTitle($a_id)
lookup object title
TableGUI class for file list.
ilPCFileListTableGUI($a_parent_obj, $a_parent_cmd, $a_file_list)
fillRow($a_set)
Standard Version of Fill Row.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
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.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40