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);
117 if ($this->pc_id !==
"") {
118 $pc = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
119 return $pc->getIIMModel();
126 if ($this->pc_id !==
"") {
127 $pc = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
128 return $pc->getPopupDummy();
135 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.";
141 $tpl = new \ilTemplate(
"tpl.main_head.html",
true,
true,
"components/ILIAS/COPage/PC/InteractiveImage");
142 $tpl->setVariable(
"TITLE", $lng->txt(
"cont_iim_edit"));
143 $tpl->setVariable(
"HEAD_TRIGGER", $lng->txt(
"cont_iim_trigger"));
146 $this->
section($this->ui_wrapper->getRenderedButton(
147 $lng->txt(
"cont_iim_finish_editing"),
161 return $this->
section($this->ui_wrapper->getRenderedInfoBox(
162 $lng->txt(
"cont_iim_select_trigger")
169 return $this->
section($this->ui_wrapper->getRenderedSuccessBox(
170 $lng->txt(
"msg_obj_modified")
183 return $this->
section($this->ui_wrapper->getRenderedInfoBox(
184 $lng->txt(
"cont_iim_add_trigger_text")
192 $tpl = new \ilTemplate(
"tpl.main_slate.html",
true,
true,
"components/ILIAS/COPage/PC/InteractiveImage");
193 $tpl->setVariable(
"HEAD_SETTINGS", $lng->txt(
"settings"));
194 $tpl->setVariable(
"HEAD_OVERVIEW", $lng->txt(
"cont_iim_overview"));
198 $this->
section($this->ui_wrapper->getRenderedButton(
199 $this->lng->txt(
"cont_iim_add_trigger"),
209 $this->
section($this->ui_wrapper->getRenderedLink(
210 $lng->txt(
"cont_iim_background_image_and_caption"),
220 $this->
section($this->ui_wrapper->getRenderedLink(
221 $lng->txt(
"cont_overlay_images"),
231 $this->
section($this->ui_wrapper->getRenderedLink(
232 $lng->txt(
"cont_content_popups"),
243 public function getBackgroundImage(
246 if ($this->pc_id !==
"") {
248 $pc = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
253 return $pc->getBackgroundImage();
256 protected function section(
string $content): string
258 return "<div class='copg-edit-button-group'>" . $content .
"</div>";
263 return $this->
section($this->ui_wrapper->getRenderedButton(
264 $this->lng->txt(
"back"),
274 return $this->
getHeading($this->
lng->txt(
"cont_iim_edit_trigger"));
279 return $this->
section($this->ui_wrapper->getRenderedViewControl(
281 [
"InteractiveImage",
"trigger.properties", $this->lng->txt(
"properties")],
282 [
"InteractiveImage",
"trigger.overlay", $this->
lng->txt(
"cont_overlay_image")],
283 [
"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")
311 return "<div id='cont_iim_message'></div>";
316 return $this->
section($this->ui_wrapper->getRenderedInfoBox($this->lng->txt(
"cont_iim_tr_properties_info")));
325 $content .= $this->ui_wrapper->getRenderedAdapterForm(
327 [[
"InteractiveImage",
"trigger.properties.save", $this->
lng->txt(
"save")]],
328 "copg-iim-trigger-prop-form" 336 return $this->gui->form(
null,
"#")
339 $this->
lng->txt(
"cont_iim_select_overlay"),
351 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
352 $this->lng->txt(
"cont_iim_add_overlay"),
354 "trigger.add.overlay",
358 $content .= $this->ui_wrapper->getRenderedAdapterForm(
360 [[
"InteractiveImage",
"trigger.overlay.save", $this->
lng->txt(
"save")]],
361 "copg-iim-trigger-overlay-form" 369 return $this->gui->form(
null,
"#")
372 $this->
lng->txt(
"cont_content_popup"),
377 $this->
lng->txt(
"cont_iim_size"),
379 "sm" => $this->
lng->txt(
"cont_iim_sm"),
380 "md" => $this->
lng->txt(
"cont_iim_md"),
381 "lg" => $this->
lng->txt(
"cont_iim_lg")
394 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
395 $this->lng->txt(
"cont_iim_tr_add_popup"),
401 $content .= $this->ui_wrapper->getRenderedAdapterForm(
403 [[
"InteractiveImage",
"trigger.save.popup", $this->
lng->txt(
"save")]],
404 "copg-iim-trigger-popup-form" 409 protected function getHeading(
string $text, $sub =
false): string
413 return "<div class='copg-edit-button-group'><h3>" . $text .
"</h3></div>";
415 return "<div class='copg-edit-button-group'><h2>" . $text .
"</h2></div>";
421 $content .= $this->
getHeading($this->
lng->txt(
"cont_content_popups"),
true);
423 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
424 $this->lng->txt(
"cont_iim_tr_add_popup"),
430 $content .= $this->
section($this->ui_wrapper->getRenderedListingPanelTemplate($this->lng->txt(
"cont_iim_overview")));
437 $content .= $this->
getHeading($this->
lng->txt(
"cont_overlay_images"),
true);
439 $content .= $this->
section($this->ui_wrapper->getRenderedButton(
440 $this->lng->txt(
"cont_iim_add_overlay"),
442 "trigger.add.overlay",
446 $content .= $this->
section($this->ui_wrapper->getRenderedListingPanelTemplate($this->lng->txt(
"cont_iim_overview"),
true));
454 $this->
ctrl->setParameterByClass(
455 \ilPCInteractiveImageGUI::class,
461 $content .= $this->
getHeading($this->
lng->txt(
"cont_iim_background_image"),
true);
463 $content .= $this->ui_wrapper->getRenderedAdapterForm(
464 $this->
getPCInteractiveImageGUI()->getBackgroundPropertiesFormAdapter([get_class($this->page_gui), \ilPageEditorGUI::class, \ilPCInteractiveImageGUI::class]),
465 [[
"InteractiveImage",
"component.save", $this->
lng->txt(
"save")]]
474 $modal = $ui->factory()->modal()->roundtrip(
'#title#', $ui->factory()->legacy()->content(
'#content#'))
475 ->withActionButtons([
476 $ui->factory()->button()->standard(
'#button_title#',
'#'),
478 $modalt[
"signal"] = $modal->getShowSignal()->getId();
479 $modalt[
"closeSignal"] = $modal->getCloseSignal()->getId();
480 $modalt[
"template"] = $ui->renderer()->renderAsync($modal);
487 $pg = $this->page_gui->getPageObject();
488 $iim = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id);
489 $iim_gui = new \ilPCInteractiveImageGUI($pg, $iim,
"", $this->pc_id);
490 $iim_gui->setPageConfig($pg->getPageConfig());
497 ->getOverlayUploadFormAdapter([get_class($this->page_gui), \ilPageEditorGUI::class, \ilPCInteractiveImageGUI::class]);
502 $this->
ctrl->setParameterByClass(
503 \ilPCInteractiveImageGUI::class,
507 $content = $this->ui_wrapper->getRenderedAdapterForm(
509 [[
"InteractiveImage",
"overlay.upload", $this->
lng->txt(
"add")]],
513 $this->
ctrl->setParameterByClass(
514 \ilPCInteractiveImageGUI::class,
524 $content = $this->ui_wrapper->getRenderedAdapterForm(
525 $iim_gui->getPopupFormAdapter(),
526 [[
"InteractiveImage",
"popup.save", $this->
lng->txt(
"save")]],
ILIAS COPage InternalGUIService $gui
getIIMModel()
Get interactive image model.
getOverlayUploadFormAdapter()
__construct(\ilPageObjectGUI $page_gui, string $pc_id="")
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
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()