5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
6 require_once(
"./Services/COPage/classes/class.ilPCInteractiveImage.php");
7 include_once(
"./Services/COPage/classes/class.ilMediaAliasItem.php");
31 public function __construct($a_pg_obj, $a_content_obj, $a_hier_id = 0, $a_pc_id =
"")
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);
56 $next_class = $this->ctrl->getNextClass($this);
59 $cmd = $this->ctrl->getCmd();
61 if (is_object($this->content_obj)) {
63 $this->
getTabs($this->tabs_gui);
78 switch ($next_class) {
80 case "ilpciimtriggereditorgui":
81 require_once(
"./Services/COPage/classes/class.ilPCIIMTriggerEditorGUI.php");
82 $ilTabs->setTabActive(
"triggers");
87 $ret = $this->ctrl->forwardCommand($image_map_edit);
105 public function getTabs(&$tab_gui, $a_create =
false, $a_change_obj_ref =
false)
112 $ilTabs->setBackTarget(
114 $ilCtrl->getParentReturn($this)
119 $lng->txt(
"cont_active_areas"),
120 $ilCtrl->getLinkTargetByClass(
"ilpciimtriggereditorgui",
"editMapAreas")
125 $lng->txt(
"cont_overlay_images"),
126 $ilCtrl->getLinkTarget($this,
"listOverlayImages")
131 $lng->txt(
"cont_content_popups"),
132 $ilCtrl->getLinkTarget($this,
"listContentPopups")
137 $lng->txt(
"cont_base_image") .
" & " .
$lng->txt(
"cont_caption"),
138 $ilCtrl->getLinkTarget($this,
"editBaseImage")
146 public function insert($a_post_cmd =
"edpost", $a_submit_cmd =
"create_mob", $a_input_error =
false)
158 if ($a_input_error) {
178 $ilCtrl->redirectByClass(array(
"ilpcinteractiveimagegui",
"ilpciimtriggereditorgui"),
"editMapAreas");
194 $ilTabs->activateTab(
"edit_base_image");
211 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
216 $fi->setAllowDeletion(
false);
217 if ($a_mode ==
"edit") {
218 $fi->
setImage($this->content_obj->getBaseThumbnailTarget());
222 if ($a_mode ==
"edit") {
224 $ti =
new ilTextInputGUI($this->lng->txt(
"cont_caption"),
"caption");
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"));
241 $this->content_obj->getPcId(),
244 $ti->setValue($std_alias_item->getCaption());
246 $form->setTitle(
$lng->txt(
"cont_edit_base_image"));
247 $form->addCommandButton(
"update",
$lng->txt(
"save"));
264 $this->content_obj->createMediaObject();
265 $media_obj = $this->content_obj->getMediaObject();
266 $media_obj->setTitle($_FILES[
'image_file'][
'name']);
267 $media_obj->create();
270 $media_obj->createDirectory();
272 $media_obj->addMediaItem($media_item);
273 $media_item->setPurpose(
"Standard");
275 $file = $mob_dir .
"/" . $_FILES[
'image_file'][
'name'];
276 ilUtil::moveUploadedFile(
277 $_FILES[
'image_file'][
'tmp_name'],
278 $_FILES[
'image_file'][
'name'],
284 $location = $_FILES[
'image_file'][
'name'];
287 $media_item->setFormat(
$format);
289 $media_item->setLocationType(
"LocalFile");
292 $media_obj->update();
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");
321 $mob = $this->content_obj->getMediaObject();
323 $std_item = $mob->getMediaItem(
"Standard");
324 $location = $_FILES[
'image_file'][
'name'];
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'],
336 $location = $_FILES[
'image_file'][
'name'];
339 $std_item->setLocationType(
"LocalFile");
349 $this->content_obj->getPcId(),
353 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
354 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
356 $ilCtrl->redirectByClass(
"ilpcinteractiveimagegui",
"editBaseImage");
369 $this->content_obj->getPcId(),
373 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
374 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
386 $this->content_obj->getPcId(),
390 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
391 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
403 $this->content_obj->getPcId(),
407 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
408 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
420 $this->content_obj->getPcId(),
424 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
425 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
437 $this->content_obj->getPcId(),
441 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
442 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
465 $ilTabs->setTabActive(
"list_overlays");
467 $ilToolbar->addButton(
468 $lng->txt(
"cont_add_images"),
469 $ilCtrl->getLinkTarget($this,
"addOverlayImages")
472 include_once(
"./Services/COPage/classes/class.ilPCIIMOverlaysTableGUI.php");
476 $this->content_obj->getMediaObject()
509 $ilTabs->setTabActive(
"list_overlays");
511 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
513 $form->setTitle(
$lng->txt(
"cont_add_images"));
517 include_once(
"./Services/Form/classes/class.ilFileWizardInputGUI.php");
519 $fi->
setSuffixes(array(
"gif",
"jpeg",
"jpg",
"png"));
520 $fi->setFilenames(array(0 =>
''));
521 $fi->setRequired(
true);
524 $form->addCommandButton(
"uploadOverlayImages",
$lng->txt(
"upload"));
525 $form->addCommandButton(
"listOverlayImages",
$lng->txt(
"cancel"));
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];
551 $this->content_obj->getMediaObject()->uploadAdditionalFile(
556 $piname = pathinfo(
$name);
557 $this->content_obj->getMediaObject()->makeThumbnail(
559 basename(
$name,
"." . $piname[
'extension']) .
".png" 563 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"));
564 $ilCtrl->redirect($this,
"listOverlayImages");
566 $form->setValuesByPost();
581 $ilTabs->setTabActive(
"list_overlays");
583 if (!is_array(
$_POST[
"file"]) || count(
$_POST[
"file"]) == 0) {
585 $ilCtrl->redirect($this,
"listOverlayImages");
587 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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");
595 $cgui->addItem(
"file[]",
$i,
$i);
598 $tpl->setContent($cgui->getHTML());
610 if (is_array(
$_POST[
"file"]) && count(
$_POST[
"file"]) != 0) {
613 $this->content_obj->getMediaObject()
614 ->removeAdditionalFile(
"overlays/" . $f);
617 ilUtil::sendSuccess(
$lng->txt(
"cont_overlays_have_been_deleted"),
true);
619 $ilCtrl->redirect($this,
"listOverlayImages");
640 $ilTabs->setTabActive(
"content_popups");
642 $ilToolbar->addButton(
643 $lng->txt(
"cont_add_popup"),
644 $ilCtrl->getLinkTarget($this,
"addPopup")
647 include_once(
"./Services/COPage/classes/class.ilPCIIMPopupTableGUI.php");
667 $this->content_obj->addContentPopup();
668 $this->pg_obj->update();
669 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
670 $ilCtrl->redirect($this,
"listContentPopups");
681 if (is_array(
$_POST[
"title"])) {
683 $this->content_obj->savePopUps($titles);
684 $this->pg_obj->update();
685 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
687 $ilCtrl->redirect($this,
"listContentPopups");
700 $ilTabs->setTabActive(
"content_popups");
702 if (!is_array(
$_POST[
"tid"]) || count(
$_POST[
"tid"]) == 0) {
704 $ilCtrl->redirect($this,
"listContentPopups");
706 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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");
714 $cgui->addItem(
"tid[]",
$i,
$_POST[
"title"][
$i]);
717 $tpl->setContent($cgui->getHTML());
732 if (is_array(
$_POST[
"tid"]) && count(
$_POST[
"tid"]) != 0) {
734 $id = explode(
":", $id);
735 $this->content_obj->deletePopup($id[0], $id[1]);
737 $this->pg_obj->update();
738 ilUtil::sendSuccess(
$lng->txt(
"cont_popups_have_been_deleted"),
true);
740 $ilCtrl->redirect($this,
"listContentPopups");
deletePopups()
Delete popups.
centerAlign()
Align media object to center.
getTabs(&$tab_gui, $a_create=false, $a_change_obj_ref=false)
Add tabs to ilTabsGUI object.
uploadOverlayImages()
Upload overlay images.
if(!array_key_exists('StateId', $_REQUEST)) $id
getHierId()
get hierarchical id in dom object
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
executeCommand()
execute command
insert($a_post_cmd="edpost", $a_submit_cmd="create_mob", $a_input_error=false)
Insert new media object form.
if(isset($_POST['submit'])) $form
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
confirmDeleteOverlays()
Confirm overlay deletion.
listContentPopups()
List content popups.
displayValidationError()
display validation errors
This class represents a text property in a property form.
__construct($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
rightFloatAlign()
align media object to right, floating text
setMaxLength($a_maxlength)
Set Max Length.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
initForm($a_mode="edit")
Init creation/base image form.
initAddOverlaysForm()
Init add overlays form.
listOverlayImages()
List overlay images.
update()
Update (base image)
addOverlayImages($a_form=null)
Add overlay images.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
leftFloatAlign()
align media object to left, floating text
TableGUI class for interactive image overlays.
create()
Create new content element.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
leftAlign()
align media object to left
deleteOverlays()
Delete overlays.
rightAlign()
align media object to right
confirmPopupDeletion()
Confirm popup deletion.
editBaseImage($a_form=null)
Edit base image.
User interface class for interactive images.
User interface class for page content map editor.
setHierId($a_hier_id)
get hierarchical id in dom object
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Confirmation screen class.