ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
IIMEditorInit.php
Go to the documentation of this file.
1
<?php
2
19
namespace
ILIAS\COPage\PC\InteractiveImage
;
20
24
class
IIMEditorInit
25
{
26
protected \ILIAS\DI\UIServices
$ui
;
27
protected \ilCtrl
$ctrl
;
28
protected \ilLanguage
$lng
;
29
30
public
function
__construct
()
31
{
32
global
$DIC
;
33
34
$this->
ctrl
= $DIC->ctrl();
35
$this->
lng
= $DIC->language();
36
$this->
ui
= $DIC->ui();
37
}
38
39
public
function
initUI
(
40
\
ilGlobalTemplateInterface
$main_tpl
41
): void {
42
$ctrl =
$this->ctrl
;
43
$lng =
$this->lng
;
44
45
\ILIAS\Repository\Form\FormAdapterGUI::initJavascript();
46
47
$lang_vars = [
"delete"
,
"rename"
,
"save"
,
"cont_add_popup"
,
"add"
,
"cont_iim_add_overlay"
];
48
foreach
($lang_vars as $l) {
49
$lng->toJS($l);
50
}
51
52
// ensure that form.js is loaded which is needed for file input (js that shows file names)
53
$dummy = new \ilPropertyFormGUI();
54
$dummy->getHTML();
55
// ensure modal.js from ui framework is loaded
56
$this->
ui
->renderer()->render(
57
$this->
ui
->factory()->modal()->roundtrip(
""
, $this->
ui
->factory()->legacy()->content(
""
))
58
);
59
}
60
61
protected
function
sanitizeAttribute
(
string
$attr): string
62
{
63
return
str_replace([
"<"
,
">"
,
"'"
,
"\""
],
""
, $attr);
64
}
65
66
public
function
getInitHtml
(): string
67
{
68
$ctrl =
$this->ctrl
;
69
70
$p1 = $this->
sanitizeAttribute
(
71
ILIAS_HTTP_PATH .
"/"
. $ctrl->getLinkTargetByClass([
"ilPageEditorGUI"
,
"ilPageEditorServerAdapterGUI"
],
"invokeServer"
)
72
);
73
$p2 = $this->
sanitizeAttribute
($ctrl->getFormActionByClass(
"ilPCInteractiveImageGUI"
));
74
75
$init_span = <<<EOT
76
<span
id
=
'il-copg-iim-init'
77
data-endpoint=
'$p1'
78
data-formaction=
'$p2'
79
></span><div
id
=
'il-copg-iim-main'
></div>
80
EOT;
81
$debug =
""
;
82
//$debug = ".";
83
$module_tag = <<<EOT
84
<script type=
"module"
src=
"$debug./components/ILIAS/COPage/PC/InteractiveImage/js/editor/src/editor.js"
></script>
85
EOT;
86
return
$init_span . $module_tag;
87
}
88
89
}
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit\$ctrl
ilCtrl $ctrl
Definition:
IIMEditorInit.php:27
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit\sanitizeAttribute
sanitizeAttribute(string $attr)
Definition:
IIMEditorInit.php:61
ILIAS\COPage\PC\InteractiveImage
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.GUIService.php:21
ilGlobalTemplateInterface
ILIAS\Repository\ctrl
ctrl()
Definition:
trait.GlobalDICGUIServices.php:63
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit\$ui
ILIAS DI UIServices $ui
Definition:
IIMEditorInit.php:26
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit\getInitHtml
getInitHtml()
Definition:
IIMEditorInit.php:66
ILIAS\Repository\lng
lng()
Definition:
trait.GlobalDICDomainServices.php:61
ILIAS\Repository\ui
ui()
Definition:
trait.GlobalDICGUIServices.php:53
$DIC
global $DIC
Definition:
shib_login.php:26
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit\$lng
ilLanguage $lng
Definition:
IIMEditorInit.php:28
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit\__construct
__construct()
Definition:
IIMEditorInit.php:30
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit
Definition:
IIMEditorInit.php:24
ILIAS\COPage\PC\InteractiveImage\IIMEditorInit\initUI
initUI(\ilGlobalTemplateInterface $main_tpl)
Definition:
IIMEditorInit.php:39
components
ILIAS
COPage
PC
InteractiveImage
IIMEditorInit.php
Generated on Sun Aug 31 2025 23:02:40 for ILIAS by
1.8.13 (using
Doxyfile
)