ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilTaxonomyTableGUI.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_tree,
21  $a_node_id, $a_tax)
22  {
23  global $ilCtrl, $lng, $ilAccess, $lng;
24 
25  if ($a_node_id == "")
26  {
27  $a_node_id = $a_tree->readRootId();
28  }
29 
30  $this->tree = $a_tree;
31  $this->tax = $a_tax;
32  $this->node_id = $a_node_id;
33 
34  parent::__construct($a_parent_obj, $a_parent_cmd);
35 
36  $childs = $this->tree->getChildsByTypeFilter($a_node_id,
37  array("taxn"));
38 
39  if ($a_tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
40  {
41  $childs = ilUtil::sortArray($childs, "order_nr", "asc", false);
42  }
43  else
44  {
45  $childs = ilUtil::sortArray($childs, "title", "asc", false);
46  }
47  $this->setData($childs);
48 
49  $this->setTitle($lng->txt("tax_nodes"));
50 
51  $this->addColumn($this->lng->txt(""), "", "1px", true);
52  if ($this->tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
53  {
54  $this->addColumn($this->lng->txt("tax_order"), "order_nr", "1px");
55  $this->setDefaultOrderField("order_nr");
56  $this->setDefaultOrderDirection("asc");
57  }
58  $this->addColumn($this->lng->txt("title"));
59 
60  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
61  $this->setRowTemplate("tpl.tax_row.html", "Services/Taxonomy");
62 
63  $this->addMultiCommand("deleteItems", $lng->txt("delete"));
64  $this->addMultiCommand("moveItems", $lng->txt("move"));
65  $this->addCommandButton("saveSorting", $lng->txt("save"));
66  }
67 
68 
74  function numericOrdering($a_field)
75  {
76  if (in_array($a_field, array("order_nr")))
77  {
78  return true;
79  }
80  }
81 
85  protected function fillRow($a_set)
86  {
87  global $lng, $ilCtrl;
88 
89  $ilCtrl->setParameter($this->parent_obj, "tax_node", $a_set["child"]);
90  $ret = $ilCtrl->getLinkTargetByClass("ilobjtaxonomygui", "listNodes");
91  $ilCtrl->setParameter($this->parent_obj, "tax_node", $_GET["tax_node"]);
92  if ($this->tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
93  {
94  $this->tpl->setCurrentBlock("order");
95  $this->tpl->setVariable("ORDER_NR", $a_set["order_nr"]);
96  $this->tpl->setVariable("ONODE_ID", $a_set["child"]);
97  $this->tpl->parseCurrentBlock();
98  }
99 
100  $this->tpl->setVariable("HREF_TITLE", $ret);
101 
102  $this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($a_set["title"]));
103  $this->tpl->setVariable("NODE_ID", $a_set["child"]);
104  }
105 
106 }
107 ?>
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
$_GET["client_id"]
__construct($a_parent_obj, $a_parent_cmd, $a_tree, $a_node_id, $a_tax)
Constructor.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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.
TableGUI class for taxonomies.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
numericOrdering($a_field)
Should this field be sorted numeric?
fillRow($a_set)
Fill table row.
global $lng
Definition: privfeed.php:17
$ret
Definition: parser.php:6
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.