ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 }
setTypeWhiteList(array $a_val)
Set type white list.
getToolsForContextStack(CalledContexts $called_contexts)
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
Explorer for selecting a personal workspace item.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23