27 protected \ILIAS\DI\UIServices
$ui;
28 protected \ILIAS\Taxonomy\InternalGUIService
$gui;
29 protected \ILIAS\Taxonomy\InternalDomainService
$domain;
51 $service = $DIC->taxonomy()->internal();
53 $this->domain = $domain =
$service->domain();
55 $this->
ctrl = $gui->ctrl();
56 $this->
tabs = $gui->tabs();
57 $this->
toolbar = $gui->toolbar();
58 $this->tpl = $gui->ui()->mainTemplate();
59 $this->
help = $gui->help();
61 $this->request = $gui->http()->request();
63 $this->
lng = $domain->lng();
64 $this->
user = $domain->user();
65 $this->
ui = $gui->ui();
70 $this->
ctrl->saveParameter($this,
"tax_node");
71 $this->
ctrl->saveParameter($this,
"tax_id");
73 $this->
lng->loadLanguageModule(
"tax");
76 $params = $this->request->getQueryParams();
77 $this->current_tax_node = (
int) (
$params[
"tax_node"] ?? null);
78 $this->requested_tax_id = (
int) (
$params[
"tax_id"] ?? null);
79 $this->requested_move_ids = (string) (
$params[
"move_ids"] ??
"");
92 $this->assigned_object_id = $a_val;
121 $this->list_info = trim($a_val);
134 string $a_component_id,
138 $this->assigned_item_sorting =
true;
139 $this->assigned_item_info_obj = $a_item_info_obj;
140 $this->assigned_item_comp_id = $a_component_id;
141 $this->assigned_item_obj_id = $a_obj_id;
142 $this->assigned_item_type = $a_item_type;
151 $this->
tabs->activateSubTab(
"tax_settings");
153 $cmd = $ilCtrl->getCmd(
"listTaxonomies");
181 if (in_array($tax_id, $tax_ids)) {
211 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
212 $ilToolbar->addFormButton(
$lng->
txt(
"tax_create_node"),
"createTaxNode");
214 $ilToolbar->setCloseFormTag(
false);
220 if ($tax_node === 0) {
223 $tree = $tax->getTree();
258 return parent::checkPermissionBool($perm, $cmd,
$type,
$node_id);
277 $this->requested_new_type =
"tax";
279 parent::saveObject();
292 $a_new_object->
getId(),
295 $ilCtrl->setParameter($this,
"tax_id", $a_new_object->
getId());
296 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"tax_added"),
true);
297 $ilCtrl->redirect($this,
"editSettings");
301 public function showTree(
bool $a_ass_items =
false): void
309 ?
"listAssignedItems" 312 $DIC->globalScreen()->tool()->context()->current()
317 $DIC->globalScreen()->tool()->context()->current()
322 $DIC->globalScreen()->tool()->context()->current()
327 $DIC->globalScreen()->tool()->context()->current()
332 $DIC->globalScreen()->tool()->context()->current()
357 $ilHelp->setSubScreenId(
"create_node");
380 $or->setMaxLength(5);
385 if ($a_mode ==
"edit") {
387 $ti->setValue($node->getTitle());
388 if (is_object($or)) {
389 $or->setValue($node->getOrderNr());
394 if ($a_mode ==
"create") {
395 $form->addCommandButton(
"saveTaxNode",
$lng->
txt(
"save"));
396 $form->addCommandButton(
"listNodes",
$lng->
txt(
"cancel"));
397 $form->setTitle(
$lng->
txt(
"tax_new_tax_node"));
399 $form->addCommandButton(
"updateTaxNode",
$lng->
txt(
"save"));
400 $form->addCommandButton(
"listNodes",
$lng->
txt(
"cancel"));
401 $form->setTitle(
$lng->
txt(
"tax_edit_tax_node"));
404 $form->setFormAction($ilCtrl->getFormAction($this));
419 if ($form->checkInput()) {
422 $node->setTitle($form->getInput(
"title"));
427 $order_nr = $form->getInput(
"order_nr");
429 if ($order_nr ===
"") {
433 $node->setOrderNr($order_nr);
434 $node->setTaxonomyId($tax->getId());
442 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
443 $ilCtrl->redirect($this,
"listNodes");
445 $form->setValuesByPost();
460 if ($form->checkInput()) {
463 $node->setTitle($form->getInput(
"title"));
467 $node->setOrderNr($form->getInput(
"order_nr"));
472 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"msg_obj_modified"),
true);
473 $ilCtrl->redirect($this,
"");
475 $form->setValuesByPost();
489 $body = $this->request->getParsedBody();
491 if (!isset($body[
"id"])) {
492 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
493 $ilCtrl->redirect($this,
"listNodes");
497 $ilHelp->setSubScreenId(
"del_items");
503 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
504 $confirmation_gui->setHeaderText($this->
lng->txt(
"info_delete_sure"));
507 foreach ($body[
"id"] as
$id) {
508 $confirmation_gui->addItem(
515 $confirmation_gui->setCancel(
$lng->
txt(
"cancel"),
"listNodes");
516 $confirmation_gui->setConfirm(
$lng->
txt(
"confirm"),
"confirmedDelete");
527 $body = $this->request->getParsedBody();
530 foreach ($body[
"id"] as
$id) {
534 $node_data = $tax_tree->getNodeData($id);
535 if (is_object($node)) {
538 if ($tax_tree->isInTree($id)) {
539 $tax_tree->deleteTree($node_data);
545 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"info_deleted"),
true);
547 $ilCtrl->redirect($this,
"listNodes");
557 $body = $this->request->getParsedBody();
560 if (is_array($body[
"order"] ??
false)) {
561 foreach ($body[
"order"] as $k => $v) {
568 if (is_array($body[
"title"] ??
false)) {
569 foreach ($body[
"title"] as $k => $v) {
576 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"));
577 $ilCtrl->redirect($this,
"listNodes");
589 $body = $this->request->getParsedBody();
591 if (!isset($body[
"id"])) {
592 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
593 $ilCtrl->redirect($this,
"listNodes");
597 $ilHelp->setSubScreenId(
"move_items");
599 $ilToolbar->addButton(
601 $ilCtrl->getLinkTarget($this,
"listNodes")
604 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"tax_please_select_target"));
606 if (is_array($body[
"id"])) {
607 $ilCtrl->setParameter($this,
"move_ids", implode(
",", $body[
"id"]));
618 if (!$tax_exp->handleCommand()) {
632 if ($this->requested_move_ids !=
"") {
633 $move_ids = explode(
",", $this->requested_move_ids);
635 $tree = $tax->getTree();
638 foreach ($move_ids as $m_id) {
641 if ($node->getTaxonomyId() == $tax->getId() &&
642 ($target_node->getTaxonomyId() == $tax->getId() ||
646 $m_id == $target_node->getId()) {
647 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"tax_target_within_nodes"),
true);
648 $this->
ctrl->redirect($this,
"listNodes");
662 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
663 $ilCtrl->redirect($this,
"listNodes");
678 $cgui->setFormAction($ilCtrl->getFormAction($this));
679 $cgui->setHeaderText(
$lng->
txt(
"tax_confirm_deletion"));
680 $cgui->setCancel(
$lng->
txt(
"cancel"),
"returnToSettingsParent");
681 $cgui->setConfirm(
$lng->
txt(
"delete"),
"deleteTaxonomy");
683 $cgui->addItem(
"id[]", 0, $tax->getTitle());
699 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"tax_tax_deleted"),
true);
714 if (count($tax_ids) == 0 || $this->
getMultiple()) {
715 $ilToolbar->addButton(
717 $ilCtrl->getLinkTarget($this,
"createAssignedTaxonomy")
720 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"tax_max_one_tax"));
735 return $this->
ctrl->getParentReturn($this);
754 $ilTabs->clearTargets();
762 $ilTabs->setBackTarget(
770 $ilCtrl->getLinkTarget($this,
"listNodes")
772 if ($this->assigned_item_sorting) {
775 $lng->
txt(
"tax_assigned_items"),
776 $ilCtrl->getLinkTarget($this,
"listAssignedItems")
782 $ilCtrl->getLinkTarget($this,
"editSettings")
785 $ilTabs->activateTab($a_id);
812 $ti->setMaxLength(200);
815 $ti->setValue($tax->getTitle());
822 $ta->
setValue($tax->getDescription());
833 $si->setValue($tax->getSortingMode());
836 if ($this->assigned_item_sorting) {
838 $cb->setChecked($tax->getItemSorting());
842 $form->addCommandButton(
"updateSettings",
$lng->
txt(
"save"));
844 $form->setTitle(
$lng->
txt(
"settings"));
845 $form->setFormAction($ilCtrl->getFormAction($this));
860 if ($form->checkInput()) {
862 $tax->setTitle($form->getInput(
"title"));
863 $tax->setDescription($form->getInput(
"description"));
864 $tax->setSortingMode((
int) $form->getInput(
"sorting"));
865 $tax->setItemSorting((
bool) $form->getInput(
"item_sorting"));
868 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
869 $ilCtrl->redirect($this,
"editSettings");
871 $form->setValuesByPost();
892 $this->current_tax_node,
894 $this->assigned_item_comp_id,
895 $this->assigned_item_obj_id,
896 $this->assigned_item_type,
897 $this->assigned_item_info_obj
910 $body = $this->request->getParsedBody();
912 if (is_array($body[
"order"])) {
913 $order = $body[
"order"];
915 foreach ($order as $a_item_id => $ord_nr) {
917 $this->assigned_item_comp_id,
918 $this->assigned_item_obj_id,
919 $this->assigned_item_type,
922 $tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
925 $this->assigned_item_comp_id,
926 $this->assigned_item_obj_id,
927 $this->assigned_item_type,
930 $tax_ass->fixOrderNr($tax_node);
931 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
933 $ilCtrl->redirect($this,
"listAssignedItems");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showTree(bool $a_ass_items=false)
moveTree(int $a_source_id, int $a_target_id, int $a_location=self::POS_LAST_NODE)
Move Tree Implementation public.
deleteTaxonomy()
Delete taxonomy.
static getNextOrderNr(int $a_tax_id, int $a_parent_id)
Put this node into the taxonomy tree.
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...
editSettings()
Edit settings.
string $requested_move_ids
ILIAS Taxonomy InternalDomainService $domain
int $assigned_item_obj_id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
deleteItems()
Confirm deletion screen for items.
saveTaxNode()
Save tax node form.
New implementation of ilObjectGUI.
updateSettings()
Update taxonomy settings.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Class ChatMainBarProvider .
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
listTaxonomies()
List taxonomies.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
bool $assigned_item_sorting
static writeTitle(int $a_node_id, string $a_title)
Write title.
initCreationForms(string $a_new_type)
Init creation forms.
createTaxNode()
Create tax node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
executeCommand()
Execute command.
saveAssignedItemsSorting()
Save assigned items sorting.
createAssignedTaxonomy()
Create assigned taxonomy.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
handleCommand()
Handle explorer internal command.
confirmDeleteTaxonomy()
Confirm taxonomy deletion.
afterSave(ilObject $a_new_object)
After saving,.
setAssignedObject(int $a_val)
isGrandChild(int $a_startnode_id, int $a_querynode_id)
checks if a node is in the path of an other node
setValue(string $a_value)
activateAssignedItemSorting(ilTaxAssignedItemInfo $a_item_info_obj, string $a_component_id, int $a_obj_id, string $a_item_type)
Activate sorting mode of assigned objects.
ilTaxAssignedItemInfo $assigned_item_info_obj
ILIAS Taxonomy InternalGUIService $gui
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setScreenIdComponent(string $a_comp)
static _lookupTitle(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
pasteItems()
Paste items (move operation)
ilGlobalTemplateInterface $tpl
static putInTree(int $a_tax_id, ilTaxonomyNode $a_node, int $a_parent_id=0, int $a_target_node_id=0, int $a_order_nr=0)
updateTaxNode()
Update tax node.
getParentId(int $a_node_id)
get parent id of given node
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
static _lookupDescription(int $obj_id)
confirmedDelete()
Delete taxonomy nodes.
setTabs()
create tabs (repository/workspace switch)
static saveUsage(int $a_tax_id, int $a_obj_id)
static writeOrderNr(int $a_node_id, int $a_order_nr)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
listAssignedItems()
List assigned items.
setDescription(string $a_descr)
Sets description below title in standard template.
initCreateForm(string $new_type)
This class represents a text area property in a property form.
setListInfo(string $a_val)
initTaxNodeForm(string $a_mode="edit")
string $assigned_item_type
saveSorting()
Save settings and sorting.
redirectToURL(string $target_url)
ILIAS Taxonomy Settings ModifierGUIInterface $modifier
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setOpenFormTag(bool $a_val)
setModifier(?\ILIAS\Taxonomy\TaxonomyModifierGUI $modifier)
static fixOrderNumbers(int $a_tax_id, int $a_parent_id)
string $assigned_item_comp_id
setMultiple(bool $a_val)
Set multiple.