ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCInteractiveImageGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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="")
 
 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="create_mob", bool $a_input_error=false)
 Insert new media object form. More...
 
 edit ()
 
 editBaseImage ()
 
 initForm (string $a_mode="edit")
 
 create ()
 
 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 ()
 
- 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 ()
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 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 Attributes

ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
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 = ""
 
php4DOMDocument $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;"
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning User interface class for interactive images

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

Definition at line 25 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 30 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$content_obj, $DIC, $tabs, ilPageContentGUI\$tpl, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), getTabs(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), ilGlobalTemplateInterface\setTitleIcon(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

35  {
36  global $DIC;
37 
38  $this->tpl = $DIC["tpl"];
39  $this->lng = $DIC->language();
40  $this->tabs = $DIC->tabs();
41  $this->ctrl = $DIC->ctrl();
42  $this->toolbar = $DIC->toolbar();
43  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
44  }
global $DIC
Definition: feed.php:28
__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 446 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$tpl, initAddOverlaysForm(), and ilGlobalTemplateInterface\setContent().

Referenced by uploadOverlayImages().

446  : void
447  {
448  $tpl = $this->tpl;
449 
450  if ($a_form) {
451  $form = $a_form;
452  } else {
453  $form = $this->initAddOverlaysForm();
454  }
455 
456  $tpl->setContent($form->getHTML());
457  }
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 594 of file class.ilPCInteractiveImageGUI.php.

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

594  : void
595  {
596  $ilCtrl = $this->ctrl;
597  $lng = $this->lng;
598 
599  $this->content_obj->addContentPopup();
600  $this->pg_obj->update();
601  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
602  $ilCtrl->redirect($this, "listContentPopups");
603  }
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 340 of file class.ilPCInteractiveImageGUI.php.

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

340  : void
341  {
342  $std_alias_item = new ilMediaAliasItem(
343  $this->dom,
344  $this->getHierId(),
345  "Standard",
346  $this->content_obj->getPCId(),
347  "InteractiveImage"
348  );
349  $std_alias_item->setHorizontalAlign("Center");
350  $this->updateAndReturn();
351  }
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 516 of file class.ilPCInteractiveImageGUI.php.

References ilPageContentGUI\$ctrl, $d, $i, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilGlobalTemplateInterface\setContent(), ilTabsGUI\setTabActive(), and ilLanguage\txt().

516  : void
517  {
518  $ilCtrl = $this->ctrl;
519  $tpl = $this->tpl;
520  $lng = $this->lng;
521  $ilTabs = $this->tabs;
522 
523  $ilTabs->setTabActive("list_overlays");
524 
525  $files = $this->request->getStringArray("file");
526  if (count($files) == 0) {
527  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
528  $ilCtrl->redirect($this, "listOverlayImages");
529  } else {
530  $cgui = new ilConfirmationGUI();
531  $cgui->setFormAction($ilCtrl->getFormAction($this));
532  $cgui->setHeaderText($lng->txt("cont_really_delete_overlays"));
533  $cgui->setCancel($lng->txt("cancel"), "listOverlayImages");
534  $cgui->setConfirm($lng->txt("delete"), "deleteOverlays");
535 
536  foreach ($files as $i => $d) {
537  $cgui->addItem("file[]", $i, $i);
538  }
539 
540  $tpl->setContent($cgui->getHTML());
541  }
542  }
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...
setTabActive(string $a_id)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$i
Definition: metadata.php:41
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ confirmPopupDeletion()

ilPCInteractiveImageGUI::confirmPopupDeletion ( )

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

References ilPageContentGUI\$ctrl, $d, $i, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilGlobalTemplateInterface\setContent(), ilTabsGUI\setTabActive(), and ilLanguage\txt().

619  : void
620  {
621  $ilCtrl = $this->ctrl;
622  $tpl = $this->tpl;
623  $lng = $this->lng;
624  $ilTabs = $this->tabs;
625 
626  $ilTabs->setTabActive("content_popups");
627 
628  $tids = $this->request->getStringArray("tid");
629  $titles = $this->request->getStringArray("title");
630 
631  if (count($tids) == 0) {
632  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
633  $ilCtrl->redirect($this, "listContentPopups");
634  } else {
635  $cgui = new ilConfirmationGUI();
636  $cgui->setFormAction($ilCtrl->getFormAction($this));
637  $cgui->setHeaderText($lng->txt("cont_really_delete_popups"));
638  $cgui->setCancel($lng->txt("cancel"), "listContentPopups");
639  $cgui->setConfirm($lng->txt("delete"), "deletePopups");
640 
641  foreach ($tids as $i => $d) {
642  $cgui->addItem("tid[]", $i, $titles[$i]);
643  }
644 
645  $tpl->setContent($cgui->getHTML());
646  }
647  }
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...
setTabActive(string $a_id)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$i
Definition: metadata.php:41
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ create()

ilPCInteractiveImageGUI::create ( )

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

References ilPageContentGUI\$ctrl, Vendor\Package\$e, $format, ilPageContentGUI\$lng, $location, ilPageContentGUI\$tpl, ilObjMediaObject\_getDirectory(), ILIAS\Repository\ctrl(), ilPageContentGUI\displayValidationError(), ilObjMediaObject\getMimeType(), ilPageContentGUI\getPage(), initForm(), insert(), ILIAS\Repository\lng(), ilFileUtils\moveUploadedFile(), ilFileUtils\renameExecutables(), ilGlobalTemplateInterface\setContent(), ilPageContentGUI\setHierId(), and ilLanguage\txt().

217  : void
218  {
219  $ilCtrl = $this->ctrl;
220  $lng = $this->lng;
221  $tpl = $this->tpl;
222 
223  $form = $this->initForm("create");
224  if (!$form->checkInput()) {
225  $this->displayValidationError();
226  $form->setValuesByPost();
227  $tpl->setContent($form->getHTML());
228  return;
229  }
230 
231  $this->content_obj = new ilPCInteractiveImage($this->getPage());
232  $this->content_obj->createMediaObject();
233  $media_obj = $this->content_obj->getMediaObject();
234  $media_obj->setTitle($_FILES['image_file']['name']);
235  $media_obj->create();
236  $mob_dir = ilObjMediaObject::_getDirectory($media_obj->getId());
237  // $media_obj->setStandardType("File");
238  $media_obj->createDirectory();
239  $media_item = new ilMediaItem();
240  $media_obj->addMediaItem($media_item);
241  $media_item->setPurpose("Standard");
242 
243  $file = $mob_dir . "/" . $_FILES['image_file']['name'];
244  try {
246  $_FILES['image_file']['tmp_name'],
247  $_FILES['image_file']['name'],
248  $file
249  );
250  } catch (ilException $e) {
251  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("file_is_infected"), true);
252  return;
253  }
254  // get mime type
256  $location = $_FILES['image_file']['name'];
257 
258  // set real meta and object data
259  $media_item->setFormat($format);
260  $media_item->setLocation($location);
261  $media_item->setLocationType("LocalFile");
262 
264  $media_obj->update();
265 
266  $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
267  $this->updated = $this->pg_obj->update();
268  if ($this->updated === true) {
269  $this->pg_obj->stripHierIDs();
270  $this->pg_obj->addHierIDs();
271  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
272  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
273  $this->content_obj->setHierId($this->content_obj->readHierId());
274  $this->setHierId($this->content_obj->readHierId());
275  $this->content_obj->setPcId($this->content_obj->readPCId());
276  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_saved_interactive_image"), true);
277  $this->ctrl->redirectByClass("ilpcinteractiveimagegui", "edit");
278 
279  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
280  } else {
281  $this->insert();
282  }
283  }
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...
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
setHierId(string $a_hier_id)
set hierarchical id in dom object
static renameExecutables(string $a_dir)
insert(string $a_post_cmd="edpost", string $a_submit_cmd="create_mob", bool $a_input_error=false)
Insert new media object form.
static _getDirectory(int $a_mob_id)
Get absolute directory.
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
$format
Definition: metadata.php:235
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deleteOverlays()

ilPCInteractiveImageGUI::deleteOverlays ( )

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

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

544  : void
545  {
546  $ilCtrl = $this->ctrl;
547  $lng = $this->lng;
548 
549  $files = $this->request->getStringArray("file");
550  if (count($files) > 0) {
551  foreach ($files as $f) {
552  $f = str_replace("..", "", ilUtil::stripSlashes($f));
553  $this->content_obj->getMediaObject()
554  ->removeAdditionalFile("overlays/" . $f);
555  }
556 
557  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_overlays_have_been_deleted"), true);
558  }
559  $ilCtrl->redirect($this, "listOverlayImages");
560  }
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 649 of file class.ilPCInteractiveImageGUI.php.

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

649  : void
650  {
651  $lng = $this->lng;
652  $ilCtrl = $this->ctrl;
653 
654  $tids = $this->request->getStringArray("tid");
655 
656  if (count($tids) > 0) {
657  foreach ($tids as $id) {
658  $id = explode(":", $id);
659  $this->content_obj->deletePopup($id[0], $id[1]);
660  }
661  $this->pg_obj->update();
662  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_popups_have_been_deleted"), true);
663  }
664  $ilCtrl->redirect($this, "listContentPopups");
665  }
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 150 of file class.ilPCInteractiveImageGUI.php.

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

150  : void
151  {
152  $ilCtrl = $this->ctrl;
153  $ilCtrl->redirectByClass(array("ilpcinteractiveimagegui", "ilpciimtriggereditorgui"), "editMapAreas");
154  }
redirectByClass( $a_class, 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 156 of file class.ilPCInteractiveImageGUI.php.

References $tabs, ilPageContentGUI\$tpl, ilTabsGUI\activateTab(), initForm(), and ilGlobalTemplateInterface\setContent().

156  : void
157  {
158  $tpl = $this->tpl;
159  $ilTabs = $this->tabs;
160  $ilTabs->activateTab("edit_base_image");
161  $form = $this->initForm();
162  $tpl->setContent($form->getHTML());
163  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
activateTab(string $a_id)
+ 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 88 of file class.ilPCInteractiveImageGUI.php.

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

Referenced by __construct().

91  : void {
92  $ilCtrl = $this->ctrl;
93  $ilTabs = $this->tabs;
94  $lng = $this->lng;
95 
96  if (!$a_create) {
97  $ilTabs->setBackTarget(
98  $lng->txt("pg"),
99  (string) $ilCtrl->getParentReturn($this)
100  );
101 
102  $ilTabs->addTab(
103  "triggers",
104  $lng->txt("cont_active_areas"),
105  $ilCtrl->getLinkTargetByClass("ilpciimtriggereditorgui", "editMapAreas")
106  );
107 
108  $ilTabs->addTab(
109  "list_overlays",
110  $lng->txt("cont_overlay_images"),
111  $ilCtrl->getLinkTarget($this, "listOverlayImages")
112  );
113 
114  $ilTabs->addTab(
115  "content_popups",
116  $lng->txt("cont_content_popups"),
117  $ilCtrl->getLinkTarget($this, "listContentPopups")
118  );
119 
120  $ilTabs->addTab(
121  "edit_base_image",
122  $lng->txt("cont_base_image") . " & " . $lng->txt("cont_caption"),
123  $ilCtrl->getLinkTarget($this, "editBaseImage")
124  );
125  }
126  }
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:

◆ initAddOverlaysForm()

ilPCInteractiveImageGUI::initAddOverlaysForm ( )

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

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

Referenced by addOverlayImages(), and uploadOverlayImages().

460  {
461  $lng = $this->lng;
462  $ilCtrl = $this->ctrl;
463  $ilTabs = $this->tabs;
464 
465  $ilTabs->setTabActive("list_overlays");
466 
467  $form = new ilPropertyFormGUI();
468  $form->setTitle($lng->txt("cont_add_images"));
469  $form->setFormAction($ilCtrl->getFormAction($this));
470 
471  // file input
472  $fi = new ilFileWizardInputGUI($lng->txt("file"), "ovfile");
473  $fi->setSuffixes(array("gif", "jpeg", "jpg", "png"));
474  $fi->setFilenames(array(0 => ''));
475  $fi->setRequired(true);
476  $form->addItem($fi);
477 
478  $form->addCommandButton("uploadOverlayImages", $lng->txt("upload"));
479  $form->addCommandButton("listOverlayImages", $lng->txt("cancel"));
480 
481  return $form;
482  }
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 166 of file class.ilPCInteractiveImageGUI.php.

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

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

167  {
168  $lng = $this->lng;
169  $ilCtrl = $this->ctrl;
170  $ti = null;
171 
172  $form = new ilPropertyFormGUI();
173 
174  // image file
175  $fi = new ilImageFileInputGUI($lng->txt("cont_file"), "image_file");
176  $fi->setAllowDeletion(false);
177  if ($a_mode == "edit") {
178  $fi->setImage($this->content_obj->getBaseThumbnailTarget());
179  } else {
180  $fi->setRequired(true);
181  }
182  $form->addItem($fi);
183 
184  if ($a_mode == "edit") {
185  // caption
186  $ti = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
187  $ti->setMaxLength(200);
188  $ti->setSize(50);
189  $form->addItem($ti);
190  }
191 
192  // save and cancel commands
193  if ($a_mode == "create") {
194  $form->setTitle($lng->txt("cont_ed_insert_iim"));
195  $form->addCommandButton("create_iim", $lng->txt("save"));
196  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
197  } else {
198  // get caption
199  $std_alias_item = new ilMediaAliasItem(
200  $this->dom,
201  $this->getHierId(),
202  "Standard",
203  $this->content_obj->getPCId(),
204  "InteractiveImage"
205  );
206  $ti->setValue($std_alias_item->getCaption());
207 
208  $form->setTitle($lng->txt("cont_edit_base_image"));
209  $form->addCommandButton("update", $lng->txt("save"));
210  }
211 
212  $form->setFormAction($ilCtrl->getFormAction($this));
213 
214  return $form;
215  }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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 = "create_mob",
bool  $a_input_error = false 
)

Insert new media object form.

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

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

Referenced by create().

135  : void {
136  $tpl = $this->tpl;
137  $ilCtrl = $this->ctrl;
138  $lng = $this->lng;
139 
140  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_iim_create_info"));
141 
142  $form = $this->initForm("create");
143  $form->setFormAction($ilCtrl->getFormAction($this));
144 
145  $this->displayValidationError();
146 
147  $tpl->setContent($form->getHTML());
148  }
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:
+ Here is the caller graph for this function:

◆ leftAlign()

ilPCInteractiveImageGUI::leftAlign ( )

align media object to left

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

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

356  : void
357  {
358  $std_alias_item = new ilMediaAliasItem(
359  $this->dom,
360  $this->getHierId(),
361  "Standard",
362  $this->content_obj->getPCId(),
363  "InteractiveImage"
364  );
365  $std_alias_item->setHorizontalAlign("Left");
366  $this->updateAndReturn();
367  }
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 388 of file class.ilPCInteractiveImageGUI.php.

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

388  : void
389  {
390  $std_alias_item = new ilMediaAliasItem(
391  $this->dom,
392  $this->getHierId(),
393  "Standard",
394  $this->content_obj->getPCId(),
395  "InteractiveImage"
396  );
397  $std_alias_item->setHorizontalAlign("LeftFloat");
398  $this->updateAndReturn();
399  }
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 421 of file class.ilPCInteractiveImageGUI.php.

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

421  : void
422  {
423  $tpl = $this->tpl;
424  $ilToolbar = $this->toolbar;
425  $ilCtrl = $this->ctrl;
426  $ilTabs = $this->tabs;
427  $lng = $this->lng;
428 
429  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_iim_overlay_info"));
430 
431  $ilTabs->setTabActive("list_overlays");
432 
433  $ilToolbar->addButton(
434  $lng->txt("cont_add_images"),
435  $ilCtrl->getLinkTarget($this, "addOverlayImages")
436  );
437 
438  $tab = new ilPCIIMOverlaysTableGUI(
439  $this,
440  "listOverlayImages",
441  $this->content_obj->getMediaObject()
442  );
443  $tpl->setContent($tab->getHTML());
444  }
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ rightAlign()

ilPCInteractiveImageGUI::rightAlign ( )

align media object to right

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

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

372  : void
373  {
374  $std_alias_item = new ilMediaAliasItem(
375  $this->dom,
376  $this->getHierId(),
377  "Standard",
378  $this->content_obj->getPCId(),
379  "InteractiveImage"
380  );
381  $std_alias_item->setHorizontalAlign("Right");
382  $this->updateAndReturn();
383  }
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 404 of file class.ilPCInteractiveImageGUI.php.

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

404  : void
405  {
406  $std_alias_item = new ilMediaAliasItem(
407  $this->dom,
408  $this->getHierId(),
409  "Standard",
410  $this->content_obj->getPCId(),
411  "InteractiveImage"
412  );
413  $std_alias_item->setHorizontalAlign("RightFloat");
414  $this->updateAndReturn();
415  }
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 605 of file class.ilPCInteractiveImageGUI.php.

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

605  : void
606  {
607  $ilCtrl = $this->ctrl;
608  $lng = $this->lng;
609 
610  $titles = $this->request->getStringArray("title");
611  if (count($titles) > 0) {
612  $this->content_obj->savePopups($titles);
613  $this->pg_obj->update();
614  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
615  }
616  $ilCtrl->redirect($this, "listContentPopups");
617  }
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 288 of file class.ilPCInteractiveImageGUI.php.

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

288  : void
289  {
290  $ilCtrl = $this->ctrl;
291  $lng = $this->lng;
292 
293  $form = $this->initForm("edit");
294  if ($form->checkInput()) {
295  $mob = $this->content_obj->getMediaObject();
296  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
297  $std_item = $mob->getMediaItem("Standard");
298  $location = $_FILES['image_file']['name'];
299 
300  if ($location != "" && is_file($_FILES['image_file']['tmp_name'])) {
301  $file = $mob_dir . "/" . $_FILES['image_file']['name'];
303  $_FILES['image_file']['tmp_name'],
304  $_FILES['image_file']['name'],
305  $file
306  );
307 
308  // get mime type
310  $location = $_FILES['image_file']['name'];
311  $std_item->setFormat($format);
312  $std_item->setLocation($location);
313  $std_item->setLocationType("LocalFile");
314  $mob->setDescription($format);
315  $mob->update();
316  }
317 
318  // set caption
319  $std_alias_item = new ilMediaAliasItem(
320  $this->dom,
321  $this->getHierId(),
322  "Standard",
323  $this->content_obj->getPCId(),
324  "InteractiveImage"
325  );
326  $std_alias_item->setCaption(
327  $form->getInput("caption")
328  );
329  $this->edit_repo->setPageError($this->pg_obj->update());
330  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
331  }
332 
333  $ilCtrl->redirectByClass("ilpcinteractiveimagegui", "editBaseImage");
334  }
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
$format
Definition: metadata.php:235
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 484 of file class.ilPCInteractiveImageGUI.php.

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

484  : void
485  {
486  $lng = $this->lng;
487  $ilCtrl = $this->ctrl;
488 
489  $form = $this->initAddOverlaysForm();
490  if ($form->checkInput()) {
491  if (is_array($_FILES["ovfile"]["name"])) {
492  foreach ($_FILES["ovfile"]["name"] as $k => $v) {
493  $name = $_FILES["ovfile"]["name"][$k];
494  $tmp_name = $_FILES["ovfile"]["tmp_name"][$k];
495 
496  $this->content_obj->getMediaObject()->uploadAdditionalFile(
497  $name,
498  $tmp_name,
499  "overlays"
500  );
501  $piname = pathinfo($name);
502  $this->content_obj->getMediaObject()->makeThumbnail(
503  "overlays/" . $name,
504  basename($name, "." . $piname['extension']) . ".png"
505  );
506  }
507  }
508  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"));
509  $ilCtrl->redirect($this, "listOverlayImages");
510  } else {
511  $form->setValuesByPost();
512  $this->addOverlayImages($form);
513  }
514  }
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...
if($format !==null) $name
Definition: metadata.php:247
addOverlayImages(ilPropertyFormGUI $a_form=null)
+ Here is the call graph for this function:

Field Documentation

◆ $tabs

◆ $toolbar

ilToolbarGUI ilPCInteractiveImageGUI::$toolbar
protected

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

Referenced by deleteOverlays(), and listOverlayImages().


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