ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  protected $access;
21 
25  public function __construct(
26  $a_parent_obj,
27  $a_parent_cmd,
28  $a_node_id,
29  $a_tax,
30  $a_comp_id,
31  $a_obj_id,
32  $a_item_type,
33  $a_info_obj
34  ) {
35  global $DIC;
36 
37  $this->ctrl = $DIC->ctrl();
38  $this->lng = $DIC->language();
39  $this->access = $DIC->access();
40 
41  $ilCtrl = $DIC->ctrl();
42  $lng = $DIC->language();
43 
44  $this->setId("tax_ass_it");
45  $this->setLimit(9999);
46  $this->tax = $a_tax;
47  $this->node_id = $a_node_id;
48  $this->comp_id = $a_comp_id;
49  $this->obj_id = $a_obj_id;
50  $this->item_type = $a_item_type;
51  $this->info_obj = $a_info_obj;
52 
53  parent::__construct($a_parent_obj, $a_parent_cmd);
54 
55  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
56 
57  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
58  $tax_ass = new ilTaxNodeAssignment($this->comp_id, $this->obj_id, $this->item_type, $this->tax->getId());
59  $this->setData($tax_ass->getAssignmentsOfNode($this->node_id));
60  $this->setTitle($lng->txt("tax_assigned_items"));
61 
62  $this->addColumn($this->lng->txt("tax_order"));
63  $this->setDefaultOrderField("order_nr");
64  $this->setDefaultOrderDirection("asc");
65 
66  $this->addColumn($this->lng->txt("title"));
67 
68  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
69  $this->setRowTemplate("tpl.tax_ass_items_row.html", "Services/Taxonomy");
70  $this->addCommandButton("saveAssignedItemsSorting", $lng->txt("save"));
71  }
72 
79  public function numericOrdering($a_field)
80  {
81  if (in_array($a_field, array("order_nr"))) {
82  return true;
83  }
84  return false;
85  }
86 
87 
91  protected function fillRow($a_set)
92  {
93  $lng = $this->lng;
95 
96  $this->tpl->setVariable("ONODE_ID", $a_set["item_id"]);
97  $this->tpl->setVariable("ORDER_NR", (int) $a_set["order_nr"]);
98  $this->tpl->setVariable("TITLE", $this->info_obj->getTitle(
99  $a_set["component"],
100  $a_set["item_type"],
101  $a_set["item_id"]
102  ));
103  }
104 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
Taxonomy node <-> item assignment.
global $DIC
Definition: saml.php:7
__construct( $a_parent_obj, $a_parent_cmd, $a_node_id, $a_tax, $a_comp_id, $a_obj_id, $a_item_type, $a_info_obj)
Constructor.
TableGUI class for taxonomy list.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
setLimit($a_limit=0, $a_default_limit=0)