ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPCMediaObjectGUI.php
Go to the documentation of this file.
1<?php
2
25{
28 protected string $page_back_title = "";
29 protected bool $enabledmapareas = false;
30 protected ilTabsGUI $tabs;
33 protected ilObjUser $user;
34 protected \ILIAS\DI\UIServices $ui;
35 protected string $pool_view = "";
36 public string $header = "";
37 protected string $sub_cmd = "";
38 protected \ILIAS\MediaObjects\MediaType\MediaTypeManager $media_type;
39
40 public function __construct(
41 ilPageObject $a_pg_obj,
42 ?ilPageContent $a_content_obj,
43 string $a_hier_id,
44 string $a_pc_id = ""
45 ) {
46 global $DIC;
47
48 $this->tpl = $DIC["tpl"];
49 $this->lng = $DIC->language();
50 $this->tabs = $DIC->tabs();
51 $this->access = $DIC->access();
52 $this->toolbar = $DIC->toolbar();
53 $this->user = $DIC->user();
54 $ilCtrl = $DIC->ctrl();
55 $this->ui = $DIC->ui();
56
58 ->copage()
59 ->internal()
60 ->gui()
61 ->pc()
62 ->editRequest();
63
64 $this->media_type = $DIC->mediaObjects()
65 ->internal()
66 ->domain()
67 ->mediaType();
68
69 $pc_id = $request->getPCId();
70 if ($pc_id != "" && $a_hier_id == "") {
71 $hier_ids = $a_pg_obj->getHierIdsForPCIds([$pc_id]);
72 $a_hier_id = $hier_ids[$pc_id] ?? "";
73 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
74 }
75
76 $this->pool_view = "folder";
77
78 $pv = $request->getString("pool_view");
79 if (in_array($pv, array("folder", "all"))) {
80 $this->pool_view = $pv;
81 }
82
83 $this->ctrl = $ilCtrl;
84
85 $this->ctrl->saveParameter($this, ["pool_view", "pcid"]);
86
87 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
88
89 $this->setCharacteristics(self::_getStandardCharacteristics());
90 }
91
92 protected function insert_applyFilter(): void
93 {
94 $this->insert();
95 }
96
97 protected function insert_resetFilter(): void
98 {
99 $this->insert();
100 }
101
105 public function setSubCmd(string $a_val): void
106 {
107 $this->sub_cmd = $a_val;
108 }
109
110 public function getSubCmd(): string
111 {
112 return $this->sub_cmd;
113 }
114
115
116 public function setHeader(string $a_title = ""): void
117 {
118 $this->header = $a_title;
119 }
120
121 public function getHeader(): string
122 {
123 return $this->header;
124 }
125
129 public function setEnabledMapAreas(bool $a_enabledmapareas): void
130 {
131 $this->enabledmapareas = $a_enabledmapareas;
132 }
133
134 public function getEnabledMapAreas(): bool
135 {
137 }
138
143 public function executeCommand()
144 {
147 $ilTabs = $this->tabs;
148
149 $this->getCharacteristicsOfCurrentStyle(["media_cont"]); // scorm-2004
150
151 // get next class that processes or forwards current command
152 $next_class = $this->ctrl->getNextClass($this);
153
154 // get current command
155 $cmd = $this->ctrl->getCmd();
156 if (is_object($this->content_obj)) {
157 //$this->tpl->clearHeader();
158 $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_mob.svg"));
159 $this->getTabs();
160
161 $mob = $this->content_obj->getMediaObject();
162 if (is_object($mob)) {
163 $tpl->setTitle($lng->txt("mob") . ": " .
164 $this->content_obj->getMediaObject()->getTitle());
165 $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
166 $mob_gui->setBackTitle($this->page_back_title);
167 $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
168 $mob_gui->getTabs();
169 }
170 }
171
172 switch ($next_class) {
173 case "ilobjmediaobjectgui":
174 //$this->tpl->clearHeader();
175 $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_mob.svg"));
176 $this->tpl->setTitle($this->lng->txt("mob") . ": " .
177 $this->content_obj->getMediaObject()->getTitle());
178 $mob_gui = new ilObjMediaObjectGUI("", $this->content_obj->getMediaObject()->getId(), false, false);
179 $mob_gui->setBackTitle($this->page_back_title);
180 $mob_gui->setEnabledMapAreas($this->getEnabledMapAreas());
181 $ret = $this->ctrl->forwardCommand($mob_gui);
182 break;
183
184 // instance image map editing
185 case "ilpcimagemapeditorgui":
186 $ilTabs->setTabActive("cont_inst_map_areas");
188 $pc_med = $this->content_obj;
189 $image_map_edit = new ilPCImageMapEditorGUI(
190 $pc_med,
191 $this->pg_obj,
192 $this->request
193 );
194 $ret = $this->ctrl->forwardCommand($image_map_edit);
195 $tpl->setContent($ret);
196 $this->checkFixSize();
197 break;
198
199 default:
200 $ret = $this->$cmd();
201 break;
202 }
203
204 return $ret;
205 }
206
207 public function insert(
208 $a_post_cmd = "edpost",
209 $a_submit_cmd = "",
210 $a_input_error = false
211 ): void {
212 $ilTabs = $this->tabs;
214 $ilCtrl = $this->ctrl;
216
218
219 if (in_array($sub_command, ["insertNew", "insertFromPool"])) {
220 $this->edit_repo->setSubCmd($sub_command);
221 }
222
223 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
224 $sub_command = $this->edit_repo->getSubCmd();
225 }
226
227 switch ($sub_command) {
228 case "insertFromPool":
229 $this->insertFromPool();
230 break;
231
232 case "poolSelection":
233 $this->poolSelection();
234 break;
235
236 case "selectPool":
237 $this->selectPool();
238 break;
239
240 case "insertNew":
241 default:
242 $this->getTabs(true);
243 $ilTabs->setSubTabActive("cont_new_mob");
244
245 if ($a_input_error) {
247 } else {
248 $mob_gui = new ilObjMediaObjectGUI("");
249 $mob_gui->initForm("create");
250 $form = $mob_gui->getForm();
251 }
252 $form->setFormAction($ilCtrl->getFormAction($this, "create"));
254 $form->addCommandButton("create", $lng->txt("save"));
255 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
256
257 $this->displayValidationError();
258
259 $tpl->setContent($form->getHTML());
260
261 break;
262 }
263 }
264
268 public function changeObjectReference(): void
269 {
270 $ilTabs = $this->tabs;
271 $ilCtrl = $this->ctrl;
273
274 $sub_command = $this->sub_command;
275
276 if (in_array($sub_command, ["insertNew", "insertFromPool"])) {
277 $this->edit_repo->setSubCmd($sub_command);
278 }
279
280 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
281 $sub_command = $this->edit_repo->getSubCmd();
282 }
283
284 switch ($sub_command) {
285 case "insertFromPool":
286 $this->insertFromPool(true);
287 break;
288
289 case "poolSelection":
290 $this->poolSelection(true);
291 break;
292
293 case "selectPool":
294 $this->selectPool(true);
295 break;
296
297 case "insertNew":
298 default:
299 $ilCtrl->setParameter($this, "subCmd", "changeObjectReference");
300 $this->getTabs(true, true);
301 $ilTabs->setSubTabActive("cont_new_mob");
302
303 $this->displayValidationError();
304
305 $mob_gui = new ilObjMediaObjectGUI("");
306 $mob_gui->initForm("create");
307 $form = $mob_gui->getForm();
308 $form->setFormAction($ilCtrl->getFormAction($this));
309 $form->clearCommandButtons();
310 $form->addCommandButton("createNewObjectReference", $lng->txt("save"));
311 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
312 $this->tpl->setContent($form->getHTML());
313 }
314 }
315
316 protected function checkFixSize(): void
317 {
318 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
319 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
320
321 $ok = false;
322 if (($std_alias_item->getWidth() != "" && $std_alias_item->getHeight() != "")) {
323 $ok = true;
324 }
325 if ($std_alias_item->getWidth() == "" && $std_alias_item->getHeight() == ""
326 && $std_item->getWidth() != "" && $std_item->getHeight() != "") {
327 $ok = true;
328 }
329
330 if (!$ok) {
331 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("mob_no_fixed_size_map_editing"));
332 }
333 }
334
338 public function insertFromPool(bool $a_change_obj_ref = false): void
339 {
340 $ilCtrl = $this->ctrl;
341 $ilAccess = $this->access;
342 $ilTabs = $this->tabs;
343 $tpl = $this->tpl;
345 $ui = $this->ui;
346
347 if ($this->edit_repo->getMediaPool() > 0 &&
348 $ilAccess->checkAccess("write", "", $this->edit_repo->getMediaPool())
349 && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getMediaPool())) == "mep") {
350 $html = "";
351 $tb = new ilToolbarGUI();
352
353 // button: select pool
354 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
355 if ($a_change_obj_ref) {
356 $tb->addButton(
357 $lng->txt("cont_switch_to_media_pool"),
358 $ilCtrl->getLinkTarget($this, "changeObjectReference")
359 );
360 } else {
361 $tb->addButton(
362 $lng->txt("cont_switch_to_media_pool"),
363 $ilCtrl->getLinkTarget($this, "insert")
364 );
365 }
366 $ilCtrl->setParameter($this, "subCmd", "");
367
368 // view mode: pool view (folders/all media objects)
369 $f = $ui->factory();
370 $tcmd = ($a_change_obj_ref)
371 ? "changeObjectReference"
372 : "insert";
373 $lng->loadLanguageModule("mep");
374 $ilCtrl->setParameter($this, "pool_view", "folder");
375 $actions[$lng->txt("folders")] = $ilCtrl->getLinkTarget($this, $tcmd);
376 $ilCtrl->setParameter($this, "pool_view", "all");
377 $actions[$lng->txt("mep_all_mobs")] = $ilCtrl->getLinkTarget($this, $tcmd);
378 $ilCtrl->setParameter($this, "pool_view", $this->pool_view);
379 $aria_label = $lng->txt("cont_change_pool_view");
380 $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == "folder")
381 ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
382 $tb->addSeparator();
383 $tb->addComponent($view_control);
384
385 $html = $tb->getHTML();
386
387 $this->getTabs(true, $a_change_obj_ref);
388 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
389
390 $pool = new ilObjMediaPool($this->edit_repo->getMediaPool());
391 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
392 $tcmd = ($a_change_obj_ref)
393 ? "changeObjectReference"
394 : "insert";
395 $tmode = ($a_change_obj_ref)
398
399 // handle table sub commands and get the table
400 if ($this->getSubCmd() == "applyFilter") {
401 $mpool_table = new ilMediaPoolTableGUI(
402 $this,
403 $tcmd,
404 $pool,
405 "mep_folder",
406 $tmode,
407 $this->pool_view == "all"
408 );
409 $mpool_table->resetOffset();
410 $mpool_table->writeFilterToSession();
411 }
412 if ($this->getSubCmd() == "resetFilter") {
413 $mpool_table = new ilMediaPoolTableGUI(
414 $this,
415 $tcmd,
416 $pool,
417 "mep_folder",
418 $tmode,
419 $this->pool_view == "all"
420 );
421 $mpool_table->resetOffset();
422 $mpool_table->resetFilter();
423 }
424 $mpool_table = new ilMediaPoolTableGUI(
425 $this,
426 $tcmd,
427 $pool,
428 "mep_folder",
429 $tmode,
430 $this->pool_view == "all"
431 );
432
433 $html .= $mpool_table->getHTML();
434
435 $tpl->setContent($html);
436 } else {
437 $this->poolSelection($a_change_obj_ref);
438 }
439 }
440
444 public function selectPool(
445 bool $a_change_obj_ref = false
446 ): void {
447 $ilCtrl = $this->ctrl;
448
449 $this->edit_repo->setMediaPool($this->request->getInt("pool_ref_id"));
450 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
451 if ($a_change_obj_ref) {
452 $ilCtrl->redirect($this, "changeObjectReference");
453 } else {
454 $ilCtrl->redirect($this, "insert");
455 }
456 }
457
461 public function poolSelection(
462 bool $a_change_obj_ref = false
463 ): void {
464 $tpl = $this->tpl;
465 $ilTabs = $this->tabs;
466 $ilCtrl = $this->ctrl;
467
468 $this->getTabs(true, $a_change_obj_ref);
469 $ilTabs->setSubTabActive("cont_mob_from_media_pool");
470
471 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
472 if ($a_change_obj_ref) {
473 $exp = new ilPoolSelectorGUI($this, "changeObjectReference", $this, "changeObjectReference");
474 } else {
475 $exp = new ilPoolSelectorGUI($this, "insert");
476 }
477
478 // filter
479 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
480 $exp->setClickableTypes(array('mep'));
481
482 if (!$exp->handleCommand()) {
483 $tpl->setContent($exp->getHTML());
484 }
485 }
486
487
492 public function createNewObjectReference(): void
493 {
494 $this->create(false, true);
495 }
496
501 public function selectObjectReference(): void
502 {
503 $ilCtrl = $this->ctrl;
505 $ids = $this->request->getIntArray("id");
506 if (count($ids) == 1) {
507 $fid = ilMediaPoolItem::lookupForeignId($ids[0]);
508 $this->content_obj->readMediaObject($fid);
509 $this->content_obj->updateObjectReference();
510 $this->updated = $this->pg_obj->update();
511 } else {
512 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_select_max_one_item"), true);
513 $ilCtrl->redirect($this, "changeObjectReference");
514 }
515 $ilCtrl->redirect($this, "editAlias");
516 }
517
521 public function create(
522 bool $a_create_alias = true,
523 bool $a_change_obj_ref = false
524 ): ?ilPCMediaObject {
525 $ilCtrl = $this->ctrl;
527
528 if ($this->sub_command == "insertFromPool") {
529 $ids = $this->request->getIntArray("id");
530 for ($i = count($ids) - 1; $i >= 0; $i--) {
531 $fid = ilMediaPoolItem::lookupForeignId($ids[$i]);
532 $this->content_obj = new ilPCMediaObject($this->getPage());
533 $this->content_obj->readMediaObject($fid);
534 $this->content_obj->createAlias(
535 $this->pg_obj,
536 $this->request->getHierId(),
537 $this->pc_id
538 );
539 }
540 $this->updated = $this->pg_obj->update();
541
542 $this->redirectToParent($this->request->getHierId());
543 }
544
545 // check form input
546 $mob_gui = new ilObjMediaObjectGUI("");
547 $mob_gui->initForm("create");
548
549 if (!$mob_gui->checkFormInput()) {
550 $this->form = $mob_gui->getForm();
551 $this->insert("edpost", "", true);
552 return null;
553 }
554 // create dummy object in db (we need an id)
555 if ($a_change_obj_ref != true) {
556 $this->content_obj = new ilPCMediaObject($this->getPage());
557 }
558 $this->content_obj->createMediaObject();
559 $media_obj = $this->content_obj->getMediaObject();
560
561 $mob_gui->setObjectPerCreationForm($media_obj);
562
563 if ($a_create_alias) {
564 // need a pcmediaobject here
565 //$this->node = $this->createPageContentNode();
566
567 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
568 $this->updated = $this->pg_obj->update();
569 if ($this->updated === true) {
570 $this->pg_obj->stripHierIDs();
571 $this->pg_obj->addHierIDs();
572 $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
573 $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
574 $this->content_obj->setHierId($this->content_obj->readHierId());
575 $this->setHierId($this->content_obj->readHierId());
576 $this->content_obj->setPcId($this->content_obj->readPCId());
577 $this->tpl->setOnScreenMessage('success', $lng->txt("saved_media_object"), true);
578 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
579
580 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
581 } else {
582 $this->insert();
583 }
584 } else {
585 if ($a_change_obj_ref == true) {
586 $this->content_obj->updateObjectReference();
587 $this->updated = $this->pg_obj->update();
588 $this->ctrl->redirect($this, "editAlias");
589 }
590 return $this->content_obj;
591 }
592 return null;
593 }
594
595 protected function create_mob(): void
596 {
597 $this->create();
598 }
599
603 public function edit(): void
604 {
605 if ($this->content_obj->checkInstanceEditing()) {
606 $this->ctrl->redirect($this, "editAlias");
607 }
608 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "edit");
609 }
610
611 public function editAlias(): void
612 {
613 $tpl = $this->tpl;
614
615 $this->initAliasForm();
616 $this->getAliasValues();
617 $tpl->setContent($this->form_gui->getHTML());
618 }
619
623 public function initAliasForm(): void
624 {
626 $ilCtrl = $this->ctrl;
627
628 $this->form_gui = new ilPropertyFormGUI();
629
630 // standard view resource
631 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
632
633 // title, location and format
634 $title = new ilNonEditableValueGUI($lng->txt("title"), "title");
635 $this->form_gui->addItem($title);
636 $loc = new ilNonEditableValueGUI(
637 $this->lng->txt("cont_" . strtolower($std_item->getLocationType())),
638 "st_location"
639 );
640 $this->form_gui->addItem($loc);
641 $format = new ilNonEditableValueGUI(
642 $this->lng->txt("cont_format"),
643 "st_format"
644 );
645 $this->form_gui->addItem($format);
646
647 // standard size
648 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "st_derive_size");
649 $orig_size = $std_item->getOriginalSize();
650 $add_str = (!is_null($orig_size))
651 ? " (" . $orig_size["width"] . " x " . $orig_size["height"] . ")"
652 : "";
653 $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
654 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
655 $radio_size->addOption($op1);
656
657 // width height
658 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
659 " / " . $lng->txt("cont_height"), "st_width_height");
660 if (is_int(strpos($std_item->getFormat(), "image"))
661 && $std_item->getLocationType() === "LocalFile") {
662 $width_height->setSupportConstraintsProps(true);
663 $width_height->setConstrainProportions(true);
664 }
665 $op2->addSubItem($width_height);
666
667 $radio_size->addOption($op2);
668 $this->form_gui->addItem($radio_size);
669
670 // standard caption
671 $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "st_derive_caption");
672 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
673 $def_cap = new ilNonEditableValueGUI("", "def_caption");
674 $op1->addSubItem($def_cap);
675 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
676 $rad_caption->addOption($op1);
677
678 $caption = new ilTextAreaInputGUI("", "st_caption");
679 $caption->setCols(30);
680 $caption->setRows(2);
681 $op2->addSubItem($caption);
682
683 /*$caption = new ilTextInputGUI("", "st_caption");
684 $caption->setSize(40);
685 $caption->setMaxLength(200);
686 $op2->addSubItem($caption);*/
687 $rad_caption->addOption($op2);
688 $this->form_gui->addItem($rad_caption);
689
690 // standard text representation
691 if ($this->media_type->usesAltTextProperty($std_item->getFormat())) {
692 $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "st_derive_text_representation");
693 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
694 $def_tr = new ilNonEditableValueGUI("", "def_text_representation");
695 $op1->addSubItem($def_tr);
696 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
697 $tr = new ilTextAreaInputGUI("", "st_text_representation");
698 $tr->setCols(30);
699 $tr->setRows(2);
700 $rad_tr->addOption($op1);
701 $op2->addSubItem($tr);
702 $rad_tr->addOption($op2);
703 $this->form_gui->addItem($rad_tr);
704 $rad_tr->setInfo($lng->txt("text_repr_info"));
705 }
706
707 // standard parameters
708 if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
709 if ($this->media_type->usesAutoStartParameterOnly(
710 $std_item->getLocation(),
711 $std_item->getFormat()
712 )) { // autostart
713 /*
714 $par = $std_item->getParameters();
715 $def_str = ($par["autostart"] == "true")
716 ? " (" . $lng->txt("yes") . ")"
717 : " (" . $lng->txt("no") . ")";
718 $rad_auto = new ilRadioGroupInputGUI(
719 $lng->txt("cont_autostart"),
720 "st_derive_parameters"
721 );
722 $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
723 $rad_auto->addOption($op1);
724 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
725 $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "st_autostart");
726 $op2->addSubItem($auto);
727 $rad_auto->addOption($op2);
728 $this->form_gui->addItem($rad_auto);*/
729 } else { // parameters
730 $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "st_derive_parameters");
731 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
732 $def_par = new ilNonEditableValueGUI("", "def_parameters");
733 $op1->addSubItem($def_par);
734 $rad_parameters->addOption($op1);
735 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
736 $par = new ilTextAreaInputGUI("", "st_parameters");
737 $par->setRows(5);
738 $par->setCols(50);
739 $op2->addSubItem($par);
740 $rad_parameters->addOption($op2);
741 $this->form_gui->addItem($rad_parameters);
742 }
743 }
744
745 // fullscreen view
746 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
747 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
748
749 $fs_sec = new ilFormSectionHeaderGUI();
750 $fs_sec->setTitle($lng->txt("cont_fullscreen"));
751 $this->form_gui->addItem($fs_sec);
752
753
754 // resource
755 $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "fullscreen");
756 $op1 = new ilRadioOption($lng->txt("cont_none"), "n");
757 $radio_prop->addOption($op1);
758 $op2 = new ilRadioOption($this->lng->txt("cont_" . strtolower($full_item->getLocationType())) . ": " .
759 $full_item->getLocation(), "y");
760 $radio_prop->addOption($op2);
761 $this->form_gui->addItem($radio_prop);
762
763 // format
764 $format = new ilNonEditableValueGUI(
765 $this->lng->txt("cont_format"),
766 "full_format"
767 );
768 $this->form_gui->addItem($format);
769
770 // full size
771 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_derive_size");
772 $fw_size = $std_item->getOriginalSize();
773 $add_str = (!is_null($fw_size))
774 ? " (" . $fw_size["width"] . " x " . $fw_size["height"] . ")"
775 : "";
776 $op1 = new ilRadioOption($lng->txt("cont_default") . $add_str, "y");
777 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
778 $radio_size->addOption($op1);
779
780 // width height
781 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
782 " / " . $lng->txt("cont_height"), "full_width_height");
783 if (is_int(strpos($full_item->getFormat(), "image"))
784 && $full_item->getLocationType() === "LocalFile") {
785 $width_height->setSupportConstraintsProps(true);
786 $width_height->setConstrainProportions(true);
787 }
788 $op2->addSubItem($width_height);
789
790 $radio_size->addOption($op2);
791 $this->form_gui->addItem($radio_size);
792
793 // fullscreen caption
794 $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "full_derive_caption");
795 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
796 $def_cap = new ilNonEditableValueGUI("", "full_def_caption");
797 $op1->addSubItem($def_cap);
798 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
799 $rad_caption->addOption($op1);
800
801 $caption = new ilTextAreaInputGUI("", "full_caption");
802 $caption->setCols(30);
803 $caption->setRows(2);
804 $op2->addSubItem($caption);
805
806 /*$caption = new ilTextInputGUI("", "full_caption");
807 $caption->setSize(40);
808 $caption->setMaxLength(200);
809 $op2->addSubItem($caption);*/
810 $rad_caption->addOption($op2);
811 $this->form_gui->addItem($rad_caption);
812
813 // fullscreen text representation
814 if (substr($full_item->getFormat(), 0, 5) == "image") {
815 $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "full_derive_text_representation");
816 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
817 $def_tr = new ilNonEditableValueGUI("", "full_def_text_representation");
818 $op1->addSubItem($def_tr);
819 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
820 $tr = new ilTextAreaInputGUI("", "full_text_representation");
821 $tr->setCols(30);
822 $tr->setRows(2);
823 $rad_tr->addOption($op1);
824 $op2->addSubItem($tr);
825 $rad_tr->addOption($op2);
826 $this->form_gui->addItem($rad_tr);
827 $rad_tr->setInfo($lng->txt("text_repr_info"));
828 }
829
830 // fullscreen parameters
831 if ($this->media_type->usesParameterProperty($full_item->getFormat())) {
832 if ($this->media_type->usesAutoStartParameterOnly(
833 $full_item->getLocation(),
834 $full_item->getFormat()
835 )) { // autostart
836 /*
837 $par = $full_item->getParameters();
838 $def_str = ($par["autostart"] == "true")
839 ? " (" . $lng->txt("yes") . ")"
840 : " (" . $lng->txt("no") . ")";
841 $rad_auto = new ilRadioGroupInputGUI(
842 $lng->txt("cont_autostart"),
843 "full_derive_parameters"
844 );
845 $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y");
846 $rad_auto->addOption($op1);
847 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
848 $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "full_autostart");
849 $op2->addSubItem($auto);
850 $rad_auto->addOption($op2);
851 $this->form_gui->addItem($rad_auto);*/
852 } else { // parameters
853 $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "full_derive_parameters");
854 $op1 = new ilRadioOption($lng->txt("cont_default"), "y");
855 $def_par = new ilNonEditableValueGUI("", "full_def_parameters");
856 $op1->addSubItem($def_par);
857 $rad_parameters->addOption($op1);
858 $op2 = new ilRadioOption($lng->txt("cont_custom"), "n");
859 $par = new ilTextAreaInputGUI("", "full_parameters");
860 $par->setRows(5);
861 $par->setCols(50);
862 $op2->addSubItem($par);
863 $rad_parameters->addOption($op2);
864 $this->form_gui->addItem($rad_parameters);
865 }
866 }
867 }
868
869 $this->form_gui->setTitle($lng->txt("cont_edit_mob_alias_prop"));
870 $this->form_gui->addCommandButton("saveAliasProperties", $lng->txt("save"));
871 $lm_set = new ilSetting("lm");
872 if ($lm_set->get("replace_mob_feature")) {
873 $this->form_gui->addCommandButton("changeObjectReference", $lng->txt("cont_change_object_reference"));
874 }
875 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
876 }
877
878
882 public function getAliasValues(): void
883 {
885
886 // standard view resource
887 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
888 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
889
890 $values["title"] = $this->content_obj->getMediaObject()->getTitle();
891 $values["st_location"] = $std_item->getLocation();
892 $values["st_format"] = $std_item->getFormat();
893
894 // size
895 if ($std_alias_item->definesSize()) {
896 $values["st_width_height"]["width"] = $std_alias_item->getWidth();
897 $values["st_width_height"]["height"] = $std_alias_item->getHeight();
898 $values["st_width_height"]["constr_prop"] = true;
899 } else {
900 if ($std_item->getWidth() !== "" || $std_item->getHeight() !== "") {
901 $values["st_width_height"]["width"] = $std_item->getWidth();
902 $values["st_width_height"]["height"] = $std_item->getHeight();
903 $values["st_width_height"]["constr_prop"] = true;
904 } else {
905 $orig_size = $std_item->getOriginalSize();
906 if (!is_null($orig_size)) {
907 $values["st_width_height"]["width"] = $orig_size["width"];
908 $values["st_width_height"]["height"] = $orig_size["height"];
909 $values["st_width_height"]["constr_prop"] = true;
910 }
911 }
912 }
913
914 // caption
915 $values["st_caption"] = $std_alias_item->getCaption();
916 if (trim($std_item->getCaption()) == "") {
917 $values["def_caption"] = $lng->txt("cont_no_caption");
918 } else {
919 $values["def_caption"] = $std_item->getCaption();
920 }
921
922 // text representation
923 $values["st_text_representation"] = $std_alias_item->getTextRepresentation();
924 if (trim($std_item->getTextRepresentation()) == "") {
925 $values["def_text_representation"] = $lng->txt("cont_no_text");
926 } else {
927 $values["def_text_representation"] = $std_item->getTextRepresentation();
928 }
929
930 // parameters / autostart
931 if ($this->media_type->usesAutoStartParameterOnly(
932 $std_item->getLocation(),
933 $std_item->getFormat()
934 )) { // autostart
935 /*
936 $par = $std_alias_item->getParameters();
937 if ($par["autostart"] == "true") {
938 $values["st_autostart"] = true;
939 }*/
940 } else { // parameters
941 $values["st_parameters"] = $std_alias_item->getParameterString();
942 }
943
944 // size
945 $values["st_derive_size"] = $std_alias_item->definesSize()
946 ? "n"
947 : "y";
948 $values["st_derive_caption"] = $std_alias_item->definesCaption()
949 ? "n"
950 : "y";
951 $values["st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
952 ? "n"
953 : "y";
954 $values["st_derive_parameters"] = $std_alias_item->definesParameters()
955 ? "n"
956 : "y";
957 if (trim($std_item->getParameterString()) == "") {
958 $values["def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
959 } else {
960 $values["def_parameters"] = $std_item->getParameterString();
961 }
962
963 // fullscreen properties
964 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
965 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
966 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
967
968 $values["fullscreen"] = "n";
969 if ($full_alias_item->exists()) {
970 $values["fullscreen"] = "y";
971 }
972
973 $values["full_location"] = $full_item->getLocation();
974 $values["full_format"] = $full_item->getFormat();
975
976 if ($full_alias_item->definesSize()) {
977 $values["full_width_height"]["width"] = $full_alias_item->getWidth();
978 $values["full_width_height"]["height"] = $full_alias_item->getHeight();
979 $values["full_width_height"]["constr_prop"] = true;
980 } else {
981 if ($full_item->getWidth() !== "" || $full_item->getHeight() !== "") {
982 $values["full_width_height"]["width"] = $full_item->getWidth();
983 $values["full_width_height"]["height"] = $full_item->getHeight();
984 $values["full_width_height"]["constr_prop"] = true;
985 } else {
986 $orig_full_size = $full_item->getOriginalSize();
987 if (!is_null($orig_full_size)) {
988 $values["full_width_height"]["width"] = $orig_full_size["width"];
989 $values["full_width_height"]["height"] = $orig_full_size["height"];
990 $values["full_width_height"]["constr_prop"] = true;
991 }
992 }
993 }
994
995 $values["full_caption"] = $full_alias_item->getCaption();
996 if (trim($full_item->getCaption()) == "") {
997 $values["full_def_caption"] = $lng->txt("cont_no_caption");
998 } else {
999 $values["full_def_caption"] = $full_item->getCaption();
1000 }
1001 $values["full_text_representation"] = $full_alias_item->getTextRepresentation();
1002 if (trim($full_item->getTextRepresentation()) == "") {
1003 $values["full_def_text_representation"] = $lng->txt("cont_no_text");
1004 } else {
1005 $values["full_def_text_representation"] = $full_item->getTextRepresentation();
1006 }
1007 $values["full_parameters"] = $full_alias_item->getParameterString();
1008 $values["full_derive_size"] = $full_alias_item->definesSize()
1009 ? "n"
1010 : "y";
1011 $values["full_derive_caption"] = $full_alias_item->definesCaption()
1012 ? "n"
1013 : "y";
1014 $values["full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
1015 ? "n"
1016 : "y";
1017
1018 // parameters
1019 if ($this->media_type->usesAutoStartParameterOnly(
1020 $full_item->getLocation(),
1021 $full_item->getFormat()
1022 )) { // autostart
1023 /*
1024 $par = $full_alias_item->getParameters();
1025 if ($par["autostart"] == "true") {
1026 $values["full_autostart"] = true;
1027 }*/
1028 } else { // parameters
1029 $values["full_parameters"] = $full_alias_item->getParameterString();
1030 }
1031
1032 $values["full_derive_parameters"] = $full_alias_item->definesParameters()
1033 ? "n"
1034 : "y";
1035 if (trim($full_item->getParameterString()) == "") {
1036 $values["full_def_parameters"] = "<i>" . $lng->txt("cont_no_parameters") . "</i>";
1037 } else {
1038 $values["full_def_parameters"] = $full_item->getParameterString();
1039 }
1040 }
1041
1042 $this->form_gui->setValuesByArray($values, true);
1043 }
1044
1048 public function saveAliasProperties(): void
1049 {
1050 $this->initAliasForm();
1051 $form = $this->form_gui;
1052 $form->checkInput();
1053
1054 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1055 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
1056 $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1057 $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen");
1058
1059 // standard size
1060 if ($form->getInput("st_derive_size") == "y") {
1061 $std_alias_item->deriveSize();
1062 } else {
1063 $size = $this->request->getStringArray("st_width_height");
1064 $std_alias_item->setWidth($size["width"]);
1065 $std_alias_item->setHeight($size["height"]);
1066 }
1067
1068 // standard caption
1069 if ($form->getInput("st_derive_caption") == "y") {
1070 $std_alias_item->deriveCaption();
1071 } else {
1072 $std_alias_item->setCaption($form->getInput("st_caption"));
1073 }
1074
1075 // text representation
1076 if ($form->getInput("st_derive_text_representation") == "y") {
1077 $std_alias_item->deriveTextRepresentation();
1078 } else {
1079 $std_alias_item->setTextRepresentation(
1080 $form->getInput("st_text_representation")
1081 );
1082 }
1083
1084 // standard parameters
1085 if ($form->getInput("st_derive_parameters") == "y") {
1086 $std_alias_item->deriveParameters();
1087 } else {
1088 if ($this->media_type->usesAutoStartParameterOnly(
1089 $std_item->getLocation(),
1090 $std_item->getFormat()
1091 )) { // autostart
1092 //
1093 } else { // parameters
1094 $std_alias_item->setParameters(
1096 $form->getInput("st_parameters")
1097 )
1098 );
1099 }
1100 }
1101
1102 if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1103 if ($form->getInput("fullscreen") == "y") {
1104 if (!$full_alias_item->exists()) {
1105 $full_alias_item->insert();
1106 }
1107
1108 // fullscreen size
1109 if ($form->getInput("full_derive_size") == "y") {
1110 $full_alias_item->deriveSize();
1111 } else {
1112 $full_size = $this->request->getStringArray("full_width_height");
1113 $full_alias_item->setWidth($full_size["width"]);
1114 $full_alias_item->setHeight($full_size["height"]);
1115 }
1116
1117 // fullscreen caption
1118 if ($form->getInput("full_derive_caption") == "y") {
1119 $full_alias_item->deriveCaption();
1120 } else {
1121 $full_alias_item->setCaption($form->getInput("full_caption"));
1122 }
1123
1124 // fullscreen text representation
1125 if ($form->getInput("full_derive_text_representation") == "y") {
1126 $full_alias_item->deriveTextRepresentation();
1127 } else {
1128 $full_alias_item->setTextRepresentation(
1129 $form->getInput("full_text_representation")
1130 );
1131 }
1132
1133 // fullscreen parameters
1134 if ($form->getInput("full_derive_parameters") == "y") {
1135 $full_alias_item->deriveParameters();
1136 } else {
1137 if ($this->media_type->usesAutoStartParameterOnly(
1138 $full_item->getLocation(),
1139 $full_item->getFormat()
1140 )) { // autostart
1141 //
1142 } else {
1143 $full_alias_item->setParameters(ilUtil::extractParameterString($form->getInput("full_parameters")));
1144 }
1145 }
1146 } else {
1147 if ($full_alias_item->exists()) {
1148 $full_alias_item->delete();
1149 }
1150 }
1151 }
1152
1153 $this->updated = $this->pg_obj->update();
1154 if ($this->updated === true) {
1155 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1156 $this->ctrl->redirect($this, "editAlias");
1157 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1158 } else {
1159 $this->pg_obj->addHierIDs();
1160 $this->editAlias();
1161 }
1162 }
1163
1167 public function copyToClipboard(): void
1168 {
1169 $ilUser = $this->user;
1170
1171 $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1172 $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
1173 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1174 }
1175
1179 public function centerAlign(): void
1180 {
1181 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1182 $std_alias_item->setHorizontalAlign("Center");
1183 $this->updateAndReturn();
1184 }
1185
1189 public function leftAlign(): void
1190 {
1191 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1192 $std_alias_item->setHorizontalAlign("Left");
1193 $this->updateAndReturn();
1194 }
1195
1199 public function rightAlign(): void
1200 {
1201 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1202 $std_alias_item->setHorizontalAlign("Right");
1203 $this->updateAndReturn();
1204 }
1205
1209 public function leftFloatAlign(): void
1210 {
1211 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1212 $std_alias_item->setHorizontalAlign("LeftFloat");
1213 $this->updateAndReturn();
1214 }
1215
1219 public function rightFloatAlign(): void
1220 {
1221 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1222 $std_alias_item->setHorizontalAlign("RightFloat");
1223 $this->updateAndReturn();
1224 }
1225
1229 public function checkStyleSelection(): bool
1230 {
1231 // check whether there is more than one style class
1232 $chars = $this->getCharacteristics();
1233
1234 if (count($chars) > 1 ||
1235 ($this->content_obj->getClass() != "" && $this->content_obj->getClass() != "Media")) {
1236 return true;
1237 }
1238 return false;
1239 }
1240
1244 public function editStyle(): void
1245 {
1246 $a_seleted_value = "";
1247
1248 $ilCtrl = $this->ctrl;
1249 $tpl = $this->tpl;
1250 $lng = $this->lng;
1251 $this->displayValidationError();
1252
1253 // edit form
1254 $form = new ilPropertyFormGUI();
1255 $form->setFormAction($ilCtrl->getFormAction($this));
1256 $form->setTitle($this->lng->txt("cont_edit_style"));
1257 // characteristic selection
1258 $char_prop = new ilSelectInputGUI(
1259 $this->lng->txt("cont_characteristic"),
1260 "characteristic"
1261 );
1262
1263 $chars = $this->getCharacteristics();
1264 if (is_object($this->content_obj)) {
1265 if (($chars[$a_seleted_value] ?? "") === "" && ($this->content_obj->getClass() !== "")) {
1266 $chars = array_merge(
1267 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1268 $chars
1269 );
1270 }
1271 }
1272
1273 $selected = $this->content_obj->getClass();
1274 if ($selected == "") {
1275 $selected = "MediaContainer";
1276 }
1277
1278 $options = [];
1279 foreach ($chars as $k => $char) {
1280 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1281 $char . '</div>';
1282 //$char_prop->addOption($k, $char, $html);
1283 $options[$k] = $char;
1284 }
1285 $char_prop->setOptions($options);
1286
1287 $char_prop->setValue($selected);
1288 $form->addItem($char_prop);
1289
1290
1291 // caption style
1292 $cap_style = new ilSelectInputGUI(
1293 $this->lng->txt("cont_caption_style"),
1294 "caption_style"
1295 );
1296 //$this->setBasicTableCellStyles();
1297 $this->setCharacteristics([]);
1298 $this->getCharacteristicsOfCurrentStyle(["media_caption"]);
1299 $chars = $this->getCharacteristics();
1300 $options = $chars;
1301 $cap_style->setOptions($options);
1302
1303 if (count($options) > 0) {
1304 $current_value = $this->content_obj->getCaptionClass() ?: "MediaCaption";
1305 $cap_style->setValue($current_value);
1306 $form->addItem($cap_style);
1307 }
1308
1309 // save button
1310 $form->addCommandButton("saveStyle", $lng->txt("save"));
1311
1312 $html = $form->getHTML();
1313 $tpl->setContent($html);
1314 }
1315
1317 {
1318 // characteristic selection
1319 $char_prop = new ilSelectInputGUI(
1320 $this->lng->txt("cont_characteristic"),
1321 "characteristic"
1322 );
1323
1324 $selected = $this->content_obj->getClass();
1325 if ($selected == "") {
1326 $selected = "MediaContainer";
1327 }
1328
1329 $chars = $this->getCharacteristics();
1330 if (is_object($this->content_obj)) {
1331 if (($chars[$selected] ?? "") == "" && ($this->content_obj->getClass() != "")) {
1332 $chars = array_merge(
1333 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1334 $chars
1335 );
1336 }
1337 }
1338
1339 $options = [];
1340 foreach ($chars as $k => $char) {
1341 $html = '<div class="ilCOPgEditStyleSelectionItem">' .
1342 $char . '</div>';
1343 //$char_prop->addOption($k, $char, $html);
1344 $options[$k] = $char;
1345 }
1346 $char_prop->setOptions($options);
1347 $char_prop->setValue($selected);
1348
1349 return $char_prop;
1350 }
1351
1355 public function saveStyle(): void
1356 {
1357 $this->content_obj->setClass(
1358 $this->request->getString("characteristic")
1359 );
1360 $this->content_obj->setCaptionClass(
1361 $this->request->getString("caption_style")
1362 );
1363
1364 $this->updated = $this->pg_obj->update();
1365 if ($this->updated === true) {
1366 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
1367 } else {
1368 $this->pg_obj->addHierIDs();
1369 $this->editStyle();
1370 }
1371 }
1372
1373 public function getTabs(
1374 bool $a_create = false,
1375 bool $a_change_obj_ref = false
1376 ): void {
1377 $ilCtrl = $this->ctrl;
1378 $ilTabs = $this->tabs;
1379
1380 if (!$a_create) {
1381 if ($this->checkStyleSelection()) {
1382 $ilTabs->addTarget(
1383 "cont_style",
1384 $ilCtrl->getLinkTarget($this, "editStyle"),
1385 "editStyle",
1386 get_class($this)
1387 );
1388 }
1389
1390 if ($this->content_obj->checkInstanceEditing()) {
1391 $ilTabs->addTarget(
1392 "cont_mob_inst_prop",
1393 $ilCtrl->getLinkTarget($this, "editAlias"),
1394 "editAlias",
1395 get_class($this)
1396 );
1397
1398 if ($this->getEnabledMapAreas()) {
1399 $st_item = $this->content_obj->getMediaObject()->getMediaItem("Standard");
1400 if (is_object($st_item)) {
1401 $format = $st_item->getFormat();
1402 if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg"))) {
1403 $ilTabs->addTarget(
1404 "cont_inst_map_areas",
1405 $ilCtrl->getLinkTargetByClass("ilpcimagemapeditorgui", "editMapAreas"),
1406 array(),
1407 "ilpcimagemapeditorgui"
1408 );
1409 }
1410 }
1411 }
1412 }
1413 } else {
1414 if ($a_change_obj_ref) {
1415 $cmd = "changeObjectReference";
1416 } else {
1417 $cmd = "insert";
1418 }
1419
1420 if ($a_change_obj_ref) {
1421 $ilCtrl->setParameter($this, "subCmd", "insertNew");
1422 $ilTabs->addSubTabTarget(
1423 "cont_new_mob",
1424 $ilCtrl->getLinkTarget($this, $cmd),
1425 $cmd
1426 );
1427
1428 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
1429 $ilTabs->addSubTabTarget(
1430 "cont_mob_from_media_pool",
1431 $ilCtrl->getLinkTarget($this, $cmd),
1432 $cmd
1433 );
1434 $ilCtrl->setParameter($this, "subCmd", "");
1435 }
1436 }
1437 }
1438
1442 public static function _getStandardCharacteristics(): array
1443 {
1445 global $DIC;
1446
1447 $lng = $DIC->language();
1448
1449 return array(
1450 "MediaContainer" => $lng->txt("cont_Media"),
1451 "MediaContainerMax50" => "MediaContainerMax50",
1452 "MediaContainerFull100" => "MediaContainerFull100",
1453 "MediaContainerHighlighted" => "MediaContainerHighlighted",
1454 "MediaContainerSeparated" => "MediaContainerSeparated"
1455 );
1456 }
1457
1461 public static function _getCharacteristics(int $a_style_id): array
1462 {
1463 $chars = self::_getStandardCharacteristics();
1464 if ($a_style_id > 0 &&
1465 ilObject::_lookupType($a_style_id) == "sty") {
1466 $style = new ilObjStyleSheet($a_style_id);
1467 $chars = $style->getCharacteristics("media_cont");
1468 $new_chars = array();
1469 foreach ($chars as $char) {
1470 if (($chars[$char] ?? "") != "") { // keep lang vars for standard chars
1471 $new_chars[$char] = $chars[$char];
1472 } else {
1473 $new_chars[$char] = $char;
1474 }
1475 asort($new_chars);
1476 }
1477 $chars = $new_chars;
1478 }
1479 return $chars;
1480 }
1481}
setFormAction(string $a_formaction)
This class represents a section header in a property form.
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...
static lookupForeignId(int $a_id)
TableGUI class for recent changes in wiki.
This class represents a non editable value in a property form.
Editing User Interface for MediaObjects within LMs (see ILIAS DTD)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjStyleSheet.
User class.
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
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...
static _getCharacteristics(int $a_style_id)
Get characteristics.
insertFromPool(bool $a_change_obj_ref=false)
Insert media object from pool.
rightFloatAlign()
align media object to right, floating text
ILIAS MediaObjects MediaType MediaTypeManager $media_type
setHeader(string $a_title="")
getTabs(bool $a_create=false, bool $a_change_obj_ref=false)
initAliasForm()
Init alias form.
leftFloatAlign()
align media object to left, floating text
setSubCmd(string $a_val)
Set table sub command.
leftAlign()
align media object to left
copyToClipboard()
copy media object to clipboard
poolSelection(bool $a_change_obj_ref=false)
Pool Selection.
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
getAliasValues()
Put alias values into form.
centerAlign()
align media object to center
edit()
edit properties form
rightAlign()
align media object to right
createNewObjectReference()
Create new media object and replace currrent media item with it.
checkStyleSelection()
Checks whether style selection shoudl be available or not.
selectPool(bool $a_change_obj_ref=false)
Select concrete pool.
selectObjectReference()
Create new media object and replace currrent media item with it.
changeObjectReference()
Change object reference.
insert( $a_post_cmd="edpost", $a_submit_cmd="", $a_input_error=false)
setEnabledMapAreas(bool $a_enabledmapareas)
Set Enable map areas.
saveAliasProperties()
save table properties in db and return to page edit screen
create(bool $a_create_alias=true, bool $a_change_obj_ref=false)
create new media object in dom and update page in db
Class ilPCMediaObject Media content object (see ILIAS DTD)
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
ilGlobalTemplateInterface $tpl
setCharacteristics(array $a_chars)
Content object of ilPageObject (see ILIAS DTD).
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
getHierIdsForPCIds(array $a_pc_ids)
Get hier ids for a set of pc ids.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
ILIAS Setting Class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static extractParameterString(string $a_parstr)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setContent(string $a_html)
Sets content for standard template.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form( $class_path, string $cmd, string $submit_caption="")
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26
$lm_set