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