ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTaxAssignedItemsTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
20  function __construct($a_parent_obj, $a_parent_cmd, $a_node_id, $a_tax, $a_comp_id, $a_obj_id, $a_item_type,
21  $a_info_obj)
22  {
23  global $ilCtrl, $lng, $ilAccess, $lng;
24 
25  $this->setId("tax_ass_it");
26  $this->setLimit(9999);
27  $this->tax = $a_tax;
28  $this->node_id = $a_node_id;
29  $this->comp_id = $a_comp_id;
30  $this->obj_id = $a_obj_id;
31  $this->item_type = $a_item_type;
32  $this->info_obj = $a_info_obj;
33 
34  parent::__construct($a_parent_obj, $a_parent_cmd);
35 
36  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
37 
38  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
39  $tax_ass = new ilTaxNodeAssignment($this->comp_id, $this->obj_id, $this->item_type, $this->tax->getId());
40  $this->setData($tax_ass->getAssignmentsOfNode($this->node_id));
41  $this->setTitle($lng->txt("tax_assigned_items"));
42 
43  $this->addColumn($this->lng->txt("tax_order"));
44  $this->setDefaultOrderField("order_nr");
45  $this->setDefaultOrderDirection("asc");
46 
47  $this->addColumn($this->lng->txt("title"));
48 
49  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
50  $this->setRowTemplate("tpl.tax_ass_items_row.html", "Services/Taxonomy");
51  $this->addCommandButton("saveAssignedItemsSorting", $lng->txt("save"));
52  }
53 
60  function numericOrdering($a_field)
61  {
62  if (in_array($a_field, array("order_nr")))
63  {
64  return true;
65  }
66  return false;
67  }
68 
69 
73  protected function fillRow($a_set)
74  {
75  global $lng, $ilCtrl;
76 
77  $this->tpl->setVariable("ONODE_ID", $a_set["item_id"]);
78  $this->tpl->setVariable("ORDER_NR", (int) $a_set["order_nr"]);
79  $this->tpl->setVariable("TITLE", $this->info_obj->getTitle(
80  $a_set["component"], $a_set["item_type"], $a_set["item_id"]));
81  }
82 
83 }
84 ?>