ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLMEditGSToolProvider.php
Go to the documentation of this file.
1 <?php
2 
6 
13 {
14  const SHOW_TREE = 'show_tree';
15 
16 
21  {
22  return $this->context_collection->main()->repository();
23  }
24 
25 
29  public function getToolsForContextStack(CalledContexts $called_contexts) : array
30  {
31  $tools = [];
32  $additional_data = $called_contexts->current()->getAdditionalData();
33  if ($additional_data->is(self::SHOW_TREE, true)) {
34  $title = $this->dic->language()->txt('objs_st');
35  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("outlined/icon_chp.svg"), $title);
36 
37  $iff = function ($id) {
38  return $this->identification_provider->contextAwareIdentifier($id);
39  };
40  $l = function (string $content) {
41  return $this->dic->ui()->factory()->legacy($content);
42  };
43  $tools[] = $this->factory->tool($iff("tree"))
44  ->withTitle($title)
45  ->withSymbol($icon)
46  ->withContentWrapper(function () use ($l) {
47  return $l($this->getContent());
48  });
49  }
50 
51  return $tools;
52  }
53 
54 
60  private function getContent() : string
61  {
63  $lm = $service->getLearningModule();
64 
65  $exp = new ilLMEditorExplorerGUI("illmeditorgui", "showTree", $lm);
66 
67  return $exp->getHTML();
68  }
69 }
$_GET["client_id"]
LM editor explorer GUI class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$service
Definition: result.php:17
Learning module editing GS tool provider.
Main service init and factory.
getToolsForContextStack(CalledContexts $called_contexts)