ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTaxonomySettingsGUI Class Reference

ilTaxonomySettingsGUI: ilObjTaxonomyGUI More...

+ Collaboration diagram for ilTaxonomySettingsGUI:

Public Member Functions

 __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)
 
 executeCommand ()
 

Protected Member Functions

 listTaxonomies ()
 

Protected Attributes

ilTabsGUI $tabs
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilToolbarGUI $toolboar
 
ILIAS Taxonomy Settings ModifierGUIInterface $modifier
 
string $list_info
 
bool $multiple
 
ILIAS Taxonomy InternalGUIService $gui
 
ILIAS Taxonomy InternalDomainService $domain
 
int $rep_obj_id
 
bool $assigned_item_sorting = false
 
ilTaxAssignedItemInfo $assigned_item_info_obj
 
string $assigned_item_comp_id = ""
 
int $assigned_item_obj_id = 0
 
string $assigned_item_type = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTaxonomySettingsGUI::__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 
)

Definition at line 44 of file class.ilTaxonomySettingsGUI.php.

References $domain, $gui, $list_info, $modifier, $multiple, $rep_obj_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\UI\examples\MainControls\SystemInfo\multiple(), and ILIAS\Repository\tabs().

51  {
52  $this->domain = $domain;
53  $this->gui = $gui;
54 
55  $this->toolboar = $gui->toolbar();
56  $this->ctrl = $gui->ctrl();
57  $this->tpl = $gui->ui()->mainTemplate();
58  $this->tabs = $gui->tabs();
59 
60  $this->lng = $domain->lng();
61 
62  $this->rep_obj_id = $rep_obj_id;
63  $this->multiple = $multiple;
64  $this->list_info = $list_info;
65  $this->modifier = $modifier;
66 
67  }
multiple()
description: > This example show how the UI-Elements itself looks like.
Definition: multiple.php:36
ILIAS Taxonomy InternalGUIService $gui
ILIAS Taxonomy InternalDomainService $domain
ILIAS Taxonomy Settings ModifierGUIInterface $modifier
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilTaxonomySettingsGUI::executeCommand ( )

Definition at line 84 of file class.ilTaxonomySettingsGUI.php.

References ILIAS\Repository\ctrl(), ilCtrl\getCmd(), ilCtrl\getNextClass(), ilCtrl\setReturn(), and ILIAS\Repository\tabs().

84  : void
85  {
86  $ctrl = $this->gui->ctrl();
87 
88  $next_class = $ctrl->getNextClass($this);
89  $cmd = $ctrl->getCmd("listTaxonomies");
90 
91  $this->tabs->activateSubTab("tax_settings");
92 
93  switch ($next_class) {
94 
95  case strtolower(ilObjTaxonomyGUI::class):
96  $ctrl->setReturn($this, "");
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
104  );
105  }
106  $this->ctrl->forwardCommand($tax_gui);
107  break;
108 
109  default:
110  if (in_array($cmd, ["listTaxonomies"])) {
111  $this->$cmd();
112  }
113  }
114  }
getCmd(?string $fallback_command=null)
getNextClass($a_gui_class=null)
+ Here is the call graph for this function:

◆ listTaxonomies()

ilTaxonomySettingsGUI::listTaxonomies ( )
protected

Definition at line 116 of file class.ilTaxonomySettingsGUI.php.

References $components, Vendor\Package\$f, $multiple, $r, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\UI\examples\MainControls\SystemInfo\multiple().

116  : void
117  {
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")
126  );
127  } else {
128  $this->tpl->setOnScreenMessage('info', $this->lng->txt("tax_max_one_tax"));
129  }
130  $items = [];
131  foreach($tax_ids as $t) {
132  $this->ctrl->setParameterByClass(ilObjTaxonomyGUI::class, "tax_id", $t["tax_id"]);
133  $action = [];
134  $action[] = $f->button()->shy(
135  $this->lng->txt("edit"),
136  $this->ctrl->getLinkTargetByClass(ilObjTaxonomyGUI::class, "listNodes")
137  );
138  $action[] = $f->button()->shy(
139  $this->lng->txt("delete"),
140  $this->ctrl->getLinkTargetByClass(ilObjTaxonomyGUI::class, "confirmDeleteTaxonomy")
141  );
142  $properties = [];
143  if ($this->modifier) {
144  $properties = $this->modifier->getProperties((int) $t["tax_id"]);
145  foreach ($this->modifier->getActions((int) $t["tax_id"]) as $act) {
146  $action[] = $act;
147  }
148  }
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);
153  }
154  $items[] = $item;
155  }
156  $title = ($this->multiple)
157  ? $this->lng->txt("obj_taxf")
158  : $this->lng->txt("obj_tax");
159  $panel = $f->panel()->listing()->standard(
160  $title,
161  [$f->item()->group("", $items) ]
162  );
163  $components = [];
164  if ($this->list_info !== "") {
165  $this->tpl->setOnScreenMessage("info", $this->list_info);
166  }
167  $components[] = $panel;
168  $this->tpl->setContent($r->render($components));
169  }
$components
multiple()
description: > This example show how the UI-Elements itself looks like.
Definition: multiple.php:36
$r
+ Here is the call graph for this function:

◆ withAssignedItemSorting()

ilTaxonomySettingsGUI::withAssignedItemSorting ( ilTaxAssignedItemInfo  $a_item_info_obj,
string  $a_component_id,
int  $a_obj_id,
string  $a_item_type 
)

Definition at line 69 of file class.ilTaxonomySettingsGUI.php.

74  : self {
75  $new = clone $this;
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;
81  return $new;
82  }

Field Documentation

◆ $assigned_item_comp_id

string ilTaxonomySettingsGUI::$assigned_item_comp_id = ""
protected

Definition at line 39 of file class.ilTaxonomySettingsGUI.php.

◆ $assigned_item_info_obj

ilTaxAssignedItemInfo ilTaxonomySettingsGUI::$assigned_item_info_obj
protected

Definition at line 38 of file class.ilTaxonomySettingsGUI.php.

◆ $assigned_item_obj_id

int ilTaxonomySettingsGUI::$assigned_item_obj_id = 0
protected

Definition at line 40 of file class.ilTaxonomySettingsGUI.php.

◆ $assigned_item_sorting

bool ilTaxonomySettingsGUI::$assigned_item_sorting = false
protected

Definition at line 37 of file class.ilTaxonomySettingsGUI.php.

◆ $assigned_item_type

string ilTaxonomySettingsGUI::$assigned_item_type = ""
protected

Definition at line 41 of file class.ilTaxonomySettingsGUI.php.

◆ $ctrl

ilCtrl ilTaxonomySettingsGUI::$ctrl
protected

Definition at line 28 of file class.ilTaxonomySettingsGUI.php.

◆ $domain

ILIAS Taxonomy InternalDomainService ilTaxonomySettingsGUI::$domain
protected

Definition at line 35 of file class.ilTaxonomySettingsGUI.php.

Referenced by __construct().

◆ $gui

ILIAS Taxonomy InternalGUIService ilTaxonomySettingsGUI::$gui
protected

Definition at line 34 of file class.ilTaxonomySettingsGUI.php.

Referenced by __construct().

◆ $list_info

string ilTaxonomySettingsGUI::$list_info
protected

Definition at line 32 of file class.ilTaxonomySettingsGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilTaxonomySettingsGUI::$lng
protected

Definition at line 29 of file class.ilTaxonomySettingsGUI.php.

◆ $modifier

ILIAS Taxonomy Settings ModifierGUIInterface ilTaxonomySettingsGUI::$modifier
protected

Definition at line 31 of file class.ilTaxonomySettingsGUI.php.

Referenced by __construct().

◆ $multiple

bool ilTaxonomySettingsGUI::$multiple
protected

Definition at line 33 of file class.ilTaxonomySettingsGUI.php.

Referenced by __construct(), and listTaxonomies().

◆ $rep_obj_id

int ilTaxonomySettingsGUI::$rep_obj_id
protected

Definition at line 36 of file class.ilTaxonomySettingsGUI.php.

Referenced by __construct().

◆ $tabs

ilTabsGUI ilTaxonomySettingsGUI::$tabs
protected

Definition at line 26 of file class.ilTaxonomySettingsGUI.php.

◆ $toolboar

ilToolbarGUI ilTaxonomySettingsGUI::$toolboar
protected

Definition at line 30 of file class.ilTaxonomySettingsGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilTaxonomySettingsGUI::$tpl
protected

Definition at line 27 of file class.ilTaxonomySettingsGUI.php.


The documentation for this class was generated from the following file: