19 declare(strict_types=1);
31 protected ?\ILIAS\Taxonomy\Settings\ModifierGUIInterface
$modifier;
34 protected \ILIAS\Taxonomy\InternalGUIService
$gui;
35 protected \ILIAS\Taxonomy\InternalDomainService
$domain;
45 \
ILIAS\Taxonomy\InternalDomainService $domain,
46 \
ILIAS\Taxonomy\InternalGUIService $gui,
48 string $list_info =
"",
49 bool $multiple =
true,
55 $this->toolboar = $gui->toolbar();
56 $this->
ctrl = $gui->ctrl();
57 $this->tpl = $gui->ui()->mainTemplate();
58 $this->
tabs = $gui->tabs();
60 $this->
lng = $domain->lng();
71 string $a_component_id,
76 $new->assigned_item_sorting =
true;
77 $new->assigned_item_info_obj = $a_item_info_obj;
78 $new->assigned_item_comp_id = $a_component_id;
79 $new->assigned_item_obj_id = $a_obj_id;
80 $new->assigned_item_type = $a_item_type;
86 $ctrl = $this->gui->ctrl();
89 $cmd = $ctrl->
getCmd(
"listTaxonomies");
91 $this->
tabs->activateSubTab(
"tax_settings");
93 switch ($next_class) {
95 case strtolower(ilObjTaxonomyGUI::class):
97 $tax_gui = $this->gui->getObjTaxonomyGUI($this->rep_obj_id);
98 if ($this->assigned_item_sorting) {
99 $tax_gui->activateAssignedItemSorting(
100 $this->assigned_item_info_obj,
101 $this->assigned_item_comp_id,
102 $this->assigned_item_obj_id,
103 $this->assigned_item_type
106 $this->
ctrl->forwardCommand($tax_gui);
110 if (in_array($cmd, [
"listTaxonomies"])) {
118 $f = $this->gui->ui()->factory();
119 $r = $this->gui->ui()->renderer();
120 $um = $this->domain->usage();
121 $tax_ids = $um->getUsageOfObject($this->rep_obj_id,
true);
122 if ($this->
multiple || count($tax_ids) === 0) {
123 $this->toolboar->addButton(
124 $this->
lng->txt(
"tax_add_taxonomy"),
125 $this->
ctrl->getLinkTargetByClass(ilObjTaxonomyGUI::class,
"createAssignedTaxonomy")
128 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"tax_max_one_tax"));
131 foreach($tax_ids as $t) {
132 $this->
ctrl->setParameterByClass(ilObjTaxonomyGUI::class,
"tax_id", $t[
"tax_id"]);
134 $action[] =
$f->button()->shy(
135 $this->
lng->txt(
"edit"),
136 $this->
ctrl->getLinkTargetByClass(ilObjTaxonomyGUI::class,
"listNodes")
138 $action[] =
$f->button()->shy(
139 $this->
lng->txt(
"delete"),
140 $this->
ctrl->getLinkTargetByClass(ilObjTaxonomyGUI::class,
"confirmDeleteTaxonomy")
143 if ($this->modifier) {
144 $properties = $this->modifier->getProperties((
int) $t[
"tax_id"]);
145 foreach ($this->modifier->getActions((
int) $t[
"tax_id"]) as $act) {
149 $dd =
$f->dropdown()->standard($action);
150 $item =
$f->item()->standard($t[
"title"])->withActions($dd);
151 if (count($properties) > 0) {
152 $item = $item->withProperties($properties);
157 ? $this->
lng->txt(
"obj_taxf")
158 : $this->
lng->txt(
"obj_tax");
159 $panel =
$f->panel()->listing()->standard(
161 [
$f->item()->group(
"", $items) ]
164 if ($this->list_info !==
"") {
165 $this->tpl->setOnScreenMessage(
"info", $this->list_info);
bool $assigned_item_sorting
ilTaxonomySettingsGUI: ilObjTaxonomyGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
ilTaxAssignedItemInfo $assigned_item_info_obj
Interface Observer Contains several chained tasks and infos about them.
getCmd(?string $fallback_command=null)
string $assigned_item_type
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $assigned_item_comp_id
getNextClass($a_gui_class=null)
multiple()
description: > This example show how the UI-Elements itself looks like.
setReturn(object $a_gui_obj, ?string $a_cmd=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
int $assigned_item_obj_id
ILIAS Taxonomy InternalGUIService $gui
__construct(\ILIAS\Taxonomy\InternalDomainService $domain, \ILIAS\Taxonomy\InternalGUIService $gui, int $rep_obj_id, string $list_info="", bool $multiple=true, ?\ILIAS\Taxonomy\Settings\ModifierGUIInterface $modifier=null)
withAssignedItemSorting(ilTaxAssignedItemInfo $a_item_info_obj, string $a_component_id, int $a_obj_id, string $a_item_type)
ILIAS Taxonomy InternalDomainService $domain
ILIAS Taxonomy Settings ModifierGUIInterface $modifier