34 protected \ILIAS\DI\UIServices
$ui;
38 protected \ILIAS\MediaObjects\MediaType\MediaTypeManager
$media_type;
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();
64 $this->media_type = $DIC->mediaObjects()
70 if (
$pc_id !=
"" && $a_hier_id ==
"") {
72 $a_hier_id = $hier_ids[
$pc_id] ??
"";
73 $ilCtrl->setParameter($this,
"hier_id", $a_hier_id);
76 $this->pool_view =
"folder";
78 $pv =
$request->getString(
"pool_view");
79 if (in_array($pv, array(
"folder",
"all"))) {
80 $this->pool_view = $pv;
83 $this->
ctrl = $ilCtrl;
85 $this->
ctrl->saveParameter($this, [
"pool_view",
"pcid"]);
97 $this->sub_cmd = $a_val;
121 $this->enabledmapareas = $a_enabledmapareas;
133 public function executeCommand()
142 $next_class = $this->
ctrl->getNextClass($this);
145 $cmd = $this->
ctrl->getCmd();
146 if (is_object($this->content_obj)) {
151 $mob = $this->content_obj->getMediaObject();
152 if (is_object($mob)) {
154 $this->content_obj->getMediaObject()->getTitle());
155 $mob_gui =
new ilObjMediaObjectGUI(
"", $this->content_obj->getMediaObject()->getId(),
false,
false);
162 switch ($next_class) {
163 case "ilobjmediaobjectgui":
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);
171 $ret = $this->
ctrl->forwardCommand($mob_gui);
175 case "ilpcimagemapeditorgui":
176 $ilTabs->setTabActive(
"cont_inst_map_areas");
184 $ret = $this->
ctrl->forwardCommand($image_map_edit);
190 $ret = $this->$cmd();
198 $a_post_cmd =
"edpost",
199 $a_submit_cmd =
"create_mob",
200 $a_input_error =
false 209 if (in_array(
$sub_command, [
"insertNew",
"insertFromPool"])) {
213 if ((
$sub_command ==
"") && $this->edit_repo->getSubCmd() !=
"") {
218 case "insertFromPool":
222 case "poolSelection":
233 $ilTabs->setSubTabActive(
"cont_new_mob");
235 if ($a_input_error) {
239 $mob_gui->initForm(
"create");
240 $form = $mob_gui->getForm();
242 $form->
setFormAction($ilCtrl->getFormAction($this,
"create_mob"));
266 if (in_array(
$sub_command, [
"insertNew",
"insertFromPool"])) {
270 if ((
$sub_command ==
"") && $this->edit_repo->getSubCmd() !=
"") {
275 case "insertFromPool":
279 case "poolSelection":
289 $ilCtrl->setParameter($this,
"subCmd",
"changeObjectReference");
291 $ilTabs->setSubTabActive(
"cont_new_mob");
296 $mob_gui->initForm(
"create");
297 $form = $mob_gui->getForm();
302 $this->tpl->setContent($form->
getHTML());
308 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
309 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
312 if (($std_alias_item->getWidth() !=
"" && $std_alias_item->getHeight() !=
"")) {
315 if ($std_alias_item->getWidth() ==
"" && $std_alias_item->getHeight() ==
"" 316 && $std_item->getWidth() !=
"" && $std_item->getHeight() !=
"") {
321 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"mob_no_fixed_size_map_editing"));
337 if ($this->edit_repo->getMediaPool() > 0 &&
338 $ilAccess->checkAccess(
"write",
"", $this->edit_repo->getMediaPool())
344 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
345 if ($a_change_obj_ref) {
347 $lng->
txt(
"cont_switch_to_media_pool"),
348 $ilCtrl->getLinkTarget($this,
"changeObjectReference")
352 $lng->
txt(
"cont_switch_to_media_pool"),
353 $ilCtrl->getLinkTarget($this,
"insert")
356 $ilCtrl->setParameter($this,
"subCmd",
"");
360 $tcmd = ($a_change_obj_ref)
361 ?
"changeObjectReference" 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")
373 $tb->addComponent($view_control);
375 $html = $tb->getHTML();
377 $this->
getTabs(
true, $a_change_obj_ref);
378 $ilTabs->setSubTabActive(
"cont_mob_from_media_pool");
381 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
382 $tcmd = ($a_change_obj_ref)
383 ?
"changeObjectReference" 385 $tmode = ($a_change_obj_ref)
390 if ($this->
getSubCmd() ==
"applyFilter") {
397 $this->pool_view ==
"all" 399 $mpool_table->resetOffset();
400 $mpool_table->writeFilterToSession();
402 if ($this->
getSubCmd() ==
"resetFilter") {
409 $this->pool_view ==
"all" 411 $mpool_table->resetOffset();
412 $mpool_table->resetFilter();
420 $this->pool_view ==
"all" 423 $html .= $mpool_table->getHTML();
435 bool $a_change_obj_ref =
false 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");
444 $ilCtrl->redirect($this,
"insert");
452 bool $a_change_obj_ref =
false 458 $this->
getTabs(
true, $a_change_obj_ref);
459 $ilTabs->setSubTabActive(
"cont_mob_from_media_pool");
461 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
462 if ($a_change_obj_ref) {
463 $exp =
new ilPoolSelectorGUI($this,
"changeObjectReference", $this,
"changeObjectReference");
469 $exp->setTypeWhiteList(array(
"root",
"cat",
"grp",
"fold",
"crs",
"mep"));
470 $exp->setClickableTypes(array(
'mep'));
472 if (!$exp->handleCommand()) {
484 $this->
create(
false,
true);
495 $ids = $this->request->getIntArray(
"id");
496 if (count($ids) == 1) {
498 $this->content_obj->readMediaObject($fid);
499 $this->content_obj->updateObjectReference();
500 $this->updated = $this->pg_obj->update();
502 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_select_max_one_item"),
true);
503 $ilCtrl->redirect($this,
"changeObjectReference");
505 $ilCtrl->redirect($this,
"editAlias");
512 bool $a_create_alias =
true,
513 bool $a_change_obj_ref =
false 518 if ($this->sub_command ==
"insertFromPool") {
519 $ids = $this->request->getIntArray(
"id");
520 for ($i = count($ids) - 1; $i >= 0; $i--) {
523 $this->content_obj->readMediaObject($fid);
524 $this->content_obj->createAlias(
526 $this->request->getHierId(),
530 $this->updated = $this->pg_obj->update();
537 $mob_gui->initForm(
"create");
539 if (!$mob_gui->checkFormInput()) {
540 $this->
form = $mob_gui->getForm();
541 $this->
insert(
"edpost",
"create_mob",
true);
545 if ($a_change_obj_ref !=
true) {
548 $this->content_obj->createMediaObject();
549 $media_obj = $this->content_obj->getMediaObject();
551 $mob_gui->setObjectPerCreationForm($media_obj);
553 if ($a_create_alias) {
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");
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");
591 if ($this->content_obj->checkInstanceEditing()) {
592 $this->
ctrl->redirect($this,
"editAlias");
594 $this->
ctrl->redirectByClass(
"ilobjmediaobjectgui",
"edit");
617 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
621 $this->form_gui->addItem($title);
623 $this->
lng->txt(
"cont_" . strtolower($std_item->getLocationType())),
626 $this->form_gui->addItem($loc);
628 $this->
lng->txt(
"cont_format"),
631 $this->form_gui->addItem($format);
635 $orig_size = $std_item->getOriginalSize();
636 $add_str = (!is_null($orig_size))
637 ?
" (" . $orig_size[
"width"] .
" x " . $orig_size[
"height"] .
")" 641 $radio_size->addOption($op1);
645 " / " .
$lng->
txt(
"cont_height"),
"st_width_height");
646 if (is_int(strpos($std_item->getFormat(),
"image"))
647 && $std_item->getLocationType() ===
"LocalFile") {
649 $width_height->setConstrainProportions(
true);
653 $radio_size->addOption($op2);
654 $this->form_gui->addItem($radio_size);
662 $rad_caption->addOption($op1);
665 $caption->setCols(30);
666 $caption->setRows(2);
673 $rad_caption->addOption($op2);
674 $this->form_gui->addItem($rad_caption);
677 if ($this->media_type->usesAltTextProperty($std_item->getFormat())) {
686 $rad_tr->addOption($op1);
688 $rad_tr->addOption($op2);
689 $this->form_gui->addItem($rad_tr);
690 $rad_tr->setInfo(
$lng->
txt(
"text_repr_info"));
694 if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
695 if ($this->media_type->usesAutoStartParameterOnly(
696 $std_item->getLocation(),
697 $std_item->getFormat()
720 $rad_parameters->addOption($op1);
726 $rad_parameters->addOption($op2);
727 $this->form_gui->addItem($rad_parameters);
732 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
733 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
736 $fs_sec->setTitle(
$lng->
txt(
"cont_fullscreen"));
737 $this->form_gui->addItem($fs_sec);
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);
751 $this->
lng->txt(
"cont_format"),
754 $this->form_gui->addItem($format);
758 $fw_size = $std_item->getOriginalSize();
759 $add_str = (!is_null($fw_size))
760 ?
" (" . $fw_size[
"width"] .
" x " . $fw_size[
"height"] .
")" 764 $radio_size->addOption($op1);
768 " / " .
$lng->
txt(
"cont_height"),
"full_width_height");
769 if (is_int(strpos($full_item->getFormat(),
"image"))
770 && $full_item->getLocationType() ===
"LocalFile") {
772 $width_height->setConstrainProportions(
true);
776 $radio_size->addOption($op2);
777 $this->form_gui->addItem($radio_size);
785 $rad_caption->addOption($op1);
788 $caption->setCols(30);
789 $caption->setRows(2);
796 $rad_caption->addOption($op2);
797 $this->form_gui->addItem($rad_caption);
800 if (substr($full_item->getFormat(), 0, 5) ==
"image") {
809 $rad_tr->addOption($op1);
811 $rad_tr->addOption($op2);
812 $this->form_gui->addItem($rad_tr);
813 $rad_tr->setInfo(
$lng->
txt(
"text_repr_info"));
817 if ($this->media_type->usesParameterProperty($full_item->getFormat())) {
818 if ($this->media_type->usesAutoStartParameterOnly(
819 $full_item->getLocation(),
820 $full_item->getFormat()
843 $rad_parameters->addOption($op1);
849 $rad_parameters->addOption($op2);
850 $this->form_gui->addItem($rad_parameters);
855 $this->form_gui->setTitle(
$lng->
txt(
"cont_edit_mob_alias_prop"));
856 $this->form_gui->addCommandButton(
"saveAliasProperties",
$lng->
txt(
"save"));
858 if (
$lm_set->get(
"replace_mob_feature")) {
859 $this->form_gui->addCommandButton(
"changeObjectReference",
$lng->
txt(
"cont_change_object_reference"));
861 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
873 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
874 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
876 $values[
"title"] = $this->content_obj->getMediaObject()->getTitle();
877 $values[
"st_location"] = $std_item->getLocation();
878 $values[
"st_format"] = $std_item->getFormat();
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;
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;
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;
901 $values[
"st_caption"] = $std_alias_item->getCaption();
902 if (trim($std_item->getCaption()) ==
"") {
903 $values[
"def_caption"] =
$lng->
txt(
"cont_no_caption");
905 $values[
"def_caption"] = $std_item->getCaption();
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");
913 $values[
"def_text_representation"] = $std_item->getTextRepresentation();
917 if ($this->media_type->usesAutoStartParameterOnly(
918 $std_item->getLocation(),
919 $std_item->getFormat()
927 $values[
"st_parameters"] = $std_alias_item->getParameterString();
931 $values[
"st_derive_size"] = $std_alias_item->definesSize()
934 $values[
"st_derive_caption"] = $std_alias_item->definesCaption()
937 $values[
"st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
940 $values[
"st_derive_parameters"] = $std_alias_item->definesParameters()
943 if (trim($std_item->getParameterString()) ==
"") {
944 $values[
"def_parameters"] =
"<i>" .
$lng->
txt(
"cont_no_parameters") .
"</i>";
946 $values[
"def_parameters"] = $std_item->getParameterString();
950 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
951 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
952 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
954 $values[
"fullscreen"] =
"n";
955 if ($full_alias_item->exists()) {
956 $values[
"fullscreen"] =
"y";
959 $values[
"full_location"] = $full_item->getLocation();
960 $values[
"full_format"] = $full_item->getFormat();
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;
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;
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;
981 $values[
"full_caption"] = $full_alias_item->getCaption();
982 if (trim($full_item->getCaption()) ==
"") {
983 $values[
"full_def_caption"] =
$lng->
txt(
"cont_no_caption");
985 $values[
"full_def_caption"] = $full_item->getCaption();
987 $values[
"full_text_representation"] = $full_alias_item->getTextRepresentation();
988 if (trim($full_item->getTextRepresentation()) ==
"") {
989 $values[
"full_def_text_representation"] =
$lng->
txt(
"cont_no_text");
991 $values[
"full_def_text_representation"] = $full_item->getTextRepresentation();
993 $values[
"full_parameters"] = $full_alias_item->getParameterString();
994 $values[
"full_derive_size"] = $full_alias_item->definesSize()
997 $values[
"full_derive_caption"] = $full_alias_item->definesCaption()
1000 $values[
"full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
1005 if ($this->media_type->usesAutoStartParameterOnly(
1006 $full_item->getLocation(),
1007 $full_item->getFormat()
1015 $values[
"full_parameters"] = $full_alias_item->getParameterString();
1018 $values[
"full_derive_parameters"] = $full_alias_item->definesParameters()
1021 if (trim($full_item->getParameterString()) ==
"") {
1022 $values[
"full_def_parameters"] =
"<i>" .
$lng->
txt(
"cont_no_parameters") .
"</i>";
1024 $values[
"full_def_parameters"] = $full_item->getParameterString();
1028 $this->form_gui->setValuesByArray($values,
true);
1040 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1041 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
1042 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
1043 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
1046 if ($form->
getInput(
"st_derive_size") ==
"y") {
1047 $std_alias_item->deriveSize();
1049 $size = $this->request->getStringArray(
"st_width_height");
1050 $std_alias_item->setWidth($size[
"width"]);
1051 $std_alias_item->setHeight($size[
"height"]);
1055 if ($form->
getInput(
"st_derive_caption") ==
"y") {
1056 $std_alias_item->deriveCaption();
1058 $std_alias_item->setCaption($form->
getInput(
"st_caption"));
1062 if ($form->
getInput(
"st_derive_text_representation") ==
"y") {
1063 $std_alias_item->deriveTextRepresentation();
1065 $std_alias_item->setTextRepresentation(
1066 $form->
getInput(
"st_text_representation")
1071 if ($form->
getInput(
"st_derive_parameters") ==
"y") {
1072 $std_alias_item->deriveParameters();
1074 if ($this->media_type->usesAutoStartParameterOnly(
1075 $std_item->getLocation(),
1076 $std_item->getFormat()
1080 $std_alias_item->setParameters(
1088 if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1089 if ($form->
getInput(
"fullscreen") ==
"y") {
1090 if (!$full_alias_item->exists()) {
1091 $full_alias_item->insert();
1095 if ($form->
getInput(
"full_derive_size") ==
"y") {
1096 $full_alias_item->deriveSize();
1098 $full_size = $this->request->getStringArray(
"full_width_height");
1099 $full_alias_item->setWidth($full_size[
"width"]);
1100 $full_alias_item->setHeight($full_size[
"height"]);
1104 if ($form->
getInput(
"full_derive_caption") ==
"y") {
1105 $full_alias_item->deriveCaption();
1107 $full_alias_item->setCaption($form->
getInput(
"full_caption"));
1111 if ($form->
getInput(
"full_derive_text_representation") ==
"y") {
1112 $full_alias_item->deriveTextRepresentation();
1114 $full_alias_item->setTextRepresentation(
1115 $form->
getInput(
"full_text_representation")
1120 if ($form->
getInput(
"full_derive_parameters") ==
"y") {
1121 $full_alias_item->deriveParameters();
1123 if ($this->media_type->usesAutoStartParameterOnly(
1124 $full_item->getLocation(),
1125 $full_item->getFormat()
1133 if ($full_alias_item->exists()) {
1134 $full_alias_item->delete();
1139 $this->updated = $this->pg_obj->update();
1140 if ($this->updated ===
true) {
1141 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1142 $this->
ctrl->redirect($this,
"editAlias");
1143 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
1145 $this->pg_obj->addHierIDs();
1157 $ilUser->
addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1158 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"copied_to_clipboard"),
true);
1159 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
1167 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1168 $std_alias_item->setHorizontalAlign(
"Center");
1177 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1178 $std_alias_item->setHorizontalAlign(
"Left");
1187 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1188 $std_alias_item->setHorizontalAlign(
"Right");
1197 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1198 $std_alias_item->setHorizontalAlign(
"LeftFloat");
1207 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1208 $std_alias_item->setHorizontalAlign(
"RightFloat");
1221 ($this->content_obj->getClass() !=
"" && $this->content_obj->getClass() !=
"Media")) {
1232 $a_seleted_value =
"";
1243 $form->
setTitle($this->
lng->txt(
"cont_edit_style"));
1247 $this->
lng->txt(
"cont_characteristic"),
1252 if (is_object($this->content_obj)) {
1253 if (($chars[$a_seleted_value] ??
"") ===
"" && ($this->content_obj->getClass() !==
"")) {
1254 $chars = array_merge(
1255 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1261 $selected = $this->content_obj->getClass();
1262 if ($selected ==
"") {
1263 $selected =
"MediaContainer";
1266 foreach ($chars as $k => $char) {
1267 $html =
'<div class="ilCOPgEditStyleSelectionItem">' .
1269 $char_prop->addOption($k, $char, $html);
1272 $char_prop->setValue($selected);
1278 $this->
lng->txt(
"cont_caption_style"),
1287 foreach ($options as $k => $option) {
1288 $html =
'<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k .
'">' .
1289 $option .
'</td></tr></table>';
1290 $cap_style->addOption($k, $option, $html);
1293 if (count($options) > 0) {
1294 $current_value = $this->content_obj->getCaptionClass() ?:
"MediaCaption";
1295 $cap_style->setValue($current_value);
1312 $this->
lng->txt(
"cont_characteristic"),
1316 $selected = $this->content_obj->getClass();
1317 if ($selected ==
"") {
1318 $selected =
"MediaContainer";
1322 if (is_object($this->content_obj)) {
1323 if ((
$chars[$selected] ??
"") ==
"" && ($this->content_obj->getClass() !=
"")) {
1325 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1331 foreach (
$chars as $k => $char) {
1332 $html =
'<div class="ilCOPgEditStyleSelectionItem">' .
1334 $char_prop->addOption($k, $char, $html);
1337 $char_prop->setValue($selected);
1347 $this->content_obj->setClass(
1348 $this->request->getString(
"characteristic")
1350 $this->content_obj->setCaptionClass(
1351 $this->request->getString(
"caption_style")
1354 $this->updated = $this->pg_obj->update();
1355 if ($this->updated ===
true) {
1356 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
1358 $this->pg_obj->addHierIDs();
1364 bool $a_create =
false,
1365 bool $a_change_obj_ref =
false 1374 $ilCtrl->getLinkTarget($this,
"editStyle"),
1380 if ($this->content_obj->checkInstanceEditing()) {
1382 "cont_mob_inst_prop",
1383 $ilCtrl->getLinkTarget($this,
"editAlias"),
1389 $st_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
1390 if (is_object($st_item)) {
1391 $format = $st_item->getFormat();
1392 if (substr($format, 0, 5) ==
"image" && !is_int(strpos($format,
"svg"))) {
1394 "cont_inst_map_areas",
1395 $ilCtrl->getLinkTargetByClass(
"ilpcimagemapeditorgui",
"editMapAreas"),
1397 "ilpcimagemapeditorgui" 1404 if ($a_change_obj_ref) {
1405 $cmd =
"changeObjectReference";
1410 if ($a_change_obj_ref) {
1411 $ilCtrl->setParameter($this,
"subCmd",
"insertNew");
1412 $ilTabs->addSubTabTarget(
1414 $ilCtrl->getLinkTarget($this, $cmd),
1418 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
1419 $ilTabs->addSubTabTarget(
1420 "cont_mob_from_media_pool",
1421 $ilCtrl->getLinkTarget($this, $cmd),
1424 $ilCtrl->setParameter($this,
"subCmd",
"");
1432 public static function _getStandardCharacteristics(): array
1437 $lng = $DIC->language();
1440 "MediaContainer" =>
$lng->
txt(
"cont_Media"),
1441 "MediaContainerMax50" =>
"MediaContainerMax50",
1442 "MediaContainerFull100" =>
"MediaContainerFull100",
1443 "MediaContainerHighlighted" =>
"MediaContainerHighlighted",
1444 "MediaContainerSeparated" =>
"MediaContainerSeparated" 1453 $chars = self::_getStandardCharacteristics();
1454 if ($a_style_id > 0 &&
1458 $new_chars = array();
1459 foreach (
$chars as $char) {
1460 if ((
$chars[$char] ??
"") !=
"") {
1461 $new_chars[$char] =
$chars[$char];
1463 $new_chars[$char] = $char;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPageContent $content_obj
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
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...
addTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setHierId(string $a_hier_id)
set hierarchical id in dom object
redirectToParent(string $hier_id="")
loadLanguageModule(string $a_module)
Load language module.
setCharacteristics(array $a_chars)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
Content object of ilPageObject (see ILIAS DTD).
addObjectToClipboard(int $a_item_id, string $a_type, string $a_title, int $a_parent=0, string $a_time="", int $a_order_nr=0)
add an item to user's personal clipboard
static _lookupObjId(int $ref_id)
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getHierIdsForPCIds(array $a_pc_ids)
Get hier ids for a set of pc ids.
setContent(string $a_html)
Sets content for standard template.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
ilGlobalTemplateInterface $tpl
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
User interface class for page content map editor.
form( $class_path, string $cmd, string $submit_caption="")
getCharacteristics(string $a_type="", bool $a_no_hidden=false, bool $a_include_core=true)
Get characteristics.
static extractParameterString(string $a_parstr)
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...
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
static _lookupType(int $id, bool $reference=false)