33     protected \ILIAS\MediaObjects\Video\GUIService 
$video_gui;
    51     protected \ILIAS\MediaObjects\MediaType\MediaTypeManager 
$media_type;
    62         bool $a_call_by_reference = 
false,
    63         bool $a_prepare_output = 
false    67         $this->
access = $DIC->access();
    68         $this->error = $DIC[
"ilErr"];
    69         $this->
help = $DIC[
"ilHelp"];
    70         $this->
tabs = $DIC->tabs();
    71         $this->
toolbar = $DIC->toolbar();
    72         $this->
user = $DIC->user();
    73         $lng = $DIC->language();
    74         $ilCtrl = $DIC->ctrl();
    75         $domain = $DIC->mediaObjects()
    78         $this->media_type = $domain->mediaType();
    80         $this->
ctrl = $ilCtrl;
    83         $this->back_title = 
"";
    86         $this->sub_title_request = $DIC->mediaObjects()
    93         $this->file_service_settings = $DIC->fileServiceSettings();
    94         $this->video_gui = $DIC->mediaObjects()->internal()->gui()->video();
    95         $this->md = $DIC->mediaObjects()->internal()->domain()->metadata();
    96         $this->media_manager = $domain->mediaObject();
   106         string $a_adv_subtype = 
"-"   108         $this->adv_ref_id = $a_adv_ref_id;
   109         $this->adv_type = $a_adv_type;
   110         $this->adv_subtype = $a_adv_subtype;
   119         if ($this->adv_type == null) {
   139         bool $a_enabledmapareas
   141         $this->enabledmapareas = $a_enabledmapareas;
   154         $this->width_preset = $a_val;
   167         $this->height_preset = $a_val;
   182         if ($this->
id != 0) {
   192         $this->
ctrl->returnToParent($this);
   202         $next_class = $this->
ctrl->getNextClass($this);
   203         $cmd = $this->
ctrl->getCmd();
   206         switch ($next_class) {
   207             case 'ilobjectmetadatagui':
   210                 $md_gui->
addMDObserver($this->
object, 
'MDUpdateListener', 
'General');
   213                 if ($this->adv_type != 
"") {
   214                     $md_gui->setAdvMdRecordObject($this->adv_ref_id, $this->adv_type, $this->adv_subtype);
   217                 $this->
ctrl->forwardCommand($md_gui);
   220             case "ilimagemapeditorgui":
   224                 $ret = $this->
ctrl->forwardCommand($image_map_edit);
   229             case strtolower(ilContainerResourceGUI::class):
   230                 $res = $this->media_manager->getContainerResource($this->
object->getId());
   235                     $this->
lng->txt(
'files'),
   248                 $this->
ctrl->forwardCommand($container_gui);
   253                 $ret = $this->$cmd();
   260         $this->back_title = $a_title;
   273     public function initForm(
string $a_mode = 
"create"): void
   281         if ($a_mode == 
"edit") {
   282             $std_item = $this->
object->getMediaItem(
"Standard");
   290         $title->setMaxLength(120);
   291         $this->form_gui->addItem($title);
   295         $up->setSuffixes(iterator_to_array($this->media_type->getAllowedSuffixes()));
   298         if ($a_mode == 
"create" || $std_item->getLocationType() != 
"LocalFile") {
   299             $up->setRequired(
true);
   302         $radio_prop->addOption($op1);
   306         $ref->setRequired(
true);
   308         $radio_prop->addOption($op2);
   309         $radio_prop->setValue(
"File");
   310         $this->form_gui->addItem($radio_prop);
   313         if ($a_mode == 
"edit") {
   315             $format->setValue($std_item->getFormat());
   316             $this->form_gui->addItem($format);
   321         if ($a_mode == 
"edit") {
   322             if ($orig_size = $std_item->getOriginalSize()) {
   323                 $add_str = 
" (" . ($orig_size[
"width"] ?? 
"") . 
" x " . ($orig_size[
"height"] ?? 
"") . 
")";
   333         $radio_size->addOption($op1);
   337                 " / " . 
$lng->
txt(
"cont_height"), 
"standard_width_height");
   338         if ($a_mode == 
"edit" && is_int(strpos($std_item->getFormat(), 
"image"))
   339             && $std_item->getLocationType() == 
"LocalFile") {
   341             $width_height->setConstrainProportions(
true);
   343         $op2->addSubItem($width_height);
   346         if ($a_mode == 
"edit") {
   347             $std_item = $this->
object->getMediaItem(
"Standard");
   348             if (is_int(strpos($std_item->getFormat(), 
"image"))
   349                     && $std_item->getLocationType() == 
"LocalFile") {
   351                 $op2->addSubItem($resize);
   355         $radio_size->setValue(
"original");
   357             $radio_size->setValue(
"selected");
   361         $radio_size->addOption($op2);
   362         $this->form_gui->addItem($radio_size);
   367         $caption->setRows(2);
   368         $this->form_gui->addItem($caption);
   376         if ($a_mode == 
"edit" && $this->media_type->usesAltTextProperty($std_item->getFormat())) {
   380             $ta->setInfo(
$lng->
txt(
"text_repr_info"));
   381             $this->form_gui->addItem($ta);
   385             $this->video_gui->addPreviewInput($this->form_gui, $this->
object->getId());
   389         if ($a_mode == 
"edit" &&
   390             $this->media_type->usesParameterProperty($std_item->getFormat())) {
   391             if ($this->media_type->usesAutoStartParameterOnly(
   392                 $std_item->getLocation(),
   393                 $std_item->getFormat()
   401                 $this->form_gui->addItem($par);
   405         if ($a_mode == 
"edit") {
   406             $full_item = $this->
object->getMediaItem(
"Fullscreen");
   411         $fs_sec->setTitle(
$lng->
txt(
"cont_fullscreen"));
   412         $this->form_gui->addItem($fs_sec);
   416         $radio_prop2->addOption($op1);
   418         $radio_prop2->addOption($op4);
   421         $up->setSuffixes(iterator_to_array($this->media_type->getAllowedSuffixes()));
   424         if ($a_mode == 
"create" || !$full_item || $full_item->getLocationType() != 
"LocalFile") {
   425             $up->setRequired(
true);
   428         $radio_prop2->addOption($op2);
   432         $ref->setRequired(
true);
   434         $radio_prop2->addOption($op3);
   435         $radio_prop2->setValue(
"None");
   436         $this->form_gui->addItem($radio_prop2);
   439         if ($a_mode == 
"edit") {
   440             if ($this->
object->hasFullscreenItem()) {
   442                 $format->setValue($full_item->getFormat());
   443                 $this->form_gui->addItem($format);
   448         $full_support_constraint_props = 
false;
   450         if ($a_mode == 
"edit") {
   452             if ($this->
object->hasFullscreenItem() && ($orig_size = $full_item->getOriginalSize())) {
   453                 $add_str = 
" (" . ($orig_size[
"width"] ?? 
"") . 
" x " . ($orig_size[
"height"] ?? 
"") . 
")";
   455                 if (is_int(strpos($full_item->getFormat(), 
"image"))
   456                     && $full_item->getLocationType() == 
"LocalFile") {
   457                     $full_support_constraint_props = 
true;
   468         $radio_size->addOption($op1);
   472                 " / " . 
$lng->
txt(
"cont_height"), 
"full_width_height");
   473         if ($full_support_constraint_props) {
   475             $width_height->setConstrainProportions(
true);
   477         $op2->addSubItem($width_height);
   480         if ($a_mode == 
"edit") {
   481             $full_item = $this->
object->getMediaItem(
"Fullscreen");
   482             if ($this->
object->hasFullscreenItem() &&
   483                     is_int(strpos($full_item->getFormat(), 
"image")) &&
   484                     $full_item->getLocationType() == 
"LocalFile") {
   489                 $op2->addSubItem($resize);
   493         $radio_size->setValue(
"original");
   494         $radio_size->addOption($op2);
   495         $this->form_gui->addItem($radio_size);
   500         $caption->setRows(2);
   501         $this->form_gui->addItem($caption);
   509         if ($a_mode == 
"edit" && $this->
object->hasFullscreenItem() && $this->media_type->usesAltTextProperty($std_item->getFormat())) {
   513             $ta->setInfo(
$lng->
txt(
"text_repr_info"));
   514             $this->form_gui->addItem($ta);
   519         if ($a_mode == 
"edit" && $this->
object->hasFullscreenItem() &&
   520             $this->media_type->usesParameterProperty($full_item->getFormat())) {
   521             if ($this->media_type->usesAutoStartParameterOnly(
   522                 $full_item->getLocation(),
   523                 $full_item->getFormat()
   531                 $this->form_gui->addItem($par);
   536         if ($a_mode == 
"edit") {
   537             $this->form_gui->setTitle(
$lng->
txt(
"cont_edit_mob"));
   538             $this->form_gui->addCommandButton(
"saveProperties", 
$lng->
txt(
"save"));
   540             $this->form_gui->setTitle(
$lng->
txt(
"cont_insert_mob"));
   541             $this->form_gui->addCommandButton(
"save", 
$lng->
txt(
"save"));
   542             $this->form_gui->addCommandButton(
"cancel", 
$lng->
txt(
"cancel"));
   544         $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
   552         $std_item = $this->
object->getMediaItem(
"Standard");
   553         if ($std_item->getWidth() == 
"" || $std_item->getHeight() == 
"") {
   554             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"mob_no_fixed_size_map_editing"));
   566         $values[
"standard_title"] = $this->
object->getTitle();
   568         $std_item = $this->
object->getMediaItem(
"Standard");
   569         if ($std_item->getLocationType() == 
"LocalFile") {
   570             $values[
"standard_type"] = 
"File";
   571             $values[
"standard_file"] = $std_item->getLocation();
   573             $values[
"standard_type"] = 
"Reference";
   574             $values[
"standard_reference"] = $std_item->getLocation();
   576         $values[
"standard_format"] = $std_item->getFormat();
   577         $values[
"standard_width_height"][
"width"] = $std_item->getWidth();
   578         $values[
"standard_width_height"][
"height"] = $std_item->getHeight();
   579         $values[
"standard_width_height"][
"constr_prop"] = 
true;
   581         $values[
"standard_size"] = 
"selected";
   583         $orig_size = $std_item->getOriginalSize();
   584         if ($std_item->getWidth() == 
"" && $std_item->getHeight() == 
"") {
   585             $values[
"standard_size"] = 
"original";
   586             $values[
"standard_width_height"][
"width"] = $orig_size[
"width"] ?? 
"";
   587             $values[
"standard_width_height"][
"height"] = $orig_size[
"height"] ?? 
"";
   590         $values[
"standard_caption"] = $std_item->getCaption();
   591         $values[
"text_representation"] = $std_item->getTextRepresentation();
   592         if ($this->media_type->usesAutoStartParameterOnly(
   593             $std_item->getLocation(),
   594             $std_item->getFormat()
   601             $values[
"standard_parameters"] = $std_item->getParameterString();
   604         $values[
"full_type"] = 
"None";
   605         $values[
"full_size"] = 
"original";
   606         if ($this->
object->hasFullscreenItem()) {
   607             $full_item = $this->
object->getMediaItem(
"Fullscreen");
   608             if ($full_item->getLocationType() == 
"LocalFile") {
   609                 $values[
"full_type"] = 
"File";
   610                 $values[
"full_file"] = $full_item->getLocation();
   612                 $values[
"full_type"] = 
"Reference";
   613                 $values[
"full_reference"] = $full_item->getLocation();
   615             $values[
"full_format"] = $full_item->getFormat();
   616             $values[
"full_width_height"][
"width"] = $full_item->getWidth();
   617             $values[
"full_width_height"][
"height"] = $full_item->getHeight();
   618             $values[
"full_width_height"][
"constr_prop"] = 
true;
   620             $values[
"full_size"] = 
"selected";
   622             $orig_size = $full_item->getOriginalSize();
   623             if ($full_item->getWidth() == 
"" &&
   624                 $full_item->getHeight() == 
"") {
   625                 $values[
"full_size"] = 
"original";
   626                 $values[
"full_width_height"][
"width"] = $orig_size[
"width"] ?? 
"";
   627                 $values[
"full_width_height"][
"height"] = $orig_size[
"height"] ?? 
"";
   629             $values[
"full_caption"] = $full_item->getCaption();
   630             if ($this->media_type->usesAutoStartParameterOnly(
   631                 $full_item->getLocation(),
   632                 $full_item->getFormat()
   639                 $values[
"full_parameters"] = $full_item->getParameterString();
   641             $values[
"full_text_representation"] = $full_item->getTextRepresentation();
   644         $this->form_gui->setValuesByArray($values);
   655         if ($this->form_gui->checkInput()) {
   658             $this->tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"saved_media_object"), 
true);
   660             $this->form_gui->setValuesByPost();
   667         if (!$this->form_gui->checkInput()) {
   668             $this->form_gui->setValuesByPost();
   689         if (trim($form->getInput(
"standard_title")) != 
"") {
   690             $title = trim($form->getInput(
"standard_title"));
   692             if ($form->getInput(
"standard_type") == 
"File") {
   693                 $title = $_FILES[
'standard_file'][
'name'];
   695                 $title = $form->getInput(
"standard_reference");
   709         if ($form->getInput(
"standard_type") == 
"File") {
   710             $width = $height = 0;
   711             $constr_prop = 
false;
   712             if ($form->getInput(
"standard_size") != 
"original") {
   713                 $wh_input = $form->getInput(
"standard_width_height");
   714                 $width = (
int) $wh_input[
"width"];
   715                 $height = (
int) $wh_input[
"height"];
   716                 $constr_prop = ($wh_input[
"constr_prop"] ?? 
false);
   720                 $_FILES[
"standard_file"][
"tmp_name"],
   721                 $_FILES[
"standard_file"][
"name"],
   729             $media_item->setPurpose(
"Standard");
   732             $media_item->setFormat($format);
   734             $media_item->setLocationType(
"Reference");
   761         if ($form->getInput(
"standard_caption") != 
"") {
   762             $media_item->setCaption($form->getInput(
"standard_caption"));
   766         $media_item->setHAlign(
"Left");
   769         if ($form->getInput(
"full_type") != 
"None") {
   772             $media_item2->setPurpose(
"Fullscreen");
   775             if ($form->getInput(
"full_type") == 
"File") {
   777                 if ($_FILES[
'full_file'][
'name'] != 
"") {
   779                     $file = $mob_dir . 
"/" . $full_file_name;
   781                         $_FILES[
'full_file'][
'tmp_name'],
   788             } elseif ($form->getInput(
"full_type") == 
"Standard" && $form->getInput(
"standard_type") == 
"File") {
   793             if ($form->getInput(
"full_type") == 
"File" ||
   794                 ($form->getInput(
"full_type") == 
"Standard" && $form->getInput(
"standard_type") == 
"File")) {
   795                 if (($form->getInput(
"full_size") != 
"original" &&
   796                         is_int(strpos($format, 
"image")))
   798                     $full_wh_input = $form->getInput(
"full_width_height");
   801                         (
int) $full_wh_input[
"width"],
   802                         (
int) $full_wh_input[
"height"],
   803                         (
bool) ($full_wh_input[
"constr_prop"] ?? 
false)
   807                 $media_item2->setFormat($format);
   809                 $media_item2->setLocationType(
"LocalFile");
   813             if ($form->getInput(
"full_type") == 
"Reference") {
   815                 if ($form->getInput(
"full_reference") != 
"") {
   821             if ($form->getInput(
"full_type") == 
"Reference" ||
   822                 ($form->getInput(
"full_type") == 
"Standard" && $form->getInput(
"standard_type") == 
"Reference")) {
   823                 $media_item2->setFormat($format);
   825                 $media_item2->setLocationType(
"Reference");
   846             if ($form->getInput(
"full_caption") != 
"") {
   847                 $media_item2->setCaption($form->getInput(
"full_caption"));
   863         $this->
ctrl->returnToParent($this);
   871         $this->video_gui->addPreviewExtractionToToolbar(
   883         $this->video_gui->handleExtractionRequest(
   898         $std_item = $this->
object->getMediaItem(
"Standard");
   899         if ($std_item->getLocationType() == 
"LocalFile" &&
   900             is_int(strpos($std_item->getFormat(), 
"image"))
   902             $file = $mob_dir . 
"/" . $std_item->getLocation();
   905                 $std_item->getWidth(),
   906                 $std_item->getHeight()
   913         if ($this->
object->hasFullscreenItem()) {
   914             $full_item = $this->
object->getMediaItem(
"Fullscreen");
   915             if ($full_item->getLocationType() == 
"LocalFile" &&
   916                 is_int(strpos($full_item->getFormat(), 
"image"))
   918                 $file = $mob_dir . 
"/" . $full_item->getLocation();
   921                     $full_item->getWidth(),
   922                     $full_item->getHeight()
   925                 $full_item->update();
   929         $this->
ctrl->redirect($this, 
"edit");
   938         $std_item = $this->
object->getMediaItem(
"Standard");
   941         if ($std_item->getLocationType() == 
"LocalFile") {
   942             $file = $mob_dir . 
"/" . $std_item->getLocation();
   946             $std_item->setWidth($size[0]);
   947             $std_item->setHeight($size[1]);
   948             $this->
object->update();
   950         $this->
ctrl->redirect($this, 
"edit");
   959         $full_item = $this->
object->getMediaItem(
"Fullscreen");
   962         if ($full_item->getLocationType() == 
"LocalFile") {
   963             $file = $mob_dir . 
"/" . $full_item->getLocation();
   965             $full_item->setWidth($size[0]);
   966             $full_item->setHeight($size[1]);
   967             $this->
object->update();
   969         $this->
ctrl->redirect($this, 
"edit");
   982         if ($form->checkInput()) {
   983             $title = trim($form->getInput(
"standard_title"));
   986             $std_item = $this->
object->getMediaItem(
"Standard");
   988             $format = $std_item->getFormat();
   989             if ($form->getInput(
"standard_type") == 
"Reference") {
   991                 $std_item->setFormat($format);
   993                 $std_item->setLocationType(
"Reference");
   996             if ($form->getInput(
"standard_type") == 
"File") {
   998                 if ($_FILES[
'standard_file'][
'name'] != 
"") {
  1000                     $file_name = $_FILES[
'standard_file'][
'name'];
  1001                     $this->media_manager->addFileFromLegacyUpload(
  1003                         $_FILES[
'standard_file'][
'tmp_name']
  1011                 } elseif ($form->getInput(
"standard_resize")) {
  1018                     if ($form->getInput(
"standard_size") != 
"original" &&
  1019                         is_int(strpos($format, 
"image"))) {
  1020                         $wh_input = $form->getInput(
"standard_width_height");
  1023                             (
int) $wh_input[
"width"],
  1024                             (
int) $wh_input[
"height"],
  1025                             (
bool) ($wh_input[
"constr_prop"] ?? 
false)
  1028                     $std_item->setFormat($format);
  1032                 $std_item->setLocationType(
"LocalFile");
  1034             $this->
object->setDescription($format);
  1036             $wh_input = $form->getInput(
"standard_width_height");
  1039                 $form->getInput(
"standard_type"),
  1041                 $std_item->getLocation(),
  1042                 (bool) ($wh_input[
"constr_prop"] ?? 
false),
  1043                 ($form->getInput(
"standard_size") == 
"original"),
  1044                 ($wh_input[
"width"] == 
"") ? null : (
int) $wh_input[
"width"],
  1045                 ($wh_input[
"height"] == 
"") ? null : (
int) $wh_input[
"height"]
  1047             if ($wh[
"info"] != 
"") {
  1048                 $this->tpl->setOnScreenMessage(
'info', $wh[
"info"], 
true);
  1050             $std_item->setWidth($wh[
"width"]);
  1051             $std_item->setHeight($wh[
"height"]);
  1054             $std_item->setCaption($form->getInput(
"standard_caption"));
  1057             $std_item->setTextRepresentation($form->getInput(
"text_representation"));
  1059             $this->video_gui->savePreviewInput($form, $this->
object->getId());
  1062             if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
  1063                 if (!$this->media_type->usesAutoStartParameterOnly(
  1064                     $std_item->getLocation(),
  1065                     $std_item->getFormat()
  1067                     $std_item->setParameters($form->getInput(
"standard_parameters"));
  1072             if ($form->getInput(
"full_type") == 
"None") {
  1073                 if ($this->
object->hasFullscreenItem()) {               
  1074                     $this->
object->removeMediaItem(
"Fullscreen");
  1077                 if ($this->
object->hasFullscreenItem()) {       
  1078                     $full_item = $this->
object->getMediaItem(
"Fullscreen");
  1081                     $this->
object->addMediaItem($full_item);
  1082                     $full_item->setPurpose(
"Fullscreen");
  1085                 $format = $full_item->getFormat();
  1086                 if ($form->getInput(
"full_type") == 
"Reference") {
  1088                     $full_item->setFormat($format);
  1089                     $full_item->setLocationType(
"Reference");
  1091                     $type = 
"Reference";
  1095                 if ($form->getInput(
"full_type") == 
"File") {
  1097                     if ($_FILES[
'full_file'][
'name'] != 
"") {
  1099                         $full_file_name = $_FILES[
'full_file'][
'name'];
  1100                         $this->media_manager->addFileFromLegacyUpload(
  1102                             $_FILES[
'full_file'][
'tmp_name']
  1109                     } elseif ($form->getInput(
"full_resize")) {
  1116                         if ($form->getInput(
"full_size") != 
"original" &&
  1117                             is_int(strpos($format, 
"image"))) {
  1118                             $wh_input = $form->getInput(
"full_width_height");
  1121                                 (
int) $wh_input[
"width"],
  1122                                 (
int) $wh_input[
"height"],
  1123                                 (
bool) ($wh_input[
"constr_prop"] ?? 
false)
  1126                         $full_item->setFormat($format);
  1130                     $full_item->setLocationType(
"LocalFile");
  1133                 if ($form->getInput(
"full_type") == 
"Standard") {
  1134                     $format = $std_item->getFormat();
  1136                     $full_item->setLocationType($std_item->getLocationType());
  1137                     $full_item->setFormat($format);
  1139                     $type = $std_item->getLocationType();
  1140                     if (
$type == 
"LocalFile") {
  1144                     if ($form->getInput(
"full_size") != 
"original" &&
  1145                         is_int(strpos($format, 
"image")) &&
  1146                         $full_item->getLocationType() == 
"LocalFile") {
  1148                         $wh_input = $form->getInput(
"full_width_height");
  1151                             (
int) $wh_input[
"width"],
  1152                             (
int) $wh_input[
"height"],
  1153                             (
bool) ($wh_input[
"constr_prop"] ?? 
false)
  1159                 $wh_input = $form->getInput(
"full_width_height");
  1164                     $full_item->getLocation(),
  1165                     (bool) ($wh_input[
"constr_prop"] ?? 
false),
  1166                     ($form->getInput(
"full_size") == 
"original"),
  1167                     ($wh_input[
"width"] == 
"") ? null : (
int) $wh_input[
"width"],
  1168                     ($wh_input[
"height"] == 
"") ? null : (
int) $wh_input[
"height"]
  1170                 if ($wh[
"info"] != 
"") {
  1171                     $this->tpl->setOnScreenMessage(
'info', $wh[
"info"], 
true);
  1174                 $full_item->setWidth($wh[
"width"]);
  1175                 $full_item->setHeight($wh[
"height"]);
  1176                 $full_item->setLocation($location);
  1178                 $full_item->setCaption($form->getInput(
"full_caption"));
  1181                 $full_item->setTextRepresentation($form->getInput(
"full_text_representation"));
  1185                 if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
  1186                     if (!$this->media_type->usesAutoStartParameterOnly(
  1187                         $std_item->getLocation(),
  1188                         $std_item->getFormat()
  1190                         $full_item->setParameters($form->getInput(
"full_parameters"));
  1200             $this->
object->update();
  1201             $this->tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"msg_obj_modified"), 
true);
  1202             $this->
ctrl->redirect($this, 
"edit");
  1204             $this->form_gui->setValuesByPost();
  1216         $cur_subdir = dirname($a_file);
  1218         $cur_dir = (!empty($cur_subdir))
  1219             ? $mob_dir . 
"/" . $cur_subdir
  1221         $file = $cur_dir . 
"/" . basename($a_file);
  1224         if (!is_file($file)) {
  1225             $this->
ilias->raiseError($this->
lng->txt(
"cont_select_file"), $this->
ilias->error_obj->MESSAGE);
  1228         $std_item = $this->
object->getMediaItem(
"Standard");
  1229         $std_item->setLocationType(
"LocalFile");
  1232         $std_item->setFormat($format);
  1233         $this->
object->update();
  1235         $this->
ctrl->redirectByClass(ilContainerResourceGUI::class, 
"listFiles");
  1246         $cur_subdir = dirname($a_file);
  1248         $cur_dir = (!empty($cur_subdir))
  1249             ? $mob_dir . 
"/" . $cur_subdir
  1251         $file = $cur_dir . 
"/" . basename($a_file);
  1254         if (!is_file($file)) {
  1255             $this->
ilias->raiseError($this->
lng->txt(
"cont_select_file"), $this->
ilias->error_obj->MESSAGE);
  1258         if (!$this->
object->hasFullscreenItem()) {      
  1259             $std_item = $this->
object->getMediaItem(
"Standard");
  1263             $full_item->setMobId($std_item->getMobId());
  1265             $full_item->setLocationType(
"LocalFile");
  1267             $full_item->setPurpose(
"Fullscreen");
  1268             $this->
object->addMediaItem($full_item);
  1270             $full_item = $this->
object->getMediaItem(
"Fullscreen");
  1272             $full_item->setLocationType(
"LocalFile");
  1275             $full_item->setFormat($format);
  1277         $this->
object->update();
  1279         $this->
ctrl->redirectByClass(ilContainerResourceGUI::class, 
"listFiles");
  1288         $this->
object->removeMediaItem(
"Fullscreen");
  1289         $this->
object->update();
  1291         $this->
ctrl->redirect($this, 
"edit");
  1299         if (!$this->
object->hasFullscreenItem()) {
  1300             $std_item = $this->
object->getMediaItem(
"Standard");
  1302             $full_item->setMobId($std_item->getMobId());
  1303             $full_item->setLocation($std_item->getLocation());
  1304             $full_item->setLocationType($std_item->getLocationType());
  1305             $full_item->setFormat($std_item->getFormat());
  1306             $full_item->setWidth($std_item->getWidth());
  1307             $full_item->setHeight($std_item->getHeight());
  1308             $full_item->setCaption($std_item->getCaption());
  1309             $full_item->setTextRepresentation($std_item->getTextRepresentation());
  1310             $full_item->setPurpose(
"Fullscreen");
  1311             $this->
object->addMediaItem($full_item);
  1313             $this->
object->update();
  1316         $this->
ctrl->redirect($this, 
"edit");
  1324         $this->showUsagesObject(
true);
  1331     public function showUsagesObject(
  1341             $lng->
txt(
"cont_current_usages"),
  1342             $ilCtrl->getLinkTarget($this, 
"showUsages")
  1348             $ilCtrl->getLinkTarget($this, 
"showAllUsages")
  1352             $ilTabs->activateSubTab(
"all_usages");
  1353             $cmd = 
"showAllUsages";
  1355             $ilTabs->activateSubTab(
"current_usages");
  1356             $cmd = 
"showUsages";
  1378         $lng = $DIC->language();
  1379         $lom_services = $DIC->learningObjectMetadata();
  1380         $media_manager = $DIC->mediaObjects()->internal()->domain()->mediaObject();
  1382         $tpl = 
new ilTemplate(
"tpl.media_info.html", 
true, 
true, 
"components/ILIAS/MediaObjects");
  1383         $types = array(
"Standard", 
"Fullscreen");
  1384         foreach ($types as 
$type) {
  1395             if ($type == 
"Standard") {
  1402             if ($med->getLocationType() == 
"LocalFile") {
  1405                     $info = $media_manager->getInfoOfEntry($med->getMobId(), 
"/" . $med->getLocation());
  1409                 $size = $info[
"size"] ?? 0;
  1414             if ($med->getWidth() != 
"" && $med->getHeight() != 
"") {
  1417                 $tpl->
setVariable(
"VAL_SIZE", $med->getWidth() . 
"x" . $med->getHeight());
  1422             if ($orig_size = $med->getOriginalSize()) {
  1423                 if (($orig_size[
"width"] ?? 
"") !== $med->getWidth() ||
  1424                     ($orig_size[
"height"] ?? 
"") !== $med->getHeight()) {
  1434             if (strlen($med->getCaption())) {
  1441             if ($type == 
"Standard") {
  1442                 $keyword_data = $lom_services
  1443                     ->read(0, $med->getMobId(), 
'mob', $lom_services->paths()->keywords())
  1444                     ->allData($lom_services->paths()->keywords());
  1445                 $presentable_keywords = $lom_services->dataHelper()->makePresentableAsList(
  1449                 if ($presentable_keywords !== 
'') {
  1472         if (is_object($this->
object) && strtolower(get_class($this->
object)) == 
"ilobjmediaobject") {
  1474             $this->tpl->setTitle($this->
object->getTitle());
  1478             $this->tpl->setTitle($this->
lng->txt(
"cont_create_mob"));
  1488         if (is_object($this->
object) && strtolower(get_class($this->
object)) == 
"ilobjmediaobject"  1489             && $this->
object->getId() > 0) {
  1491             $this->tabs_gui->addTarget(
  1492                 "cont_mob_def_prop",
  1493                 $this->
ctrl->getLinkTarget($this, 
"edit"),
  1498             $st_item = $this->
object->getMediaItem(
"Standard");
  1503                 $format = $st_item->getFormat();
  1504                 if (substr($format, 0, 5) == 
"image" && !is_int(strpos($format, 
"svg"))) {
  1505                     $this->tabs_gui->addTarget(
  1506                         "cont_def_map_areas",
  1507                         $this->
ctrl->getLinkTargetByClass(
  1508                             array(
"ilobjmediaobjectgui", 
"ilimagemapeditorgui"),
  1512                         "ilimagemapeditorgui"  1518             $this->tabs_gui->addTarget(
  1520                 $this->
ctrl->getLinkTarget($this, 
"showUsages"),
  1526             $std_item = $this->
object->getMediaItem(
"Standard");
  1527             $full_item = $this->
object->getMediaItem(
"Fullscreen");
  1529             if ($mset->get(
"file_manager_always") ||
  1530                 ($this->media_type->usesParameterProperty($std_item->getFormat()) ||
  1531                     (is_object($full_item) && $this->media_type->usesParameterProperty($full_item->getFormat())))
  1533                 $this->tabs_gui->addTarget(
  1535                     $this->
ctrl->getLinkTargetByClass(
  1536                         array(
"ilobjmediaobjectgui", ilContainerResourceGUI::class),
  1540                     "ilContainerResourceGUI"  1545             $mdtab = $mdgui->
getTab(
"ilobjmediaobjectgui");
  1547                 $this->tabs_gui->addTarget(
  1557         if ($this->back_title != 
"") {
  1558             $this->tabs_gui->setBackTarget(
  1560                 $this->
ctrl->getParentReturn($this)
  1575         if ($a_tpl == null) {
  1581         $a_tpl->addJavaScript(
"components/ILIAS/COPage/js/ilCOPagePres.js");
  1593         $ilTabs->activateTab(
"cont_mob_def_prop");
  1598             $ilCtrl->getLinkTarget($this, 
"edit")
  1601         if ($this->
object->getMediaItem(
"Standard")->getFormat() == 
"video/webm" ||
  1602             $this->
object->getMediaItem(
"Standard")->getFormat() == 
"video/mp4") {
  1606                 $ilCtrl->getLinkTarget($this, 
"listSubtitleFiles")
  1610         $ilTabs->activateSubTab($a_active);
  1613     public function listSubtitleFilesObject(): 
void  1622         $this->media_manager->generateMissingVTT($this->
object->getId());
  1624         if (!in_array(
"vtt", $this->file_service_settings->getWhiteListedSuffixes())) {
  1629             $ilToolbar->setFormAction($ilCtrl->getFormAction($this), 
true);
  1632             $ilToolbar->addInputItem($fi, 
true);
  1635             $options = $this->md->getLOMLanguagesForSelectInputs();
  1638             $si->setValue($ilUser->getLanguage());
  1639             $ilToolbar->addInputItem($si, 
true);
  1641             $ilToolbar->addFormButton(
$lng->
txt(
"upload"), 
"uploadSubtitleFile");
  1643             $ilToolbar->addSeparator();
  1644             $ilToolbar->addFormButton(
$lng->
txt(
"mob_upload_multi_srt"), 
"uploadMultipleSubtitleFileForm");
  1662         if ($this->
object->uploadSrtFile(
  1663             $_FILES[
"subtitle_file"][
"tmp_name"],
  1664             $this->sub_title_request->getLanguage()
  1666             $this->tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"msg_obj_modified"), 
true);
  1668         $ilCtrl->
redirect($this, 
"listSubtitleFiles");
  1682         $srts = $this->sub_title_request->getSrtFiles();
  1683         if (count($srts) == 0) {
  1684             $this->tpl->setOnScreenMessage(
'info', 
$lng->
txt(
"no_checkbox"), 
true);
  1685             $ilCtrl->redirect($this, 
"listSubtitleFiles");
  1688             $cgui->setFormAction($ilCtrl->getFormAction($this));
  1689             $cgui->setHeaderText(
$lng->
txt(
"mob_really_delete_srt"));
  1690             $cgui->setCancel(
$lng->
txt(
"cancel"), 
"listSubtitleFiles");
  1691             $cgui->setConfirm(
$lng->
txt(
"delete"), 
"deleteSrtFiles");
  1692             foreach ($srts as $i) {
  1693                 $p = explode(
":", $i);
  1694                 $cgui->addItem(
"srt[]", $i, 
"subtitle_" . $p[0] . 
".".$p[1].
" (" . 
$lng->
txt(
"meta_l_" . $p[0]) . 
")");
  1709         $srts = $this->sub_title_request->getSrtFiles();
  1711         foreach ($srts as $i) {
  1712             if (strlen($i) == 6 && !is_int(strpos($i, 
"."))) {
  1713                 $p = explode(
":", $i);
  1714                 $this->
object->removeAdditionalFile(
"srt/subtitle_" . $p[0] . 
"." . $p[1]);
  1719             $this->tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"mob_srt_files_deleted"), 
true);
  1721         $ilCtrl->redirect($this, 
"listSubtitleFiles");
  1730         $this->tpl->setOnScreenMessage(
'info', 
$lng->
txt(
"mob_upload_multi_srt_howto"));
  1735         $ilToolbar->setFormAction($ilCtrl->getFormAction($this), 
true);
  1738         $ilToolbar->addInputItem($fi, 
true);
  1740         $ilToolbar->addFormButton(
$lng->
txt(
"upload"), 
"uploadMultipleSubtitleFile");
  1747             $this->
ctrl->redirect($this, 
"showMultiSubtitleConfirmationTable");
  1749             $this->tpl->setOnScreenMessage(
'failure', $e->getMessage(), 
true);
  1750             $this->
ctrl->redirect($this, 
"uploadMultipleSubtitleFileForm");
  1772         $this->
object->clearMultiSrtDirectory();
  1773         $this->
ctrl->redirect($this, 
"listSubtitleFiles");
  1782         $srt_files = $this->
object->getMultiSrtFiles();
  1783         $files = $this->sub_title_request->getFiles();
  1784         foreach ($files as 
$f) {
  1785             foreach ($srt_files as $srt_file) {
  1786                 if ($f == $srt_file[
"filename"]) {
  1787                     $this->
object->uploadSrtFile($this->
object->getMultiSrtUploadDir() . 
"/" . $srt_file[
"filename"], $srt_file[
"lang"], 
"rename");
  1791         $this->
object->clearMultiSrtDirectory();
  1792         $ilCtrl->
redirect($this, 
"listSubtitleFiles");
  1797         $this->media_manager->generateMissingVTT($this->
object->getId());
  1798         $this->
ctrl->redirect($this, 
"listSubtitleFiles");
 
static getWebspaceDir(string $mode="filesystem")
get webspace directory 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
 
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user. 
 
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
 
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string. 
 
loadLanguageModule(string $a_module)
Load language module. 
 
setVariable(string $variable, $value='')
Sets the given variable to the given value. 
 
static secureLink(string $a_str)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ilGlobalTemplateInterface $tpl
 
setScreenId(string $a_id)
 
setContent(string $a_html)
Sets content for standard template. 
 
setScreenIdComponent(string $a_comp)
 
Class ilObjectGUI Basic methods of all Output classes. 
 
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
Class ilObjForumAdministration. 
 
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file 
 
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block. 
 
User interface class for map editor. 
 
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template 
 
__construct(Container $dic, ilPlugin $plugin)
 
This class represents a text area property in a property form. 
 
static getLocalMaphilightPath()
Get local path of maphilight file. 
 
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block. 
 
setDescription(string $description)
 
static stripSlashesArray(array $a_arr, bool $a_strip_html=true, string $a_allow="")