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");
41 $this->header = $a_title;
56 $this->enabledmapareas = $a_enabledmapareas;
66 return $this->enabledmapareas;
79 $next_class = $this->ctrl->getNextClass($this);
82 $cmd = $this->ctrl->getCmd();
84 if (is_object ($this->content_obj))
86 $this->tpl->clearHeader();
88 $this->
getTabs($this->tabs_gui);
90 $mob = $this->content_obj->getMediaObject();
93 $tpl->setVariable(
"HEADER", $lng->txt(
"mob").
": ".
94 $this->content_obj->getMediaObject()->getTitle());
95 $mob_gui =&
new ilObjMediaObjectGUI(
"", $this->content_obj->getMediaObject()->getId(),
false,
false);
98 $mob_gui->getTabs($this->tabs_gui);
107 case "ilobjmediaobjectgui":
108 include_once (
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
109 $this->tpl->clearHeader();
111 $this->tpl->setTitle($this->lng->txt(
"mob").
": ".
112 $this->content_obj->getMediaObject()->getTitle());
113 $mob_gui =&
new ilObjMediaObjectGUI(
"", $this->content_obj->getMediaObject()->getId(),
false,
false);
116 $ret =& $this->ctrl->forwardCommand($mob_gui);
120 case "ilpcimagemapeditorgui":
121 require_once(
"./Services/COPage/classes/class.ilPCImageMapEditorGUI.php");
122 $ilTabs->setTabActive(
"cont_inst_map_areas");
125 $ret = $this->ctrl->forwardCommand($image_map_edit);
126 $tpl->setContent(
$ret);
140 function insert($a_post_cmd =
"edpost", $a_submit_cmd =
"create_mob", $a_input_error =
false)
144 if (
$_GET[
"subCmd"] ==
"insertNew")
146 $_SESSION[
"cont_media_insert"] =
"insertNew";
148 if (
$_GET[
"subCmd"] ==
"insertFromPool")
150 $_SESSION[
"cont_media_insert"] =
"insertFromPool";
153 if ((
$_GET[
"subCmd"] ==
"") &&
$_SESSION[
"cont_media_insert"] !=
"")
158 switch (
$_GET[
"subCmd"])
160 case "insertFromPool":
164 case "poolSelection":
175 $ilTabs->setSubTabActive(
"cont_new_mob");
177 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
185 $mob_gui->initForm(
"create");
186 $form = $mob_gui->getForm();
188 $form->setFormAction($ilCtrl->getFormAction($this,
"create_mob"));
189 $form->clearCommandButtons();
190 $form->addCommandButton(
"create_mob", $lng->txt(
"save"));
191 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
195 $tpl->setContent($form->getHTML());
208 if (
$_GET[
"subCmd"] ==
"insertNew")
210 $_SESSION[
"cont_media_insert"] =
"insertNew";
212 if (
$_GET[
"subCmd"] ==
"insertFromPool")
214 $_SESSION[
"cont_media_insert"] =
"insertFromPool";
217 if ((
$_GET[
"subCmd"] ==
"") &&
$_SESSION[
"cont_media_insert"] !=
"")
222 switch (
$_GET[
"subCmd"])
224 case "insertFromPool":
228 case "poolSelection":
238 $ilCtrl->setParameter($this,
"subCmd",
"changeObjectReference");
239 $this->
getTabs($ilTabs,
true,
true);
240 $ilTabs->setSubTabActive(
"cont_new_mob");
245 $mob_gui->initForm(
"create");
246 $form = $mob_gui->getForm();
247 $form->setFormAction($ilCtrl->getFormAction($this));
248 $form->clearCommandButtons();
249 $form->addCommandButton(
"createNewObjectReference", $lng->txt(
"save"));
250 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
251 $this->tpl->setContent($form->getHTML());
262 if (
$_SESSION[
"cont_media_pool"] !=
"" &&
263 $ilAccess->checkAccess(
"write",
"",
$_SESSION[
"cont_media_pool"])
269 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
270 if ($a_change_obj_ref)
272 $tb->addButton($lng->txt(
"cont_switch_to_media_pool"),
273 $ilCtrl->getLinkTarget($this,
"changeObjectReference"));
277 $tb->addButton($lng->txt(
"cont_switch_to_media_pool"),
278 $ilCtrl->getLinkTarget($this,
"insert"));
281 $ilCtrl->setParameter($this,
"subCmd",
"");
283 $html = $tb->getHTML();
285 $this->
getTabs($ilTabs,
true, $a_change_obj_ref);
286 $ilTabs->setSubTabActive(
"cont_mob_from_media_pool");
288 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
289 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
291 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
292 $tcmd = ($a_change_obj_ref)
293 ?
"changeObjectReference"
295 $tmode = ($a_change_obj_ref)
301 $html.= $mpool_table->getHTML();
303 $tpl->setContent($html);
319 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
320 if ($a_change_obj_ref)
322 $ilCtrl->redirect($this,
"changeObjectReference");
326 $ilCtrl->redirect($this,
"insert");
337 $this->
getTabs($ilTabs,
true, $a_change_obj_ref);
338 $ilTabs->setSubTabActive(
"cont_mob_from_media_pool");
340 include_once
"./Services/COPage/classes/class.ilPoolSelectorGUI.php";
342 if ($a_change_obj_ref)
344 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
345 $exp =
new ilPoolSelectorGUI($this,
"changeObjectReference", $this,
"changeObjectReference");
349 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
354 $exp->setTypeWhiteList(array(
"root",
"cat",
"grp",
"fold",
"crs",
"mep"));
355 $exp->setClickableTypes(array(
'mep'));
357 if (!$exp->handleCommand())
359 $tpl->setContent($exp->getHTML());
370 $this->
create(
false,
true);
382 include_once(
"./Services/COPage/classes/class.ilPCMediaObject.php");
383 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
385 $this->content_obj->readMediaObject($fid);
386 $this->content_obj->updateObjectReference();
387 $this->updated = $this->pg_obj->update();
392 $ilCtrl->redirect($this,
"changeObjectReference");
395 $ilCtrl->redirect($this,
"editAlias");
401 function &
create($a_create_alias =
true, $a_change_obj_ref =
false)
405 if (
$_GET[
"subCmd"] ==
"insertFromPool")
407 if (is_array(
$_POST[
"id"]))
409 for($i = count(
$_POST[
"id"]) - 1; $i>=0; $i--)
411 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
413 include_once(
"./Services/COPage/classes/class.ilPCMediaObject.php");
415 $this->content_obj->readMediaObject($fid);
416 $this->content_obj->createAlias($this->pg_obj,
$_GET[
"hier_id"], $this->pc_id);
418 $this->updated = $this->pg_obj->update();
421 $ilCtrl->returnToParent($this);
426 $mob_gui->initForm(
"create");
428 if (!$mob_gui->checkFormInput())
430 $this->form = $mob_gui->getForm();
431 $this->
insert(
"edpost",
"create_mob",
true);
435 include_once(
"./Services/COPage/classes/class.ilPCMediaObject.php");
436 if ($a_change_obj_ref !=
true)
440 $this->content_obj->createMediaObject();
441 $media_obj = $this->content_obj->getMediaObject();
443 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
451 $this->content_obj->createAlias($this->pg_obj, $this->hier_id, $this->pc_id);
452 $this->updated = $this->pg_obj->update();
453 if ($this->updated ===
true)
455 $this->pg_obj->stripHierIDs();
456 $this->pg_obj->addHierIDs();
457 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
458 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
459 $this->content_obj->setHierId($this->content_obj->readHierId());
460 $this->
setHierId($this->content_obj->readHierId());
461 $this->content_obj->setPCId($this->content_obj->readPCId());
463 $this->ctrl->redirectByClass(
"ilobjmediaobjectgui",
"edit");
474 if ($a_change_obj_ref ==
true)
476 $this->content_obj->updateObjectReference();
477 $this->updated = $this->pg_obj->update();
478 $this->ctrl->redirect($this,
"editAlias");
494 $tpl->setContent($this->form_gui->getHTML());
504 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
510 $this->content_obj->getPcId());
511 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
515 $this->form_gui->addItem($title);
517 $this->lng->txt(
"cont_".strtolower($std_item->getLocationType())),
"st_location");
518 $this->form_gui->addItem($loc);
520 $this->lng->txt(
"cont_format"),
"st_format");
521 $this->form_gui->addItem($format);
526 " (".$std_item->getWidth().
" x ".$std_item->
getHeight().
")",
"y");
528 $radio_size->addOption($op1);
531 include_once(
"./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
533 " / ".$lng->txt(
"cont_height"),
"st_width_height");
537 $radio_size->addOption($op2);
538 $this->form_gui->addItem($radio_size);
546 $rad_caption->addOption($op1);
549 $caption->setCols(30);
550 $caption->setRows(2);
557 $rad_caption->addOption($op2);
558 $this->form_gui->addItem($rad_caption);
561 if (substr($std_item->getFormat(), 0, 5) ==
"image")
571 $rad_tr->addOption($op1);
573 $rad_tr->addOption($op2);
574 $this->form_gui->addItem($rad_tr);
575 $rad_tr->setInfo($lng->txt(
"text_repr_info"));
582 $std_item->getFormat()))
585 $def_str = ($par[
"autostart"] ==
"true")
586 ?
" (".$lng->txt(
"yes").
")"
587 :
" (".$lng->txt(
"no").
")";
589 "st_derive_parameters");
590 $op1 =
new ilRadioOption($lng->txt(
"cont_default").$def_str,
"y");
591 $rad_auto->addOption($op1);
595 $rad_auto->addOption($op2);
596 $this->form_gui->addItem($rad_auto);
600 $rad_parameters =
new ilRadioGroupInputGUI($lng->txt(
"cont_parameter"),
"st_derive_parameters");
604 $rad_parameters->addOption($op1);
610 $rad_parameters->addOption($op2);
611 $this->form_gui->addItem($rad_parameters);
616 if($this->content_obj->getMediaObject()->hasFullScreenItem())
619 $this->content_obj->getPcId());
620 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
623 $fs_sec->setTitle($lng->txt(
"cont_fullscreen"));
624 $this->form_gui->addItem($fs_sec);
630 $radio_prop->addOption($op1);
631 $op2 =
new ilRadioOption($this->lng->txt(
"cont_".strtolower($full_item->getLocationType())).
": ".
632 $full_item->getLocation(),
"y");
633 $radio_prop->addOption($op2);
634 $this->form_gui->addItem($radio_prop);
638 $this->lng->txt(
"cont_format"),
"full_format");
639 $this->form_gui->addItem($format);
644 " (".$full_item->getWidth().
" x ".$full_item->
getHeight().
")",
"y");
646 $radio_size->addOption($op1);
649 include_once(
"./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
651 " / ".$lng->txt(
"cont_height"),
"full_width_height");
655 $radio_size->addOption($op2);
656 $this->form_gui->addItem($radio_size);
664 $rad_caption->addOption($op1);
667 $caption->setCols(30);
668 $caption->setRows(2);
675 $rad_caption->addOption($op2);
676 $this->form_gui->addItem($rad_caption);
679 if (substr($full_item->getFormat(), 0, 5) ==
"image")
689 $rad_tr->addOption($op1);
691 $rad_tr->addOption($op2);
692 $this->form_gui->addItem($rad_tr);
693 $rad_tr->setInfo($lng->txt(
"text_repr_info"));
700 $full_item->getFormat()))
703 $def_str = ($par[
"autostart"] ==
"true")
704 ?
" (".$lng->txt(
"yes").
")"
705 :
" (".$lng->txt(
"no").
")";
707 "full_derive_parameters");
708 $op1 =
new ilRadioOption($lng->txt(
"cont_default").$def_str,
"y");
709 $rad_auto->addOption($op1);
713 $rad_auto->addOption($op2);
714 $this->form_gui->addItem($rad_auto);
718 $rad_parameters =
new ilRadioGroupInputGUI($lng->txt(
"cont_parameter"),
"full_derive_parameters");
722 $rad_parameters->addOption($op1);
728 $rad_parameters->addOption($op2);
729 $this->form_gui->addItem($rad_parameters);
734 $this->form_gui->setTitle($lng->txt(
"cont_edit_mob_alias_prop"));
735 $this->form_gui->addCommandButton(
"saveAliasProperties", $lng->txt(
"save"));
737 if (
$lm_set->get(
"replace_mob_feature"))
739 $this->form_gui->addCommandButton(
"changeObjectReference", $lng->txt(
"cont_change_object_reference"));
741 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
753 $this->content_obj->getPcId());
754 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
756 $values[
"title"] = $this->content_obj->getMediaObject()->getTitle();
757 $values[
"st_location"] = $std_item->getLocation();
758 $values[
"st_format"] = $std_item->getFormat();
761 $values[
"st_width_height"][
"width"] = $std_alias_item->
getWidth();
762 $values[
"st_width_height"][
"height"] = $std_alias_item->getHeight();
763 $values[
"st_width_height"][
"constr_prop"] =
true;
766 $values[
"st_caption"] = $std_alias_item->getCaption();
769 $values[
"def_caption"] =
"<i>".$lng->txt(
"cont_no_caption").
"</i>";
773 $values[
"def_caption"] = $std_item->
getCaption();
777 $values[
"st_text_representation"] = $std_alias_item->getTextRepresentation();
780 $values[
"def_text_representation"] =
"<i>".$lng->txt(
"cont_no_text").
"</i>";
789 $std_item->getFormat()))
791 $par = $std_alias_item->getParameters();
792 if ($par[
"autostart"] ==
"true")
794 $values[
"st_autostart"] =
true;
799 $values[
"st_parameters"] = $std_alias_item->getParameterString();
803 $values[
"st_derive_size"] = $std_alias_item->definesSize()
806 if ($values[
"st_derive_size"] ==
"y")
808 $values[
"st_width_height"][
"width"] = $std_item->
getWidth();
809 $values[
"st_width_height"][
"height"] = $std_item->
getHeight();
811 $values[
"st_derive_caption"] = $std_alias_item->definesCaption()
814 $values[
"st_derive_text_representation"] = $std_alias_item->definesTextRepresentation()
817 $values[
"st_derive_parameters"] = $std_alias_item->definesParameters()
822 $values[
"def_parameters"] =
"<i>".$lng->txt(
"cont_no_parameters").
"</i>";
830 if($this->content_obj->getMediaObject()->hasFullScreenItem())
833 $this->content_obj->getPcId());
834 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
836 $values[
"fullscreen"] =
"n";
837 if ($full_alias_item->exists())
839 $values[
"fullscreen"] =
"y";
842 $values[
"full_location"] = $full_item->getLocation();
843 $values[
"full_format"] = $full_item->getFormat();
844 $values[
"full_width_height"][
"width"] = $full_alias_item->
getWidth();
845 $values[
"full_width_height"][
"height"] = $full_alias_item->getHeight();
846 $values[
"full_width_height"][
"constr_prop"] =
true;
847 $values[
"full_caption"] = $full_alias_item->getCaption();
850 $values[
"full_def_caption"] =
"<i>".$lng->txt(
"cont_no_caption").
"</i>";
854 $values[
"full_def_caption"] = $full_item->
getCaption();
856 $values[
"full_text_representation"] = $full_alias_item->getTextRepresentation();
859 $values[
"full_def_text_representation"] =
"<i>".$lng->txt(
"cont_no_text").
"</i>";
865 $values[
"full_parameters"] = $full_alias_item->getParameterString();
866 $values[
"full_derive_size"] = $full_alias_item->definesSize()
869 if ($values[
"full_derive_size"] ==
"y")
871 $values[
"full_width_height"][
"width"] = $full_item->
getWidth();
872 $values[
"full_width_height"][
"height"] = $full_item->
getHeight();
874 $values[
"full_derive_caption"] = $full_alias_item->definesCaption()
877 $values[
"full_derive_text_representation"] = $full_alias_item->definesTextRepresentation()
883 $full_item->getFormat()))
885 $par = $full_alias_item->getParameters();
886 if ($par[
"autostart"] ==
"true")
888 $values[
"full_autostart"] =
true;
893 $values[
"full_parameters"] = $full_alias_item->getParameterString();
896 $values[
"full_derive_parameters"] = $full_alias_item->definesParameters()
901 $values[
"full_def_parameters"] =
"<i>".$lng->txt(
"cont_no_parameters").
"</i>";
910 $this->form_gui->setValuesByArray($values);
919 $this->content_obj->getPcId());
921 $this->content_obj->getPcId());
922 $std_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
923 $full_item = $this->content_obj->getMediaObject()->getMediaItem(
"Fullscreen");
926 if(
$_POST[
"st_derive_size"] ==
"y")
937 if(
$_POST[
"st_derive_caption"] ==
"y")
939 $std_alias_item->deriveCaption();
947 if(
$_POST[
"st_derive_text_representation"] ==
"y")
949 $std_alias_item->deriveTextRepresentation();
957 if(
$_POST[
"st_derive_parameters"] ==
"y")
959 $std_alias_item->deriveParameters();
964 $std_item->getFormat()))
966 if (
$_POST[
"st_autostart"])
981 if($this->content_obj->getMediaObject()->hasFullscreenItem())
983 if (
$_POST[
"fullscreen"] ==
"y")
985 if (!$full_alias_item->
exists())
987 $full_alias_item->
insert();
991 if(
$_POST[
"full_derive_size"] ==
"y")
1002 if(
$_POST[
"full_derive_caption"] ==
"y")
1012 if(
$_POST[
"full_derive_text_representation"] ==
"y")
1022 if(
$_POST[
"full_derive_parameters"] ==
"y")
1029 $full_item->getFormat()))
1031 if (
$_POST[
"full_autostart"])
1048 if ($full_alias_item->
exists())
1050 $full_alias_item->
delete();
1055 $this->updated = $this->pg_obj->update();
1056 if ($this->updated ===
true)
1058 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1062 $this->pg_obj->addHierIDs();
1072 $this->ilias->account->addObjectToClipboard($this->content_obj->getMediaObject()->getId(), $this->content_obj->getMediaObject()->getType()
1073 , $this->content_obj->getMediaObject()->getTitle());
1075 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1084 $this->content_obj->getPcId());
1086 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1087 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1096 $this->content_obj->getPcId());
1098 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1099 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1108 $this->content_obj->getPcId());
1110 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1111 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1120 $this->content_obj->getPcId());
1122 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1123 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1132 $this->content_obj->getPcId());
1134 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
1135 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1146 if (count($chars) > 1 ||
1147 ($this->content_obj->getClass() !=
"" && $this->content_obj->getClass() !=
"Media"))
1164 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1166 $form->setFormAction($ilCtrl->getFormAction($this));
1167 $form->setTitle($this->lng->txt(
"cont_edit_style"));
1170 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
1175 if (is_object($this->content_obj))
1177 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getClass() !=
""))
1179 $chars = array_merge(
1180 array($this->content_obj->getClass() => $this->content_obj->getClass()),
1185 $selected = $this->content_obj->getClass();
1186 if ($selected ==
"")
1188 $selected =
"MediaContainer";
1191 foreach ($chars as $k => $char)
1193 $html =
'<table class="ilc_media_cont_'.$k.
'"><tr><td>'.
1194 $char.
'</td></tr></table>';
1195 $char_prop->addOption($k, $char, $html);
1198 $char_prop->setValue($selected);
1199 $form->addItem($char_prop);
1202 $form->addCommandButton(
"saveStyle", $lng->txt(
"save"));
1204 $html = $form->getHTML();
1205 $tpl->setContent($html);
1214 $this->content_obj->setClass(
$_POST[
"characteristic"]);
1215 $this->updated = $this->pg_obj->update();
1216 if ($this->updated ===
true)
1218 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
1222 $this->pg_obj->addHierIDs();
1233 function getTabs(&$tab_gui, $a_create =
false, $a_change_obj_ref =
false)
1241 $ilTabs->addTarget(
"cont_style",
1242 $ilCtrl->getLinkTarget($this,
"editStyle"),
"editStyle",
1246 $ilTabs->addTarget(
"cont_mob_inst_prop",
1247 $ilCtrl->getLinkTarget($this,
"editAlias"),
"editAlias",
1252 $st_item = $this->content_obj->getMediaObject()->getMediaItem(
"Standard");
1253 if (is_object($st_item))
1255 $format = $st_item->getFormat();
1256 if (substr($format, 0, 5) ==
"image")
1258 $ilTabs->addTarget(
"cont_inst_map_areas",
1259 $ilCtrl->getLinkTargetByClass(
"ilpcimagemapeditorgui",
"editMapAreas"), array(),
1260 "ilpcimagemapeditorgui");
1267 if ($a_change_obj_ref)
1269 $cmd =
"changeObjectReference";
1276 $ilCtrl->setParameter($this,
"subCmd",
"insertNew");
1277 $ilTabs->addSubTabTarget(
"cont_new_mob",
1278 $ilCtrl->getLinkTarget($this,
$cmd),
$cmd);
1280 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
1281 $ilTabs->addSubTabTarget(
"cont_mob_from_media_pool",
1282 $ilCtrl->getLinkTarget($this,
$cmd),
$cmd);
1283 $ilCtrl->setParameter($this,
"subCmd",
"");