38 $this->tpl = $DIC[
"tpl"];
39 $this->
lng = $DIC->language();
40 $this->
tabs = $DIC->tabs();
41 $this->
ctrl = $DIC->ctrl();
42 $this->
toolbar = $DIC->toolbar();
46 public function executeCommand():
void 52 $next_class = $this->
ctrl->getNextClass($this);
55 $cmd = $this->
ctrl->getCmd();
57 if (is_object($this->content_obj)) {
62 switch ($next_class) {
64 case "ilpciimtriggereditorgui":
65 $ilTabs->setTabActive(
"triggers");
73 $ret = $this->
ctrl->forwardCommand($image_map_edit);
89 bool $a_create =
false,
90 bool $a_change_obj_ref =
false 97 $ilTabs->setBackTarget(
99 (string) $ilCtrl->getParentReturn($this)
104 $lng->
txt(
"cont_active_areas"),
105 $ilCtrl->getLinkTargetByClass(
"ilpciimtriggereditorgui",
"editMapAreas")
110 $lng->
txt(
"cont_overlay_images"),
111 $ilCtrl->getLinkTarget($this,
"listOverlayImages")
116 $lng->
txt(
"cont_content_popups"),
117 $ilCtrl->getLinkTarget($this,
"listContentPopups")
123 $ilCtrl->getLinkTarget($this,
"editBaseImage")
132 string $a_post_cmd =
"edpost",
133 string $a_submit_cmd =
"create_mob",
134 bool $a_input_error =
false 140 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_iim_create_info"));
143 $form->setFormAction($ilCtrl->getFormAction($this));
153 $ilCtrl->
redirectByClass(array(
"ilpcinteractiveimagegui",
"ilpciimtriggereditorgui"),
"editMapAreas");
177 if ($a_mode ==
"edit") {
178 $fi->setImage($this->content_obj->getBaseThumbnailTarget());
180 $fi->setRequired(
true);
184 if ($a_mode ==
"edit") {
187 $ti->setMaxLength(200);
193 if ($a_mode ==
"create") {
194 $form->setTitle(
$lng->
txt(
"cont_ed_insert_iim"));
195 $form->addCommandButton(
"create_iim",
$lng->
txt(
"save"));
196 $form->addCommandButton(
"cancelCreate",
$lng->
txt(
"cancel"));
203 $this->content_obj->getPCId(),
206 $ti->setValue($std_alias_item->getCaption());
208 $form->setTitle(
$lng->
txt(
"cont_edit_base_image"));
209 $form->addCommandButton(
"update",
$lng->
txt(
"save"));
212 $form->setFormAction($ilCtrl->getFormAction($this));
224 if (!$form->checkInput()) {
226 $form->setValuesByPost();
232 $this->content_obj->createMediaObject();
233 $media_obj = $this->content_obj->getMediaObject();
234 $media_obj->setTitle($_FILES[
'image_file'][
'name']);
235 $media_obj->create();
238 $media_obj->createDirectory();
240 $media_obj->addMediaItem($media_item);
241 $media_item->setPurpose(
"Standard");
243 $file = $mob_dir .
"/" . $_FILES[
'image_file'][
'name'];
246 $_FILES[
'image_file'][
'tmp_name'],
247 $_FILES[
'image_file'][
'name'],
251 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"file_is_infected"),
true);
256 $location = $_FILES[
'image_file'][
'name'];
259 $media_item->setFormat(
$format);
261 $media_item->setLocationType(
"LocalFile");
264 $media_obj->update();
266 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
267 $this->updated = $this->pg_obj->update();
268 if ($this->updated ===
true) {
269 $this->pg_obj->stripHierIDs();
270 $this->pg_obj->addHierIDs();
271 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
272 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
273 $this->content_obj->setHierId($this->content_obj->readHierId());
274 $this->
setHierId($this->content_obj->readHierId());
275 $this->content_obj->setPcId($this->content_obj->readPCId());
276 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"cont_saved_interactive_image"),
true);
277 $this->
ctrl->redirectByClass(
"ilpcinteractiveimagegui",
"edit");
294 if ($form->checkInput()) {
295 $mob = $this->content_obj->getMediaObject();
297 $std_item = $mob->getMediaItem(
"Standard");
298 $location = $_FILES[
'image_file'][
'name'];
300 if (
$location !=
"" && is_file($_FILES[
'image_file'][
'tmp_name'])) {
301 $file = $mob_dir .
"/" . $_FILES[
'image_file'][
'name'];
303 $_FILES[
'image_file'][
'tmp_name'],
304 $_FILES[
'image_file'][
'name'],
310 $location = $_FILES[
'image_file'][
'name'];
313 $std_item->setLocationType(
"LocalFile");
323 $this->content_obj->getPCId(),
327 $form->getInput(
"caption")
329 $this->edit_repo->setPageError($this->pg_obj->update());
330 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
333 $ilCtrl->redirectByClass(
"ilpcinteractiveimagegui",
"editBaseImage");
346 $this->content_obj->getPCId(),
362 $this->content_obj->getPCId(),
378 $this->content_obj->getPCId(),
394 $this->content_obj->getPCId(),
410 $this->content_obj->getPCId(),
429 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_iim_overlay_info"));
431 $ilTabs->setTabActive(
"list_overlays");
433 $ilToolbar->addButton(
435 $ilCtrl->getLinkTarget($this,
"addOverlayImages")
441 $this->content_obj->getMediaObject()
468 $form->setTitle(
$lng->
txt(
"cont_add_images"));
469 $form->setFormAction($ilCtrl->getFormAction($this));
473 $fi->
setSuffixes(array(
"gif",
"jpeg",
"jpg",
"png"));
474 $fi->setFilenames(array(0 =>
''));
475 $fi->setRequired(
true);
478 $form->addCommandButton(
"uploadOverlayImages",
$lng->
txt(
"upload"));
479 $form->addCommandButton(
"listOverlayImages",
$lng->
txt(
"cancel"));
490 if ($form->checkInput()) {
491 if (is_array($_FILES[
"ovfile"][
"name"])) {
492 foreach ($_FILES[
"ovfile"][
"name"] as $k => $v) {
493 $name = $_FILES[
"ovfile"][
"name"][$k];
494 $tmp_name = $_FILES[
"ovfile"][
"tmp_name"][$k];
496 $this->content_obj->getMediaObject()->uploadAdditionalFile(
501 $piname = pathinfo(
$name);
502 $this->content_obj->getMediaObject()->makeThumbnail(
504 basename(
$name,
"." . $piname[
'extension']) .
".png" 508 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"));
509 $ilCtrl->redirect($this,
"listOverlayImages");
511 $form->setValuesByPost();
525 $files = $this->request->getStringArray(
"file");
526 if (count($files) == 0) {
527 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"),
true);
528 $ilCtrl->redirect($this,
"listOverlayImages");
531 $cgui->setFormAction($ilCtrl->getFormAction($this));
532 $cgui->setHeaderText(
$lng->
txt(
"cont_really_delete_overlays"));
533 $cgui->setCancel(
$lng->
txt(
"cancel"),
"listOverlayImages");
534 $cgui->setConfirm(
$lng->
txt(
"delete"),
"deleteOverlays");
536 foreach ($files as
$i =>
$d) {
537 $cgui->addItem(
"file[]",
$i,
$i);
549 $files = $this->request->getStringArray(
"file");
550 if (count($files) > 0) {
551 foreach ($files as
$f) {
553 $this->content_obj->getMediaObject()
554 ->removeAdditionalFile(
"overlays/" . $f);
557 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"cont_overlays_have_been_deleted"),
true);
559 $ilCtrl->redirect($this,
"listOverlayImages");
567 public function listContentPopups():
void 575 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_iim_content_popups_info"));
577 $ilTabs->setTabActive(
"content_popups");
579 $ilToolbar->addButton(
581 $ilCtrl->getLinkTarget($this,
"addPopup")
599 $this->content_obj->addContentPopup();
600 $this->pg_obj->update();
601 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
602 $ilCtrl->redirect($this,
"listContentPopups");
610 $titles = $this->request->getStringArray(
"title");
611 if (count($titles) > 0) {
612 $this->content_obj->savePopups($titles);
613 $this->pg_obj->update();
614 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
616 $ilCtrl->redirect($this,
"listContentPopups");
628 $tids = $this->request->getStringArray(
"tid");
629 $titles = $this->request->getStringArray(
"title");
631 if (count($tids) == 0) {
632 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"),
true);
633 $ilCtrl->redirect($this,
"listContentPopups");
636 $cgui->setFormAction($ilCtrl->getFormAction($this));
637 $cgui->setHeaderText(
$lng->
txt(
"cont_really_delete_popups"));
638 $cgui->setCancel(
$lng->
txt(
"cancel"),
"listContentPopups");
639 $cgui->setConfirm(
$lng->
txt(
"delete"),
"deletePopups");
641 foreach ($tids as
$i =>
$d) {
642 $cgui->addItem(
"tid[]",
$i, $titles[
$i]);
654 $tids = $this->request->getStringArray(
"tid");
656 if (count($tids) > 0) {
657 foreach ($tids as
$id) {
658 $id = explode(
":", $id);
659 $this->content_obj->deletePopup($id[0], $id[1]);
661 $this->pg_obj->update();
662 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"cont_popups_have_been_deleted"),
true);
664 $ilCtrl->redirect($this,
"listContentPopups");
ilPageContent $content_obj
centerAlign()
Align media object to center.
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getTabs(bool $a_create=false, bool $a_change_obj_ref=false)
Add tabs to ilTabsGUI object.
setHierId(string $a_hier_id)
set hierarchical id in dom object
initForm(string $a_mode="edit")
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTabActive(string $a_id)
static renameExecutables(string $a_dir)
insert(string $a_post_cmd="edpost", string $a_submit_cmd="create_mob", bool $a_input_error=false)
Insert new media object form.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
setContent(string $a_html)
Sets content for standard template.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
ilGlobalTemplateInterface $tpl
rightFloatAlign()
align media object to right, floating text
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
addOverlayImages(ilPropertyFormGUI $a_form=null)
update()
Update (base image)
activateTab(string $a_id)
leftFloatAlign()
align media object to left, floating text
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
leftAlign()
align media object to left
__construct(Container $dic, ilPlugin $plugin)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
rightAlign()
align media object to right
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User interface class for page content map editor.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...