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

Page editing GS tool provider. More...

+ Inheritance diagram for ilCOPageEditGSToolProvider:
+ Collaboration diagram for ilCOPageEditGSToolProvider:

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 (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

Data Fields

const SHOW_EDITOR = 'copg_show_editor'
 

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

Page 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.ilCOPageEditGSToolProvider.php.

Member Function Documentation

◆ getContent()

ilCOPageEditGSToolProvider::getContent ( )
private
Parameters
int$ref_id
Returns
string

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

Referenced by getToolsForContextStack().

74  : string
75  {
76  return "<div id='copg-editor-slate-error'></div><div id='copg-editor-slate-content'></div>";
77  }
+ Here is the caller graph for this function:

◆ getToolsForContextStack()

ilCOPageEditGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

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

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

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

31  : array
32  {
33  $tools = [];
34  $additional_data = $called_contexts->current()->getAdditionalData();
35  if ($additional_data->is(self::SHOW_EDITOR, true)) {
36  $title = $this->dic->language()->txt('editor');
37  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("outlined/icon_edtr.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("copg_editor");
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  $('body').on('il-copg-editor-slate', function(){
54  il.UI.maincontrols.mainbar.engageTool('$hashed');
55  });";
56  });
57  }
58  return $c;
59  })
60  ->withSymbol($icon)
61  ->withTitle($title)
62  ->withContent($l($this->getContent()));
63  }
64 
65  return $tools;
66  }
Class Factory.
$c
Definition: cli.php:37
Class ChatMainBarProvider .
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilCOPageEditGSToolProvider::isInterestedInContexts ( )

Field Documentation

◆ SHOW_EDITOR

const ilCOPageEditGSToolProvider::SHOW_EDITOR = 'copg_show_editor'

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