ILIAS  release_8 Revision v8.24
class.ilTaxonomyGSToolProvider.php
Go to the documentation of this file.
1<?php
2
6
12{
13 public const SHOW_TAX_TREE = 'show_tax_tree';
14 public const TAX_TREE_GUI_PATH = 'tax_tree_gui_path';
15 public const TAX_ID = 'tax_id';
16 public const TAX_TREE_CMD = 'tax_tree_cmd';
17 public const TAX_TREE_PARENT_CMD = 'tax_tree_parent_cmd';
18
23 {
24 return $this->context_collection->main()->main();
25 }
26
30 public function getToolsForContextStack(CalledContexts $called_contexts): array
31 {
32 global $DIC;
33
34 $lng = $DIC->language();
35 $lng->loadLanguageModule("tax");
36
37 $title = $lng->txt("tax_taxonomy");
38 $icon = $DIC->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("icon_tax.svg"), $title);
39
40 $tools = [];
41 $additional_data = $called_contexts->current()->getAdditionalData();
42 if ($additional_data->is(self::SHOW_TAX_TREE, true)) {
43 $iff = fn (
44 $id
45 ): \ILIAS\GlobalScreen\Identification\IdentificationInterface => $this->identification_provider->contextAwareIdentifier($id);
46 $l = fn (
47 string $content
48 ): \ILIAS\UI\Component\Legacy\Legacy => $this->dic->ui()->factory()->legacy($content);
49 $tools[] = $this->factory->tool($iff("tree"))
50 ->withTitle($title)
51 ->withSymbol($icon)
52 ->withContentWrapper(fn (
53 ): \ILIAS\UI\Component\Legacy\Legacy => $l($this->getEditTree(
54 $additional_data->get(self::TAX_TREE_GUI_PATH),
55 $additional_data->get(self::TAX_ID),
56 $additional_data->get(self::TAX_TREE_CMD),
57 $additional_data->get(self::TAX_TREE_PARENT_CMD)
58 )));
59 }
60
61 return $tools;
62 }
63
64 private function getEditTree(array $gui_path, int $tax_id, string $cmd, string $parent_cmd): string
65 {
66 $target_gui = $gui_path[count($gui_path) - 1];
67 $tax_exp = new ilTaxonomyExplorerGUI(
68 $gui_path,
69 $parent_cmd,
70 $tax_id,
71 $target_gui,
72 $cmd
73 );
74
75 return $tax_exp->getHTML();
76 }
77}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getEditTree(array $gui_path, int $tax_id, string $cmd, string $parent_cmd)
getToolsForContextStack(CalledContexts $called_contexts)
@inheritDoc
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.
$lng