ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 ilPageContentGUI ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor @access 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $ilias
 
 $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...
 
- Protected Attributes inherited from ilPageContentGUI
 $log
 
- 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$

@ilCtrl_Calls 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 21 of file class.ilPCInteractiveImageGUI.php.

22 {
23 parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
24 }

Member Function Documentation

◆ addOverlayImages()

ilPCInteractiveImageGUI::addOverlayImages (   $a_form = null)

Add overlay images.

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

417 {
418 global $tpl;
419
420 if ($a_form)
421 {
422 $form = $a_form;
423 }
424 else
425 {
426 $form = $this->initAddOverlaysForm();
427 }
428
429 $tpl->setContent($form->getHTML());
430 }
initAddOverlaysForm()
Init add overlays form.

References ilPageContentGUI\$tpl, and initAddOverlaysForm().

Referenced by uploadOverlayImages().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPopup()

ilPCInteractiveImageGUI::addPopup ( )

Add popup.

Parameters

return

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

588 {
589 global $ilCtrl, $lng;
590
591 $this->content_obj->addContentPopup();
592 $this->pg_obj->update();
593 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
594 $ilCtrl->redirect($this, "listContentPopups");
595 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, ilPageContentGUI\$lng, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ centerAlign()

ilPCInteractiveImageGUI::centerAlign ( )

Align media object to center.

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

330 {
331 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
332 $this->content_obj->getPcId(), "InteractiveImage");
333 $std_alias_item->setHorizontalAlign("Center");
334 $_SESSION["il_pg_error"] = $this->pg_obj->update();
335 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
336 }
$_SESSION["AccountId"]
Class ilMediaAliasItem.
getHierId()
get hierarchical id in dom object

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ confirmDeleteOverlays()

ilPCInteractiveImageGUI::confirmDeleteOverlays ( )

Confirm overlay deletion.

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

507 {
508 global $ilCtrl, $tpl, $lng, $ilTabs;
509
510 $ilTabs->setTabActive("list_overlays");
511
512 if (!is_array($_POST["file"]) || count($_POST["file"]) == 0)
513 {
514 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
515 $ilCtrl->redirect($this, "listOverlayImages");
516 }
517 else
518 {
519 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
520 $cgui = new ilConfirmationGUI();
521 $cgui->setFormAction($ilCtrl->getFormAction($this));
522 $cgui->setHeaderText($lng->txt("cont_really_delete_overlays"));
523 $cgui->setCancel($lng->txt("cancel"), "listOverlayImages");
524 $cgui->setConfirm($lng->txt("delete"), "deleteOverlays");
525
526 foreach ($_POST["file"] as $i => $d)
527 {
528 $cgui->addItem("file[]", $i, $i);
529 }
530
531 $tpl->setContent($cgui->getHTML());
532 }
533 }
Confirmation screen class.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST['username']
Definition: cron.php:12

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

+ Here is the call graph for this function:

◆ confirmPopupDeletion()

ilPCInteractiveImageGUI::confirmPopupDeletion ( )

Confirm popup deletion.

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

618 {
619 global $ilCtrl, $tpl, $lng, $ilTabs;
620
621 $ilTabs->setTabActive("content_popups");
622
623 if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0)
624 {
625 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
626 $ilCtrl->redirect($this, "listContentPopups");
627 }
628 else
629 {
630 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
631 $cgui = new ilConfirmationGUI();
632 $cgui->setFormAction($ilCtrl->getFormAction($this));
633 $cgui->setHeaderText($lng->txt("cont_really_delete_popups"));
634 $cgui->setCancel($lng->txt("cancel"), "listContentPopups");
635 $cgui->setConfirm($lng->txt("delete"), "deletePopups");
636
637 foreach ($_POST["tid"] as $i => $d)
638 {
639 $cgui->addItem("tid[]", $i, $_POST["title"][$i]);
640 }
641
642 $tpl->setContent($cgui->getHTML());
643 }
644 }

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

+ Here is the call graph for this function:

◆ create()

ilPCInteractiveImageGUI::create ( )

Create new content element.

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

234 {
235 global $ilCtrl, $lng;
236
237 $this->content_obj = new ilPCInteractiveImage($this->getPage());
238 $this->content_obj->createMediaObject();
239 $media_obj = $this->content_obj->getMediaObject();
240 $media_obj->setTitle($_FILES['image_file']['name']);
241 $media_obj->create();
242 $mob_dir = ilObjMediaObject::_getDirectory($media_obj->getId());
243// $media_obj->setStandardType("File");
244 $media_obj->createDirectory();
245 $media_item = new ilMediaItem();
246 $media_obj->addMediaItem($media_item);
247 $media_item->setPurpose("Standard");
248
249 $file = $mob_dir."/".$_FILES['image_file']['name'];
250 ilUtil::moveUploadedFile($_FILES['image_file']['tmp_name'],
251 $_FILES['image_file']['name'], $file);
252
253 // get mime type
255 $location = $_FILES['image_file']['name'];
256
257 // set real meta and object data
258 $media_item->setFormat($format);
259 $media_item->setLocation($location);
260 $media_item->setLocationType("LocalFile");
261
263 $media_obj->update();
264
265 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
266 $this->updated = $this->pg_obj->update();
267 if ($this->updated === true)
268 {
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 ilUtil::sendSuccess($lng->txt("cont_saved_interactive_image"), true);
277 $this->ctrl->redirectByClass("ilpcinteractiveimagegui", "edit");
278
279 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
280 }
281 else
282 {
283 $this->insert();
284 }
285 }
print $file
$location
Definition: buildRTE.php:44
Class ilMediaItem.
_getDirectory($a_mob_id)
get directory for files of media object (static)
static getMimeType($a_file, $a_external=false)
get mime type for file
insert($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
Insert new media object form.
setHierId($a_hier_id)
get hierarchical id in dom object
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.

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

+ Here is the call graph for this function:

◆ deleteOverlays()

ilPCInteractiveImageGUI::deleteOverlays ( )

Delete overlays.

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

539 {
540 global $ilCtrl, $lng;
541
542 if (is_array($_POST["file"]) && count($_POST["file"]) != 0)
543 {
544 foreach ($_POST["file"] as $f)
545 {
546 $f = str_replace("..", "", ilUtil::stripSlashes($f));
547 $this->content_obj->getMediaObject()
548 ->removeAdditionalFile("overlays/".$f);
549 }
550
551 ilUtil::sendSuccess($lng->txt("cont_overlays_have_been_deleted"), true);
552 }
553 $ilCtrl->redirect($this, "listOverlayImages");
554 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ deletePopups()

ilPCInteractiveImageGUI::deletePopups ( )

Delete popups.

Parameters

return

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

653 {
654 global $lng, $ilCtrl;
655
656 if (is_array($_POST["tid"]) && count($_POST["tid"]) != 0)
657 {
658 foreach ($_POST["tid"] as $id)
659 {
660 $id = explode(":", $id);
661 $this->content_obj->deletePopup($id[0], $id[1]);
662 }
663 $this->pg_obj->update();
664 ilUtil::sendSuccess($lng->txt("cont_popups_have_been_deleted"), true);
665 }
666 $ilCtrl->redirect($this, "listContentPopups");
667 }

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

+ Here is the call graph for this function:

◆ edit()

ilPCInteractiveImageGUI::edit ( )

Edit.

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

153 {
154 global $tpl, $ilCtrl;
155
156 $ilCtrl->redirectByClass(array("ilpcinteractiveimagegui", "ilpciimtriggereditorgui"), "editMapAreas");
157 //$tpl->setContent("hh");
158 }

References $ilCtrl, and ilPageContentGUI\$tpl.

◆ editBaseImage()

ilPCInteractiveImageGUI::editBaseImage (   $a_form = null)

Edit base image.

Parameters

return

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

167 {
168 global $tpl, $ilTabs, $lng;
169
170 $ilTabs->activateTab("edit_base_image");
171
172 $form = $this->initForm();
173 $tpl->setContent($form->getHTML());
174 }
initForm($a_mode="edit")
Init creation/base image form.

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

+ Here is the call graph for this function:

◆ executeCommand()

& ilPCInteractiveImageGUI::executeCommand ( )

execute command

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

30 {
31 global $tpl, $lng, $ilTabs;
32
33
34// $this->getCharacteristicsOfCurrentStyle("media_cont"); // scorm-2004
35
36 // get next class that processes or forwards current command
37 $next_class = $this->ctrl->getNextClass($this);
38
39 // get current command
40 $cmd = $this->ctrl->getCmd();
41
42 if (is_object ($this->content_obj))
43 {
44 $tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
45 $this->getTabs($this->tabs_gui);
46
47/* $mob = $this->content_obj->getMediaObject();
48 if (is_object($mob))
49 {
50 $tpl->setVariable("HEADER", $lng->txt("mob").": ".
51 $this->content_obj->getMediaObject()->getTitle());
52 $mob_gui =& new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(),false, false);
53 $mob_gui->setBackTitle($this->page_back_title);
54 $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
55 $mob_gui->getTabs($this->tabs_gui);
56 }*/
57 }
58 else
59 {
60 }
61
62 switch($next_class)
63 {
64 // trigger editor
65 case "ilpciimtriggereditorgui":
66 require_once("./Services/COPage/classes/class.ilPCIIMTriggerEditorGUI.php");
67 $ilTabs->setTabActive("triggers");
68 $image_map_edit = new ilPCIIMTriggerEditorGUI($this->content_obj,
69 $this->pg_obj);
70 $ret = $this->ctrl->forwardCommand($image_map_edit);
71 $tpl->setContent($ret);
72 break;
73
74 default:
75 $ret =& $this->$cmd();
76 break;
77 }
78
79 return $ret;
80 }
User interface class for page content map editor.
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)
$cmd
Definition: sahs_server.php:35

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

+ 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 88 of file class.ilPCInteractiveImageGUI.php.

89 {
90 global $ilCtrl, $ilTabs, $lng;
91
92 if (!$a_create)
93 {
94
95 $ilTabs->setBackTarget($lng->txt("pg"),
96 $ilCtrl->getParentReturn($this)
97 );
98
99 $ilTabs->addTab("triggers",
100 $lng->txt("cont_active_areas"),
101 $ilCtrl->getLinkTargetByClass("ilpciimtriggereditorgui", "editMapAreas")
102 );
103
104 $ilTabs->addTab("list_overlays",
105 $lng->txt("cont_overlay_images"),
106 $ilCtrl->getLinkTarget($this, "listOverlayImages")
107 );
108
109 $ilTabs->addTab("content_popups",
110 $lng->txt("cont_content_popups"),
111 $ilCtrl->getLinkTarget($this, "listContentPopups")
112 );
113
114 $ilTabs->addTab("edit_base_image",
115 $lng->txt("cont_base_image")." & ".$lng->txt("cont_caption"),
116 $ilCtrl->getLinkTarget($this, "editBaseImage")
117 );
118
119 }
120 }

References $ilCtrl, and ilPageContentGUI\$lng.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ initAddOverlaysForm()

ilPCInteractiveImageGUI::initAddOverlaysForm ( )

Init add overlays form.

Parameters

return

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

439 {
440 global $lng, $ilCtrl, $ilTabs;
441
442 $ilTabs->setTabActive("list_overlays");
443
444 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
445 $form = new ilPropertyFormGUI();
446 $form->setTitle($lng->txt("cont_add_images"));
447 $form->setFormAction($ilCtrl->getFormAction($this));
448
449 // file input
450 include_once("./Services/Form/classes/class.ilFileWizardInputGUI.php");
451 $fi = new ilFileWizardInputGUI($lng->txt("file"), "ovfile");
452 $fi->setSuffixes(array("gif", "jpeg", "jpg", "png"));
453 $fi->setFilenames(array(0 => ''));
454 $fi->setRequired(true);
455 $form->addItem($fi);
456
457 $form->addCommandButton("uploadOverlayImages", $lng->txt("upload"));
458 $form->addCommandButton("listOverlayImages", $lng->txt("cancel"));
459
460 return $form;
461 }
This class represents a file wizard property in a property form.
This class represents a property form user interface.

References $ilCtrl, and ilPageContentGUI\$lng.

Referenced by addOverlayImages(), and uploadOverlayImages().

+ 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 182 of file class.ilPCInteractiveImageGUI.php.

183 {
184 global $lng, $ilCtrl;
185
186 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
187 $form = new ilPropertyFormGUI();
188
189 // image file
190 $fi = new ilImageFileInputGUI($lng->txt("cont_file"), "image_file");
191 $fi->setAllowDeletion(false);
192 if ($a_mode == "edit")
193 {
194 $fi->setImage($this->content_obj->getBaseThumbnailTarget());
195 }
196 $form->addItem($fi);
197
198 if ($a_mode == "edit")
199 {
200 // caption
201 $ti = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
202 $ti->setMaxLength(200);
203 $ti->setSize(50);
204 $form->addItem($ti);
205 }
206
207 // save and cancel commands
208 if ($a_mode == "create")
209 {
210 $form->setTitle($lng->txt("cont_ed_insert_iim"));
211 $form->addCommandButton("create_iim", $lng->txt("save"));
212 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
213 }
214 else
215 {
216 // get caption
217 $std_alias_item = new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
218 $this->content_obj->getPcId(), "InteractiveImage");
219 $ti->setValue($std_alias_item->getCaption());
220
221 $form->setTitle($lng->txt("cont_edit_base_image"));
222 $form->addCommandButton("update", $lng->txt("save"));
223 }
224
225 $form->setFormAction($ilCtrl->getFormAction($this));
226
227 return $form;
228 }
This class represents an image file property in a property form.
This class represents a text property in a property form.

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

Referenced by editBaseImage(), and insert().

+ 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 125 of file class.ilPCInteractiveImageGUI.php.

126 {
127 global $ilTabs, $tpl, $ilCtrl, $lng;
128
129 ilUtil::sendInfo($lng->txt("cont_iim_create_info"));
130
131// $this->getTabs($ilTabs, true);
132// $ilTabs->setSubTabActive("cont_new_mob");
133
134 if ($a_input_error)
135 {
136 $form = $this->form;
137 }
138 else
139 {
140 $form = $this->initForm("create");
141 }
142 $form->setFormAction($ilCtrl->getFormAction($this));
143
144 $this->displayValidationError();
145
146 $tpl->setContent($form->getHTML());
147 }
displayValidationError()
display validation errors
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

Referenced by create().

+ 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 341 of file class.ilPCInteractiveImageGUI.php.

342 {
343 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
344 $this->content_obj->getPcId(), "InteractiveImage");
345 $std_alias_item->setHorizontalAlign("Left");
346 $_SESSION["il_pg_error"] = $this->pg_obj->update();
347 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
348 }

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ leftFloatAlign()

ilPCInteractiveImageGUI::leftFloatAlign ( )

align media object to left, floating text

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

366 {
367 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
368 $this->content_obj->getPcId(), "InteractiveImage");
369 $std_alias_item->setHorizontalAlign("LeftFloat");
370 $_SESSION["il_pg_error"] = $this->pg_obj->update();
371 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
372 }

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ listContentPopups()

ilPCInteractiveImageGUI::listContentPopups ( )

List content popups.

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

565 {
566 global $tpl, $ilToolbar, $ilCtrl, $ilTabs, $lng;
567
568 ilUtil::sendInfo($lng->txt("cont_iim_content_popups_info"));
569
570 $ilTabs->setTabActive("content_popups");
571
572 $ilToolbar->addButton($lng->txt("cont_add_popup"),
573 $ilCtrl->getLinkTarget($this, "addPopup"));
574
575 include_once("./Services/COPage/classes/class.ilPCIIMPopupTableGUI.php");
576 $tab = new ilPCIIMPopupTableGUI($this, "listContentPopups",
577 $this->content_obj);
578 $tpl->setContent($tab->getHTML());
579 }
TableGUI class for content popup.

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

+ Here is the call graph for this function:

◆ listOverlayImages()

ilPCInteractiveImageGUI::listOverlayImages ( )

List overlay images.

Parameters

return

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

397 {
398 global $tpl, $ilToolbar, $ilCtrl, $ilTabs, $lng;
399
400 ilUtil::sendInfo($lng->txt("cont_iim_overlay_info"));
401
402 $ilTabs->setTabActive("list_overlays");
403
404 $ilToolbar->addButton($lng->txt("cont_add_images"),
405 $ilCtrl->getLinkTarget($this, "addOverlayImages"));
406
407 include_once("./Services/COPage/classes/class.ilPCIIMOverlaysTableGUI.php");
408 $tab = new ilPCIIMOverlaysTableGUI($this, "listOverlayImages",
409 $this->content_obj->getMediaObject());
410 $tpl->setContent($tab->getHTML());
411 }
TableGUI class for interactive image overlays.

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

+ Here is the call graph for this function:

◆ rightAlign()

ilPCInteractiveImageGUI::rightAlign ( )

align media object to right

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

354 {
355 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
356 $this->content_obj->getPcId(), "InteractiveImage");
357 $std_alias_item->setHorizontalAlign("Right");
358 $_SESSION["il_pg_error"] = $this->pg_obj->update();
359 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
360 }

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ rightFloatAlign()

ilPCInteractiveImageGUI::rightFloatAlign ( )

align media object to right, floating text

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

378 {
379 $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
380 $this->content_obj->getPcId(), "InteractiveImage");
381 $std_alias_item->setHorizontalAlign("RightFloat");
382 $_SESSION["il_pg_error"] = $this->pg_obj->update();
383 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
384 }

References $_SESSION, and ilPageContentGUI\getHierId().

+ Here is the call graph for this function:

◆ savePopups()

ilPCInteractiveImageGUI::savePopups ( )

Save popups.

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

601 {
602 global $ilCtrl, $lng;
603
604 if (is_array($_POST["title"]))
605 {
606 $titles = ilUtil::stripSlashesArray($_POST["title"]);
607 $this->content_obj->savePopUps($titles);
608 $this->pg_obj->update();
609 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
610 }
611 $ilCtrl->redirect($this, "listContentPopups");
612 }
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.

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

+ Here is the call graph for this function:

◆ update()

ilPCInteractiveImageGUI::update ( )

Update (base image)

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

291 {
292 global $ilCtrl, $lng;
293
294 $mob = $this->content_obj->getMediaObject();
295 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
296 $std_item = $mob->getMediaItem("Standard");
297 $location = $_FILES['image_file']['name'];
298
299 if ($location != "" && is_file($_FILES['image_file']['tmp_name']))
300 {
301 $file = $mob_dir."/".$_FILES['image_file']['name'];
302 ilUtil::moveUploadedFile($_FILES['image_file']['tmp_name'],
303 $_FILES['image_file']['name'], $file);
304
305 // get mime type
307 $location = $_FILES['image_file']['name'];
308 $std_item->setFormat($format);
309 $std_item->setLocation($location);
310 $std_item->setLocationType("LocalFile");
311 $mob->setDescription($format);
312 $mob->update();
313 }
314
315 // set caption
316 $std_alias_item = new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard",
317 $this->content_obj->getPcId(), "InteractiveImage");
318 $std_alias_item->setCaption(ilUtil::stripSlashes($_POST["caption"]));
319 $_SESSION["il_pg_error"] = $this->pg_obj->update();
320 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
321
322 $ilCtrl->redirectByClass("ilpcinteractiveimagegui", "editBaseImage");
323 }

References $_POST, $_SESSION, $file, $ilCtrl, ilPageContentGUI\$lng, $location, ilObjMediaObject\_getDirectory(), ilPageContentGUI\getHierId(), ilObjMediaObject\getMimeType(), ilUtil\moveUploadedFile(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ uploadOverlayImages()

ilPCInteractiveImageGUI::uploadOverlayImages ( )

Upload overlay images.

Parameters

return

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

471 {
472 global $lng, $ilCtrl;
473
474 $form = $this->initAddOverlaysForm();
475 if ($form->checkInput())
476 {
477 if (is_array($_FILES["ovfile"]["name"]))
478 {
479 foreach ($_FILES["ovfile"]["name"] as $k => $v)
480 {
481 $name = $_FILES["ovfile"]["name"][$k];
482 $mime = $_FILES["ovfile"]["type"][$k];
483 $tmp_name = $_FILES["ovfile"]["tmp_name"][$k];
484 $size = $_FILES["ovfile"]["size"][$k];
485
486 $this->content_obj->getMediaObject()->uploadAdditionalFile($name,
487 $tmp_name, "overlays");
488 $piname = pathinfo($name);
489 $this->content_obj->getMediaObject()->makeThumbnail("overlays/".$name,
490 basename($name, ".".$piname['extension']).".png");
491 }
492 }
493 ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
494 $ilCtrl->redirect($this, "listOverlayImages");
495 }
496 else
497 {
498 $form->setValuesByPost();
499 $this->addOverlayImages($form);
500 }
501 }
$size
Definition: RandomTest.php:79
addOverlayImages($a_form=null)
Add overlay images.

References $ilCtrl, ilPageContentGUI\$lng, $size, addOverlayImages(), initAddOverlaysForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

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