ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPCInteractiveImageGUI Class Reference

User interface class for interactive images. More...

+ Inheritance diagram for ilPCInteractiveImageGUI:
+ Collaboration diagram for ilPCInteractiveImageGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 
 getTabs (bool $a_create=false, bool $a_change_obj_ref=false)
 Add tabs to ilTabsGUI object. More...
 
 insert (string $a_post_cmd="edpost", string $a_submit_cmd="", bool $a_input_error=false)
 Insert new media object form. More...
 
 edit ()
 
 editBaseImage ()
 
 initForm (string $a_mode="edit")
 
 update ()
 Update (base image) More...
 
 centerAlign ()
 Align media object to center. More...
 
 leftAlign ()
 align media object to left More...
 
 rightAlign ()
 align media object to right More...
 
 leftFloatAlign ()
 align media object to left, floating text More...
 
 rightFloatAlign ()
 align media object to right, floating text More...
 
 listOverlayImages ()
 
 addOverlayImages (?ilPropertyFormGUI $a_form=null)
 
 initAddOverlaysForm ()
 
 uploadOverlayImages ()
 
 confirmDeleteOverlays ()
 
 deleteOverlays ()
 
 addPopup ()
 
 savePopups ()
 
 confirmPopupDeletion ()
 
 deletePopups ()
 
 getImportFormAdapter ()
 
 handleUploadResult (FileUpload $upload, UploadResult $result)
 
 editor ()
 
 getOverlayUploadFormAdapter (?array $path=null)
 
 handleOverlayUpload (FileUpload $upload, UploadResult $result)
 
 getPopupFormAdapter ()
 
 getBackgroundPropertiesFormAdapter (?array $path=null)
 
 handleBackgroundUpload (FileUpload $upload, UploadResult $result)
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 displayValidationError ()
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 

Protected Member Functions

 forwardFormToUploadHandler ()
 
 initInteractiveImageEditor ()
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

Protected Attributes

ILIAS COPage PC InteractiveImage IIMManager $iim_manager
 
ILIAS COPage PC InteractiveImage GUIService $iim_gui
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

User interface class for interactive images.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilPCInteractiveImageGUI: ilPCIIMTriggerEditorGUI, ilRepoStandardUploadHandlerGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCInteractiveImageGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Definition at line 38 of file class.ilPCInteractiveImageGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

43  {
44  global $DIC;
45 
46  $this->tpl = $DIC["tpl"];
47  $this->lng = $DIC->language();
48  $this->tabs = $DIC->tabs();
49  $this->ctrl = $DIC->ctrl();
50  $this->toolbar = $DIC->toolbar();
51  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
52  $this->iim_gui = $DIC->copage()->internal()->gui()->pc()->interactiveImage();
53  $this->iim_manager = $DIC->copage()->internal()->domain()->pc()->interactiveImage();
54  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addOverlayImages()

ilPCInteractiveImageGUI::addOverlayImages ( ?ilPropertyFormGUI  $a_form = null)

Definition at line 374 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$tpl, initAddOverlaysForm(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by uploadOverlayImages().

374  : void
375  {
376  $tpl = $this->tpl;
377 
378  if ($a_form) {
379  $form = $a_form;
380  } else {
381  $form = $this->initAddOverlaysForm();
382  }
383 
384  $tpl->setContent($form->getHTML());
385  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPopup()

ilPCInteractiveImageGUI::addPopup ( )

Definition at line 522 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, and ilLanguage\txt().

522  : void
523  {
524  $ilCtrl = $this->ctrl;
525  $lng = $this->lng;
526 
527  $this->content_obj->addContentPopup();
528  $this->pg_obj->update();
529  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
530  $ilCtrl->redirect($this, "listContentPopups");
531  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ centerAlign()

ilPCInteractiveImageGUI::centerAlign ( )

Align media object to center.

Definition at line 268 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\getHierId(), ilMediaAliasItem\setHorizontalAlign(), and ilPageContentGUI\updateAndReturn().

268  : void
269  {
270  $std_alias_item = new ilMediaAliasItem(
271  $this->content_obj->getDomDoc(),
272  $this->getHierId(),
273  "Standard",
274  $this->content_obj->getPCId(),
275  "InteractiveImage"
276  );
277  $std_alias_item->setHorizontalAlign("Center");
278  $this->updateAndReturn();
279  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setHorizontalAlign(string $a_halign)
+ Here is the call graph for this function:

◆ confirmDeleteOverlays()

ilPCInteractiveImageGUI::confirmDeleteOverlays ( )

Definition at line 444 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, Vendor\Package\$d, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), ilTabsGUI\setTabActive(), and ilLanguage\txt().

444  : void
445  {
446  $ilCtrl = $this->ctrl;
447  $tpl = $this->tpl;
448  $lng = $this->lng;
449  $ilTabs = $this->tabs;
450 
451  $ilTabs->setTabActive("list_overlays");
452 
453  $files = $this->request->getStringArray("file");
454  if (count($files) == 0) {
455  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
456  $ilCtrl->redirect($this, "listOverlayImages");
457  } else {
458  $cgui = new ilConfirmationGUI();
459  $cgui->setFormAction($ilCtrl->getFormAction($this));
460  $cgui->setHeaderText($lng->txt("cont_really_delete_overlays"));
461  $cgui->setCancel($lng->txt("cancel"), "listOverlayImages");
462  $cgui->setConfirm($lng->txt("delete"), "deleteOverlays");
463 
464  foreach ($files as $i => $d) {
465  $cgui->addItem("file[]", $i, $i);
466  }
467 
468  $tpl->setContent($cgui->getHTML());
469  }
470  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
setTabActive(string $a_id)
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ confirmPopupDeletion()

ilPCInteractiveImageGUI::confirmPopupDeletion ( )

Definition at line 547 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, Vendor\Package\$d, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), ilTabsGUI\setTabActive(), and ilLanguage\txt().

547  : void
548  {
549  $ilCtrl = $this->ctrl;
550  $tpl = $this->tpl;
551  $lng = $this->lng;
552  $ilTabs = $this->tabs;
553 
554  $ilTabs->setTabActive("content_popups");
555 
556  $tids = $this->request->getStringArray("tid");
557  $titles = $this->request->getStringArray("title");
558 
559  if (count($tids) == 0) {
560  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
561  $ilCtrl->redirect($this, "listContentPopups");
562  } else {
563  $cgui = new ilConfirmationGUI();
564  $cgui->setFormAction($ilCtrl->getFormAction($this));
565  $cgui->setHeaderText($lng->txt("cont_really_delete_popups"));
566  $cgui->setCancel($lng->txt("cancel"), "listContentPopups");
567  $cgui->setConfirm($lng->txt("delete"), "deletePopups");
568 
569  foreach ($tids as $i => $d) {
570  $cgui->addItem("tid[]", $i, $titles[$i]);
571  }
572 
573  $tpl->setContent($cgui->getHTML());
574  }
575  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
setTabActive(string $a_id)
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ deleteOverlays()

ilPCInteractiveImageGUI::deleteOverlays ( )

Definition at line 472 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$content_obj, ilPageContentGUI\$ctrl, Vendor\Package\$f, ilPageContentGUI\$lng, $tabs, $toolbar, ilPageContentGUI\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), ilUtil\stripSlashes(), and ilLanguage\txt().

472  : void
473  {
474  $ilCtrl = $this->ctrl;
475  $lng = $this->lng;
476 
477  $files = $this->request->getStringArray("file");
478  if (count($files) > 0) {
479  foreach ($files as $f) {
480  $f = str_replace("..", "", ilUtil::stripSlashes($f));
481  $this->content_obj->getMediaObject()
482  ->removeAdditionalFile("overlays/" . $f);
483  }
484 
485  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_overlays_have_been_deleted"), true);
486  }
487  $ilCtrl->redirect($this, "listOverlayImages");
488  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:

◆ deletePopups()

ilPCInteractiveImageGUI::deletePopups ( )

Definition at line 577 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, $id, ilPageContentGUI\$lng, and ilLanguage\txt().

577  : void
578  {
579  $lng = $this->lng;
580  $ilCtrl = $this->ctrl;
581 
582  $tids = $this->request->getStringArray("tid");
583 
584  if (count($tids) > 0) {
585  foreach ($tids as $id) {
586  $id = explode(":", $id);
587  $this->content_obj->deletePopup($id[0], $id[1]);
588  }
589  $this->pg_obj->update();
590  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_popups_have_been_deleted"), true);
591  }
592  $ilCtrl->redirect($this, "listContentPopups");
593  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ edit()

ilPCInteractiveImageGUI::edit ( )

Definition at line 145 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, and ilCtrl\redirect().

145  : void
146  {
147  $ilCtrl = $this->ctrl;
148  $ilCtrl->redirect($this, "editor");
149  }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ editBaseImage()

ilPCInteractiveImageGUI::editBaseImage ( )

Definition at line 151 of file class.ilPCInteractiveImageGUI.php.

References $tabs, ilPageContentGUI\$tpl, ilTabsGUI\activateTab(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

151  : void
152  {
153  $tpl = $this->tpl;
154  $ilTabs = $this->tabs;
155  $ilTabs->activateTab("edit_base_image");
156  $form = $this->initForm();
157  $tpl->setContent($form->getHTML());
158  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
activateTab(string $a_id)
+ Here is the call graph for this function:

◆ editor()

ilPCInteractiveImageGUI::editor ( )

Definition at line 622 of file class.ilPCInteractiveImageGUI.php.

References $tabs, ilTabsGUI\activateTab(), ilObjStyleSheet\getBaseContentStylePath(), and initInteractiveImageEditor().

622  : void
623  {
624  $ilTabs = $this->tabs;
625  $ilTabs->activateTab("editor");
626  $this->tpl->addCss(ilObjStyleSheet::getBaseContentStylePath());
627  $this->tpl->setContent($this->iim_gui->editorInit()->getInitHtml());
629  }
activateTab(string $a_id)
+ Here is the call graph for this function:

◆ executeCommand()

ilPCInteractiveImageGUI::executeCommand ( )

Definition at line 56 of file class.ilPCInteractiveImageGUI.php.

References $tabs, ilPageContentGUI\$tpl, ILIAS\Repository\ctrl(), forwardFormToUploadHandler(), ilUtil\getImagePath(), getTabs(), and ILIAS\UICore\GlobalTemplate\setTitleIcon().

56  : void
57  {
58  $tpl = $this->tpl;
59  $ilTabs = $this->tabs;
60 
61  // get next class that processes or forwards current command
62  $next_class = $this->ctrl->getNextClass($this);
63 
64  // get current command
65  $cmd = $this->ctrl->getCmd();
66 
67  if (is_object($this->content_obj)) {
68  $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_mob.svg"));
69  $this->getTabs();
70  }
71 
72  switch ($next_class) {
73  case strtolower(ilRepoStandardUploadHandlerGUI::class):
75  break;
76 
77  default:
78  $this->$cmd();
79  break;
80  }
81  }
getTabs(bool $a_create=false, bool $a_change_obj_ref=false)
Add tabs to ilTabsGUI object.
ilGlobalTemplateInterface $tpl
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
+ Here is the call graph for this function:

◆ forwardFormToUploadHandler()

ilPCInteractiveImageGUI::forwardFormToUploadHandler ( )
protected

Definition at line 83 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$gui, ILIAS\Repository\ctrl(), getBackgroundPropertiesFormAdapter(), getImportFormAdapter(), and getOverlayUploadFormAdapter().

Referenced by executeCommand().

83  : void
84  {
85  switch ($this->request->getString("mode")) {
86  case "overlayUpload":
87  $form = $this->getOverlayUploadFormAdapter();
88  $gui = $form->getRepoStandardUploadHandlerGUI("overlay_file");
89  break;
90 
91  case "backgroundUpdate":
92  $form = $this->getBackgroundPropertiesFormAdapter();
93  $gui = $form->getRepoStandardUploadHandlerGUI("input_file");
94  break;
95 
96  default:
97  $form = $this->getImportFormAdapter();
98  $gui = $form->getRepoStandardUploadHandlerGUI("input_file");
99  break;
100  }
101  $this->ctrl->forwardCommand($gui);
102  }
getBackgroundPropertiesFormAdapter(?array $path=null)
ILIAS COPage InternalGUIService $gui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBackgroundPropertiesFormAdapter()

ilPCInteractiveImageGUI::getBackgroundPropertiesFormAdapter ( ?array  $path = null)

Definition at line 681 of file class.ilPCInteractiveImageGUI.php.

References Vendor\Package\$f, $path, and ILIAS\Repository\lng().

Referenced by forwardFormToUploadHandler().

681  : \ILIAS\Repository\Form\FormAdapterGUI
682  {
683  if (is_null($path)) {
684  $path = [self::class];
685  }
686 
687  $f = $this->gui->form($path, "#")
688  ->async()
689  ->file(
690  "input_file",
691  $this->lng->txt("file"),
692  \Closure::fromCallable([$this, 'handleBackgroundUpload']),
693  "mob_id",
694  "",
695  1,
696  ["image/png", "image/jpeg", "image/gif"],
697  $path,
698  "copg"
699  )->text(
700  "caption",
701  $this->lng->txt("cont_caption")
702  );
703  return $f;
704  }
$path
Definition: ltiservices.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImportFormAdapter()

ilPCInteractiveImageGUI::getImportFormAdapter ( )

Definition at line 595 of file class.ilPCInteractiveImageGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by forwardFormToUploadHandler(), and ilPCInteractiveImageEditorGUI\getRenderedCreationForm().

595  : \ILIAS\Repository\Form\FormAdapterGUI
596  {
597  $this->ctrl->setParameter($this, "cname", "InteractiveImage");
598  $form = $this->gui->form([self::class], "#")
599  ->async()
600  ->section("f", $this->lng->txt("cont_ed_insert_iim"))
601  ->file(
602  "input_file",
603  $this->lng->txt("file"),
604  \Closure::fromCallable([$this, 'handleUploadResult']),
605  "mob_id",
606  "",
607  1,
608  [],
609  [self::class],
610  "copg"
611  )->required();
612  return $form;
613  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverlayUploadFormAdapter()

ilPCInteractiveImageGUI::getOverlayUploadFormAdapter ( ?array  $path = null)

Definition at line 637 of file class.ilPCInteractiveImageGUI.php.

References Vendor\Package\$f, $path, and ILIAS\Repository\lng().

Referenced by forwardFormToUploadHandler().

637  : \ILIAS\Repository\Form\FormAdapterGUI
638  {
639  if (is_null($path)) {
640  $path = [self::class];
641  }
642 
643  $f = $this->gui->form($path, "#")
644  ->async()
645  ->file(
646  "overlay_file",
647  $this->lng->txt("file"),
648  \Closure::fromCallable([$this, 'handleOverlayUpload']),
649  "mob_id",
650  "",
651  1,
652  ["image/png", "image/jpeg", "image/gif"],
653  $path,
654  "copg"
655  );
656  return $f;
657  }
$path
Definition: ltiservices.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPopupFormAdapter()

ilPCInteractiveImageGUI::getPopupFormAdapter ( )

Definition at line 671 of file class.ilPCInteractiveImageGUI.php.

References Vendor\Package\$f, ILIAS\Repository\lng(), and null.

671  : \ILIAS\Repository\Form\FormAdapterGUI
672  {
673  $f = $this->gui->form(null, "#")
674  ->text(
675  "title",
676  $this->lng->txt("title")
677  );
678  return $f;
679  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getTabs()

ilPCInteractiveImageGUI::getTabs ( bool  $a_create = false,
bool  $a_change_obj_ref = false 
)

Add tabs to ilTabsGUI object.

Definition at line 107 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, and ilLanguage\txt().

Referenced by executeCommand().

110  : void {
111  $ilCtrl = $this->ctrl;
112  $ilTabs = $this->tabs;
113  $lng = $this->lng;
114 
115  if (!$a_create) {
116  $ilTabs->setBackTarget(
117  $lng->txt("pg"),
118  (string) $ilCtrl->getParentReturn($this)
119  );
120  }
121  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleBackgroundUpload()

ilPCInteractiveImageGUI::handleBackgroundUpload ( FileUpload  $upload,
UploadResult  $result 
)

Definition at line 707 of file class.ilPCInteractiveImageGUI.php.

711  $this->log->debug(">>>");
712  $this->log->debug("Start upload");
713  $this->log->debug($this->content_obj->getMediaObject()->getId());
714  return $this->iim_manager->handleUploadResult(
715  $upload,
716  $result,
717  $this->content_obj->getMediaObject()
718  );
719  }

◆ handleOverlayUpload()

ilPCInteractiveImageGUI::handleOverlayUpload ( FileUpload  $upload,
UploadResult  $result 
)

Definition at line 660 of file class.ilPCInteractiveImageGUI.php.

664  return $this->iim_manager->handleOverlayUpload(
665  $this->content_obj->getMediaObject(),
666  $upload,
667  $result
668  );
669  }

◆ handleUploadResult()

ilPCInteractiveImageGUI::handleUploadResult ( FileUpload  $upload,
UploadResult  $result 
)

Definition at line 615 of file class.ilPCInteractiveImageGUI.php.

619  return $this->iim_manager->handleUploadResult($upload, $result);
620  }

◆ initAddOverlaysForm()

ilPCInteractiveImageGUI::initAddOverlaysForm ( )

Definition at line 387 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, ilFileInputGUI\setSuffixes(), ilTabsGUI\setTabActive(), and ilLanguage\txt().

Referenced by addOverlayImages(), and uploadOverlayImages().

388  {
389  $lng = $this->lng;
390  $ilCtrl = $this->ctrl;
391  $ilTabs = $this->tabs;
392 
393  $ilTabs->setTabActive("list_overlays");
394 
395  $form = new ilPropertyFormGUI();
396  $form->setTitle($lng->txt("cont_add_images"));
397  $form->setFormAction($ilCtrl->getFormAction($this));
398 
399  // file input
400  $fi = new ilFileWizardInputGUI($lng->txt("file"), "ovfile");
401  $fi->setSuffixes(array("gif", "jpeg", "jpg", "png"));
402  $fi->setFilenames(array(0 => ''));
403  $fi->setRequired(true);
404  $form->addItem($fi);
405 
406  $form->addCommandButton("uploadOverlayImages", $lng->txt("upload"));
407  $form->addCommandButton("listOverlayImages", $lng->txt("cancel"));
408 
409  return $form;
410  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a file wizard property in a property form.
setSuffixes(array $a_suffixes)
setTabActive(string $a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilPCInteractiveImageGUI::initForm ( string  $a_mode = "edit")

Definition at line 161 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\getHierId(), ILIAS\Repository\lng(), null, ilImageFileInputGUI\setAllowDeletion(), and ilLanguage\txt().

Referenced by editBaseImage(), insert(), and update().

162  {
163  $lng = $this->lng;
164  $ilCtrl = $this->ctrl;
165  $ti = null;
166 
167  $form = new ilPropertyFormGUI();
168 
169  // image file
170  $fi = new ilImageFileInputGUI($lng->txt("cont_file"), "image_file");
171  $fi->setAllowDeletion(false);
172  if ($a_mode == "edit") {
173  $fi->setImage($this->content_obj->getBaseThumbnailTarget());
174  } else {
175  $fi->setRequired(true);
176  }
177  $form->addItem($fi);
178 
179  if ($a_mode == "edit") {
180  // caption
181  $ti = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
182  $ti->setMaxLength(200);
183  $ti->setSize(50);
184  $form->addItem($ti);
185  }
186 
187  // save and cancel commands
188  if ($a_mode == "create") {
189  $form->setTitle($lng->txt("cont_ed_insert_iim"));
190  $form->addCommandButton("create_iim", $lng->txt("save"));
191  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
192  } else {
193  // get caption
194  $std_alias_item = new ilMediaAliasItem(
195  $this->content_obj->getDomDoc(),
196  $this->getHierId(),
197  "Standard",
198  $this->content_obj->getPCId(),
199  "InteractiveImage"
200  );
201  $ti->setValue($std_alias_item->getCaption());
202 
203  $form->setTitle($lng->txt("cont_edit_base_image"));
204  $form->addCommandButton("update", $lng->txt("save"));
205  }
206 
207  $form->setFormAction($ilCtrl->getFormAction($this));
208 
209  return $form;
210  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This class represents an image file property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initInteractiveImageEditor()

ilPCInteractiveImageGUI::initInteractiveImageEditor ( )
protected

Definition at line 631 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\setEditorToolContext().

Referenced by editor().

631  : void
632  {
633  $this->setEditorToolContext();
634  $this->iim_gui->editorInit()->initUI($this->tpl);
635  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCInteractiveImageGUI::insert ( string  $a_post_cmd = "edpost",
string  $a_submit_cmd = "",
bool  $a_input_error = false 
)

Insert new media object form.

Definition at line 126 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

130  : void {
131  $tpl = $this->tpl;
132  $ilCtrl = $this->ctrl;
133  $lng = $this->lng;
134 
135  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_iim_create_info"));
136 
137  $form = $this->initForm("create");
138  $form->setFormAction($ilCtrl->getFormAction($this));
139 
140  $this->displayValidationError();
141 
142  $tpl->setContent($form->getHTML());
143  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ leftAlign()

ilPCInteractiveImageGUI::leftAlign ( )

align media object to left

Definition at line 284 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\getHierId(), ilMediaAliasItem\setHorizontalAlign(), and ilPageContentGUI\updateAndReturn().

284  : void
285  {
286  $std_alias_item = new ilMediaAliasItem(
287  $this->dom,
288  $this->getHierId(),
289  "Standard",
290  $this->content_obj->getPCId(),
291  "InteractiveImage"
292  );
293  $std_alias_item->setHorizontalAlign("Left");
294  $this->updateAndReturn();
295  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setHorizontalAlign(string $a_halign)
+ Here is the call graph for this function:

◆ leftFloatAlign()

ilPCInteractiveImageGUI::leftFloatAlign ( )

align media object to left, floating text

Definition at line 316 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\getHierId(), ilMediaAliasItem\setHorizontalAlign(), and ilPageContentGUI\updateAndReturn().

316  : void
317  {
318  $std_alias_item = new ilMediaAliasItem(
319  $this->content_obj->getDomDoc(),
320  $this->getHierId(),
321  "Standard",
322  $this->content_obj->getPCId(),
323  "InteractiveImage"
324  );
325  $std_alias_item->setHorizontalAlign("LeftFloat");
326  $this->updateAndReturn();
327  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setHorizontalAlign(string $a_halign)
+ Here is the call graph for this function:

◆ listOverlayImages()

ilPCInteractiveImageGUI::listOverlayImages ( )

Definition at line 349 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, $toolbar, ilPageContentGUI\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

349  : void
350  {
351  $tpl = $this->tpl;
352  $ilToolbar = $this->toolbar;
353  $ilCtrl = $this->ctrl;
354  $ilTabs = $this->tabs;
355  $lng = $this->lng;
356 
357  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_iim_overlay_info"));
358 
359  $ilTabs->setTabActive("list_overlays");
360 
361  $ilToolbar->addButton(
362  $lng->txt("cont_add_images"),
363  $ilCtrl->getLinkTarget($this, "addOverlayImages")
364  );
365 
366  $tab = new ilPCIIMOverlaysTableGUI(
367  $this,
368  "listOverlayImages",
369  $this->content_obj->getMediaObject()
370  );
371  $tpl->setContent($tab->getHTML());
372  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
TableGUI class for interactive image overlays.
+ Here is the call graph for this function:

◆ rightAlign()

ilPCInteractiveImageGUI::rightAlign ( )

align media object to right

Definition at line 300 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\getHierId(), ilMediaAliasItem\setHorizontalAlign(), and ilPageContentGUI\updateAndReturn().

300  : void
301  {
302  $std_alias_item = new ilMediaAliasItem(
303  $this->content_obj->getDomDoc(),
304  $this->getHierId(),
305  "Standard",
306  $this->content_obj->getPCId(),
307  "InteractiveImage"
308  );
309  $std_alias_item->setHorizontalAlign("Right");
310  $this->updateAndReturn();
311  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setHorizontalAlign(string $a_halign)
+ Here is the call graph for this function:

◆ rightFloatAlign()

ilPCInteractiveImageGUI::rightFloatAlign ( )

align media object to right, floating text

Definition at line 332 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\getHierId(), ilMediaAliasItem\setHorizontalAlign(), and ilPageContentGUI\updateAndReturn().

332  : void
333  {
334  $std_alias_item = new ilMediaAliasItem(
335  $this->content_obj->getDomDoc(),
336  $this->getHierId(),
337  "Standard",
338  $this->content_obj->getPCId(),
339  "InteractiveImage"
340  );
341  $std_alias_item->setHorizontalAlign("RightFloat");
342  $this->updateAndReturn();
343  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setHorizontalAlign(string $a_halign)
+ Here is the call graph for this function:

◆ savePopups()

ilPCInteractiveImageGUI::savePopups ( )

Definition at line 533 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, and ilLanguage\txt().

533  : void
534  {
535  $ilCtrl = $this->ctrl;
536  $lng = $this->lng;
537 
538  $titles = $this->request->getStringArray("title");
539  if (count($titles) > 0) {
540  $this->content_obj->savePopups($titles);
541  $this->pg_obj->update();
542  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
543  }
544  $ilCtrl->redirect($this, "listContentPopups");
545  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ update()

ilPCInteractiveImageGUI::update ( )

Update (base image)

Definition at line 216 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $location, ilObjMediaObject\_getDirectory(), ilPageContentGUI\getHierId(), ilObjMediaObject\getMimeType(), initForm(), ilFileUtils\moveUploadedFile(), ilMediaAliasItem\setCaption(), and ilLanguage\txt().

216  : void
217  {
218  $ilCtrl = $this->ctrl;
219  $lng = $this->lng;
220 
221  $form = $this->initForm("edit");
222  if ($form->checkInput()) {
223  $mob = $this->content_obj->getMediaObject();
224  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
225  $std_item = $mob->getMediaItem("Standard");
226  $location = $_FILES['image_file']['name'];
227 
228  if ($location != "" && is_file($_FILES['image_file']['tmp_name'])) {
229  $file = $mob_dir . "/" . $_FILES['image_file']['name'];
231  $_FILES['image_file']['tmp_name'],
232  $_FILES['image_file']['name'],
233  $file
234  );
235 
236  // get mime type
237  $format = ilObjMediaObject::getMimeType($file);
238  $location = $_FILES['image_file']['name'];
239  $std_item->setFormat($format);
240  $std_item->setLocation($location);
241  $std_item->setLocationType("LocalFile");
242  $mob->setDescription($format);
243  $mob->update();
244  }
245 
246  // set caption
247  $std_alias_item = new ilMediaAliasItem(
248  $this->content_obj->getDomDoc(),
249  $this->getHierId(),
250  "Standard",
251  $this->content_obj->getPCId(),
252  "InteractiveImage"
253  );
254  $std_alias_item->setCaption(
255  $form->getInput("caption")
256  );
257  $this->edit_repo->setPageError($this->pg_obj->update());
258  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
259  }
260 
261  $ilCtrl->redirectByClass("ilpcinteractiveimagegui", "editBaseImage");
262  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setCaption(string $a_caption)
$location
Definition: buildRTE.php:22
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getDirectory(int $a_mob_id)
Get absolute directory.
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
+ Here is the call graph for this function:

◆ uploadOverlayImages()

ilPCInteractiveImageGUI::uploadOverlayImages ( )

Definition at line 412 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, addOverlayImages(), initAddOverlaysForm(), and ilLanguage\txt().

412  : void
413  {
414  $lng = $this->lng;
415  $ilCtrl = $this->ctrl;
416 
417  $form = $this->initAddOverlaysForm();
418  if ($form->checkInput()) {
419  if (is_array($_FILES["ovfile"]["name"])) {
420  foreach ($_FILES["ovfile"]["name"] as $k => $v) {
421  $name = $_FILES["ovfile"]["name"][$k];
422  $tmp_name = $_FILES["ovfile"]["tmp_name"][$k];
423 
424  $this->content_obj->getMediaObject()->uploadAdditionalFile(
425  $name,
426  $tmp_name,
427  "overlays"
428  );
429  $piname = pathinfo($name);
430  $this->content_obj->getMediaObject()->makeThumbnail(
431  "overlays/" . $name,
432  basename($name, "." . $piname['extension']) . ".png"
433  );
434  }
435  }
436  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"));
437  $ilCtrl->redirect($this, "listOverlayImages");
438  } else {
439  $form->setValuesByPost();
440  $this->addOverlayImages($form);
441  }
442  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addOverlayImages(?ilPropertyFormGUI $a_form=null)
+ Here is the call graph for this function:

Field Documentation

◆ $iim_gui

ILIAS COPage PC InteractiveImage GUIService ilPCInteractiveImageGUI::$iim_gui
protected

Definition at line 34 of file class.ilPCInteractiveImageGUI.php.

◆ $iim_manager

ILIAS COPage PC InteractiveImage IIMManager ilPCInteractiveImageGUI::$iim_manager
protected

Definition at line 33 of file class.ilPCInteractiveImageGUI.php.

◆ $tabs

◆ $toolbar

ilToolbarGUI ilPCInteractiveImageGUI::$toolbar
protected

Definition at line 36 of file class.ilPCInteractiveImageGUI.php.

Referenced by deleteOverlays(), and listOverlayImages().


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