ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addOverlayImages()

ilPCInteractiveImageGUI::addOverlayImages (   $a_form = null)

Add overlay images.

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

References $form, ilPageContentGUI\$tpl, and initAddOverlaysForm().

Referenced by uploadOverlayImages().

485  {
486  $tpl = $this->tpl;
487 
488  if ($a_form) {
489  $form = $a_form;
490  } else {
491  $form = $this->initAddOverlaysForm();
492  }
493 
494  $tpl->setContent($form->getHTML());
495  }
if(isset($_POST['submit'])) $form
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 662 of file class.ilPCInteractiveImageGUI.php.

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

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

◆ centerAlign()

ilPCInteractiveImageGUI::centerAlign ( )

Align media object to center.

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

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

364  {
365  $std_alias_item = new ilMediaAliasItem(
366  $this->dom,
367  $this->getHierId(),
368  "Standard",
369  $this->content_obj->getPcId(),
370  "InteractiveImage"
371  );
372  $std_alias_item->setHorizontalAlign("Center");
373  $_SESSION["il_pg_error"] = $this->pg_obj->update();
374  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
375  }
$_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 574 of file class.ilPCInteractiveImageGUI.php.

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

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

◆ confirmPopupDeletion()

ilPCInteractiveImageGUI::confirmPopupDeletion ( )

Confirm popup deletion.

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

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

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

◆ create()

ilPCInteractiveImageGUI::create ( )

Create new content element.

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

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

259  {
261  $lng = $this->lng;
262 
263  $this->content_obj = new ilPCInteractiveImage($this->getPage());
264  $this->content_obj->createMediaObject();
265  $media_obj = $this->content_obj->getMediaObject();
266  $media_obj->setTitle($_FILES['image_file']['name']);
267  $media_obj->create();
268  $mob_dir = ilObjMediaObject::_getDirectory($media_obj->getId());
269  // $media_obj->setStandardType("File");
270  $media_obj->createDirectory();
271  $media_item = new ilMediaItem();
272  $media_obj->addMediaItem($media_item);
273  $media_item->setPurpose("Standard");
274 
275  $file = $mob_dir . "/" . $_FILES['image_file']['name'];
276  ilUtil::moveUploadedFile(
277  $_FILES['image_file']['tmp_name'],
278  $_FILES['image_file']['name'],
279  $file
280  );
281 
282  // get mime type
284  $location = $_FILES['image_file']['name'];
285 
286  // set real meta and object data
287  $media_item->setFormat($format);
288  $media_item->setLocation($location);
289  $media_item->setLocationType("LocalFile");
290 
291  ilUtil::renameExecutables($mob_dir);
292  $media_obj->update();
293 
294  $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
295  $this->updated = $this->pg_obj->update();
296  if ($this->updated === true) {
297  $this->pg_obj->stripHierIDs();
298  $this->pg_obj->addHierIDs();
299  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
300  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
301  $this->content_obj->setHierId($this->content_obj->readHierId());
302  $this->setHierId($this->content_obj->readHierId());
303  $this->content_obj->setPCId($this->content_obj->readPCId());
304  ilUtil::sendSuccess($lng->txt("cont_saved_interactive_image"), true);
305  $this->ctrl->redirectByClass("ilpcinteractiveimagegui", "edit");
306 
307  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
308  } else {
309  $this->insert();
310  }
311  }
static getMimeType($a_file, $a_external=null)
get mime type for file
$format
Definition: metadata.php:141
$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.
Class ilMediaItem.
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 605 of file class.ilPCInteractiveImageGUI.php.

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

606  {
608  $lng = $this->lng;
609 
610  if (is_array($_POST["file"]) && count($_POST["file"]) != 0) {
611  foreach ($_POST["file"] as $f) {
612  $f = str_replace("..", "", ilUtil::stripSlashes($f));
613  $this->content_obj->getMediaObject()
614  ->removeAdditionalFile("overlays/" . $f);
615  }
616 
617  ilUtil::sendSuccess($lng->txt("cont_overlays_have_been_deleted"), true);
618  }
619  $ilCtrl->redirect($this, "listOverlayImages");
620  }
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 727 of file class.ilPCInteractiveImageGUI.php.

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

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

◆ edit()

ilPCInteractiveImageGUI::edit ( )

Edit.

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

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

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

◆ editBaseImage()

ilPCInteractiveImageGUI::editBaseImage (   $a_form = null)

Edit base image.

Parameters

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

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

189  {
190  $tpl = $this->tpl;
191  $ilTabs = $this->tabs;
192  $lng = $this->lng;
193 
194  $ilTabs->activateTab("edit_base_image");
195 
196  $form = $this->initForm();
197  $tpl->setContent($form->getHTML());
198  }
if(isset($_POST['submit'])) $form
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  $tpl->setContent($ret);
89  break;
90 
91  default:
92  $ret = $this->$cmd();
93  break;
94  }
95 
96  return $ret;
97  }
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 105 of file class.ilPCInteractiveImageGUI.php.

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

Referenced by executeCommand().

106  {
108  $ilTabs = $this->tabs;
109  $lng = $this->lng;
110 
111  if (!$a_create) {
112  $ilTabs->setBackTarget(
113  $lng->txt("pg"),
114  $ilCtrl->getParentReturn($this)
115  );
116 
117  $ilTabs->addTab(
118  "triggers",
119  $lng->txt("cont_active_areas"),
120  $ilCtrl->getLinkTargetByClass("ilpciimtriggereditorgui", "editMapAreas")
121  );
122 
123  $ilTabs->addTab(
124  "list_overlays",
125  $lng->txt("cont_overlay_images"),
126  $ilCtrl->getLinkTarget($this, "listOverlayImages")
127  );
128 
129  $ilTabs->addTab(
130  "content_popups",
131  $lng->txt("cont_content_popups"),
132  $ilCtrl->getLinkTarget($this, "listContentPopups")
133  );
134 
135  $ilTabs->addTab(
136  "edit_base_image",
137  $lng->txt("cont_base_image") . " & " . $lng->txt("cont_caption"),
138  $ilCtrl->getLinkTarget($this, "editBaseImage")
139  );
140  }
141  }
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 503 of file class.ilPCInteractiveImageGUI.php.

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

Referenced by addOverlayImages(), and uploadOverlayImages().

504  {
505  $lng = $this->lng;
507  $ilTabs = $this->tabs;
508 
509  $ilTabs->setTabActive("list_overlays");
510 
511  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
512  $form = new ilPropertyFormGUI();
513  $form->setTitle($lng->txt("cont_add_images"));
514  $form->setFormAction($ilCtrl->getFormAction($this));
515 
516  // file input
517  include_once("./Services/Form/classes/class.ilFileWizardInputGUI.php");
518  $fi = new ilFileWizardInputGUI($lng->txt("file"), "ovfile");
519  $fi->setSuffixes(array("gif", "jpeg", "jpg", "png"));
520  $fi->setFilenames(array(0 => ''));
521  $fi->setRequired(true);
522  $form->addItem($fi);
523 
524  $form->addCommandButton("uploadOverlayImages", $lng->txt("upload"));
525  $form->addCommandButton("listOverlayImages", $lng->txt("cancel"));
526 
527  return $form;
528  }
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
if(isset($_POST['submit'])) $form
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 206 of file class.ilPCInteractiveImageGUI.php.

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

Referenced by editBaseImage(), and insert().

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

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

Referenced by create().

147  {
148  $ilTabs = $this->tabs;
149  $tpl = $this->tpl;
151  $lng = $this->lng;
152 
153  ilUtil::sendInfo($lng->txt("cont_iim_create_info"));
154 
155  // $this->getTabs($ilTabs, true);
156  // $ilTabs->setSubTabActive("cont_new_mob");
157 
158  if ($a_input_error) {
159  $form = $this->form;
160  } else {
161  $form = $this->initForm("create");
162  }
163  $form->setFormAction($ilCtrl->getFormAction($this));
164 
165  $this->displayValidationError();
166 
167  $tpl->setContent($form->getHTML());
168  }
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
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 380 of file class.ilPCInteractiveImageGUI.php.

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

381  {
382  $std_alias_item = new ilMediaAliasItem(
383  $this->dom,
384  $this->getHierId(),
385  "Standard",
386  $this->content_obj->getPcId(),
387  "InteractiveImage"
388  );
389  $std_alias_item->setHorizontalAlign("Left");
390  $_SESSION["il_pg_error"] = $this->pg_obj->update();
391  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
392  }
$_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 414 of file class.ilPCInteractiveImageGUI.php.

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

415  {
416  $std_alias_item = new ilMediaAliasItem(
417  $this->dom,
418  $this->getHierId(),
419  "Standard",
420  $this->content_obj->getPcId(),
421  "InteractiveImage"
422  );
423  $std_alias_item->setHorizontalAlign("LeftFloat");
424  $_SESSION["il_pg_error"] = $this->pg_obj->update();
425  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
426  }
$_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 630 of file class.ilPCInteractiveImageGUI.php.

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

631  {
632  $tpl = $this->tpl;
633  $ilToolbar = $this->toolbar;
635  $ilTabs = $this->tabs;
636  $lng = $this->lng;
637 
638  ilUtil::sendInfo($lng->txt("cont_iim_content_popups_info"));
639 
640  $ilTabs->setTabActive("content_popups");
641 
642  $ilToolbar->addButton(
643  $lng->txt("cont_add_popup"),
644  $ilCtrl->getLinkTarget($this, "addPopup")
645  );
646 
647  include_once("./Services/COPage/classes/class.ilPCIIMPopupTableGUI.php");
649  $this,
650  "listContentPopups",
651  $this->content_obj
652  );
653  $tpl->setContent($tab->getHTML());
654  }
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 455 of file class.ilPCInteractiveImageGUI.php.

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

456  {
457  $tpl = $this->tpl;
458  $ilToolbar = $this->toolbar;
460  $ilTabs = $this->tabs;
461  $lng = $this->lng;
462 
463  ilUtil::sendInfo($lng->txt("cont_iim_overlay_info"));
464 
465  $ilTabs->setTabActive("list_overlays");
466 
467  $ilToolbar->addButton(
468  $lng->txt("cont_add_images"),
469  $ilCtrl->getLinkTarget($this, "addOverlayImages")
470  );
471 
472  include_once("./Services/COPage/classes/class.ilPCIIMOverlaysTableGUI.php");
474  $this,
475  "listOverlayImages",
476  $this->content_obj->getMediaObject()
477  );
478  $tpl->setContent($tab->getHTML());
479  }
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 397 of file class.ilPCInteractiveImageGUI.php.

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

398  {
399  $std_alias_item = new ilMediaAliasItem(
400  $this->dom,
401  $this->getHierId(),
402  "Standard",
403  $this->content_obj->getPcId(),
404  "InteractiveImage"
405  );
406  $std_alias_item->setHorizontalAlign("Right");
407  $_SESSION["il_pg_error"] = $this->pg_obj->update();
408  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
409  }
$_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 431 of file class.ilPCInteractiveImageGUI.php.

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

432  {
433  $std_alias_item = new ilMediaAliasItem(
434  $this->dom,
435  $this->getHierId(),
436  "Standard",
437  $this->content_obj->getPcId(),
438  "InteractiveImage"
439  );
440  $std_alias_item->setHorizontalAlign("RightFloat");
441  $_SESSION["il_pg_error"] = $this->pg_obj->update();
442  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
443  }
$_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 676 of file class.ilPCInteractiveImageGUI.php.

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

677  {
679  $lng = $this->lng;
680 
681  if (is_array($_POST["title"])) {
682  $titles = ilUtil::stripSlashesArray($_POST["title"]);
683  $this->content_obj->savePopUps($titles);
684  $this->pg_obj->update();
685  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
686  }
687  $ilCtrl->redirect($this, "listContentPopups");
688  }
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 316 of file class.ilPCInteractiveImageGUI.php.

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

317  {
319  $lng = $this->lng;
320 
321  $mob = $this->content_obj->getMediaObject();
322  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
323  $std_item = $mob->getMediaItem("Standard");
324  $location = $_FILES['image_file']['name'];
325 
326  if ($location != "" && is_file($_FILES['image_file']['tmp_name'])) {
327  $file = $mob_dir . "/" . $_FILES['image_file']['name'];
328  ilUtil::moveUploadedFile(
329  $_FILES['image_file']['tmp_name'],
330  $_FILES['image_file']['name'],
331  $file
332  );
333 
334  // get mime type
336  $location = $_FILES['image_file']['name'];
337  $std_item->setFormat($format);
338  $std_item->setLocation($location);
339  $std_item->setLocationType("LocalFile");
340  $mob->setDescription($format);
341  $mob->update();
342  }
343 
344  // set caption
345  $std_alias_item = new ilMediaAliasItem(
346  $this->dom,
347  $this->getHierId(),
348  "Standard",
349  $this->content_obj->getPcId(),
350  "InteractiveImage"
351  );
352  $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["caption"]));
353  $_SESSION["il_pg_error"] = $this->pg_obj->update();
354  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
355 
356  $ilCtrl->redirectByClass("ilpcinteractiveimagegui", "editBaseImage");
357  }
static getMimeType($a_file, $a_external=null)
get mime type for file
$format
Definition: metadata.php:141
$_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 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 537 of file class.ilPCInteractiveImageGUI.php.

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

538  {
539  $lng = $this->lng;
541 
542  $form = $this->initAddOverlaysForm();
543  if ($form->checkInput()) {
544  if (is_array($_FILES["ovfile"]["name"])) {
545  foreach ($_FILES["ovfile"]["name"] as $k => $v) {
546  $name = $_FILES["ovfile"]["name"][$k];
547  $mime = $_FILES["ovfile"]["type"][$k];
548  $tmp_name = $_FILES["ovfile"]["tmp_name"][$k];
549  $size = $_FILES["ovfile"]["size"][$k];
550 
551  $this->content_obj->getMediaObject()->uploadAdditionalFile(
552  $name,
553  $tmp_name,
554  "overlays"
555  );
556  $piname = pathinfo($name);
557  $this->content_obj->getMediaObject()->makeThumbnail(
558  "overlays/" . $name,
559  basename($name, "." . $piname['extension']) . ".png"
560  );
561  }
562  }
563  ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
564  $ilCtrl->redirect($this, "listOverlayImages");
565  } else {
566  $form->setValuesByPost();
567  $this->addOverlayImages($form);
568  }
569  }
$size
Definition: RandomTest.php:84
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
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: