ILIAS  release_8 Revision v8.24
class.ilWorkspaceGSToolProvider.php
Go to the documentation of this file.
1<?php
2
6
13{
14 public const SHOW_WS_TREE = 'show_ws_tree';
15
17 {
18 return $this->context_collection->main()->desktop();
19 }
20
21 public function getToolsForContextStack(CalledContexts $called_contexts): array
22 {
23 $tools = [];
24 $additional_data = $called_contexts->current()->getAdditionalData();
25
26 $title = $this->dic->language()->txt("objs_fold");
27
28 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard("fold", $title);
29
30 if ($additional_data->is(self::SHOW_WS_TREE, true)) {
31 $iff = function ($id) {
32 return $this->identification_provider->contextAwareIdentifier($id);
33 };
34 $l = function (string $content) {
35 return $this->dic->ui()->factory()->legacy($content);
36 };
37 $ref_id = $called_contexts->current()->getReferenceId()->toInt();
38 $tools[] = $this->factory->tool($iff("tree"))
39 ->withTitle($title)
40 ->withSymbol($icon)
41 ->withContentWrapper(function () use ($l) {
42 return $l($this->getTree());
43 });
44 }
45
46 return $tools;
47 }
48
49 private function getTree(): string
50 {
51 global $DIC;
52
53 $user = $DIC->user();
54 $exp = new ilWorkspaceExplorerGUI($user->getId(), ["ilPersonalWorkspaceGUI", "ilObjWorkspaceFolderGUI"], "render", "ilObjWorkspaceFolderGUI", "", "wsp_id");
55 $exp->setTypeWhiteList(array("wsrt", "wfld"));
56 $exp->setSelectableTypes(array("wsrt", "wfld"));
57 $exp->setLinkToNodeClass(true);
58 $exp->setAjax(false);
59 $exp->setActivateHighlighting(true);
60
61 return $exp->getHTML(true);
62 }
63}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Explorer for selecting a personal workspace item.
getToolsForContextStack(CalledContexts $called_contexts)
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67