ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilPCInteractiveImageGUI Class Reference

User interface class for interactive images. More...

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

Public Member Functions

 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 
 executeCommand ()
 execute command More...
 
 getTabs (&$tab_gui, $a_create=false, $a_change_obj_ref=false)
 Add tabs to ilTabsGUI object. More...
 
 insert ($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
 Insert new media object form. More...
 
 edit ()
 Edit. More...
 
 editBaseImage ($a_form=null)
 Edit base image. More...
 
 initForm ($a_mode="edit")
 Init creation/base image form. More...
 
 create ()
 Create new content element. More...
 
 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 ()
 List overlay images. More...
 
 addOverlayImages ($a_form=null)
 Add overlay images. More...
 
 initAddOverlaysForm ()
 Init add overlays form. More...
 
 uploadOverlayImages ()
 Upload overlay images. More...
 
 confirmDeleteOverlays ()
 Confirm overlay deletion. More...
 
 deleteOverlays ()
 Delete overlays. More...
 
 listContentPopups ()
 List content popups. More...
 
 addPopup ()
 Add popup. More...
 
 savePopups ()
 Save popups. More...
 
 confirmPopupDeletion ()
 Confirm popup deletion. More...
 
 deletePopups ()
 Delete popups. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 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 ()
 display validation errors More...
 
 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 ($a_type)
 Get table templates. More...
 

Protected Attributes

 $tabs
 
 $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

User interface class for interactive images.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilPCInteractiveImageGUI: ilPCIIMTriggerEditorGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCInteractiveImageGUI::__construct (   $a_pg_obj,
  $a_content_obj,
  $a_hier_id = 0,
  $a_pc_id = "" 
)

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

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

32  {
33  global $DIC;
34 
35  $this->tpl = $DIC["tpl"];
36  $this->lng = $DIC->language();
37  $this->tabs = $DIC->tabs();
38  $this->ctrl = $DIC->ctrl();
39  $this->toolbar = $DIC->toolbar();
40  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
41  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ addOverlayImages()

ilPCInteractiveImageGUI::addOverlayImages (   $a_form = null)

Add overlay images.

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

References ilPageContentGUI\$tpl, and initAddOverlaysForm().

Referenced by uploadOverlayImages().

487  {
488  $tpl = $this->tpl;
489 
490  if ($a_form) {
491  $form = $a_form;
492  } else {
493  $form = $this->initAddOverlaysForm();
494  }
495 
496  $tpl->setContent($form->getHTML());
497  }
initAddOverlaysForm()
Init add overlays form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPopup()

ilPCInteractiveImageGUI::addPopup ( )

Add popup.

Parameters

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

References ilPageContentGUI\$ctrl, $ilCtrl, and ilPageContentGUI\$lng.

665  {
667  $lng = $this->lng;
668 
669  $this->content_obj->addContentPopup();
670  $this->pg_obj->update();
671  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
672  $ilCtrl->redirect($this, "listContentPopups");
673  }
global $ilCtrl
Definition: ilias.php:18

◆ centerAlign()

ilPCInteractiveImageGUI::centerAlign ( )

Align media object to center.

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

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

366  {
367  $std_alias_item = new ilMediaAliasItem(
368  $this->dom,
369  $this->getHierId(),
370  "Standard",
371  $this->content_obj->getPcId(),
372  "InteractiveImage"
373  );
374  $std_alias_item->setHorizontalAlign("Center");
375  $_SESSION["il_pg_error"] = $this->pg_obj->update();
376  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
377  }
$_SESSION["AccountId"]
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ confirmDeleteOverlays()

ilPCInteractiveImageGUI::confirmDeleteOverlays ( )

Confirm overlay deletion.

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

References $_POST, ilPageContentGUI\$ctrl, $d, $i, $ilCtrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, and ilUtil\sendFailure().

577  {
579  $tpl = $this->tpl;
580  $lng = $this->lng;
581  $ilTabs = $this->tabs;
582 
583  $ilTabs->setTabActive("list_overlays");
584 
585  if (!is_array($_POST["file"]) || count($_POST["file"]) == 0) {
586  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
587  $ilCtrl->redirect($this, "listOverlayImages");
588  } else {
589  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
590  $cgui = new ilConfirmationGUI();
591  $cgui->setFormAction($ilCtrl->getFormAction($this));
592  $cgui->setHeaderText($lng->txt("cont_really_delete_overlays"));
593  $cgui->setCancel($lng->txt("cancel"), "listOverlayImages");
594  $cgui->setConfirm($lng->txt("delete"), "deleteOverlays");
595 
596  foreach ($_POST["file"] as $i => $d) {
597  $cgui->addItem("file[]", $i, $i);
598  }
599 
600  $tpl->setContent($cgui->getHTML());
601  }
602  }
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmPopupDeletion()

ilPCInteractiveImageGUI::confirmPopupDeletion ( )

Confirm popup deletion.

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

References $_POST, ilPageContentGUI\$ctrl, $d, $i, $ilCtrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, and ilUtil\sendFailure().

696  {
698  $tpl = $this->tpl;
699  $lng = $this->lng;
700  $ilTabs = $this->tabs;
701 
702  $ilTabs->setTabActive("content_popups");
703 
704  if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0) {
705  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
706  $ilCtrl->redirect($this, "listContentPopups");
707  } else {
708  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
709  $cgui = new ilConfirmationGUI();
710  $cgui->setFormAction($ilCtrl->getFormAction($this));
711  $cgui->setHeaderText($lng->txt("cont_really_delete_popups"));
712  $cgui->setCancel($lng->txt("cancel"), "listContentPopups");
713  $cgui->setConfirm($lng->txt("delete"), "deletePopups");
714 
715  foreach ($_POST["tid"] as $i => $d) {
716  $cgui->addItem("tid[]", $i, $_POST["title"][$i]);
717  }
718 
719  $tpl->setContent($cgui->getHTML());
720  }
721  }
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ create()

ilPCInteractiveImageGUI::create ( )

Create new content element.

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

References ilPageContentGUI\$ctrl, $format, $ilCtrl, ilPageContentGUI\$lng, $location, ilObjMediaObject\_getDirectory(), ilObjMediaObject\getMimeType(), ilPageContentGUI\getPage(), insert(), ilUtil\moveUploadedFile(), ilUtil\renameExecutables(), and ilPageContentGUI\setHierId().

261  {
263  $lng = $this->lng;
264 
265  $this->content_obj = new ilPCInteractiveImage($this->getPage());
266  $this->content_obj->createMediaObject();
267  $media_obj = $this->content_obj->getMediaObject();
268  $media_obj->setTitle($_FILES['image_file']['name']);
269  $media_obj->create();
270  $mob_dir = ilObjMediaObject::_getDirectory($media_obj->getId());
271  // $media_obj->setStandardType("File");
272  $media_obj->createDirectory();
273  $media_item = new ilMediaItem();
274  $media_obj->addMediaItem($media_item);
275  $media_item->setPurpose("Standard");
276 
277  $file = $mob_dir . "/" . $_FILES['image_file']['name'];
279  $_FILES['image_file']['tmp_name'],
280  $_FILES['image_file']['name'],
281  $file
282  );
283 
284  // get mime type
286  $location = $_FILES['image_file']['name'];
287 
288  // set real meta and object data
289  $media_item->setFormat($format);
290  $media_item->setLocation($location);
291  $media_item->setLocationType("LocalFile");
292 
293  ilUtil::renameExecutables($mob_dir);
294  $media_obj->update();
295 
296  $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
297  $this->updated = $this->pg_obj->update();
298  if ($this->updated === true) {
299  $this->pg_obj->stripHierIDs();
300  $this->pg_obj->addHierIDs();
301  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
302  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
303  $this->content_obj->setHierId($this->content_obj->readHierId());
304  $this->setHierId($this->content_obj->readHierId());
305  $this->content_obj->setPCId($this->content_obj->readPCId());
306  ilUtil::sendSuccess($lng->txt("cont_saved_interactive_image"), true);
307  $this->ctrl->redirectByClass("ilpcinteractiveimagegui", "edit");
308 
309  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
310  } else {
311  $this->insert();
312  }
313  }
static getMimeType($a_file, $a_external=null)
get mime type for file
$location
Definition: buildRTE.php:44
static _getDirectory($a_mob_id)
Get absolute directory.
global $ilCtrl
Definition: ilias.php:18
insert($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
Insert new media object form.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilMediaItem.
$format
Definition: metadata.php:218
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
setHierId($a_hier_id)
get hierarchical id in dom object
+ Here is the call graph for this function:

◆ deleteOverlays()

ilPCInteractiveImageGUI::deleteOverlays ( )

Delete overlays.

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

References $_POST, ilPageContentGUI\$ctrl, Vendor\Package\$f, $ilCtrl, ilPageContentGUI\$lng, and ilUtil\stripSlashes().

608  {
610  $lng = $this->lng;
611 
612  if (is_array($_POST["file"]) && count($_POST["file"]) != 0) {
613  foreach ($_POST["file"] as $f) {
614  $f = str_replace("..", "", ilUtil::stripSlashes($f));
615  $this->content_obj->getMediaObject()
616  ->removeAdditionalFile("overlays/" . $f);
617  }
618 
619  ilUtil::sendSuccess($lng->txt("cont_overlays_have_been_deleted"), true);
620  }
621  $ilCtrl->redirect($this, "listOverlayImages");
622  }
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ deletePopups()

ilPCInteractiveImageGUI::deletePopups ( )

Delete popups.

Parameters

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

References $_POST, ilPageContentGUI\$ctrl, $ilCtrl, and ilPageContentGUI\$lng.

730  {
731  $lng = $this->lng;
733 
734  if (is_array($_POST["tid"]) && count($_POST["tid"]) != 0) {
735  foreach ($_POST["tid"] as $id) {
736  $id = explode(":", $id);
737  $this->content_obj->deletePopup($id[0], $id[1]);
738  }
739  $this->pg_obj->update();
740  ilUtil::sendSuccess($lng->txt("cont_popups_have_been_deleted"), true);
741  }
742  $ilCtrl->redirect($this, "listContentPopups");
743  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ edit()

ilPCInteractiveImageGUI::edit ( )

Edit.

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

References ilPageContentGUI\$ctrl, $ilCtrl, and ilPageContentGUI\$tpl.

176  {
177  $tpl = $this->tpl;
179 
180  $ilCtrl->redirectByClass(array("ilpcinteractiveimagegui", "ilpciimtriggereditorgui"), "editMapAreas");
181  //$tpl->setContent("hh");
182  }
global $ilCtrl
Definition: ilias.php:18

◆ editBaseImage()

ilPCInteractiveImageGUI::editBaseImage (   $a_form = null)

Edit base image.

Parameters

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

References ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, and initForm().

191  {
192  $tpl = $this->tpl;
193  $ilTabs = $this->tabs;
194  $lng = $this->lng;
195 
196  $ilTabs->activateTab("edit_base_image");
197 
198  $form = $this->initForm();
199  $tpl->setContent($form->getHTML());
200  }
initForm($a_mode="edit")
Init creation/base image form.
+ Here is the call graph for this function:

◆ executeCommand()

ilPCInteractiveImageGUI::executeCommand ( )

execute command

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

References ilPageContentGUI\$lng, $ret, $tabs, ilPageContentGUI\$tpl, ilUtil\getImagePath(), and getTabs().

47  {
48  $tpl = $this->tpl;
49  $lng = $this->lng;
50  $ilTabs = $this->tabs;
51 
52 
53  // $this->getCharacteristicsOfCurrentStyle("media_cont"); // scorm-2004
54 
55  // get next class that processes or forwards current command
56  $next_class = $this->ctrl->getNextClass($this);
57 
58  // get current command
59  $cmd = $this->ctrl->getCmd();
60 
61  if (is_object($this->content_obj)) {
62  $tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
63  $this->getTabs($this->tabs_gui);
64 
65  /* $mob = $this->content_obj->getMediaObject();
66  if (is_object($mob))
67  {
68  $tpl->setVariable("HEADER", $lng->txt("mob").": ".
69  $this->content_obj->getMediaObject()->getTitle());
70  $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(),false, false);
71  $mob_gui->setBackTitle($this->page_back_title);
72  $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
73  $mob_gui->getTabs($this->tabs_gui);
74  }*/
75  } else {
76  }
77 
78  switch ($next_class) {
79  // trigger editor
80  case "ilpciimtriggereditorgui":
81  require_once("./Services/COPage/classes/class.ilPCIIMTriggerEditorGUI.php");
82  $ilTabs->setTabActive("triggers");
83  $image_map_edit = new ilPCIIMTriggerEditorGUI(
84  $this->content_obj,
85  $this->pg_obj
86  );
87  $ret = $this->ctrl->forwardCommand($image_map_edit);
88  if ($ret != "") {
89  $tpl->setContent($ret);
90  }
91  break;
92 
93  default:
94  $ret = $this->$cmd();
95  break;
96  }
97 
98  return $ret;
99  }
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
Add tabs to ilTabsGUI object.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ret
Definition: parser.php:6
User interface class for page content map editor.
+ Here is the call graph for this function:

◆ getTabs()

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

Add tabs to ilTabsGUI object.

Parameters
object$tab_guiilTabsGUI object
boolean$a_createnew creation true/false

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, and $tabs.

Referenced by executeCommand().

108  {
110  $ilTabs = $this->tabs;
111  $lng = $this->lng;
112 
113  if (!$a_create) {
114  $ilTabs->setBackTarget(
115  $lng->txt("pg"),
116  $ilCtrl->getParentReturn($this)
117  );
118 
119  $ilTabs->addTab(
120  "triggers",
121  $lng->txt("cont_active_areas"),
122  $ilCtrl->getLinkTargetByClass("ilpciimtriggereditorgui", "editMapAreas")
123  );
124 
125  $ilTabs->addTab(
126  "list_overlays",
127  $lng->txt("cont_overlay_images"),
128  $ilCtrl->getLinkTarget($this, "listOverlayImages")
129  );
130 
131  $ilTabs->addTab(
132  "content_popups",
133  $lng->txt("cont_content_popups"),
134  $ilCtrl->getLinkTarget($this, "listContentPopups")
135  );
136 
137  $ilTabs->addTab(
138  "edit_base_image",
139  $lng->txt("cont_base_image") . " & " . $lng->txt("cont_caption"),
140  $ilCtrl->getLinkTarget($this, "editBaseImage")
141  );
142  }
143  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ initAddOverlaysForm()

ilPCInteractiveImageGUI::initAddOverlaysForm ( )

Init add overlays form.

Parameters

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $tabs, and ilFileInputGUI\setSuffixes().

Referenced by addOverlayImages(), and uploadOverlayImages().

506  {
507  $lng = $this->lng;
509  $ilTabs = $this->tabs;
510 
511  $ilTabs->setTabActive("list_overlays");
512 
513  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
514  $form = new ilPropertyFormGUI();
515  $form->setTitle($lng->txt("cont_add_images"));
516  $form->setFormAction($ilCtrl->getFormAction($this));
517 
518  // file input
519  include_once("./Services/Form/classes/class.ilFileWizardInputGUI.php");
520  $fi = new ilFileWizardInputGUI($lng->txt("file"), "ovfile");
521  $fi->setSuffixes(array("gif", "jpeg", "jpg", "png"));
522  $fi->setFilenames(array(0 => ''));
523  $fi->setRequired(true);
524  $form->addItem($fi);
525 
526  $form->addCommandButton("uploadOverlayImages", $lng->txt("upload"));
527  $form->addCommandButton("listOverlayImages", $lng->txt("cancel"));
528 
529  return $form;
530  }
This class represents a property form user interface.
This class represents a file wizard property in a property form.
global $ilCtrl
Definition: ilias.php:18
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

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

Init creation/base image form.

Parameters
int$a_modeEdit Mode

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\getHierId(), and ilImageFileInputGUI\setImage().

Referenced by editBaseImage(), and insert().

209  {
210  $lng = $this->lng;
212 
213  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
214  $form = new ilPropertyFormGUI();
215 
216  // image file
217  $fi = new ilImageFileInputGUI($lng->txt("cont_file"), "image_file");
218  $fi->setAllowDeletion(false);
219  if ($a_mode == "edit") {
220  $fi->setImage($this->content_obj->getBaseThumbnailTarget());
221  }
222  $form->addItem($fi);
223 
224  if ($a_mode == "edit") {
225  // caption
226  $ti = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
227  $ti->setMaxLength(200);
228  $ti->setSize(50);
229  $form->addItem($ti);
230  }
231 
232  // save and cancel commands
233  if ($a_mode == "create") {
234  $form->setTitle($lng->txt("cont_ed_insert_iim"));
235  $form->addCommandButton("create_iim", $lng->txt("save"));
236  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
237  } else {
238  // get caption
239  $std_alias_item = new ilMediaAliasItem(
240  $this->dom,
241  $this->getHierId(),
242  "Standard",
243  $this->content_obj->getPcId(),
244  "InteractiveImage"
245  );
246  $ti->setValue($std_alias_item->getCaption());
247 
248  $form->setTitle($lng->txt("cont_edit_base_image"));
249  $form->addCommandButton("update", $lng->txt("save"));
250  }
251 
252  $form->setFormAction($ilCtrl->getFormAction($this));
253 
254  return $form;
255  }
This class represents a property form user interface.
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
global $ilCtrl
Definition: ilias.php:18
setImage($a_image)
Set Image.
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:

◆ insert()

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

Insert new media object form.

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ilUtil\sendInfo().

Referenced by create().

149  {
150  $ilTabs = $this->tabs;
151  $tpl = $this->tpl;
153  $lng = $this->lng;
154 
155  ilUtil::sendInfo($lng->txt("cont_iim_create_info"));
156 
157  // $this->getTabs($ilTabs, true);
158  // $ilTabs->setSubTabActive("cont_new_mob");
159 
160  if ($a_input_error) {
161  $form = $this->form;
162  } else {
163  $form = $this->initForm("create");
164  }
165  $form->setFormAction($ilCtrl->getFormAction($this));
166 
167  $this->displayValidationError();
168 
169  $tpl->setContent($form->getHTML());
170  }
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
displayValidationError()
display validation errors
initForm($a_mode="edit")
Init creation/base image form.
+ 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 382 of file class.ilPCInteractiveImageGUI.php.

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

383  {
384  $std_alias_item = new ilMediaAliasItem(
385  $this->dom,
386  $this->getHierId(),
387  "Standard",
388  $this->content_obj->getPcId(),
389  "InteractiveImage"
390  );
391  $std_alias_item->setHorizontalAlign("Left");
392  $_SESSION["il_pg_error"] = $this->pg_obj->update();
393  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
394  }
$_SESSION["AccountId"]
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ leftFloatAlign()

ilPCInteractiveImageGUI::leftFloatAlign ( )

align media object to left, floating text

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

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

417  {
418  $std_alias_item = new ilMediaAliasItem(
419  $this->dom,
420  $this->getHierId(),
421  "Standard",
422  $this->content_obj->getPcId(),
423  "InteractiveImage"
424  );
425  $std_alias_item->setHorizontalAlign("LeftFloat");
426  $_SESSION["il_pg_error"] = $this->pg_obj->update();
427  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
428  }
$_SESSION["AccountId"]
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ listContentPopups()

ilPCInteractiveImageGUI::listContentPopups ( )

List content popups.

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $tab, $tabs, $toolbar, ilPageContentGUI\$tpl, and ilUtil\sendInfo().

633  {
634  $tpl = $this->tpl;
635  $ilToolbar = $this->toolbar;
637  $ilTabs = $this->tabs;
638  $lng = $this->lng;
639 
640  ilUtil::sendInfo($lng->txt("cont_iim_content_popups_info"));
641 
642  $ilTabs->setTabActive("content_popups");
643 
644  $ilToolbar->addButton(
645  $lng->txt("cont_add_popup"),
646  $ilCtrl->getLinkTarget($this, "addPopup")
647  );
648 
649  include_once("./Services/COPage/classes/class.ilPCIIMPopupTableGUI.php");
651  $this,
652  "listContentPopups",
653  $this->content_obj
654  );
655  $tpl->setContent($tab->getHTML());
656  }
TableGUI class for content popup.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ listOverlayImages()

ilPCInteractiveImageGUI::listOverlayImages ( )

List overlay images.

Parameters

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $tab, $tabs, $toolbar, ilPageContentGUI\$tpl, and ilUtil\sendInfo().

458  {
459  $tpl = $this->tpl;
460  $ilToolbar = $this->toolbar;
462  $ilTabs = $this->tabs;
463  $lng = $this->lng;
464 
465  ilUtil::sendInfo($lng->txt("cont_iim_overlay_info"));
466 
467  $ilTabs->setTabActive("list_overlays");
468 
469  $ilToolbar->addButton(
470  $lng->txt("cont_add_images"),
471  $ilCtrl->getLinkTarget($this, "addOverlayImages")
472  );
473 
474  include_once("./Services/COPage/classes/class.ilPCIIMOverlaysTableGUI.php");
476  $this,
477  "listOverlayImages",
478  $this->content_obj->getMediaObject()
479  );
480  $tpl->setContent($tab->getHTML());
481  }
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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 399 of file class.ilPCInteractiveImageGUI.php.

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

400  {
401  $std_alias_item = new ilMediaAliasItem(
402  $this->dom,
403  $this->getHierId(),
404  "Standard",
405  $this->content_obj->getPcId(),
406  "InteractiveImage"
407  );
408  $std_alias_item->setHorizontalAlign("Right");
409  $_SESSION["il_pg_error"] = $this->pg_obj->update();
410  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
411  }
$_SESSION["AccountId"]
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ rightFloatAlign()

ilPCInteractiveImageGUI::rightFloatAlign ( )

align media object to right, floating text

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

References $_SESSION, ilPageContentGUI\getHierId(), and ilMediaAliasItem\setHorizontalAlign().

434  {
435  $std_alias_item = new ilMediaAliasItem(
436  $this->dom,
437  $this->getHierId(),
438  "Standard",
439  $this->content_obj->getPcId(),
440  "InteractiveImage"
441  );
442  $std_alias_item->setHorizontalAlign("RightFloat");
443  $_SESSION["il_pg_error"] = $this->pg_obj->update();
444  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
445  }
$_SESSION["AccountId"]
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
+ Here is the call graph for this function:

◆ savePopups()

ilPCInteractiveImageGUI::savePopups ( )

Save popups.

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

References $_POST, ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, and ilUtil\stripSlashesArray().

679  {
681  $lng = $this->lng;
682 
683  if (is_array($_POST["title"])) {
684  $titles = ilUtil::stripSlashesArray($_POST["title"]);
685  $this->content_obj->savePopUps($titles);
686  $this->pg_obj->update();
687  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
688  }
689  $ilCtrl->redirect($this, "listContentPopups");
690  }
global $ilCtrl
Definition: ilias.php:18
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
$_POST["username"]
+ Here is the call graph for this function:

◆ update()

ilPCInteractiveImageGUI::update ( )

Update (base image)

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

References $_POST, $_SESSION, ilPageContentGUI\$ctrl, $format, $ilCtrl, ilPageContentGUI\$lng, $location, ilObjMediaObject\_getDirectory(), ilPageContentGUI\getHierId(), ilObjMediaObject\getMimeType(), ilUtil\moveUploadedFile(), ilMediaAliasItem\setCaption(), and ilUtil\stripSlashes().

319  {
321  $lng = $this->lng;
322 
323  $mob = $this->content_obj->getMediaObject();
324  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
325  $std_item = $mob->getMediaItem("Standard");
326  $location = $_FILES['image_file']['name'];
327 
328  if ($location != "" && is_file($_FILES['image_file']['tmp_name'])) {
329  $file = $mob_dir . "/" . $_FILES['image_file']['name'];
331  $_FILES['image_file']['tmp_name'],
332  $_FILES['image_file']['name'],
333  $file
334  );
335 
336  // get mime type
338  $location = $_FILES['image_file']['name'];
339  $std_item->setFormat($format);
340  $std_item->setLocation($location);
341  $std_item->setLocationType("LocalFile");
342  $mob->setDescription($format);
343  $mob->update();
344  }
345 
346  // set caption
347  $std_alias_item = new ilMediaAliasItem(
348  $this->dom,
349  $this->getHierId(),
350  "Standard",
351  $this->content_obj->getPcId(),
352  "InteractiveImage"
353  );
354  $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["caption"]));
355  $_SESSION["il_pg_error"] = $this->pg_obj->update();
356  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
357 
358  $ilCtrl->redirectByClass("ilpcinteractiveimagegui", "editBaseImage");
359  }
static getMimeType($a_file, $a_external=null)
get mime type for file
$_SESSION["AccountId"]
setCaption($a_caption)
Set Caption.
$location
Definition: buildRTE.php:44
getHierId()
get hierarchical id in dom object
Class ilMediaAliasItem.
static _getDirectory($a_mob_id)
Get absolute directory.
global $ilCtrl
Definition: ilias.php:18
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
$format
Definition: metadata.php:218
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ uploadOverlayImages()

ilPCInteractiveImageGUI::uploadOverlayImages ( )

Upload overlay images.

Parameters

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $name, $size, addOverlayImages(), and initAddOverlaysForm().

540  {
541  $lng = $this->lng;
543 
544  $form = $this->initAddOverlaysForm();
545  if ($form->checkInput()) {
546  if (is_array($_FILES["ovfile"]["name"])) {
547  foreach ($_FILES["ovfile"]["name"] as $k => $v) {
548  $name = $_FILES["ovfile"]["name"][$k];
549  $mime = $_FILES["ovfile"]["type"][$k];
550  $tmp_name = $_FILES["ovfile"]["tmp_name"][$k];
551  $size = $_FILES["ovfile"]["size"][$k];
552 
553  $this->content_obj->getMediaObject()->uploadAdditionalFile(
554  $name,
555  $tmp_name,
556  "overlays"
557  );
558  $piname = pathinfo($name);
559  $this->content_obj->getMediaObject()->makeThumbnail(
560  "overlays/" . $name,
561  basename($name, "." . $piname['extension']) . ".png"
562  );
563  }
564  }
565  ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
566  $ilCtrl->redirect($this, "listOverlayImages");
567  } else {
568  $form->setValuesByPost();
569  $this->addOverlayImages($form);
570  }
571  }
$size
Definition: RandomTest.php:84
global $ilCtrl
Definition: ilias.php:18
if($format !==null) $name
Definition: metadata.php:230
initAddOverlaysForm()
Init add overlays form.
addOverlayImages($a_form=null)
Add overlay images.
+ Here is the call graph for this function:

Field Documentation

◆ $tabs

◆ $toolbar

ilPCInteractiveImageGUI::$toolbar
protected

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

Referenced by listContentPopups(), and listOverlayImages().


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