ILIAS  release_7 Revision v7.30-3-g800a261c036
ilLMEditGSToolProvider Class Reference

Learning module editing GS tool provider. More...

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

Public Member Functions

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

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
 $identification_provider
 
 $context_collection
 
 $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

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
Parameters
int$ref_id
Returns
string

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

78 : string
79 {
81 $lm = $service->getLearningModule();
82
83 $exp = new ilLMEditorExplorerGUI("illmeditorgui", "showTree", $lm);
84
85 return $exp->getHTML();
86 }
$_GET["client_id"]
Main service init and factory.
LM editor explorer GUI class.
$service
Definition: result.php:17

References $_GET, and $service.

Referenced by getToolsForContextStack().

+ Here is the caller graph for this function:

◆ getToolsForContextStack()

ilLMEditGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

@inheritDoc

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

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

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("outlined/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 "
53 console.log('trigger added');
54 $('body').on('il-lm-editor-tree', function(){
55 il.UI.maincontrols.mainbar.engageTool('$hashed');
56 console.log('trigger tree');
57 });";
58 });
59 }
60 return $c;
61 })
62 ->withTitle($title)
63 ->withSymbol($icon)
64 ->withContentWrapper(function () use ($l) {
65 return $l($this->getContent());
66 });
67 }
68
69 return $tools;
70 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$c
Definition: cli.php:37
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.

References $c, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), getContent(), and ilUtil\getImagePath().

+ 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: