ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 30 of file class.ilLMEditGSToolProvider.php.

Member Function Documentation

◆ getContent()

ilLMEditGSToolProvider::getContent ( )
private
Returns
string

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

References $DIC.

Referenced by getToolsForContextStack().

90  : string
91  {
92  global $DIC;
93  $request = $DIC->learningModule()
94  ->internal()
95  ->gui()
96  ->editing()
97  ->request();
98 
99  $lm = new ilObjLearningModule($request->getRefId());
100 
101  $exp = new ilLMEditorExplorerGUI("illmeditorgui", "showTree", $lm);
102 
103  return $exp->getHTML(true);
104  }
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:22
+ Here is the caller graph for this function:

◆ getToolsForContextStack()

ilLMEditGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

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

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

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

47  : array
48  {
49  $tools = [];
50  $additional_data = $called_contexts->current()->getAdditionalData();
51  if ($additional_data->is(self::SHOW_TREE, true)) {
52  $title = $this->dic->language()->txt('objs_st');
53  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("standard/icon_chp.svg"), $title);
54 
55  $iff = function ($id) {
56  return $this->identification_provider->contextAwareIdentifier($id);
57  };
58  $l = function (string $content) {
59  return $this->dic->ui()->factory()->legacy()->content($content);
60  };
61  $identification = $iff("tree");
62  $hashed = $this->hash($identification->serialize());
63  $tools[] = $this->factory->tool($identification)
64  ->addComponentDecorator(static function (ILIAS\UI\Component\Component $c) use ($hashed): ILIAS\UI\Component\Component {
65  if ($c instanceof LegacySlate) {
66  $signal_id = $c->getToggleSignal()->getId();
67  return $c->withAdditionalOnLoadCode(static function ($id) use ($hashed) {
68  return "document.addEventListener('il-lm-editor-tree', () => {
69  il.UI.maincontrols.mainbar.engageTool('$hashed');
70  });";
71  });
72  }
73  return $c;
74  })
75  ->withTitle($title)
76  ->withSymbol($icon)
77  ->withContentWrapper(function () use ($l) {
78  return $l($this->getContent());
79  });
80  }
81 
82  return $tools;
83  }
Interface Observer Contains several chained tasks and infos about them.
factory()
$c
Definition: deliver.php:25
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:23
+ 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: