4 require_once (
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
5 require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
6 require_once (
"./Services/Object/classes/class.ilObjectGUI.php");
26 function __construct($a_data, $a_id = 0, $a_call_by_reference =
false, $a_prepare_output =
false)
31 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
33 $this->back_title =
"";
36 $lng->loadLanguageModule(
"mob");
56 $this->enabledmapareas = $a_enabledmapareas;
76 $this->width_preset = $a_val;
86 return $this->width_preset;
96 $this->height_preset = $a_val;
106 return $this->height_preset;
116 return $this->form_gui;
129 $this->ctrl->returnToParent($this);
140 $next_class = $this->ctrl->getNextClass($this);
141 $cmd = $this->ctrl->getCmd();
145 case 'ilobjectmetadatagui':
146 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
149 $md_gui->
addMDObserver($this->
object,
'MDUpdateListener',
'General');
150 $this->ctrl->forwardCommand($md_gui);
153 case "ilimagemapeditorgui":
154 require_once(
"./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php");
156 $ret = $this->ctrl->forwardCommand($image_map_edit);
157 $tpl->setContent(
$ret);
160 case "ilfilesystemgui":
161 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
165 $fs_gui->activateLabels(
true, $this->lng->txt(
"cont_purpose"));
166 $fs_gui->setTableId(
"mobfs".$this->
object->getId());
167 $fs_gui->labelFile($this->
object->getMediaItem(
"Standard")->getLocation(),
168 $this->lng->txt(
"cont_std_view"));
169 if($this->
object->hasFullscreenItem())
171 $fs_gui->labelFile($this->
object->getMediaItem(
"Fullscreen")->getLocation(),
172 $this->lng->txt(
"cont_fullscreen"));
174 $fs_gui->addCommand($this,
"assignStandardObject", $this->lng->txt(
"cont_assign_std"));
175 $fs_gui->addCommand($this,
"assignFullscreenObject", $this->lng->txt(
"cont_assign_full"));
177 $ret = $this->ctrl->forwardCommand($fs_gui);
179 include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
185 if (isset(
$_POST[
"editImagemapForward"]) ||
186 isset(
$_POST[
"editImagemapForward_x"]) ||
187 isset(
$_POST[
"editImagemapForward_y"]))
189 $cmd =
"editImagemapForward";
204 $this->back_title = $a_title;
212 global
$tpl, $ilHelp;
214 $ilHelp->setScreenId(
"create");
216 $tpl->setContent($this->form_gui->getHTML());
226 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
228 if ($a_mode ==
"edit")
230 $std_item = $this->
object->getMediaItem(
"Standard");
238 $title->setMaxLength(120);
239 $this->form_gui->addItem(
$title);
247 $radio_prop->addOption($op1);
250 $ref->
setInfo($lng->txt(
"cont_ref_helptext"));
251 $op2->addSubItem($ref);
252 $radio_prop->addOption($op2);
253 $radio_prop->setValue(
"File");
254 $this->form_gui->addItem($radio_prop);
257 if ($a_mode ==
"edit")
260 $format->
setValue($std_item->getFormat());
261 $this->form_gui->addItem($format);
266 if ($a_mode ==
"edit")
268 if ($orig_size = $std_item->getOriginalSize())
270 $add_str =
" (".$orig_size[
"width"].
" x ".$orig_size[
"height"].
")";
272 $op1 =
new ilRadioOption($lng->txt(
"cont_resource_size").$add_str,
"original");
273 $op2 =
new ilRadioOption($lng->txt(
"cont_custom_size"),
"selected");
277 $op1 =
new ilRadioOption($lng->txt(
"cont_orig_size"),
"original");
278 $op2 =
new ilRadioOption($lng->txt(
"cont_adjust_size"),
"selected");
280 $radio_size->addOption($op1);
283 include_once(
"./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
285 " / ".$lng->txt(
"cont_height"),
"standard_width_height");
287 $op2->addSubItem($width_height);
290 if ($a_mode ==
"edit")
292 $std_item = $this->
object->getMediaItem(
"Standard");
293 if (is_int(strpos($std_item->getFormat(),
"image"))
294 && $std_item->getLocationType() ==
"LocalFile")
297 ,
"standard_resize");
302 $radio_size->setValue(
"original");
305 $radio_size->setValue(
"selected");
309 $radio_size->addOption($op2);
310 $this->form_gui->addItem($radio_size);
315 $caption->setRows(2);
316 $this->form_gui->addItem($caption);
324 if ($a_mode ==
"edit" && is_int(strpos($std_item->getFormat(),
"image")))
329 $ta->setInfo($lng->txt(
"text_repr_info"));
330 $this->form_gui->addItem($ta);
334 if ($a_mode ==
"edit" &&
338 $std_item->getFormat()))
341 $this->form_gui->addItem($auto);
348 $this->form_gui->addItem($par);
352 if ($a_mode ==
"edit")
354 $full_item = $this->
object->getMediaItem(
"Fullscreen");
359 $fs_sec->setTitle($lng->txt(
"cont_fullscreen"));
360 $this->form_gui->addItem($fs_sec);
364 $radio_prop2->addOption($op1);
365 $op4 =
new ilRadioOption($lng->txt(
"cont_use_same_resource_as_above"),
"Standard");
366 $radio_prop2->addOption($op4);
372 $op2->addSubItem($up);
373 $radio_prop2->addOption($op2);
376 $ref->
setInfo($lng->txt(
"cont_ref_helptext"));
377 $op3->addSubItem($ref);
378 $radio_prop2->addOption($op3);
379 $radio_prop2->setValue(
"None");
380 $this->form_gui->addItem($radio_prop2);
383 if ($a_mode ==
"edit")
385 if ($this->
object->hasFullscreenItem())
388 $format->
setValue($full_item->getFormat());
389 $this->form_gui->addItem($format);
395 if ($a_mode ==
"edit")
398 if ($this->
object->hasFullscreenItem() && ($orig_size = $full_item->getOriginalSize()))
400 $add_str =
" (".$orig_size[
"width"].
" x ".$orig_size[
"height"].
")";
402 $op1 =
new ilRadioOption($lng->txt(
"cont_resource_size").$add_str,
"original");
403 $op2 =
new ilRadioOption($lng->txt(
"cont_custom_size"),
"selected");
407 $op1 =
new ilRadioOption($lng->txt(
"cont_orig_size"),
"original");
408 $op2 =
new ilRadioOption($lng->txt(
"cont_adjust_size"),
"selected");
410 $radio_size->addOption($op1);
414 " / ".$lng->txt(
"cont_height"),
"full_width_height");
416 $op2->addSubItem($width_height);
419 if ($a_mode ==
"edit")
421 $full_item = $this->
object->getMediaItem(
"Fullscreen");
422 if ($this->
object->hasFullscreenItem() &&
423 is_int(strpos($full_item->getFormat(),
"image")) &&
424 $full_item->getLocationType() ==
"LocalFile")
432 $radio_size->setValue(
"original");
433 $radio_size->addOption($op2);
434 $this->form_gui->addItem($radio_size);
439 $caption->setRows(2);
440 $this->form_gui->addItem($caption);
448 if ($a_mode ==
"edit" && $this->
object->hasFullscreenItem() && is_int(strpos($std_item->getFormat(),
"image")))
453 $ta->setInfo($lng->txt(
"text_repr_info"));
454 $this->form_gui->addItem($ta);
459 if ($a_mode ==
"edit" && $this->
object->hasFullscreenItem() &&
463 $full_item->getFormat()))
466 $this->form_gui->addItem($auto);
473 $this->form_gui->addItem($par);
477 $this->form_gui->setTitle($lng->txt(
"cont_insert_mob"));
478 if ($a_mode ==
"edit")
480 $this->form_gui->addCommandButton(
"saveProperties", $lng->txt(
"save"));
484 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
485 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
487 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
499 $values[
"standard_title"] = $this->
object->getTitle();
501 $std_item = $this->
object->getMediaItem(
"Standard");
502 if ($std_item->getLocationType() ==
"LocalFile")
504 $values[
"standard_type"] =
"File";
505 $values[
"standard_file"] = $std_item->getLocation();
509 $values[
"standard_type"] =
"Reference";
510 $values[
"standard_reference"] = $std_item->getLocation();
512 $values[
"standard_format"] = $std_item->getFormat();
513 $values[
"standard_width_height"][
"width"] = $std_item->getWidth();
514 $values[
"standard_width_height"][
"height"] = $std_item->getHeight();
515 $values[
"standard_width_height"][
"constr_prop"] =
true;
517 $values[
"standard_size"] =
"selected";
519 if ($orig_size = $std_item->getOriginalSize())
523 if ($std_item->getWidth() ==
"" && $std_item->getHeight() ==
"")
525 $values[
"standard_size"] =
"original";
526 $values[
"standard_width_height"][
"width"] = $orig_size[
"width"];
527 $values[
"standard_width_height"][
"height"] = $orig_size[
"height"];
530 $values[
"standard_caption"] = $std_item->getCaption();
531 $values[
"text_representation"] = $std_item->getTextRepresentation();
533 $std_item->getFormat()))
535 $par = $std_item->getParameters();
536 if ($par[
"autostart"])
538 $values[
"standard_autostart"] =
true;
543 $values[
"standard_parameters"] = $std_item->getParameterString();
546 $values[
"full_type"] =
"None";
547 $values[
"full_size"] =
"original";
548 if ($this->
object->hasFullScreenItem())
550 $full_item = $this->
object->getMediaItem(
"Fullscreen");
551 if ($full_item->getLocationType() ==
"LocalFile")
553 $values[
"full_type"] =
"File";
554 $values[
"full_file"] = $full_item->getLocation();
558 $values[
"full_type"] =
"Reference";
559 $values[
"full_reference"] = $full_item->getLocation();
561 $values[
"full_format"] = $full_item->getFormat();
562 $values[
"full_width_height"][
"width"] = $full_item->getWidth();
563 $values[
"full_width_height"][
"height"] = $full_item->getHeight();
564 $values[
"full_width_height"][
"constr_prop"] =
true;
566 $values[
"full_size"] =
"selected";
568 if ($orig_size = $full_item->getOriginalSize())
570 if ($orig_size[
"width"] == $full_item->getWidth() &&
571 $orig_size[
"height"] == $full_item->getHeight())
573 $values[
"full_size"] =
"original";
576 $values[
"full_caption"] = $full_item->getCaption();
578 $full_item->getFormat()))
580 $par = $full_item->getParameters();
581 if ($par[
"autostart"])
583 $values[
"full_autostart"] =
true;
588 $values[
"full_parameters"] = $full_item->getParameterString();
590 $values[
"full_text_representation"] = $full_item->getTextRepresentation();
593 $this->form_gui->setValuesByArray($values);
604 if ($this->form_gui->checkInput())
613 $this->form_gui->setValuesByPost();
614 $tpl->setContent($this->form_gui->getHTML());
627 if (!$this->form_gui->checkInput())
629 $this->form_gui->setValuesByPost();
642 if (trim(
$_POST[
"standard_title"]) !=
"")
648 if (
$_POST[
"standard_type"] ==
"File")
650 $title = $_FILES[
'standard_file'][
'name'];
659 $a_mob->setDescription(
"");
664 $a_mob->createDirectory();
668 $a_mob->addMediaItem($media_item);
669 $media_item->setPurpose(
"Standard");
671 if (
$_POST[
"standard_type"] ==
"File")
674 $file = $mob_dir.
"/".$file_name;
683 if (
$_POST[
"standard_size"] !=
"original" &&
684 is_int(strpos($format,
"image")))
687 (
int) $_POST[
"standard_width_height"][
"height"], (
boolean) $_POST[
"standard_width_height"][
"contr_prop"]);
691 $media_item->setFormat($format);
693 $media_item->setLocationType(
"LocalFile");
698 $media_item->setFormat($format);
700 $media_item->setLocationType(
"Reference");
702 $a_mob->setDescription($format);
706 $_POST[
"standard_type"], $mob_dir.
"/".
$location, $media_item->getLocation(),
707 $_POST[
"standard_width_height"][
"constr_prop"], (
$_POST[
"standard_size"] ==
"original"),
708 $_POST[
"standard_width_height"][
"width"], $_POST[
"standard_width_height"][
"height"]);
709 $media_item->setWidth($wh[
"width"]);
710 $media_item->setHeight($wh[
"height"]);
711 if ($wh[
"info"] !=
"")
716 if ($_POST[
"standard_caption"] !=
"")
722 $media_item->setHAlign(
"Left");
725 if ($_POST[
"full_type"] !=
"None")
728 $a_mob->addMediaItem($media_item2);
729 $media_item2->setPurpose(
"Fullscreen");
732 if ($_POST[
"full_type"] ==
"File")
735 if ($_FILES[
'full_file'][
'name'] !=
"")
738 $file = $mob_dir.
"/".$full_file_name;
740 $full_file_name,
$file);
745 else if ($_POST[
"full_type"] ==
"Standard" && $_POST[
"standard_type"] ==
"File")
751 if ($_POST[
"full_type"] ==
"File" ||
752 ($_POST[
"full_type"] ==
"Standard" && $_POST[
"standard_type"] ==
"File"))
754 if (($_POST[
"full_size"] !=
"original" &&
755 is_int(strpos($format,
"image")))
759 (
int) $_POST[
"full_width_height"][
"height"], (
boolean) $_POST[
"full_width_height"][
"constr_prop"]);
762 $media_item2->setFormat($format);
764 $media_item2->setLocationType(
"LocalFile");
768 if ($_POST[
"full_type"] ==
"Reference")
771 if ($_POST[
"full_reference"] !=
"")
778 if ($_POST[
"full_type"] ==
"Reference" ||
779 ($_POST[
"full_type"] ==
"Standard" && $_POST[
"standard_type"] ==
"Reference"))
781 $media_item2->setFormat($format);
783 $media_item2->setLocationType(
"Reference");
789 $type, $mob_dir.
"/".
$location, $media_item2->getLocation(),
790 $_POST[
"full_width_height"][
"constr_prop"], ($_POST[
"full_size"] ==
"original"),
791 $_POST[
"full_width_height"][
"width"], $_POST[
"full_width_height"][
"height"]);
793 $media_item2->setWidth($wh[
"width"]);
794 $media_item2->setHeight($wh[
"height"]);
796 if ($_POST[
"full_caption"] !=
"")
804 include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
815 $this->ctrl->returnToParent($this);
829 $tpl->setContent($this->form_gui->getHTML());
842 $std_item = $this->
object->getMediaItem(
"Standard");
843 if ($std_item->getLocationType() ==
"LocalFile" &&
844 is_int(strpos($std_item->getFormat(),
"image"))
847 $file = $mob_dir.
"/".$std_item->getLocation();
849 $std_item->getHeight());
855 if($this->
object->hasFullScreenItem())
857 $full_item = $this->
object->getMediaItem(
"Fullscreen");
858 if ($full_item->getLocationType() ==
"LocalFile" &&
859 is_int(strpos($full_item->getFormat(),
"image"))
862 $file = $mob_dir.
"/".$full_item->getLocation();
864 $full_item->getHeight());
866 $full_item->update();
870 $this->ctrl->redirect($this,
"edit");
879 $std_item = $this->
object->getMediaItem(
"Standard");
882 if ($std_item->getLocationType() ==
"LocalFile")
884 $file = $mob_dir.
"/".$std_item->getLocation();
886 include_once(
"./Services/MediaObjects/classes/class.ilMediaImageUtil.php");
889 $std_item->setWidth(
$size[0]);
890 $std_item->setHeight(
$size[1]);
891 $this->
object->update();
893 $this->ctrl->redirect($this,
"edit");
902 $full_item = $this->
object->getMediaItem(
"Fullscreen");
905 if ($full_item->getLocationType() ==
"LocalFile")
907 $file = $mob_dir.
"/".$full_item->getLocation();
908 include_once(
"./Services/MediaObjects/classes/class.ilMediaImageUtil.php");
910 $full_item->setWidth(
$size[0]);
911 $full_item->setHeight(
$size[1]);
912 $this->
object->update();
914 $this->ctrl->redirect($this,
"edit");
925 if ($this->form_gui->checkInput())
928 $this->
object->setTitle(
$title);
930 $std_item = $this->
object->getMediaItem(
"Standard");
932 $format = $std_item->getFormat();
933 if (
$_POST[
"standard_type"] ==
"Reference")
936 $std_item->setFormat($format);
938 $std_item->setLocationType(
"Reference");
941 if (
$_POST[
"standard_type"] ==
"File")
944 if ($_FILES[
'standard_file'][
'name'] !=
"")
947 $file = $mob_dir.
"/".$file_name;
957 else if (
$_POST[
"standard_resize"])
966 if (
$_POST[
"standard_size"] !=
"original" &&
967 is_int(strpos($format,
"image")))
970 (
int) $_POST[
"standard_width_height"][
"height"], (
boolean) $_POST[
"standard_width_height"][
"contr_prop"]);
972 $std_item->setFormat($format);
976 $std_item->setLocationType(
"LocalFile");
978 $this->
object->setDescription($format);
981 $_POST[
"standard_type"], $mob_dir.
"/".
$location, $std_item->getLocation(),
982 $_POST[
"standard_width_height"][
"constr_prop"], (
$_POST[
"standard_size"] ==
"original"),
983 $_POST[
"standard_width_height"][
"width"], $_POST[
"standard_width_height"][
"height"]);
984 if ($wh[
"info"] !=
"")
988 $std_item->setWidth($wh[
"width"]);
989 $std_item->setHeight($wh[
"height"]);
1001 $std_item->getFormat()))
1003 if ($_POST[
"standard_autostart"])
1005 $std_item->setParameters(
'autostart="true"');
1009 $std_item->setParameters(
"");
1019 if ($_POST[
"full_type"] ==
"None")
1021 if ($this->
object->hasFullscreenItem())
1023 $this->
object->removeMediaItem(
"Fullscreen");
1028 if ($this->
object->hasFullscreenItem())
1030 $full_item = $this->
object->getMediaItem(
"Fullscreen");
1035 $this->
object->addMediaItem($full_item);
1036 $full_item->setPurpose(
"Fullscreen");
1039 $format = $full_item->getFormat();
1040 if ($_POST[
"full_type"] ==
"Reference")
1043 $full_item->setFormat($format);
1044 $full_item->setLocationType(
"Reference");
1046 $type =
"Reference";
1049 if ($_POST[
"full_type"] ==
"File")
1052 if ($_FILES[
'full_file'][
'name'] !=
"")
1055 $file = $mob_dir.
"/".$full_file_name;
1057 $full_file_name,
$file);
1064 else if ($_POST[
"full_resize"])
1073 if ($_POST[
"full_size"] !=
"original" &&
1074 is_int(strpos($format,
"image")))
1077 (
int) $_POST[
"full_width_height"][
"height"], (
boolean) $_POST[
"full_width_height"][
"contr_prop"]);
1079 $full_item->setFormat($format);
1083 $full_item->setLocationType(
"LocalFile");
1086 if ($_POST[
"full_type"] ==
"Standard")
1088 $format = $std_item->getFormat();
1090 $full_item->setLocationType($std_item->getLocationType());
1091 $full_item->setFormat($format);
1093 $type = $std_item->getLocationType();
1094 if ($type ==
"LocalFile")
1100 if ($_POST[
"full_size"] !=
"original" &&
1101 is_int(strpos($format,
"image")) &&
1102 $full_item->getLocationType() ==
"LocalFile")
1106 (
int) $_POST[
"full_width_height"][
"height"], (
boolean) $_POST[
"full_width_height"][
"contr_prop"]);
1112 $type, $mob_dir.
"/".
$location, $full_item->getLocation(),
1113 $_POST[
"full_width_height"][
"constr_prop"], ($_POST[
"full_size"] ==
"original"),
1114 $_POST[
"full_width_height"][
"width"], $_POST[
"full_width_height"][
"height"]);
1115 if ($wh[
"info"] !=
"")
1120 $full_item->setWidth($wh[
"width"]);
1121 $full_item->setHeight($wh[
"height"]);
1134 $std_item->getFormat()))
1136 if ($_POST[
"full_autostart"])
1138 $full_item->setParameters(
'autostart="true"');
1142 $full_item->setParameters(
"");
1153 include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
1156 $this->
object->update();
1158 $this->ctrl->redirect($this,
"edit");
1162 $this->form_gui->setValuesByPost();
1163 $tpl->setContent($this->form_gui->getHTML());
1174 $std_item = $this->
object->getMediaItem(
"Standard");
1175 if($this->
object->hasFullscreenItem())
1177 $full_item = $this->
object->getMediaItem(
"Fullscreen");
1181 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
1185 $cur_subdir =
$_GET[
"cdir"];
1186 if(
$_GET[
"newdir"] ==
"..")
1188 $cur_subdir = substr($cur_subdir, 0, strrpos($cur_subdir,
"/"));
1192 if (!empty(
$_GET[
"newdir"]))
1194 if (!empty($cur_subdir))
1196 $cur_subdir = $cur_subdir.
"/".
$_GET[
"newdir"];
1200 $cur_subdir =
$_GET[
"newdir"];
1205 $cur_subdir = str_replace(
".",
"", $cur_subdir);
1207 $cur_dir = (!empty($cur_subdir))
1208 ? $mob_dir.
"/".$cur_subdir
1212 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.mob_files.html",
"Services/MediaObjects");
1214 $this->ctrl->setParameter($this,
"cdir", urlencode($cur_subdir));
1215 $this->tpl->setVariable(
"FORMACTION1", $this->ctrl->getFormAction($this));
1218 $this->tpl->setVariable(
"TXT_NEW_DIRECTORY", $this->lng->txt(
"cont_new_dir"));
1219 $this->tpl->setVariable(
"TXT_NEW_FILE", $this->lng->txt(
"cont_new_file"));
1220 $this->tpl->setVariable(
"CMD_NEW_DIR",
"createDirectory");
1221 $this->tpl->setVariable(
"CMD_NEW_FILE",
"uploadFile");
1222 $this->tpl->setVariable(
"BTN_NEW_DIR", $this->lng->txt(
"create"));
1223 $this->tpl->setVariable(
"BTN_NEW_FILE", $this->lng->txt(
"upload"));
1226 $this->tpl->addBlockfile(
"FILE_TABLE",
"files",
"tpl.table.html");
1229 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.mob_file_row.html",
"Services/MediaObjects");
1233 $obj_str = ($this->call_by_reference) ?
"" :
"&obj_id=".$this->obj_id;
1234 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1236 $tbl->setTitle($this->lng->txt(
"cont_files").
" ".$cur_subdir);
1239 $tbl->setHeaderNames(
array(
"",
"", $this->lng->txt(
"cont_dir_file"),
1240 $this->lng->txt(
"cont_size"), $this->lng->txt(
"cont_purpose")));
1242 $cols =
array(
"",
"",
"dir_file",
"size",
"purpose");
1243 $header_params =
array(
"ref_id" =>
$_GET[
"ref_id"],
"obj_id" =>
$_GET[
"obj_id"],
1244 "cmd" =>
"editFiles",
"hier_id" =>
$_GET[
"hier_id"],
"item_id" =>
$_GET[
"item_id"]);
1245 $tbl->setHeaderVars($cols, $header_params);
1246 $tbl->setColumnWidth(
array(
"1%",
"1%",
"33%",
"33%",
"32%"));
1250 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1253 $tbl->setMaxCount($this->maxcount);
1256 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
1260 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1261 $this->tpl->setVariable(
"BTN_NAME",
"deleteFile");
1262 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
1263 $this->tpl->parseCurrentBlock();
1265 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1266 $this->tpl->setVariable(
"BTN_NAME",
"assignStandard");
1267 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_assign_std"));
1268 $this->tpl->parseCurrentBlock();
1270 $this->tpl->setCurrentBlock(
"tbl_action_btn");
1271 $this->tpl->setVariable(
"BTN_NAME",
"assignFullscreen");
1272 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_assign_full"));
1273 $this->tpl->parseCurrentBlock();
1276 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1282 $tbl->setMaxCount(count($entries));
1283 $entries = array_slice($entries,
$_GET[
"offset"],
$_GET[
"limit"]);
1286 if(count($entries) > 0)
1289 foreach($entries as $entry)
1291 if(($entry[
"entry"] ==
".") || ($entry[
"entry"] ==
".." && empty($cur_subdir)))
1297 if($entry[
"type"] ==
"dir")
1299 $this->tpl->setCurrentBlock(
"FileLink");
1300 $this->ctrl->setParameter($this,
"cdir", $cur_subdir);
1301 $this->ctrl->setParameter($this,
"newdir", rawurlencode($entry[
"entry"]));
1302 $this->tpl->setVariable(
"LINK_FILENAME", $this->ctrl->getLinkTarget($this,
"editFiles"));
1303 $this->tpl->setVariable(
"TXT_FILENAME", $entry[
"entry"]);
1304 $this->tpl->parseCurrentBlock();
1306 $this->tpl->setVariable(
"ICON",
"<img src=\"".
1311 $this->tpl->setCurrentBlock(
"File");
1312 $this->tpl->setVariable(
"TXT_FILENAME2", $entry[
"entry"]);
1313 $this->tpl->parseCurrentBlock();
1316 $this->tpl->setCurrentBlock(
"tbl_content");
1318 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1320 $this->tpl->setVariable(
"TXT_SIZE", $entry[
"size"]);
1321 $this->tpl->setVariable(
"CHECKBOX_ID", $entry[
"entry"]);
1322 $compare = (!empty($cur_subdir))
1323 ? $cur_subdir.
"/".$entry[
"entry"]
1326 if ($std_item->getLocation() == $compare)
1328 $purpose[] = $this->lng->txt(
"cont_std_view");
1330 if($this->
object->hasFullscreenItem())
1332 if ($full_item->getLocation() == $compare)
1334 $purpose[] = $this->lng->txt(
"cont_fullscreen");
1337 $this->tpl->setVariable(
"TXT_PURPOSE", implode($purpose,
", "));
1339 $this->tpl->parseCurrentBlock();
1344 $this->tpl->setCurrentBlock(
"notfound");
1345 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1346 $this->tpl->setVariable(
"NUM_COLS", 4);
1347 $this->tpl->parseCurrentBlock();
1350 $this->tpl->parseCurrentBlock();
1361 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
1363 $cur_dir = (!empty($cur_subdir))
1364 ? $mob_dir.
"/".$cur_subdir
1367 $new_dir = str_replace(
".",
"",
$_POST[
"new_dir"]);
1368 $new_dir = str_replace(
"/",
"", $new_dir);
1370 if (!empty($new_dir))
1374 $this->ctrl->saveParameter($this,
"cdir");
1375 $this->ctrl->redirect($this,
"editFiles");
1384 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
1386 $cur_dir = (!empty($cur_subdir))
1387 ? $mob_dir.
"/".$cur_subdir
1389 if (is_file($_FILES[
"new_file"][
"tmp_name"]))
1392 $file = $cur_dir.
"/".$file_name;
1398 include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
1401 $this->ctrl->saveParameter($this,
"cdir");
1402 $this->ctrl->redirect($this,
"editFiles");
1411 $cur_subdir = dirname($a_file);
1413 $cur_dir = (!empty($cur_subdir))
1414 ? $mob_dir.
"/".$cur_subdir
1416 $file = $cur_dir.
"/".basename($a_file);
1421 $this->
ilias->raiseError($this->lng->txt(
"cont_select_file"),$this->
ilias->error_obj->MESSAGE);
1424 $std_item = $this->
object->getMediaItem(
"Standard");
1425 $std_item->setLocationType(
"LocalFile");
1428 $std_item->setFormat($format);
1429 $this->
object->update();
1431 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
1441 $cur_subdir = dirname($a_file);
1443 $cur_dir = (!empty($cur_subdir))
1444 ? $mob_dir.
"/".$cur_subdir
1446 $file = $cur_dir.
"/".basename($a_file);
1451 $this->
ilias->raiseError($this->lng->txt(
"cont_select_file"),$this->
ilias->error_obj->MESSAGE);
1454 if(!$this->
object->hasFullScreenItem())
1456 $std_item = $this->
object->getMediaItem(
"Standard");
1460 $full_item->setMobId($std_item->getMobId());
1462 $full_item->setLocationType(
"LocalFile");
1464 $full_item->setPurpose(
"Fullscreen");
1465 $this->
object->addMediaItem($full_item);
1469 $full_item = $this->
object->getMediaItem(
"Fullscreen");
1471 $full_item->setLocationType(
"LocalFile");
1474 $full_item->setFormat($format);
1476 $this->
object->update();
1478 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
1487 $this->
object->removeMediaItem(
"Fullscreen");
1488 $this->
object->update();
1490 $this->ctrl->redirect($this,
"edit");
1499 if (!$this->
object->hasFullScreenItem())
1501 $std_item = $this->
object->getMediaItem(
"Standard");
1503 $full_item->setMobId($std_item->getMobId());
1504 $full_item->setLocation($std_item->getLocation());
1505 $full_item->setLocationType($std_item->getLocationType());
1506 $full_item->setFormat($std_item->getFormat());
1507 $full_item->setWidth($std_item->getWidth());
1508 $full_item->setHeight($std_item->getHeight());
1509 $full_item->setCaption($std_item->getCaption());
1510 $full_item->setTextRepresentation($std_item->getTextRepresentation());
1511 $full_item->setPurpose(
"Fullscreen");
1512 $this->
object->addMediaItem($full_item);
1514 $this->
object->update();
1517 $this->ctrl->redirect($this,
"edit");
1526 if (!isset(
$_POST[
"file"]))
1528 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
1531 if (count(
$_POST[
"file"]) > 1)
1533 $this->
ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->
ilias->error_obj->MESSAGE);
1536 if (
$_POST[
"file"][0] ==
"..")
1538 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
1541 $cur_subdir = str_replace(
".",
"",
$_GET[
"cdir"]);
1543 $cur_dir = (!empty($cur_subdir))
1544 ? $mob_dir.
"/".$cur_subdir
1548 ? $cur_subdir.
"/".
$_POST[
"file"][0]
1551 $full_item = $this->object->getMediaItem(
"Fullscreen");
1552 $std_item = $this->
object->getMediaItem(
"Standard");
1554 if (
$location == $std_item->getLocation())
1556 $this->
ilias->raiseError($this->lng->txt(
"cont_cant_del_std"),$this->
ilias->error_obj->MESSAGE);
1559 if($this->
object->hasFullScreenItem())
1561 if (
$location == $full_item->getLocation())
1563 $this->
ilias->raiseError($this->lng->txt(
"cont_cant_del_full"),$this->
ilias->error_obj->MESSAGE);
1571 $this->
ilias->raiseError($this->lng->txt(
"cont_std_is_in_dir"),$this->
ilias->error_obj->MESSAGE);
1574 if($this->
object->hasFullScreenItem())
1578 $this->
ilias->raiseError($this->lng->txt(
"cont_full_is_in_dir"),$this->
ilias->error_obj->MESSAGE);
1583 if (@is_file(
$file))
1593 $this->ctrl->saveParameter($this,
"cdir");
1594 $this->ctrl->redirect($this,
"editFiles");
1613 $ilTabs->addSubTab(
"current_usages", $lng->txt(
"cont_current_usages"),
1614 $ilCtrl->getLinkTarget($this,
"showUsages"));
1616 $ilTabs->addSubTab(
"all_usages", $lng->txt(
"cont_all_usages"),
1617 $ilCtrl->getLinkTarget($this,
"showAllUsages"));
1621 $ilTabs->activateSubTab(
"all_usages");
1622 $cmd =
"showAllUsages";
1626 $ilTabs->activateSubTab(
"current_usages");
1627 $cmd =
"showUsages";
1630 include_once(
"./Services/MediaObjects/classes/class.ilMediaObjectUsagesTableGUI.php");
1632 $this->
object, $a_all);
1633 $tpl->setContent($usages_table->getHTML());
1643 $tpl =
new ilTemplate(
"tpl.media_info.html",
true,
true,
"Services/MediaObjects");
1644 $types =
array(
"Standard",
"Fullscreen");
1645 foreach ($types as $type)
1647 if($type ==
"Fullscreen" && !$a_mob->hasFullScreenItem())
1652 $med = $a_mob->getMediaItem($type);
1658 $tpl->setCurrentBlock(
"media_info");
1659 if ($type ==
"Standard")
1661 $tpl->setVariable(
"TXT_PURPOSE", $lng->txt(
"cont_std_view"));
1665 $tpl->setVariable(
"TXT_PURPOSE", $lng->txt(
"cont_fullscreen"));
1667 $tpl->setVariable(
"TXT_TYPE", $lng->txt(
"cont_".strtolower($med->getLocationType())));
1668 $tpl->setVariable(
"VAL_LOCATION", $med->getLocation());
1669 if ($med->getLocationType() ==
"LocalFile")
1680 $tpl->setVariable(
"VAL_FILE_SIZE",
" ($size ".$lng->txt(
"bytes").
")");
1682 $tpl->setVariable(
"TXT_FORMAT", $lng->txt(
"cont_format"));
1683 $tpl->setVariable(
"VAL_FORMAT", $med->getFormat());
1684 if ($med->getWidth() !=
"" && $med->getHeight() !=
"")
1686 $tpl->setCurrentBlock(
"size");
1687 $tpl->setVariable(
"TXT_SIZE", $lng->txt(
"size"));
1688 $tpl->setVariable(
"VAL_SIZE", $med->getWidth().
"x".$med->getHeight());
1689 $tpl->parseCurrentBlock();
1693 if ($orig_size = $med->getOriginalSize())
1695 if ($orig_size[
"width"] != $med->getWidth() ||
1696 $orig_size[
"height"] != $med->getHeight())
1698 $tpl->setCurrentBlock(
"orig_size");
1699 $tpl->setVariable(
"TXT_ORIG_SIZE", $lng->txt(
"cont_orig_size"));
1700 $tpl->setVariable(
"ORIG_WIDTH", $orig_size[
"width"]);
1701 $tpl->setVariable(
"ORIG_HEIGHT", $orig_size[
"height"]);
1702 $tpl->parseCurrentBlock();
1707 if($med && strlen($med->getCaption()))
1709 $tpl->setCurrentBlock(
'additional_info');
1710 $tpl->setVariable(
'ADD_INFO',$lng->txt(
'cont_caption').
': '.$med->getCaption());
1711 $tpl->parseCurrentBlock();
1715 if ($type ==
"Standard")
1717 include_once
'./Services/MetaData/classes/class.ilMDKeyword.php';
1720 $tpl->setCurrentBlock(
'additional_info');
1721 $tpl->setVariable(
'ADD_INFO',$lng->txt(
'keywords').
': '.implode(
', ',$kws));
1722 $tpl->parseCurrentBlock();
1726 $tpl->setCurrentBlock(
"media_info");
1727 $tpl->parseCurrentBlock();
1745 $this->tpl->clearHeader();
1746 if (is_object($this->
object) && strtolower(get_class($this->
object)) ==
"ilobjmediaobject")
1749 $this->tpl->setTitle($this->
object->getTitle());
1755 $this->tpl->setTitle($this->lng->txt(
"cont_create_mob"));
1767 $ilHelp->setScreenIdComponent(
"mob");
1770 if (is_object($this->
object) && strtolower(get_class($this->
object)) ==
"ilobjmediaobject" 1771 && $this->
object->getId() > 0)
1774 $this->tabs_gui->addTarget(
"cont_mob_def_prop",
1775 $this->ctrl->getLinkTarget($this,
"edit"),
"edit",
1778 $st_item = $this->
object->getMediaItem(
"Standard");
1781 if (substr($st_item->getFormat(), 0, 6) ==
"video/" && DEVMODE)
1783 $this->tabs_gui->addTarget(
"mob_video_tools",
1784 $this->ctrl->getLinkTargetByClass(
"ilobjmediaobjectgui",
"showVideoTool"),
1785 "showVideoTool",
"ilobjmediaobjectgui");
1792 $format = $st_item->getFormat();
1793 if (substr($format, 0, 5) ==
"image" && !is_int(strpos($format,
"svg")))
1795 $this->tabs_gui->addTarget(
"cont_def_map_areas",
1796 $this->ctrl->getLinkTargetByClass(
1797 array(
"ilobjmediaobjectgui",
"ilimagemapeditorgui"),
"editMapAreas"),
"editMapAreas",
1798 "ilimagemapeditorgui");
1803 $this->tabs_gui->addTarget(
"cont_mob_usages",
1804 $this->ctrl->getLinkTarget($this,
"showUsages"),
"showUsages",
1808 $std_item = $this->
object->getMediaItem(
"Standard");
1809 $full_item = $this->
object->getMediaItem(
"Fullscreen");
1811 if ($mset->get(
"file_manager_always") ||
1820 $this->tabs_gui->addTarget(
"cont_files",
1821 $this->ctrl->getLinkTargetByClass(
1822 array(
"ilobjmediaobjectgui",
"ilfilesystemgui"),
"listFiles"),
"",
1826 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
1828 $mdtab = $mdgui->
getTab(
"ilobjmediaobjectgui");
1831 $this->tabs_gui->addTarget(
"meta_data",
1833 "",
"ilmdeditorgui");
1839 if ($this->back_title !=
"")
1841 $this->tabs_gui->setBackTarget($this->back_title,
1842 $this->ctrl->getParentReturn($this));
1856 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1863 $formats_str = implode($formats,
"<br />");
1864 $tpl->setContent($formats_str);
1880 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
1881 iljQueryUtil::initjQUery($a_tpl);
1882 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
1884 $a_tpl->addJavascript(
"./Services/COPage/js/ilCOPagePres.js");
1886 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1899 $ilTabs->activateTab(
"cont_mob_def_prop");
1901 $ilTabs->addSubTab(
"general",
1902 $lng->txt(
"mob_general"),
1903 $ilCtrl->getLinkTarget($this,
"edit"));
1905 if ($this->
object->getMediaItem(
"Standard")->getFormat() ==
"video/webm" ||
1906 $this->
object->getMediaItem(
"Standard")->getFormat() ==
"video/mp4")
1908 $ilTabs->addSubTab(
"subtitles",
1909 $lng->txt(
"mob_subtitles"),
1910 $ilCtrl->getLinkTarget($this,
"listSubtitleFiles"));
1913 $ilTabs->activateSubTab($a_active);
1929 $ilToolbar->setFormAction($ilCtrl->getFormAction($this),
true);
1930 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1931 $fi =
new ilFileInputGUI($lng->txt(
"mob_subtitle_file").
" (.srt)",
"subtitle_file");
1933 $ilToolbar->addInputItem($fi,
true);
1936 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1937 include_once(
"./Services/MetaData/classes/class.ilMDLanguageItem.php");
1941 $si->setValue($ilUser->getLanguage());
1942 $ilToolbar->addInputItem(
$si,
true);
1944 $ilToolbar->addFormButton($lng->txt(
"upload"),
"uploadSubtitleFile");
1946 $ilToolbar->addSeparator();
1947 $ilToolbar->addFormButton($lng->txt(
"mob_upload_multi_srt"),
"uploadMultipleSubtitleFileForm");
1949 include_once(
"./Services/MediaObjects/classes/class.ilMobSubtitleTableGUI.php");
1952 $tpl->setContent(
$tab->getHTML());
1969 $ilCtrl->redirect($this,
"listSubtitleFiles");
1979 $lng->loadLanguageModule(
"meta");
1981 if (!is_array(
$_POST[
"srt"]) || count(
$_POST[
"srt"]) == 0)
1984 $ilCtrl->redirect($this,
"listSubtitleFiles");
1988 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1990 $cgui->setFormAction($ilCtrl->getFormAction($this));
1991 $cgui->setHeaderText($lng->txt(
"mob_really_delete_srt"));
1992 $cgui->setCancel($lng->txt(
"cancel"),
"listSubtitleFiles");
1993 $cgui->setConfirm($lng->txt(
"delete"),
"deleteSrtFiles");
1995 foreach (
$_POST[
"srt"] as $i)
1997 $cgui->addItem(
"srt[]", $i,
"subtitle_".$i.
".srt (".$lng->txt(
"meta_l_".$i).
")");
2000 $tpl->setContent($cgui->getHTML());
2011 foreach (
$_POST[
"srt"] as $i)
2013 if (strlen($i) == 2 && !is_int(strpos($i,
".")))
2015 $this->
object->removeAdditionalFile(
"srt/subtitle_".$i.
".srt");
2019 $ilCtrl->redirect($this,
"listSubtitleFiles");
2037 $ilToolbar->setFormAction($ilCtrl->getFormAction($this),
true);
2038 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
2039 $fi =
new ilFileInputGUI($lng->txt(
"mob_subtitle_file").
" (.zip)",
"subtitle_file");
2041 $ilToolbar->addInputItem($fi,
true);
2043 $ilToolbar->addFormButton($lng->txt(
"upload"),
"uploadMultipleSubtitleFile");
2054 $this->ctrl->redirect($this,
"showMultiSubtitleConfirmationTable");
2059 $this->ctrl->redirect($this,
"uploadMultipleSubtitleFileForm");
2073 include_once(
"./Services/MediaObjects/classes/class.ilMultiSrtConfirmationTable2GUI.php");
2075 $tpl->setContent(
$tab->getHTML());
2083 $this->
object->clearMultiSrtDirectory();
2084 $this->ctrl->redirect($this,
"listSubtitleFiles");
2093 $srt_files = $this->
object->getMultiSrtFiles();
2094 if (is_array(
$_POST[
"file"]))
2096 foreach (
$_POST[
"file"] as $f)
2098 foreach ($srt_files as $srt_file)
2100 if ($f == $srt_file[
"filename"])
2102 $this->
object->uploadSrtFile($this->
object->getMultiSrtUploadDir().
"/".$srt_file[
"filename"], $srt_file[
"lang"],
"rename");
2107 $this->
object->clearMultiSrtDirectory();
2108 $ilCtrl->redirect($this,
"listSubtitleFiles");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
setValue($a_value)
Set Value.
TableGUI class for subtitle list.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
static getSupportedFormatsInfo()
Get all supported formats.
setInfo($a_info)
Set Info.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
List srt files from zip file for upload confirmation.
if(!is_array($argv)) $options
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjectGUI Basic methods of all Output classes.
special template class to simplify handling of ITX/PEAR
setAllowedSuffixes($a_suffixes)
Set allowed Suffixes.
This class represents a text property in a property form.
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
setCols($a_cols)
Set Cols.
redirection script todo: (a better solution should control the processing via a xml file) ...
Add a drawing to the header
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
User interface class for map editor.
static secureLink($a_str)
This class represents a non editable value in a property form.
setRows($a_rows)
Set Rows.
Create new PHPExcel object
obj_idprivate
This class represents a text area property in a property form.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
static getLocalMaphilightPath()
Get local path of maphilight file.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
File System Explorer GUI class.
static lookupKeywords($a_rbac_id, $a_obj_id, $a_return_ids=false)
Lookup Keywords.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
Confirmation screen class.