ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 12 of file class.ilCOPageEditGSToolProvider.php.

Member Function Documentation

◆ getContent()

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

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

References $lng, $tpl, ilGlyphGUI\ADD, ilGlyphGUI\DRAG, and ilGlyphGUI\get().

Referenced by getToolsForContextStack().

58  : string
59  {
60  $lng = $this->dic->language();
61  $lng->loadLanguageModule("content");
62  $tpl = new ilTemplate("tpl.editor_slate.html", true, true, "Services/COPage");
63  $tpl->setCurrentBlock("help");
64  $tpl->setVariable("TXT_ADD_EL", $lng->txt("cont_add_elements"));
65  $tpl->setVariable("PLUS", ilGlyphGUI::get(ilGlyphGUI::ADD));
66  $tpl->setVariable("DRAG_ARROW", ilGlyphGUI::get(ilGlyphGUI::DRAG));
67  $tpl->setVariable("TXT_DRAG", $lng->txt("cont_drag_and_drop_elements"));
68  $tpl->setVariable("TXT_SEL", $lng->txt("cont_double_click_to_delete"));
69  $tpl->parseCurrentBlock();
70  return $tpl->get();
71  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static get($a_glyph, $a_text="")
Get glyph html.
$lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getToolsForContextStack()

ilCOPageEditGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

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

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

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

29  : array
30  {
31  $tools = [];
32  $additional_data = $called_contexts->current()->getAdditionalData();
33  if ($additional_data->is(self::SHOW_EDITOR, true)) {
34  $title = $this->dic->language()->txt('editor');
35  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("outlined/icon_edtr.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("copg_editor"))
44  ->withSymbol($icon)
45  ->withTitle($title)
46  ->withContent($l($this->getContent()));
47  }
48 
49  return $tools;
50  }
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: