ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilWorkspaceGSToolProvider.php
Go to the documentation of this file.
1<?php
2
6
13{
14 const SHOW_WS_TREE = 'show_ws_tree';
15
16
21 {
22 return $this->context_collection->main()->desktop();
23 }
24
25
29 public function getToolsForContextStack(CalledContexts $called_contexts) : array
30 {
31 $tools = [];
32 $additional_data = $called_contexts->current()->getAdditionalData();
33
34 $title = $this->dic->language()->txt("objs_fold");
35
36 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard("fold", $title)->withIsOutlined(true);
37
38 if ($additional_data->is(self::SHOW_WS_TREE, true)) {
39 $iff = function ($id) {
40 return $this->identification_provider->contextAwareIdentifier($id);
41 };
42 $l = function (string $content) {
43 return $this->dic->ui()->factory()->legacy($content);
44 };
45 $ref_id = $called_contexts->current()->getReferenceId()->toInt();
46 $tools[] = $this->factory->tool($iff("tree"))
47 ->withTitle($title)
48 ->withSymbol($icon)
49 ->withContentWrapper(function () use ($l) {
50 return $l($this->getTree());
51 });
52 }
53
54 return $tools;
55 }
56
57
63 private function getTree() : string
64 {
65 global $DIC;
66
67 $user = $DIC->user();
68 $exp = new ilWorkspaceExplorerGUI($user->getId(), ["ilPersonalWorkspaceGUI", "ilObjWorkspaceFolderGUI"], "render", "ilObjWorkspaceFolderGUI", "", "wsp_id");
69 $exp->setTypeWhiteList(array("wsrt", "wfld"));
70 $exp->setSelectableTypes(array("wsrt", "wfld"));
71 $exp->setLinkToNodeClass(true);
72 $exp->setAjax(false);
73 $exp->setActivateHighlighting(true);
74
75 return $exp->getHTML(true);
76 }
77}
An exception for terminatinating execution or to throw for unit testing.
Explorer for selecting a personal workspace item.
getToolsForContextStack(CalledContexts $called_contexts)
@inheritDoc
$DIC
Definition: xapitoken.php:46