24 require_once (
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
25 require_once (
"./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
26 require_once (
"classes/class.ilObjectGUI.php");
46 function ilObjMediaObjectGUI($a_data, $a_id = 0, $a_call_by_reference =
false, $a_prepare_output =
false)
53 $this->back_title =
"";
59 $this->header = $a_title;
74 $this->enabledmapareas = $a_enabledmapareas;
97 $this->ctrl->returnToParent($this);
108 $next_class = $this->ctrl->getNextClass($this);
109 $cmd = $this->ctrl->getCmd();
113 case 'ilmdeditorgui':
115 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
117 $md_gui =&
new ilMDEditorGUI(0, $this->object->getId(), $this->
object->getType());
118 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
120 $this->ctrl->forwardCommand($md_gui);
123 case "ilimagemapeditorgui":
124 require_once(
"./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php");
126 $ret = $this->ctrl->forwardCommand($image_map_edit);
127 $tpl->setContent(
$ret);
131 if (isset($_POST[
"editImagemapForward"]) ||
132 isset($_POST[
"editImagemapForward_x"]) ||
133 isset($_POST[
"editImagemapForward_y"]))
135 $cmd =
"editImagemapForward";
150 $this->back_title = $a_title;
158 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.mob_new.html",
"Services/MediaObjects");
159 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_insert_mob"));
160 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
163 $this->tpl->setVariable(
"TXT_STANDARD_VIEW", $this->lng->txt(
"cont_std_view"));
164 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"cont_file"));
165 $this->tpl->setVariable(
"TXT_REFERENCE", $this->lng->txt(
"cont_reference"));
166 $this->tpl->setVariable(
"TXT_REF_HELPTEXT", $this->lng->txt(
"cont_ref_helptext"));
167 $this->tpl->setVariable(
"TXT_WIDTH", $this->lng->txt(
"cont_width"));
168 $this->tpl->setVariable(
"TXT_HEIGHT", $this->lng->txt(
"cont_height"));
169 $this->tpl->setVariable(
"TXT_ORIGINAL_SIZE", $this->lng->txt(
"cont_orig_size"));
170 $this->tpl->setVariable(
"TXT_CAPTION", $this->lng->txt(
"cont_caption"));
171 $this->tpl->setVariable(
"TXT_FULLSCREEN_VIEW", $this->lng->txt(
"cont_fullscreen"));
172 $this->tpl->setVariable(
"TXT_PARAMETER", $this->lng->txt(
"cont_parameter"));
173 $this->tpl->setVariable(
"TXT_RESIZE", $this->lng->txt(
"cont_resize_image"));
174 $this->tpl->setVariable(
"TXT_RESIZE_EXPLANATION", $this->lng->txt(
"cont_resize_explanation"));
178 $this->tpl->setCurrentBlock(
"commands");
179 $this->tpl->setVariable(
"BTN_NAME",
"save");
180 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
181 $this->tpl->setVariable(
"BTN_CANCEL",
"cancel");
182 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
183 $this->tpl->parseCurrentBlock();
192 if ($_POST[
"standard_type"] ==
"File")
194 $title = $_FILES[
'standard_file'][
'name'];
204 $this->
object->setTitle(
$title);
205 $this->
object->setDescription(
"");
206 $this->
object->create();
210 $this->
object->createDirectory();
214 $this->
object->addMediaItem($media_item);
215 $media_item->setPurpose(
"Standard");
217 if ($_POST[
"standard_type"] ==
"File")
219 $file = $mob_dir.
"/".$_FILES[
'standard_file'][
'name'];
222 $_FILES[
'standard_file'][
'name'],
$file);
226 $location = $_FILES[
'standard_file'][
'name'];
229 if ($_POST[
"standard_size"] !=
"original" &&
230 $_POST[
"standard_resize"] ==
"y" &&
231 is_int(strpos($format,
"image")))
234 (
int) $_POST[
"standard_height"]);
238 $media_item->setFormat($format);
240 $media_item->setLocationType(
"LocalFile");
244 $this->
object->setTitle($_FILES[
'standard_file'][
'name']);
249 $media_item->setFormat($format);
251 $media_item->setLocationType(
"Reference");
258 $this->
object->setDescription($format);
261 if ($_POST[
"standard_size"] ==
"original")
266 $media_item->setWidth(
$size[0]);
267 $media_item->setHeight(
$size[1]);
271 $media_item->setWidth(500);
272 $media_item->setHeight(400);
277 $media_item->setWidth((
int) $_POST[
"standard_width"]);
278 $media_item->setHeight((
int) $_POST[
"standard_height"]);
281 if ($_POST[
"standard_caption"] !=
"")
286 if ($_POST[
"standard_param"] !=
"")
291 $media_item->setHAlign(
"Left");
294 if ($_POST[
"fullscreen"] ==
"y")
297 $this->
object->addMediaItem($media_item);
298 $media_item->setPurpose(
"Fullscreen");
301 if ($_POST[
"full_type"] ==
"File")
303 if ($_FILES[
'full_file'][
'name'] !=
"")
305 $file = $mob_dir.
"/".$_FILES[
'full_file'][
'name'];
308 $_FILES[
'full_file'][
'name'],
$file);
311 if ($_FILES[
'full_file'][
'name'] !=
"" ||
312 ($_POST[
"full_size"] !=
"original" &&
313 $_POST[
"full_resize"] ==
"y" &&
314 is_int(strpos($format,
"image")))
319 $location = $_FILES[
'full_file'][
'name'];
322 if ($_POST[
"full_size"] !=
"original" &&
323 $_POST[
"full_resize"] ==
"y" &&
324 is_int(strpos($format,
"image")))
327 (
int) $_POST[
"full_height"]);
331 $media_item->setFormat($format);
333 $media_item->setLocationType(
"LocalFile");
344 if ($_POST[
"full_reference"] !=
"")
347 $media_item->setFormat($format);
349 $media_item->setLocationType(
"Reference");
358 if ($_POST[
"full_size"] ==
"original")
363 $media_item->setWidth(
$size[0]);
364 $media_item->setHeight(
$size[1]);
368 $media_item->setWidth(500);
369 $media_item->setHeight(400);
374 $media_item->setWidth((
int) $_POST[
"full_width"]);
375 $media_item->setHeight((
int) $_POST[
"full_height"]);
378 if ($_POST[
"full_caption"] !=
"")
383 if ($_POST[
"full_param"] !=
"")
391 $this->
object->update();
399 $this->ctrl->returnToParent($this);
408 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
411 $std_item =& $this->
object->getMediaItem(
"Standard");
414 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.mob_properties.html",
"Services/MediaObjects");
417 if ($std_item->getLocationType() ==
"LocalFile" &&
420 $this->tpl->setCurrentBlock(
"get_size");
421 $this->tpl->setVariable(
"CMD_SIZE",
"getStandardSize");
422 $this->tpl->setVariable(
"TXT_GET_SIZE", $this->lng->txt(
"cont_get_orig_size"));
423 $this->tpl->parseCurrentBlock();
427 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_edit_mob_properties"));
428 $this->tpl->setVariable(
"TXT_STANDARD_VIEW", $this->lng->txt(
"cont_std_view"));
430 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"cont_localfile"));
431 $this->tpl->setVariable(
"TXT_REFERENCE", $this->lng->txt(
"cont_reference"));
432 $this->tpl->setVariable(
"TXT_REF_HELPTEXT", $this->lng->txt(
"cont_ref_helptext"));
433 if ($std_item->getLocationType() ==
"LocalFile")
435 $this->tpl->setVariable(
"FILE_CHECKED",
"checked=\"1\"");
436 $this->tpl->setVariable(
"VAL_FILE", $std_item->getLocation());
440 $this->tpl->setVariable(
"REF_CHECKED",
"checked=\"1\"");
441 $this->tpl->setVariable(
"VAL_REFERENCE", $std_item->getLocation());
444 $this->tpl->setVariable(
"TXT_FORMAT", $this->lng->txt(
"cont_format"));
445 $this->tpl->setVariable(
"VAL_FORMAT", $std_item->getFormat());
446 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
449 $this->tpl->setVariable(
"TXT_MOB_WIDTH", $this->lng->txt(
"cont_width"));
450 $this->tpl->setVariable(
"INPUT_MOB_WIDTH",
"mob_width");
451 $this->tpl->setVariable(
"VAL_MOB_WIDTH", $std_item->getWidth());
454 $this->tpl->setVariable(
"TXT_MOB_HEIGHT", $this->lng->txt(
"cont_height"));
455 $this->tpl->setVariable(
"INPUT_MOB_HEIGHT",
"mob_height");
456 $this->tpl->setVariable(
"VAL_MOB_HEIGHT", $std_item->getHeight());
459 if ($orig_size = $std_item->getOriginalSize())
461 $this->tpl->setCurrentBlock(
"orig_size");
462 $this->tpl->setVariable(
"TXT_ORIGINAL_SIZE", $this->lng->txt(
"cont_orig_size"));
463 $this->tpl->setVariable(
"VAL_ORIG_WIDTH", $orig_size[
"width"]);
464 $this->tpl->setVariable(
"VAL_ORIG_HEIGHT", $orig_size[
"height"]);
465 $this->tpl->parseCurrentBlock();
469 $this->tpl->setVariable(
"TXT_CAPTION", $this->lng->txt(
"cont_caption"));
470 $this->tpl->setVariable(
"INPUT_CAPTION",
"mob_caption");
471 $this->tpl->setVariable(
"VAL_CAPTION", $std_item->getCaption());
475 $this->tpl->setVariable(
"TXT_PARAMETER", $this->lng->txt(
"cont_parameter"));
476 $this->tpl->setVariable(
"INPUT_PARAMETERS",
"mob_parameters");
477 $this->tpl->setVariable(
"VAL_PARAMETERS", $std_item->getParameterString());
481 if($this->object->hasFullScreenItem())
483 $full_item =& $this->
object->getMediaItem(
"Fullscreen");
485 if ($full_item->getLocationType() ==
"LocalFile" &&
488 $this->tpl->setCurrentBlock(
"get_full_size");
489 $this->tpl->setVariable(
"CMD_FULL_SIZE",
"getFullscreenSize");
490 $this->tpl->setVariable(
"TXT_GET_FULL_SIZE", $this->lng->txt(
"cont_get_orig_size"));
491 $this->tpl->parseCurrentBlock();
494 $this->tpl->setCurrentBlock(
"fullscreen");
497 $this->tpl->setVariable(
"TXT_FULLSCREEN_VIEW", $this->lng->txt(
"cont_fullscreen"));
499 $this->tpl->setVariable(
"TXT_FULL_FILE", $this->lng->txt(
"cont_localfile"));
500 $this->tpl->setVariable(
"TXT_FULL_REFERENCE", $this->lng->txt(
"cont_reference"));
501 $this->tpl->setVariable(
"TXT_FULL_REF_HELPTEXT", $this->lng->txt(
"cont_ref_helptext"));
502 if ($full_item->getLocationType() ==
"LocalFile")
504 $this->tpl->setVariable(
"FULL_FILE_CHECKED",
"checked=\"1\"");
505 $this->tpl->setVariable(
"VAL_FULL_FILE", $full_item->getLocation());
509 $this->tpl->setVariable(
"FULL_REF_CHECKED",
"checked=\"1\"");
510 $this->tpl->setVariable(
"VAL_FULL_REFERENCE", $full_item->getLocation());
515 $this->tpl->setVariable(
"TXT_FULL_FORMAT", $this->lng->txt(
"cont_format"));
516 $this->tpl->setVariable(
"VAL_FULL_FORMAT", $full_item->getFormat());
519 $this->tpl->setVariable(
"TXT_FULL_WIDTH", $this->lng->txt(
"cont_width"));
520 $this->tpl->setVariable(
"INPUT_FULL_WIDTH",
"full_width");
521 $this->tpl->setVariable(
"VAL_FULL_WIDTH", $full_item->getWidth());
524 $this->tpl->setVariable(
"TXT_FULL_HEIGHT", $this->lng->txt(
"cont_height"));
525 $this->tpl->setVariable(
"INPUT_FULL_HEIGHT",
"full_height");
526 $this->tpl->setVariable(
"VAL_FULL_HEIGHT", $full_item->getHeight());
529 if ($orig_size = $full_item->getOriginalSize())
531 $this->tpl->setCurrentBlock(
"orig_full_size");
532 $this->tpl->setVariable(
"TXT_ORIGINAL_SIZE", $this->lng->txt(
"cont_orig_size"));
533 $this->tpl->setVariable(
"VAL_ORIG_WIDTH", $orig_size[
"width"]);
534 $this->tpl->setVariable(
"VAL_ORIG_HEIGHT", $orig_size[
"height"]);
535 $this->tpl->parseCurrentBlock();
539 $this->tpl->setVariable(
"TXT_FULL_CAPTION", $this->lng->txt(
"cont_caption"));
540 $this->tpl->setVariable(
"INPUT_FULL_CAPTION",
"full_caption");
541 $this->tpl->setVariable(
"VAL_FULL_CAPTION", $full_item->getCaption());
544 $this->tpl->setVariable(
"TXT_FULL_PARAMETER", $this->lng->txt(
"cont_parameter"));
545 $this->tpl->setVariable(
"INPUT_FULL_PARAMETERS",
"full_parameters");
546 $this->tpl->setVariable(
"VAL_FULL_PARAMETERS", $full_item->getParameterString());
548 $this->tpl->parseCurrentBlock();
552 if($this->object->hasFullScreenItem())
554 $this->tpl->setCurrentBlock(
"remove_full");
555 $this->tpl->setVariable(
"CMD_REMOVE_FULL",
"removeFullscreen");
556 $this->tpl->setVariable(
"TXT_REMOVE_FULL", $this->lng->txt(
"cont_remove_fullscreen"));
557 $this->tpl->parseCurrentBlock();
561 $this->tpl->setCurrentBlock(
"add_full");
562 $this->tpl->setVariable(
"CMD_ADD_FULL",
"addFullscreen");
563 $this->tpl->setVariable(
"TXT_ADD_FULL", $this->lng->txt(
"cont_add_fullscreen"));
564 $this->tpl->parseCurrentBlock();
566 $this->tpl->setCurrentBlock(
"commands");
568 $this->tpl->setVariable(
"BTN_RESIZE",
"resizeImages");
569 $this->tpl->setVariable(
"TXT_RESIZE", $this->lng->txt(
"cont_resize_image").
" [*]");
570 $this->tpl->setVariable(
"BTN_NAME",
"saveProperties");
571 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
572 $this->tpl->parseCurrentBlock();
574 $this->tpl->setVariable(
"TXT_RESIZE_EXPLANATION",
575 $this->lng->txt(
"cont_resize_explanation2"));
588 $std_item =& $this->
object->getMediaItem(
"Standard");
589 if ($std_item->getLocationType() ==
"LocalFile" &&
590 is_int(strpos($std_item->getFormat(),
"image"))
593 $file = $mob_dir.
"/".$std_item->getLocation();
595 $std_item->getHeight());
601 if($this->object->hasFullScreenItem())
603 $full_item =& $this->
object->getMediaItem(
"Fullscreen");
604 if ($full_item->getLocationType() ==
"LocalFile" &&
605 is_int(strpos($full_item->getFormat(),
"image"))
608 $file = $mob_dir.
"/".$full_item->getLocation();
610 $full_item->getHeight());
612 $full_item->update();
616 $this->ctrl->redirect($this,
"edit");
625 $std_item =& $this->
object->getMediaItem(
"Standard");
628 if ($std_item->getLocationType() ==
"LocalFile")
630 $file = $mob_dir.
"/".$std_item->getLocation();
632 $std_item->setWidth(
$size[0]);
633 $std_item->setHeight(
$size[1]);
634 $this->
object->update();
636 $this->ctrl->redirect($this,
"edit");
645 $full_item =& $this->
object->getMediaItem(
"Fullscreen");
648 if ($full_item->getLocationType() ==
"LocalFile")
650 $file = $mob_dir.
"/".$full_item->getLocation();
652 $full_item->setWidth(
$size[0]);
653 $full_item->setHeight(
$size[1]);
654 $this->
object->update();
656 $this->ctrl->redirect($this,
"edit");
666 $std_item =& $this->
object->getMediaItem(
"Standard");
667 if ($_POST[
"standard_type"] ==
"Reference")
669 $std_item->setLocationType(
"Reference");
673 if ($_POST[
"standard_type"] ==
"LocalFile")
675 if ($_FILES[
'standard_file'][
'name'] !=
"")
678 $file = $mob_dir.
"/".$_FILES[
'standard_file'][
'name'];
681 $_FILES[
'standard_file'][
'name'], $file);
684 $std_item->setFormat($format);
685 $std_item->setLocation($_FILES[
'standard_file'][
'name']);
687 $std_item->setLocationType(
"LocalFile");
689 $std_item->setWidth((
int) $_POST[
"mob_width"]);
690 $std_item->setHeight((
int) $_POST[
"mob_height"]);
694 if($this->object->hasFullscreenItem())
696 $full_item =& $this->
object->getMediaItem(
"Fullscreen");
697 if ($_POST[
"full_type"] ==
"Reference")
699 $full_item->setLocationType(
"Reference");
703 if ($_POST[
"full_type"] ==
"LocalFile")
705 if ($_FILES[
'full_file'][
'name'] !=
"")
708 $file = $mob_dir.
"/".$_FILES[
'full_file'][
'name'];
711 $_FILES[
'full_file'][
'name'], $file);
714 $full_item->setFormat($format);
715 $full_item->setLocation($_FILES[
'full_file'][
'name']);
717 $full_item->setLocationType(
"LocalFile");
719 $full_item->setWidth((
int) $_POST[
"full_width"]);
720 $full_item->setHeight((
int) $_POST[
"full_height"]);
727 $this->
object->update();
730 $this->ctrl->redirect($this,
"edit");
740 $std_item =& $this->
object->getMediaItem(
"Standard");
741 if($this->object->hasFullscreenItem())
743 $full_item =& $this->
object->getMediaItem(
"Fullscreen");
747 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
751 $cur_subdir =
$_GET[
"cdir"];
752 if(
$_GET[
"newdir"] ==
"..")
754 $cur_subdir = substr($cur_subdir, 0, strrpos($cur_subdir,
"/"));
758 if (!empty(
$_GET[
"newdir"]))
760 if (!empty($cur_subdir))
762 $cur_subdir = $cur_subdir.
"/".
$_GET[
"newdir"];
766 $cur_subdir =
$_GET[
"newdir"];
771 $cur_subdir = str_replace(
".",
"", $cur_subdir);
773 $cur_dir = (!empty($cur_subdir))
774 ? $mob_dir.
"/".$cur_subdir
778 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.mob_files.html",
"Services/MediaObjects");
783 $this->ctrl->setParameter($this,
"cdir", urlencode($cur_subdir));
784 $this->tpl->setVariable(
"FORMACTION1", $this->ctrl->getFormAction($this));
787 $this->tpl->setVariable(
"TXT_NEW_DIRECTORY", $this->lng->txt(
"cont_new_dir"));
788 $this->tpl->setVariable(
"TXT_NEW_FILE", $this->lng->txt(
"cont_new_file"));
789 $this->tpl->setVariable(
"CMD_NEW_DIR",
"createDirectory");
790 $this->tpl->setVariable(
"CMD_NEW_FILE",
"uploadFile");
791 $this->tpl->setVariable(
"BTN_NEW_DIR", $this->lng->txt(
"create"));
792 $this->tpl->setVariable(
"BTN_NEW_FILE", $this->lng->txt(
"upload"));
795 $this->tpl->addBlockfile(
"FILE_TABLE",
"files",
"tpl.table.html");
798 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.mob_file_row.html",
"Services/MediaObjects");
802 $obj_str = ($this->call_by_reference) ?
"" :
"&obj_id=".$this->obj_id;
803 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
805 $tbl->setTitle($this->lng->txt(
"cont_files").
" ".$cur_subdir);
808 $tbl->setHeaderNames(array(
"",
"", $this->lng->txt(
"cont_dir_file"),
809 $this->lng->txt(
"cont_size"), $this->lng->txt(
"cont_purpose")));
811 $cols = array(
"",
"",
"dir_file",
"size",
"purpose");
812 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
813 "cmd" =>
"editFiles",
"hier_id" =>
$_GET[
"hier_id"]);
814 $tbl->setHeaderVars($cols, $header_params);
815 $tbl->setColumnWidth(array(
"1%",
"1%",
"33%",
"33%",
"32%"));
818 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
819 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
820 $tbl->setLimit(
$_GET[
"limit"]);
821 $tbl->setOffset(
$_GET[
"offset"]);
822 $tbl->setMaxCount($this->maxcount);
825 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
829 $this->tpl->setCurrentBlock(
"tbl_action_btn");
830 $this->tpl->setVariable(
"BTN_NAME",
"deleteFile");
831 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
832 $this->tpl->parseCurrentBlock();
834 $this->tpl->setCurrentBlock(
"tbl_action_btn");
835 $this->tpl->setVariable(
"BTN_NAME",
"assignStandard");
836 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_assign_std"));
837 $this->tpl->parseCurrentBlock();
839 $this->tpl->setCurrentBlock(
"tbl_action_btn");
840 $this->tpl->setVariable(
"BTN_NAME",
"assignFullscreen");
841 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_assign_full"));
842 $this->tpl->parseCurrentBlock();
845 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
851 $tbl->setMaxCount(count($entries));
852 $entries = array_slice($entries,
$_GET[
"offset"],
$_GET[
"limit"]);
855 if(count($entries) > 0)
858 foreach($entries as $entry)
860 if(($entry[
"entry"] ==
".") || ($entry[
"entry"] ==
".." && empty($cur_subdir)))
866 if($entry[
"type"] ==
"dir")
868 $this->tpl->setCurrentBlock(
"FileLink");
869 $this->ctrl->setParameter($this,
"cdir", $cur_subdir);
870 $this->ctrl->setParameter($this,
"newdir", rawurlencode($entry[
"entry"]));
871 $this->tpl->setVariable(
"LINK_FILENAME", $this->ctrl->getLinkTarget($this,
"editFiles"));
872 $this->tpl->setVariable(
"TXT_FILENAME", $entry[
"entry"]);
873 $this->tpl->parseCurrentBlock();
875 $this->tpl->setVariable(
"ICON",
"<img src=\"".
880 $this->tpl->setCurrentBlock(
"File");
881 $this->tpl->setVariable(
"TXT_FILENAME2", $entry[
"entry"]);
882 $this->tpl->parseCurrentBlock();
885 $this->tpl->setCurrentBlock(
"tbl_content");
887 $this->tpl->setVariable(
"CSS_ROW", $css_row);
889 $this->tpl->setVariable(
"TXT_SIZE", $entry[
"size"]);
890 $this->tpl->setVariable(
"CHECKBOX_ID", $entry[
"entry"]);
891 $compare = (!empty($cur_subdir))
892 ? $cur_subdir.
"/".$entry[
"entry"]
895 if ($std_item->getLocation() == $compare)
897 $purpose[] = $this->lng->txt(
"cont_std_view");
899 if($this->object->hasFullscreenItem())
901 if ($full_item->getLocation() == $compare)
903 $purpose[] = $this->lng->txt(
"cont_fullscreen");
906 $this->tpl->setVariable(
"TXT_PURPOSE", implode($purpose,
", "));
908 $this->tpl->parseCurrentBlock();
913 $this->tpl->setCurrentBlock(
"notfound");
914 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
915 $this->tpl->setVariable(
"NUM_COLS", 4);
916 $this->tpl->parseCurrentBlock();
919 $this->tpl->parseCurrentBlock();
930 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
932 $cur_dir = (!empty($cur_subdir))
933 ? $mob_dir.
"/".$cur_subdir
936 $new_dir = str_replace(
".",
"", $_POST[
"new_dir"]);
937 $new_dir = str_replace(
"/",
"", $new_dir);
939 if (!empty($new_dir))
943 $this->ctrl->saveParameter($this,
"cdir");
944 $this->ctrl->redirect($this,
"editFiles");
953 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
955 $cur_dir = (!empty($cur_subdir))
956 ? $mob_dir.
"/".$cur_subdir
958 if (is_file($_FILES[
"new_file"][
"tmp_name"]))
962 $file = $cur_dir.
"/".$_FILES[
"new_file"][
"name"];
964 $_FILES[
'new_file'][
'name'],
$file);
968 $this->ctrl->saveParameter($this,
"cdir");
969 $this->ctrl->redirect($this,
"editFiles");
977 if (!isset($_POST[
"file"]))
979 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
982 if (count($_POST[
"file"]) > 1)
984 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
988 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
990 $cur_dir = (!empty($cur_subdir))
991 ? $mob_dir.
"/".$cur_subdir
993 $file = $cur_dir.
"/".$_POST[
"file"][0];
995 ? $cur_subdir.
"/".$_POST[
"file"][0]
1000 $this->ilias->raiseError($this->lng->txt(
"cont_select_file"),$this->ilias->error_obj->MESSAGE);
1003 $std_item =& $this->
object->getMediaItem(
"Standard");
1004 $std_item->setLocationType(
"LocalFile");
1007 $std_item->setFormat($format);
1008 $this->
object->update();
1009 $this->ctrl->saveParameter($this,
"cdir");
1010 $this->ctrl->redirect($this,
"editFiles");
1012 $this->ctrl->saveParameter($this,
"cdir");
1013 $this->ctrl->redirect($this,
"editFiles");
1022 if (!isset($_POST[
"file"]))
1024 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1027 if (count($_POST[
"file"]) > 1)
1029 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1033 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
1035 $cur_dir = (!empty($cur_subdir))
1036 ? $mob_dir.
"/".$cur_subdir
1038 $file = $cur_dir.
"/".$_POST[
"file"][0];
1040 ? $cur_subdir.
"/".$_POST[
"file"][0]
1041 : $_POST[
"file"][0];
1045 $this->ilias->raiseError($this->lng->txt(
"cont_select_file"),$this->ilias->error_obj->MESSAGE);
1048 if(!$this->object->hasFullScreenItem())
1050 $std_item =& $this->
object->getMediaItem(
"Standard");
1054 $full_item->setMobId($std_item->getMobId());
1056 $full_item->setLocationType(
"LocalFile");
1058 $full_item->setPurpose(
"Fullscreen");
1059 $this->
object->addMediaItem($full_item);
1063 $full_item =& $this->
object->getMediaItem(
"Fullscreen");
1065 $full_item->setLocationType(
"LocalFile");
1068 $full_item->setFormat($format);
1070 $this->
object->update();
1071 $this->ctrl->saveParameter($this,
"cdir");
1072 $this->ctrl->redirect($this,
"editFiles");
1081 $this->
object->removeMediaItem(
"Fullscreen");
1082 $this->
object->update();
1084 $this->ctrl->redirect($this,
"edit");
1093 if (!$this->object->hasFullScreenItem())
1095 $std_item =& $this->
object->getMediaItem(
"Standard");
1097 $full_item->setMobId($std_item->getMobId());
1098 $full_item->setLocation($std_item->getLocation());
1099 $full_item->setLocationType($std_item->getLocationType());
1100 $full_item->setFormat($std_item->getFormat());
1101 $full_item->setWidth($std_item->getWidth());
1102 $full_item->setHeight($std_item->getHeight());
1103 $full_item->setCaption($std_item->getCaption());
1104 $full_item->setPurpose(
"Fullscreen");
1105 $this->
object->addMediaItem($full_item);
1107 $this->
object->update();
1110 $this->ctrl->redirect($this,
"edit");
1119 if (!isset($_POST[
"file"]))
1121 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1124 if (count($_POST[
"file"]) > 1)
1126 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1129 if ($_POST[
"file"][0] ==
"..")
1131 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1134 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
1136 $cur_dir = (!empty($cur_subdir))
1137 ? $mob_dir.
"/".$cur_subdir
1139 $file = $cur_dir.
"/".$_POST[
"file"][0];
1141 ? $cur_subdir.
"/".$_POST[
"file"][0]
1142 : $_POST[
"file"][0];
1144 $full_item =& $this->object->getMediaItem(
"Fullscreen");
1145 $std_item =& $this->
object->getMediaItem(
"Standard");
1147 if (
$location == $std_item->getLocation())
1149 $this->ilias->raiseError($this->lng->txt(
"cont_cant_del_std"),$this->ilias->error_obj->MESSAGE);
1152 if($this->object->hasFullScreenItem())
1154 if (
$location == $full_item->getLocation())
1156 $this->ilias->raiseError($this->lng->txt(
"cont_cant_del_full"),$this->ilias->error_obj->MESSAGE);
1164 $this->ilias->raiseError($this->lng->txt(
"cont_std_is_in_dir"),$this->ilias->error_obj->MESSAGE);
1167 if($this->object->hasFullScreenItem())
1171 $this->ilias->raiseError($this->lng->txt(
"cont_full_is_in_dir"),$this->ilias->error_obj->MESSAGE);
1176 if (@is_file(
$file))
1186 $this->ctrl->saveParameter($this,
"cdir");
1187 $this->ctrl->redirect($this,
"editFiles");
1197 include_once(
"./Services/MediaObjects/classes/class.ilMediaObjectUsagesTableGUI.php");
1200 $tpl->setContent($usages_table->getHTML());
1210 $tpl =&
new ilTemplate(
"tpl.media_info.html",
true,
true,
"Services/MediaObjects");
1211 $types = array(
"Standard",
"Fullscreen");
1212 foreach ($types as $type)
1214 if($type ==
"Fullscreen" && !$a_mob->hasFullScreenItem())
1219 $med =& $a_mob->getMediaItem($type);
1220 $tpl->setCurrentBlock(
"media_info");
1221 if ($type ==
"Standard")
1223 $tpl->setVariable(
"TXT_PURPOSE", $lng->txt(
"cont_std_view"));
1227 $tpl->setVariable(
"TXT_PURPOSE", $lng->txt(
"cont_fullscreen"));
1229 $tpl->setVariable(
"TXT_TYPE", $lng->txt(
"cont_".strtolower($med->getLocationType())));
1230 $tpl->setVariable(
"VAL_LOCATION", $med->getLocation());
1231 if ($med->getLocationType() ==
"LocalFile")
1242 $tpl->setVariable(
"VAL_FILE_SIZE",
" ($size ".$lng->txt(
"bytes").
")");
1244 $tpl->setVariable(
"TXT_FORMAT", $lng->txt(
"cont_format"));
1245 $tpl->setVariable(
"VAL_FORMAT", $med->getFormat());
1246 if ($med->getWidth() !=
"" && $med->getHeight() !=
"")
1248 $tpl->setCurrentBlock(
"size");
1249 $tpl->setVariable(
"TXT_SIZE", $lng->txt(
"size"));
1250 $tpl->setVariable(
"VAL_SIZE", $med->getWidth().
"x".$med->getHeight());
1251 $tpl->parseCurrentBlock();
1255 if ($orig_size = $med->getOriginalSize())
1257 if ($orig_size[
"width"] != $med->getWidth() ||
1258 $orig_size[
"height"] != $med->getHeight())
1260 $tpl->setCurrentBlock(
"orig_size");
1261 $tpl->setVariable(
"TXT_ORIG_SIZE", $lng->txt(
"cont_orig_size"));
1262 $tpl->setVariable(
"ORIG_WIDTH", $orig_size[
"width"]);
1263 $tpl->setVariable(
"ORIG_HEIGHT", $orig_size[
"height"]);
1264 $tpl->parseCurrentBlock();
1267 $tpl->setCurrentBlock(
"media_info");
1268 $tpl->parseCurrentBlock();
1281 #include_once("classes/class.ilTabsGUI.php");
1282 #$tabs_gui =& new ilTabsGUI();
1283 $this->
getTabs($this->tabs_gui);
1286 if (is_object($this->
object) && strtolower(get_class($this->
object)) ==
"ilobjmediaobject")
1292 $this->tpl->setCurrentBlock();
1293 $title = $this->
object->getTitle();
1294 $this->tpl->setVariable(
"HEADER",
$title);
1303 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"cont_create_mob"));
1315 if (is_object($this->
object) && strtolower(get_class($this->
object)) ==
"ilobjmediaobject"
1316 && $this->object->getId() > 0)
1319 $ilTabs->addTarget(
"cont_mob_def_prop",
1320 $this->ctrl->getLinkTarget($this,
"edit"),
"edit",
1324 $st_item =& $this->
object->getMediaItem(
"Standard");
1327 $format = $st_item->getFormat();
1328 if (substr($format, 0, 5) ==
"image")
1333 $ilTabs->addTarget(
"cont_def_map_areas",
1334 $this->ctrl->getLinkTargetByClass(
1335 array(
"ilobjmediaobjectgui",
"ilimagemapeditorgui"),
"editMapAreas"),
"editMapAreas",
1336 "ilimagemapeditorgui");
1341 $ilTabs->addTarget(
"cont_mob_usages",
1342 $this->ctrl->getLinkTarget($this,
"showUsages"),
"showUsages",
1346 $ilTabs->addTarget(
"cont_files",
1347 $this->ctrl->getLinkTarget($this,
"editFiles"),
"editFiles",
1350 $ilTabs->addTarget(
"meta_data",
1351 $this->ctrl->getLinkTargetByClass(
1352 array(
"ilobjmediaobjectgui",
"ilmdeditorgui"),
'listSection'),
1353 "",
"ilmdeditorgui");
1358 if ($this->back_title !=
"")
1360 $tabs_gui->setBackTarget($this->back_title,
1361 $this->ctrl->getParentReturn($this));