29 protected \ILIAS\COPage\PC\InteractiveImage\IIMManager
$iim_manager;
30 protected \ILIAS\COPage\InternalGUIService
$gui;
32 protected \ILIAS\DI\UIServices
$ui;
33 protected \ilLanguage
$lng;
44 $this->
ui = $DIC->ui();
45 $this->
lng = $DIC->language();
47 $this->
user = $DIC->user();
48 $this->
ctrl = $DIC->ctrl();
49 $this->component_factory = $DIC[
"component.factory"];
52 $this->ui_wrapper =
new Server\UIWrapper($this->
ui, $this->
lng);
53 $this->gui = $DIC->copage()->internal()->gui();
54 $this->iim_manager = $DIC->copage()->internal()->domain()->pc()->interactiveImage();
62 switch ($query[
"action"]) {
67 throw new Exception(
"Unknown action " . $query[
"action"]);
74 $o->uiModel = new \stdClass();
81 $o->uiModel->backgroundImage = $this->getBackgroundImage();
93 $o->uiModel->lore = $this->
getLore();
94 $o->uiModel->backUrl = $ctrl->getLinkTarget($this->page_gui,
"edit") .
"#pc" .
$this->pc_id;
108 return new Server\Response($o);
116 if ($this->pc_id !==
"") {
117 $pc = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
118 return $pc->getIIMModel();
125 if ($this->pc_id !==
"") {
126 $pc = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
127 return $pc->getPopupDummy();
134 return "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
140 $tpl = new \ilTemplate(
"tpl.main_head.html",
true,
true,
"components/ILIAS/COPage/PC/InteractiveImage");
141 $tpl->setVariable(
"TITLE", $lng->txt(
"cont_iim_edit"));
142 $tpl->setVariable(
"HEAD_TRIGGER", $lng->txt(
"cont_iim_trigger"));
145 $this->
section($this->ui_wrapper->getRenderedButton(
146 $lng->txt(
"cont_iim_finish_editing"),
160 return $this->
section($this->ui_wrapper->getRenderedInfoBox(
161 $lng->txt(
"cont_iim_select_trigger")
168 return $this->
section($this->ui_wrapper->getRenderedSuccessBox(
169 $lng->txt(
"msg_obj_modified")
182 return $this->
section($this->ui_wrapper->getRenderedInfoBox(
183 $lng->txt(
"cont_iim_add_trigger_text")
191 $tpl = new \ilTemplate(
"tpl.main_slate.html",
true,
true,
"components/ILIAS/COPage/PC/InteractiveImage");
192 $tpl->setVariable(
"HEAD_SETTINGS", $lng->txt(
"settings"));
193 $tpl->setVariable(
"HEAD_OVERVIEW", $lng->txt(
"cont_iim_overview"));
197 $this->
section($this->ui_wrapper->getRenderedButton(
198 $this->lng->txt(
"cont_iim_add_trigger"),
208 $this->
section($this->ui_wrapper->getRenderedLink(
209 $lng->txt(
"cont_iim_background_image_and_caption"),
219 $this->
section($this->ui_wrapper->getRenderedLink(
220 $lng->txt(
"cont_overlay_images"),
230 $this->
section($this->ui_wrapper->getRenderedLink(
231 $lng->txt(
"cont_content_popups"),
242 public function getBackgroundImage():
string 245 if ($this->pc_id !==
"") {
247 $pc = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
252 return $pc->getBackgroundImage();
255 protected function section(
string $content): string
257 return "<div class='copg-edit-button-group'>" . $content .
"</div>";
262 return $this->
section($this->ui_wrapper->getRenderedButton(
263 $this->lng->txt(
"back"),
273 return $this->
getHeading($this->
lng->txt(
"cont_iim_edit_trigger"));
278 return $this->
section($this->ui_wrapper->getRenderedViewControl(
280 [
"InteractiveImage",
"trigger.properties", $this->lng->txt(
"properties")],
281 [
"InteractiveImage",
"trigger.overlay", $this->
lng->txt(
"cont_overlay_image")],
282 [
"InteractiveImage",
"trigger.popup", $this->
lng->txt(
"cont_content_popup")]
290 return $this->gui->form(
null,
"#")
293 $this->
lng->txt(
"title")
297 $this->
lng->txt(
"cont_shape"),
299 "Rect" => $this->
lng->txt(
"cont_Rect"),
300 "Circle" => $this->
lng->txt(
"cont_Circle"),
301 "Poly" => $this->
lng->txt(
"cont_Poly"),
302 "Marker" => $this->
lng->txt(
"cont_marker")
309 $this->
lng->txt(
"cont_highlight_mode"),
316 $this->
lng->txt(
"cont_highlight_class"),
325 return "<div id='cont_iim_message'></div>";
330 return $this->
section($this->ui_wrapper->getRenderedInfoBox($this->lng->txt(
"cont_iim_tr_properties_info")));
339 $content .= $this->ui_wrapper->getRenderedAdapterForm(
342 [
"InteractiveImage",
"trigger.properties.save", $this->
lng->txt(
"save")],
343 [
"InteractiveImage",
"trigger.delete", $this->
lng->txt(
"delete")],
345 "copg-iim-trigger-prop-form" 353 return $this->gui->form(
null,
"#")
356 $this->
lng->txt(
"cont_iim_select_overlay"),
368 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
369 $this->lng->txt(
"cont_iim_add_overlay"),
371 "trigger.add.overlay",
375 $content .= $this->ui_wrapper->getRenderedAdapterForm(
377 [[
"InteractiveImage",
"trigger.overlay.save", $this->
lng->txt(
"save")]],
378 "copg-iim-trigger-overlay-form" 386 return $this->gui->form(
null,
"#")
389 $this->
lng->txt(
"cont_content_popup"),
394 $this->
lng->txt(
"cont_iim_size"),
396 "sm" => $this->
lng->txt(
"cont_iim_sm"),
397 "md" => $this->
lng->txt(
"cont_iim_md"),
398 "lg" => $this->
lng->txt(
"cont_iim_lg")
411 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
412 $this->lng->txt(
"cont_iim_tr_add_popup"),
418 $content .= $this->ui_wrapper->getRenderedAdapterForm(
420 [[
"InteractiveImage",
"trigger.save.popup", $this->
lng->txt(
"save")]],
421 "copg-iim-trigger-popup-form" 426 protected function getHeading(
string $text, $sub =
false): string
430 return "<div class='copg-edit-button-group'><h3>" . $text .
"</h3></div>";
432 return "<div class='copg-edit-button-group'><h2>" . $text .
"</h2></div>";
438 $content .= $this->
getHeading($this->
lng->txt(
"cont_content_popups"),
true);
440 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
441 $this->lng->txt(
"cont_iim_tr_add_popup"),
447 $content .= $this->
section($this->ui_wrapper->getRenderedListingPanelTemplate($this->lng->txt(
"cont_iim_overview")));
454 $content .= $this->
getHeading($this->
lng->txt(
"cont_overlay_images"),
true);
456 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
457 $this->lng->txt(
"cont_iim_add_overlay"),
459 "trigger.add.overlay",
463 $content .= $this->
section($this->ui_wrapper->getRenderedListingPanelTemplate(
464 $this->lng->txt(
"cont_iim_overview"),
473 $this->
ctrl->setParameterByClass(
474 \ilPCInteractiveImageGUI::class,
480 $content .= $this->
getHeading($this->
lng->txt(
"cont_iim_background_image"),
true);
482 $content .= $this->ui_wrapper->getRenderedAdapterForm(
484 \ilPageEditorGUI::class,
485 \ilPCInteractiveImageGUI::class
487 [[
"InteractiveImage",
"component.save", $this->
lng->txt(
"save")]]
496 $modal = $ui->factory()->modal()->roundtrip(
'#title#', $ui->factory()->legacy()->content(
'#content#'))
497 ->withActionButtons([
498 $ui->factory()->button()->standard(
'#button_title#',
'#'),
500 $modalt[
"signal"] = $modal->getShowSignal()->getId();
501 $modalt[
"closeSignal"] = $modal->getCloseSignal()->getId();
502 $modalt[
"template"] = $ui->renderer()->renderAsync($modal);
509 $pg = $this->page_gui->getPageObject();
510 $iim = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
511 $iim_gui = new \ilPCInteractiveImageGUI($pg, $iim,
"", $this->pc_id);
512 $iim_gui->setPageConfig($pg->getPageConfig());
519 ->getOverlayUploadFormAdapter([get_class($this->page_gui),
520 \ilPageEditorGUI::class,
521 \ilPCInteractiveImageGUI::class
527 $this->
ctrl->setParameterByClass(
528 \ilPCInteractiveImageGUI::class,
532 $content = $this->ui_wrapper->getRenderedAdapterForm(
534 [[
"InteractiveImage",
"overlay.upload", $this->
lng->txt(
"add")]],
538 $this->
ctrl->setParameterByClass(
539 \ilPCInteractiveImageGUI::class,
549 $content = $this->ui_wrapper->getRenderedAdapterForm(
550 $iim_gui->getPopupFormAdapter(),
551 [[
"InteractiveImage",
"popup.save", $this->
lng->txt(
"save")]],
ILIAS COPage InternalGUIService $gui
getIIMModel()
Get interactive image model.
getOverlayUploadFormAdapter()
__construct(\ilPageObjectGUI $page_gui, string $pc_id="")
static getAllHighlightClasses()
getHeading(string $text, $sub=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
Server UIWrapper $ui_wrapper
ilPageObjectGUI $page_gui
static getAllHighlightModes()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPCInteractiveImageGUI()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTriggerPropertiesInfo()
ILIAS COPage PC InteractiveImage IIMManager $iim_manager
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilComponentFactory $component_factory
getCommonSuccessMessage()
getTriggerOverlayFormAdapter()
getTriggerPopupFormAdapter()
getBackgroundProperties()
getTriggerPropertiesFormAdapter()
User interface class for interactive images.
getSelectTriggerMessage()