ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilLMEditGSToolProvider Class Reference

Learning module editing GS tool provider. More...

+ Inheritance diagram for ilLMEditGSToolProvider:
+ Collaboration diagram for ilLMEditGSToolProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getToolsForContextStack (CalledContexts $called_contexts)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
 __construct (Container $dic)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

Data Fields

const SHOW_TREE = 'show_tree'
 

Private Member Functions

 getContent ()
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
ToolIdentificationProviderInterface $identification_provider
 
ContextCollection $context_collection
 
ToolFactory $factory
 

Detailed Description

Learning module editing GS tool provider.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..com

Definition at line 14 of file class.ilLMEditGSToolProvider.php.

Member Function Documentation

◆ getContent()

ilLMEditGSToolProvider::getContent ( )
private
Returns
string

Definition at line 74 of file class.ilLMEditGSToolProvider.php.

References $DIC.

Referenced by getToolsForContextStack().

74  : string
75  {
76  global $DIC;
77  $request = $DIC->learningModule()
78  ->internal()
79  ->gui()
80  ->editing()
81  ->request();
82 
83  $lm = new ilObjLearningModule($request->getRefId());
84 
85  $exp = new ilLMEditorExplorerGUI("illmeditorgui", "showTree", $lm);
86 
87  return $exp->getHTML(true);
88  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ getToolsForContextStack()

ilLMEditGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

Implements ILIAS\GlobalScreen\Scope\Tool\Provider\DynamicToolProvider.

Definition at line 31 of file class.ilLMEditGSToolProvider.php.

References $c, $id, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), getContent(), ilUtil\getImagePath(), and ILIAS\GlobalScreen\Scope\Footer\Factory\withTitle().

31  : array
32  {
33  $tools = [];
34  $additional_data = $called_contexts->current()->getAdditionalData();
35  if ($additional_data->is(self::SHOW_TREE, true)) {
36  $title = $this->dic->language()->txt('objs_st');
37  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("standard/icon_chp.svg"), $title);
38 
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  $identification = $iff("tree");
46  $hashed = $this->hash($identification->serialize());
47  $tools[] = $this->factory->tool($identification)
48  ->addComponentDecorator(static function (ILIAS\UI\Component\Component $c) use ($hashed): ILIAS\UI\Component\Component {
49  if ($c instanceof LegacySlate) {
50  $signal_id = $c->getToggleSignal()->getId();
51  return $c->withAdditionalOnLoadCode(static function ($id) use ($hashed) {
52  return "document.addEventListener('il-lm-editor-tree', () => {
53  il.UI.maincontrols.mainbar.engageTool('$hashed');
54  });";
55  });
56  }
57  return $c;
58  })
59  ->withTitle($title)
60  ->withSymbol($icon)
61  ->withContentWrapper(function () use ($l) {
62  return $l($this->getContent());
63  });
64  }
65 
66  return $tools;
67  }
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$c
Definition: deliver.php:9
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilLMEditGSToolProvider::isInterestedInContexts ( )

Field Documentation

◆ SHOW_TREE

const ilLMEditGSToolProvider::SHOW_TREE = 'show_tree'

The documentation for this class was generated from the following file: