ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTaxAssignedItemsTableGUI.php
Go to the documentation of this file.
1<?php
2
24{
27 protected int $node_id;
28 protected string $comp_id;
29 protected int $obj_id;
30 protected string $item_type;
32
36 public function __construct(
37 $a_parent_obj,
38 string $a_parent_cmd,
39 int $a_node_id,
40 ilObjTaxonomy $a_tax,
41 string $a_comp_id,
42 int $a_obj_id,
43 string $a_item_type,
44 ilTaxAssignedItemInfo $a_info_obj
45 ) {
46 global $DIC;
47
48 $this->ctrl = $DIC->ctrl();
49 $this->lng = $DIC->language();
50 $this->access = $DIC->access();
51
52 $ilCtrl = $DIC->ctrl();
53 $lng = $DIC->language();
54
55 $this->setId("tax_ass_it");
56 $this->setLimit(9999);
57 $this->tax = $a_tax;
58 $this->node_id = $a_node_id;
59 $this->comp_id = $a_comp_id;
60 $this->obj_id = $a_obj_id;
61 $this->item_type = $a_item_type;
62 $this->info_obj = $a_info_obj;
63
64 parent::__construct($a_parent_obj, $a_parent_cmd);
65
66 $tax_ass = new ilTaxNodeAssignment($this->comp_id, $this->obj_id, $this->item_type, $this->tax->getId());
67 $this->setData($tax_ass->getAssignmentsOfNode($this->node_id));
68 $this->setTitle($lng->txt("tax_assigned_items"));
69
70 $this->addColumn($this->lng->txt("tax_order"));
71 $this->setDefaultOrderField("order_nr");
72 $this->setDefaultOrderDirection("asc");
73
74 $this->addColumn($this->lng->txt("title"));
75
76 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
77 $this->setRowTemplate("tpl.tax_ass_items_row.html", "components/ILIAS/Taxonomy");
78 $this->addCommandButton("saveAssignedItemsSorting", $lng->txt("save"));
79 }
80
81 public function numericOrdering(string $a_field): bool
82 {
83 return $a_field == "order_nr";
84 }
85
86 protected function fillRow(array $a_set): void
87 {
88 $this->tpl->setVariable("ONODE_ID", $a_set["item_id"]);
89 $this->tpl->setVariable("ORDER_NR", (int) $a_set["order_nr"]);
90 $this->tpl->setVariable("TITLE", $this->info_obj->getTitle(
91 $a_set["component"],
92 $a_set["item_type"],
93 (int) $a_set["item_id"]
94 ));
95 }
96}
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct( $a_parent_obj, string $a_parent_cmd, int $a_node_id, ilObjTaxonomy $a_tax, string $a_comp_id, int $a_obj_id, string $a_item_type, ilTaxAssignedItemInfo $a_info_obj)
Constructor.
numericOrdering(string $a_field)
Should this field be sorted numeric?
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26