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
92 $ilCtrl = $this->
ctrl;
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
137 $ilCtrl = $this->ctrl;
140 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"cont_iim_create_info"));
142 $form = $this->initForm(
"create");
143 $form->setFormAction($ilCtrl->getFormAction($this));
145 $this->displayValidationError();
147 $tpl->setContent($form->getHTML());
152 $ilCtrl = $this->ctrl;
153 $ilCtrl->redirectByClass(array(
"ilpcinteractiveimagegui",
"ilpciimtriggereditorgui"),
"editMapAreas");
159 $ilTabs = $this->tabs;
160 $ilTabs->activateTab(
"edit_base_image");
161 $form = $this->initForm();
162 $tpl->setContent($form->getHTML());
169 $ilCtrl = $this->ctrl;
176 $fi->setAllowDeletion(
false);
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));
219 $ilCtrl = $this->ctrl;
223 $form = $this->initForm(
"create");
224 if (!$form->checkInput()) {
225 $this->displayValidationError();
226 $form->setValuesByPost();
227 $tpl->setContent($form->getHTML());
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");
290 $ilCtrl = $this->ctrl;
293 $form = $this->initForm(
"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(),
326 $std_alias_item->setCaption(
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(),
349 $std_alias_item->setHorizontalAlign(
"Center");
350 $this->updateAndReturn();
362 $this->content_obj->getPCId(),
365 $std_alias_item->setHorizontalAlign(
"Left");
366 $this->updateAndReturn();
378 $this->content_obj->getPCId(),
381 $std_alias_item->setHorizontalAlign(
"Right");
382 $this->updateAndReturn();
394 $this->content_obj->getPCId(),
397 $std_alias_item->setHorizontalAlign(
"LeftFloat");
398 $this->updateAndReturn();
410 $this->content_obj->getPCId(),
413 $std_alias_item->setHorizontalAlign(
"RightFloat");
414 $this->updateAndReturn();
424 $ilToolbar = $this->toolbar;
425 $ilCtrl = $this->ctrl;
426 $ilTabs = $this->tabs;
429 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"cont_iim_overlay_info"));
431 $ilTabs->setTabActive(
"list_overlays");
433 $ilToolbar->addButton(
434 $lng->txt(
"cont_add_images"),
435 $ilCtrl->getLinkTarget($this,
"addOverlayImages")
441 $this->content_obj->getMediaObject()
443 $tpl->setContent($tab->getHTML());
453 $form = $this->initAddOverlaysForm();
456 $tpl->setContent($form->getHTML());
462 $ilCtrl = $this->ctrl;
463 $ilTabs = $this->tabs;
465 $ilTabs->setTabActive(
"list_overlays");
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"));
487 $ilCtrl = $this->ctrl;
489 $form = $this->initAddOverlaysForm();
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();
512 $this->addOverlayImages($form);
518 $ilCtrl = $this->ctrl;
521 $ilTabs = $this->tabs;
523 $ilTabs->setTabActive(
"list_overlays");
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);
540 $tpl->setContent($cgui->getHTML());
546 $ilCtrl = $this->ctrl;
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
570 $ilToolbar = $this->toolbar;
571 $ilCtrl = $this->ctrl;
572 $ilTabs = $this->tabs;
575 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"cont_iim_content_popups_info"));
577 $ilTabs->setTabActive(
"content_popups");
579 $ilToolbar->addButton(
580 $lng->txt(
"cont_add_popup"),
581 $ilCtrl->getLinkTarget($this,
"addPopup")
585 $iim = $this->content_obj;
591 $tpl->setContent($tab->getHTML());
596 $ilCtrl = $this->ctrl;
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");
607 $ilCtrl = $this->ctrl;
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");
621 $ilCtrl = $this->ctrl;
624 $ilTabs = $this->tabs;
626 $ilTabs->setTabActive(
"content_popups");
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]);
645 $tpl->setContent($cgui->getHTML());
652 $ilCtrl = $this->ctrl;
654 $tids = $this->request->getStringArray(
"tid");
656 if (count($tids) > 0) {
657 foreach ($tids as
$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");
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static renameExecutables(string $a_dir)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
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...
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTabs(bool $a_create=false, bool $a_change_obj_ref=false)
Add tabs to ilTabsGUI object.
rightFloatAlign()
align media object to right, floating text
leftAlign()
align media object to left
update()
Update (base image)
leftFloatAlign()
align media object to left, floating text
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
insert(string $a_post_cmd="edpost", string $a_submit_cmd="create_mob", bool $a_input_error=false)
Insert new media object form.
centerAlign()
Align media object to center.
addOverlayImages(ilPropertyFormGUI $a_form=null)
initForm(string $a_mode="edit")
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 for Editing of Page Content Objects (Paragraphs, Tables, ...)
ilPageContent $content_obj
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
setContent(string $a_html)
Sets content for standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc