ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLPObjectsTableGUI.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 include_once './Services/Search/classes/class.ilSearchSettings.php';
6 
17 {
18  protected $objs = array();
19 
20 
24  function __construct($a_parent_obj, $a_parent_cmd, $a_type = "", $a_objs = "")
25  {
26  global $ilCtrl, $lng, $ilAccess, $lng;
27 
28  $this->tracked_user = $a_user;
29  $this->objs = $a_objs;
30 
31  parent::__construct($a_parent_obj, $a_parent_cmd);
32  $this->setTitle($this->lng->txt("learning_progress"));
33  $this->setLimit(ilSearchSettings::getInstance()->getMaxHits());
34  $this->setLimit(9999);
35 
36  $this->addColumn("", "", "1", true);
37  $this->addColumn($this->lng->txt("trac_title_description"), "", "90%");
38  $this->addColumn($this->lng->txt("actions"), "", "10%");
39 
40  $this->setEnableHeader(true);
41  $this->setFormAction($ilCtrl->getFormActionByClass("illpfiltergui"));
42  $this->setRowTemplate("tpl.lp_object_list_row.html", "Services/Tracking");
43  #$this->disable("footer");
44  $this->setEnableHeader(true);
45  $this->setEnableNumInfo(true);
46  $this->setEnableTitle(true);
47  $this->setId("lp_obj_table");
48  $this->initFilter();
49 
50  $this->setSelectAllCheckbox("item_id");
51 
52  $this->addMultiCommand("hideSelected", $lng->txt("trac_hide_selected"));
53  //$this->addCommandButton("", $lng->txt(""));
54  }
55 
59  function initFilter()
60  {
61  global $lng;
62 
63  $this->setDisableFilterHiding(true);
64 
65  include_once("./Services/Tracking/classes/class.ilLPFilterGUI.php");
66  $filter_gui = new ilLPFilterGUI($this->tracked_user);
67 
68  // object type selection
69  include_once("./Services/Tracking/classes/class.ilLPFilterGUI.php");
71  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
72  $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
73  $si->setOptions($options);
74  $si->setValue($filter_gui->filter->getFilterType());
75  $this->addFilterItem($si);
76 
77  // hidden items
78  $options = $filter_gui->prepareHidden();
79  $values = array_keys($options);
80  if (count($options) > 0)
81  {
82  include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
83  $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
84  $msi->setValue($values);
85  $msi->setOptions($options);
86  $this->addFilterItem($msi);
87  }
88  else
89  {
90  include_once("./Services/Form/classes/class.ilNonEditableValueGUI.php");
91  $ne = new ilNonEditableValueGUI($lng->txt("trac_filter_hidden"),
92  "dummy");
93  $ne->setValue($lng->txt("none"));
94  $this->addFilterItem($ne);
95  }
96 
97  // title/description
98  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
99  $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
100  $ti->setMaxLength(64);
101  $ti->setSize(20);
102  $ti->setValue($filter_gui->filter->getQueryString());
103  $this->addFilterItem($ti);
104 
105  // repository area selection
106  include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
107  $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
108  $rs->setSelectText($lng->txt("trac_select_area"));
109  $this->addFilterItem($rs);
110  $rs->readFromSession();
111 
112  }
113 
117  protected function fillRow($object_id)
118  {
119  global $lng, $ilObjDataCache, $ilCtrl;
120 
121  $this->tpl->setCurrentBlock("item_command");
122  $ilCtrl->setParameterByClass('illpfiltergui','hide',$object_id);
123  $this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTargetByClass('illpfiltergui','hide'));
124  $this->tpl->setVariable("TXT_COMMAND", $lng->txt('trac_hide'));
125  $this->tpl->parseCurrentBlock();
126 
127  //$this->tpl->setVariable("", );
128 
129  $item_list = ilLPItemListFactory::_getInstance(0,$object_id,$ilObjDataCache->lookupType($object_id));
130  $item_list->addCheckbox("");
131  $item_list->setCmdClass(get_class($this->parent_obj));
132  $item_list->addReferences($this->objs[$object_id]['ref_ids']);
133  $item_list->enable('path');
134  $item_list->renderObjectList();
135 
136  // Hide link
137  $this->tpl->setVariable("OBJ_ID", $object_id);
138  $this->tpl->setVariable("ITEM_HTML",$item_list->getHTML());
140  $item_list->getUserStatus());
141  }
142 
143 }
144 ?>