4 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
5 require_once(
"./Services/COPage/classes/class.ilMediaAliasItem.php");
6 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
70 $this->tpl = $DIC[
"tpl"];
71 $this->lng = $DIC->language();
72 $this->tabs = $DIC->tabs();
73 $this->access = $DIC->access();
74 $this->toolbar = $DIC->toolbar();
75 $this->
user = $DIC->user();
76 $ilCtrl = $DIC->ctrl();
77 $this->
ui = $DIC->ui();
81 if (
$_GET[
"pcid"] !=
"" && $a_hier_id ==
"") {
83 $a_hier_id = $hier_ids[
$_GET[
"pcid"]];
84 $ilCtrl->setParameter($this,
"hier_id", $a_hier_id);
87 $this->pool_view =
"folder";
88 if (in_array(
$_GET[
"pool_view"], array(
"folder",
"all"))) {
89 $this->pool_view =
$_GET[
"pool_view"];
92 $this->ctrl = $ilCtrl;
94 $this->ctrl->saveParameter($this, [
"pool_view",
"pcid"]);
111 $this->sub_cmd = $a_val;
127 $this->header = $a_title;
142 $this->enabledmapareas = $a_enabledmapareas;
152 return $this->enabledmapareas;
167 $next_class = $this->ctrl->getNextClass($this);
170 $cmd = $this->ctrl->getCmd();
171 if (is_object($this->content_obj)) {
174 $this->
getTabs($this->tabs_gui);
176 $mob = $this->content_obj->getMediaObject();
177 if (is_object($mob)) {
178 $tpl->setTitle(
$lng->txt(
"mob") .
": " .
179 $this->content_obj->getMediaObject()->getTitle());
180 $mob_gui =
new ilObjMediaObjectGUI(
"", $this->content_obj->getMediaObject()->getId(),
false,
false);
183 $mob_gui->getTabs($this->tabs_gui);
188 switch ($next_class) {
189 case "ilobjmediaobjectgui":
190 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
193 $this->tpl->setTitle($this->lng->txt(
"mob") .
": " .
194 $this->content_obj->getMediaObject()->getTitle());
195 $mob_gui =
new ilObjMediaObjectGUI(
"", $this->content_obj->getMediaObject()->getId(),
false,
false);
198 $ret = $this->ctrl->forwardCommand($mob_gui);
202 case "ilpcimagemapeditorgui":
203 require_once(
"./Services/COPage/classes/class.ilPCImageMapEditorGUI.php");
204 $ilTabs->setTabActive(
"cont_inst_map_areas");
209 $ret = $this->ctrl->forwardCommand($image_map_edit);
215 $ret = $this->$cmd();
225 public function insert($a_post_cmd =
"edpost", $a_submit_cmd =
"create_mob", $a_input_error =
false)
232 if (
$_GET[
"subCmd"] ==
"insertNew") {
233 $_SESSION[
"cont_media_insert"] =
"insertNew";
235 if (
$_GET[
"subCmd"] ==
"insertFromPool") {
236 $_SESSION[
"cont_media_insert"] =
"insertFromPool";
239 if ((
$_GET[
"subCmd"] ==
"") &&
$_SESSION[
"cont_media_insert"] !=
"") {
243 switch (
$_GET[
"subCmd"]) {
244 case "insertFromPool":
248 case "poolSelection":
259 $ilTabs->setSubTabActive(
"cont_new_mob");
261 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
262 if ($a_input_error) {
266 $mob_gui->initForm(
"create");
267 $form = $mob_gui->getForm();
269 $form->setFormAction($ilCtrl->getFormAction($this,
"create_mob"));
270 $form->clearCommandButtons();
271 $form->addCommandButton(
"create_mob",
$lng->txt(
"save"));
272 $form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
276 $tpl->setContent($form->getHTML());
291 if (
$_GET[
"subCmd"] ==
"insertNew") {
292 $_SESSION[
"cont_media_insert"] =
"insertNew";
294 if (
$_GET[
"subCmd"] ==
"insertFromPool") {
295 $_SESSION[
"cont_media_insert"] =
"insertFromPool";
298 if ((
$_GET[
"subCmd"] ==
"") &&
$_SESSION[
"cont_media_insert"] !=
"") {
302 switch (
$_GET[
"subCmd"]) {
303 case "insertFromPool":
307 case "poolSelection":
317 $ilCtrl->setParameter($this,
"subCmd",
"changeObjectReference");
318 $this->
getTabs($ilTabs,
true,
true);
319 $ilTabs->setSubTabActive(
"cont_new_mob");
324 $mob_gui->initForm(
"create");
325 $form = $mob_gui->getForm();
326 $form->setFormAction($ilCtrl->getFormAction($this));
327 $form->clearCommandButtons();
328 $form->addCommandButton(
"createNewObjectReference",
$lng->txt(
"save"));
329 $form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
330 $this->tpl->setContent($form->getHTML());
340 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
341 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
344 if (($std_alias_item->getWidth() !=
"" && $std_alias_item->getHeight() !=
"")) {
347 if ($std_alias_item->getWidth() ==
"" && $std_alias_item->getHeight() ==
"" 348 && $std_item->getWidth() !=
"" && $std_item->getHeight() !=
"") {
369 if (
$_SESSION[
"cont_media_pool"] !=
"" &&
370 $ilAccess->checkAccess(
"write",
"",
$_SESSION[
"cont_media_pool"])
376 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
377 if ($a_change_obj_ref) {
379 $lng->txt(
"cont_switch_to_media_pool"),
380 $ilCtrl->getLinkTarget($this,
"changeObjectReference")
384 $lng->txt(
"cont_switch_to_media_pool"),
385 $ilCtrl->getLinkTarget($this,
"insert")
388 $ilCtrl->setParameter($this,
"subCmd",
"");
392 $tcmd = ($a_change_obj_ref)
393 ?
"changeObjectReference" 395 $lng->loadLanguageModule(
"mep");
396 $ilCtrl->setParameter($this,
"pool_view",
"folder");
397 $actions[
$lng->txt(
"folders")] = $ilCtrl->getLinkTarget($this, $tcmd);
398 $ilCtrl->setParameter($this,
"pool_view",
"all");
399 $actions[
$lng->txt(
"mep_all_mobs")] = $ilCtrl->getLinkTarget($this, $tcmd);
400 $ilCtrl->setParameter($this,
"pool_view", $this->pool_view);
401 $aria_label =
$lng->txt(
"cont_change_pool_view");
402 $view_control =
$f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view ==
"folder")
403 ?
$lng->txt(
"folders") :
$lng->txt(
"mep_all_mobs"));
405 $tb->addComponent($view_control);
407 $html = $tb->getHTML();
409 $this->
getTabs($ilTabs,
true, $a_change_obj_ref);
410 $ilTabs->setSubTabActive(
"cont_mob_from_media_pool");
415 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
416 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
418 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
419 $tcmd = ($a_change_obj_ref)
420 ?
"changeObjectReference" 422 $tmode = ($a_change_obj_ref)
427 if ($this->
getSubCmd() ==
"applyFilter") {
434 $this->pool_view ==
"all" 436 $mpool_table->resetOffset();
437 $mpool_table->writeFilterToSession();
439 if ($this->
getSubCmd() ==
"resetFilter") {
446 $this->pool_view ==
"all" 448 $mpool_table->resetOffset();
449 $mpool_table->resetFilter();
457 $this->pool_view ==
"all" 460 $html .= $mpool_table->getHTML();
462 $tpl->setContent($html);
476 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
477 if ($a_change_obj_ref) {
478 $ilCtrl->redirect($this,
"changeObjectReference");
480 $ilCtrl->redirect($this,
"insert");
493 $this->
getTabs($ilTabs,
true, $a_change_obj_ref);
494 $ilTabs->setSubTabActive(
"cont_mob_from_media_pool");
496 include_once
"./Services/COPage/classes/class.ilPoolSelectorGUI.php";
498 if ($a_change_obj_ref) {
499 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
500 $exp =
new ilPoolSelectorGUI($this,
"changeObjectReference", $this,
"changeObjectReference");
502 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
507 $exp->setTypeWhiteList(array(
"root",
"cat",
"grp",
"fold",
"crs",
"mep"));
508 $exp->setClickableTypes(array(
'mep'));
510 if (!$exp->handleCommand()) {
511 $tpl->setContent($exp->getHTML());
522 $this->
create(
false,
true);
533 if (is_array(
$_POST[
"id"]) && count(
$_POST[
"id"]) == 1) {
534 include_once(
"./Services/COPage/classes/class.ilPCMediaObject.php");
535 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
537 $this->content_obj->readMediaObject($fid);
538 $this->content_obj->updateObjectReference();
539 $this->updated = $this->pg_obj->update();
542 $ilCtrl->redirect($this,
"changeObjectReference");
544 $ilCtrl->redirect($this,
"editAlias");
550 public function &
create($a_create_alias =
true, $a_change_obj_ref =
false)
555 if (
$_GET[
"subCmd"] ==
"insertFromPool") {
556 if (is_array(
$_POST[
"id"])) {
558 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
560 include_once(
"./Services/COPage/classes/class.ilPCMediaObject.php");
562 $this->content_obj->readMediaObject($fid);
563 $this->content_obj->createAlias($this->pg_obj,
$_GET[
"hier_id"], $this->pc_id);
565 $this->updated = $this->pg_obj->update();
573 $mob_gui->initForm(
"create");
575 if (!$mob_gui->checkFormInput()) {
576 $this->form = $mob_gui->getForm();
577 $this->
insert(
"edpost",
"create_mob",
true);
581 include_once(
"./Services/COPage/classes/class.ilPCMediaObject.php");
582 if ($a_change_obj_ref !=
true) {
585 $this->content_obj->createMediaObject();
586 $media_obj = $this->content_obj->getMediaObject();
588 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
591 if ($a_create_alias) {
595 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
596 $this->updated = $this->pg_obj->update();
597 if ($this->updated ===
true) {
598 $this->pg_obj->stripHierIDs();
599 $this->pg_obj->addHierIDs();
600 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
601 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
602 $this->content_obj->setHierId($this->content_obj->readHierId());
603 $this->
setHierId($this->content_obj->readHierId());
604 $this->content_obj->setPCId($this->content_obj->readPCId());
605 ilUtil::sendSuccess(
$lng->txt(
"saved_media_object"),
true);
606 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"edit");
613 if ($a_change_obj_ref ==
true) {
614 $this->content_obj->updateObjectReference();
615 $this->updated = $this->pg_obj->update();
616 $this->ctrl->redirect($this,
"editAlias");
628 if ($this->content_obj->checkInstanceEditing()) {
629 $this->ctrl->redirect($this,
"editAlias");
631 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"edit");
643 $tpl->setContent($this->form_gui->getHTML());
654 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
659 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
663 $this->form_gui->addItem($title);
665 $this->lng->txt(
"cont_" . strtolower($std_item->getLocationType())),
668 $this->form_gui->addItem($loc);
670 $this->lng->txt(
"cont_format"),
673 $this->form_gui->addItem(
$format);
677 $orig_size = $std_item->getOriginalSize();
678 $add_str = ($orig_size[
"width"] !=
"" && $orig_size[
"height"] !=
"")
679 ?
" (" . $orig_size[
"width"] .
" x " . $orig_size[
"height"] .
")" 683 $radio_size->addOption($op1);
686 include_once(
"./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
688 " / " .
$lng->txt(
"cont_height"),
"st_width_height");
692 $radio_size->addOption($op2);
693 $this->form_gui->addItem($radio_size);
701 $rad_caption->addOption($op1);
704 $caption->setCols(30);
705 $caption->setRows(2);
712 $rad_caption->addOption($op2);
713 $this->form_gui->addItem($rad_caption);
716 if ($this->media_type->usesAltTextProperty($std_item->getFormat())) {
725 $rad_tr->addOption($op1);
727 $rad_tr->addOption($op2);
728 $this->form_gui->addItem($rad_tr);
729 $rad_tr->setInfo(
$lng->txt(
"text_repr_info"));
733 if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
734 if ($this->media_type->usesAutoStartParameterOnly(
735 $std_item->getLocation(),
736 $std_item->getFormat()
759 $rad_parameters->addOption($op1);
765 $rad_parameters->addOption($op2);
766 $this->form_gui->addItem($rad_parameters);
771 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
772 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
775 $fs_sec->setTitle(
$lng->txt(
"cont_fullscreen"));
776 $this->form_gui->addItem($fs_sec);
782 $radio_prop->addOption($op1);
783 $op2 =
new ilRadioOption($this->lng->txt(
"cont_" . strtolower($full_item->getLocationType())) .
": " .
784 $full_item->getLocation(),
"y");
785 $radio_prop->addOption($op2);
786 $this->form_gui->addItem($radio_prop);
790 $this->lng->txt(
"cont_format"),
793 $this->form_gui->addItem(
$format);
797 $fw_size = $std_item->getOriginalSize();
798 $add_str = ($fw_size[
"width"] !=
"" && $fw_size[
"height"] !=
"")
799 ?
" (" . $fw_size[
"width"] .
" x " . $fw_size[
"height"] .
")" 803 $radio_size->addOption($op1);
806 include_once(
"./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
808 " / " .
$lng->txt(
"cont_height"),
"full_width_height");
812 $radio_size->addOption($op2);
813 $this->form_gui->addItem($radio_size);
821 $rad_caption->addOption($op1);
824 $caption->setCols(30);
825 $caption->setRows(2);
832 $rad_caption->addOption($op2);
833 $this->form_gui->addItem($rad_caption);
836 if (substr($full_item->getFormat(), 0, 5) ==
"image") {
845 $rad_tr->addOption($op1);
847 $rad_tr->addOption($op2);
848 $this->form_gui->addItem($rad_tr);
849 $rad_tr->setInfo(
$lng->txt(
"text_repr_info"));
853 if ($this->media_type->usesParameterProperty($full_item->getFormat())) {
854 if ($this->media_type->usesAutoStartParameterOnly(
855 $full_item->getLocation(),
856 $full_item->getFormat()
879 $rad_parameters->addOption($op1);
885 $rad_parameters->addOption($op2);
886 $this->form_gui->addItem($rad_parameters);
891 $this->form_gui->setTitle(
$lng->txt(
"cont_edit_mob_alias_prop"));
892 $this->form_gui->addCommandButton(
"saveAliasProperties",
$lng->txt(
"save"));
894 if (
$lm_set->get(
"replace_mob_feature")) {
895 $this->form_gui->addCommandButton(
"changeObjectReference",
$lng->txt(
"cont_change_object_reference"));
897 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
909 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
910 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
912 $values[
"title"] = $this->content_obj->getMediaObject()->getTitle();
913 $values[
"st_location"] = $std_item->getLocation();
914 $values[
"st_format"] = $std_item->getFormat();
917 $values[
"st_width_height"][
"width"] = $std_alias_item->getWidth();
918 $values[
"st_width_height"][
"height"] = $std_alias_item->getHeight();
919 $values[
"st_width_height"][
"constr_prop"] =
true;
922 $values[
"st_caption"] = $std_alias_item->getCaption();
923 if (trim($std_item->getCaption()) ==
"") {
924 $values[
"def_caption"] =
$lng->txt(
"cont_no_caption");
926 $values[
"def_caption"] = $std_item->getCaption();
930 $values[
"st_text_representation"] = $std_alias_item->getTextRepresentation();
931 if (trim($std_item->getTextRepresentation()) ==
"") {
932 $values[
"def_text_representation"] =
$lng->txt(
"cont_no_text");
934 $values[
"def_text_representation"] = $std_item->getTextRepresentation();
938 if ($this->media_type->usesAutoStartParameterOnly(
939 $std_item->getLocation(),
940 $std_item->getFormat()
948 $values[
"st_parameters"] = $std_alias_item->getParameterString();
952 $values[
"st_derive_size"] = $std_alias_item->definesSize()
955 if ($values[
"st_derive_size"] ==
"y") {
956 $values[
"st_width_height"][
"width"] = $std_item->getWidth();
957 $values[
"st_width_height"][
"height"] = $std_item->getHeight();
959 $values[
"st_derive_caption"] = $std_alias_item->definesCaption()
962 $values[
"st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
965 $values[
"st_derive_parameters"] = $std_alias_item->definesParameters()
968 if (trim($std_item->getParameterString()) ==
"") {
969 $values[
"def_parameters"] =
"<i>" .
$lng->txt(
"cont_no_parameters") .
"</i>";
971 $values[
"def_parameters"] = $std_item->getParameterString();
975 if ($this->content_obj->getMediaObject()->hasFullScreenItem()) {
976 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
977 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
979 $values[
"fullscreen"] =
"n";
980 if ($full_alias_item->exists()) {
981 $values[
"fullscreen"] =
"y";
984 $values[
"full_location"] = $full_item->getLocation();
985 $values[
"full_format"] = $full_item->getFormat();
986 $values[
"full_width_height"][
"width"] = $full_alias_item->getWidth();
987 $values[
"full_width_height"][
"height"] = $full_alias_item->getHeight();
988 $values[
"full_width_height"][
"constr_prop"] =
true;
989 $values[
"full_caption"] = $full_alias_item->getCaption();
990 if (trim($full_item->getCaption()) ==
"") {
991 $values[
"full_def_caption"] =
$lng->txt(
"cont_no_caption");
993 $values[
"full_def_caption"] = $full_item->getCaption();
995 $values[
"full_text_representation"] = $full_alias_item->getTextRepresentation();
996 if (trim($full_item->getTextRepresentation()) ==
"") {
997 $values[
"full_def_text_representation"] =
$lng->txt(
"cont_no_text");
999 $values[
"full_def_text_representation"] = $full_item->getTextRepresentation();
1001 $values[
"full_parameters"] = $full_alias_item->getParameterString();
1002 $values[
"full_derive_size"] = $full_alias_item->definesSize()
1005 if ($values[
"full_derive_size"] ==
"y") {
1006 $values[
"full_width_height"][
"width"] = $full_item->getWidth();
1007 $values[
"full_width_height"][
"height"] = $full_item->getHeight();
1009 $values[
"full_derive_caption"] = $full_alias_item->definesCaption()
1012 $values[
"full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
1017 if ($this->media_type->usesAutoStartParameterOnly(
1018 $full_item->getLocation(),
1019 $full_item->getFormat()
1027 $values[
"full_parameters"] = $full_alias_item->getParameterString();
1030 $values[
"full_derive_parameters"] = $full_alias_item->definesParameters()
1033 if (trim($full_item->getParameterString()) ==
"") {
1034 $values[
"full_def_parameters"] =
"<i>" .
$lng->txt(
"cont_no_parameters") .
"</i>";
1036 $values[
"full_def_parameters"] = $full_item->getParameterString();
1040 $this->form_gui->setValuesByArray($values);
1048 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1049 $full_alias_item = $this->content_obj->getFullscreenMediaAliasItem();
1050 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
1051 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
1054 if (
$_POST[
"st_derive_size"] ==
"y") {
1055 $std_alias_item->deriveSize();
1062 if (
$_POST[
"st_derive_caption"] ==
"y") {
1063 $std_alias_item->deriveCaption();
1069 if (
$_POST[
"st_derive_text_representation"] ==
"y") {
1070 $std_alias_item->deriveTextRepresentation();
1076 if (
$_POST[
"st_derive_parameters"] ==
"y") {
1077 $std_alias_item->deriveParameters();
1079 if ($this->media_type->usesAutoStartParameterOnly(
1080 $std_item->getLocation(),
1081 $std_item->getFormat()
1094 if ($this->content_obj->getMediaObject()->hasFullscreenItem()) {
1095 if (
$_POST[
"fullscreen"] ==
"y") {
1096 if (!$full_alias_item->exists()) {
1097 $full_alias_item->insert();
1101 if (
$_POST[
"full_derive_size"] ==
"y") {
1102 $full_alias_item->deriveSize();
1109 if (
$_POST[
"full_derive_caption"] ==
"y") {
1110 $full_alias_item->deriveCaption();
1116 if (
$_POST[
"full_derive_text_representation"] ==
"y") {
1117 $full_alias_item->deriveTextRepresentation();
1123 if (
$_POST[
"full_derive_parameters"] ==
"y") {
1124 $full_alias_item->deriveParameters();
1126 if ($this->media_type->usesAutoStartParameterOnly(
1127 $full_item->getLocation(),
1128 $full_item->getFormat()
1141 if ($full_alias_item->exists()) {
1142 $full_alias_item->delete();
1147 $this->updated = $this->pg_obj->update();
1148 if ($this->updated ===
true) {
1149 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1150 $this->ctrl->redirect($this,
"editAlias");
1151 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1153 $this->pg_obj->addHierIDs();
1165 $ilUser->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType(), $this->content_obj->getMediaObject()->getTitle());
1166 ilUtil::sendSuccess($this->lng->txt(
"copied_to_clipboard"),
true);
1167 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1175 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1176 $std_alias_item->setHorizontalAlign(
"Center");
1177 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1178 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1186 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1187 $std_alias_item->setHorizontalAlign(
"Left");
1188 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1189 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1197 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1198 $std_alias_item->setHorizontalAlign(
"Right");
1199 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1200 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1208 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1209 $std_alias_item->setHorizontalAlign(
"LeftFloat");
1210 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1211 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1219 $std_alias_item = $this->content_obj->getStandardMediaAliasItem();
1220 $std_alias_item->setHorizontalAlign(
"RightFloat");
1221 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1222 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1233 if (count($chars) > 1 ||
1234 ($this->content_obj->getClass() !=
"" && $this->content_obj->getClass() !=
"Media")) {
1252 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1254 $form->setFormAction($ilCtrl->getFormAction($this));
1255 $form->setTitle($this->lng->txt(
"cont_edit_style"));
1258 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
1260 $this->lng->txt(
"cont_characteristic"),
1265 if (is_object($this->content_obj)) {
1266 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getClass() !=
"")) {
1267 $chars = array_merge(
1268 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1274 $selected = $this->content_obj->getClass();
1275 if ($selected ==
"") {
1276 $selected =
"MediaContainer";
1279 foreach ($chars as $k => $char) {
1280 $html =
'<div class="ilCOPgEditStyleSelectionItem">' .
1282 $char_prop->addOption($k, $char, $html);
1285 $char_prop->setValue($selected);
1286 $form->addItem($char_prop);
1289 $form->addCommandButton(
"saveStyle",
$lng->txt(
"save"));
1291 $html = $form->getHTML();
1292 $tpl->setContent($html);
1305 $this->lng->txt(
"cont_characteristic"),
1309 $selected = $this->content_obj->getClass();
1310 if ($selected ==
"") {
1311 $selected =
"MediaContainer";
1315 if (is_object($this->content_obj)) {
1316 if ($chars[$selected] ==
"" && ($this->content_obj->getClass() !=
"")) {
1317 $chars = array_merge(
1318 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1324 foreach ($chars as $k => $char) {
1325 $html =
'<div class="ilCOPgEditStyleSelectionItem">' .
1327 $char_prop->addOption($k, $char, $html);
1330 $char_prop->setValue($selected);
1340 $this->content_obj->setClass(
$_POST[
"characteristic"]);
1341 $this->updated = $this->pg_obj->update();
1342 if ($this->updated ===
true) {
1343 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1345 $this->pg_obj->addHierIDs();
1356 public function getTabs(&$tab_gui, $a_create =
false, $a_change_obj_ref =
false)
1365 $ilCtrl->getLinkTarget($this,
"editStyle"),
1371 if ($this->content_obj->checkInstanceEditing()) {
1373 "cont_mob_inst_prop",
1374 $ilCtrl->getLinkTarget($this,
"editAlias"),
1380 $st_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
1381 if (is_object($st_item)) {
1382 $format = $st_item->getFormat();
1383 if (substr(
$format, 0, 5) ==
"image" && !is_int(strpos(
$format,
"svg"))) {
1385 "cont_inst_map_areas",
1386 $ilCtrl->getLinkTargetByClass(
"ilpcimagemapeditorgui",
"editMapAreas"),
1388 "ilpcimagemapeditorgui" 1395 if ($a_change_obj_ref) {
1396 $cmd =
"changeObjectReference";
1401 if ($a_change_obj_ref) {
1402 $ilCtrl->setParameter($this,
"subCmd",
"insertNew");
1403 $ilTabs->addSubTabTarget(
1405 $ilCtrl->getLinkTarget($this, $cmd),
1409 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
1410 $ilTabs->addSubTabTarget(
1411 "cont_mob_from_media_pool",
1412 $ilCtrl->getLinkTarget($this, $cmd),
1415 $ilCtrl->setParameter($this,
"subCmd",
"");
1423 public static function _getStandardCharacteristics()
1428 $lng = $DIC->language();
1431 "MediaContainer" =>
$lng->txt(
"cont_Media"),
1432 "MediaContainerMax50" =>
"MediaContainerMax50",
1433 "MediaContainerFull100" =>
"MediaContainerFull100",
1434 "MediaContainerHighlighted" =>
"MediaContainerHighlighted",
1435 "MediaContainerSeparated" =>
"MediaContainerSeparated" 1444 $chars = self::_getStandardCharacteristics();
1445 if ($a_style_id > 0 &&
1448 $chars = $style->getCharacteristics(
"media_cont");
1449 $new_chars = array();
1450 foreach ($chars as $char) {
1451 if ($chars[$char] !=
"") {
1452 $new_chars[$char] = $chars[$char];
1454 $new_chars[$char] = $char;
1458 $chars = $new_chars;
This class represents an option in a radio group.
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setCharacteristics($a_chars)
Set Characteristics.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
redirectToParent($hier_id="")
Redirect to parent.
addSubItem($a_item)
Add Subitem.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
displayValidationError()
display validation errors
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
User interface class for page content map editor.
getCharacteristics()
Get characteristics.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a non editable value in a property form.
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
Select media pool for adding objects into pages.
static extractParameterString($a_parstr)
extracts parameter value pairs from a string into an array
getHierIdsForPCIds($a_pc_ids)
Get hier ids for a set of pc ids.
setHierId($a_hier_id)
get hierarchical id in dom object