4require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
    5require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
 
    6require_once(
"./Services/Object/classes/class.ilObjectGUI.php");
 
   73    public function __construct($a_data, $a_id = 0, $a_call_by_reference = 
false, $a_prepare_output = 
false)
 
   77        $this->tpl = 
$DIC[
"tpl"];
 
   78        $this->access = 
$DIC->access();
 
   79        $this->
error = $DIC[
"ilErr"];
 
   80        $this->help = 
$DIC[
"ilHelp"];
 
   81        $this->tabs = 
$DIC->tabs();
 
   82        $this->toolbar = 
$DIC->toolbar();
 
   83        $this->
user = $DIC->user();
 
   88        parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
 
   90        $this->back_title = 
"";
 
   93        $lng->loadLanguageModule(
"mob");
 
  104        $this->adv_ref_id = $a_adv_ref_id;
 
  105        $this->adv_type = $a_adv_type;
 
  106        $this->adv_subtype = $a_adv_subtype;
 
  116        if ($this->adv_type == 
null) {
 
  124        $this->header = $a_title;
 
  139        $this->enabledmapareas = $a_enabledmapareas;
 
  159        $this->width_preset = $a_val;
 
  169        return $this->width_preset;
 
  179        $this->height_preset = $a_val;
 
  189        return $this->height_preset;
 
  199        return $this->form_gui;
 
  204        if ($this->
id != 0) {
 
  211        $this->ctrl->returnToParent($this);
 
  226        $next_class = $this->ctrl->getNextClass($this);
 
  227        $cmd = $this->ctrl->getCmd();
 
  229        switch ($next_class) {
 
  230            case 'ilobjectmetadatagui':
 
  231                include_once 
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
 
  234                $md_gui->addMDObserver($this->
object, 
'MDUpdateListener', 
'General');
 
  237                if ($this->adv_type != 
"") {
 
  238                    $md_gui->setAdvMdRecordObject($this->adv_ref_id, $this->adv_type, $this->adv_subtype);
 
  241                $this->ctrl->forwardCommand($md_gui);
 
  244            case "ilimagemapeditorgui":
 
  245                require_once(
"./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php");
 
  247                $ret = $this->ctrl->forwardCommand($image_map_edit);
 
  252            case "ilfilesystemgui":
 
  253                include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
 
  257                $fs_gui->activateLabels(
true, $this->lng->txt(
"cont_purpose"));
 
  258                $fs_gui->setTableId(
"mobfs" . $this->object->getId());
 
  260                    $this->object->getMediaItem(
"Standard")->getLocation(),
 
  261                    $this->lng->txt(
"cont_std_view")
 
  263                if ($this->object->hasFullscreenItem()) {
 
  265                        $this->object->getMediaItem(
"Fullscreen")->getLocation(),
 
  266                        $this->lng->txt(
"cont_fullscreen")
 
  269                $fs_gui->addCommand($this, 
"assignStandardObject", $this->lng->txt(
"cont_assign_std"));
 
  270                $fs_gui->addCommand($this, 
"assignFullscreenObject", $this->lng->txt(
"cont_assign_full"));
 
  272                $ret = $this->ctrl->forwardCommand($fs_gui);
 
  274                include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
 
  280                if (isset(
$_POST[
"editImagemapForward"]) ||
 
  281                    isset(
$_POST[
"editImagemapForward_x"]) ||
 
  282                    isset(
$_POST[
"editImagemapForward_y"])) {
 
  283                    $cmd = 
"editImagemapForward";
 
  286                $ret = $this->$cmd();
 
  298        $this->back_title = $a_title;
 
  309        $ilHelp->setScreenId(
"create");
 
  311        $tpl->setContent($this->form_gui->getHTML());
 
  322        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  324        if ($a_mode == 
"edit") {
 
  325            $std_item = $this->
object->getMediaItem(
"Standard");
 
  333        $title->setMaxLength(120);
 
  334        $this->form_gui->addItem(
$title);
 
  341        if ($a_mode == 
"create" || $std_item->getLocationType() != 
"LocalFile") {
 
  342            $up->setRequired(
true);
 
  344        $op1->addSubItem($up);
 
  345        $radio_prop->addOption($op1);
 
  348        $ref->setInfo(
$lng->txt(
"cont_ref_helptext"));
 
  349        $ref->setRequired(
true);
 
  350        $op2->addSubItem($ref);
 
  351        $radio_prop->addOption($op2);
 
  352        $radio_prop->setValue(
"File");
 
  353        $this->form_gui->addItem($radio_prop);
 
  356        if ($a_mode == 
"edit") {
 
  358            $format->setValue($std_item->getFormat());
 
  359            $this->form_gui->addItem(
$format);
 
  364        if ($a_mode == 
"edit") {
 
  365            if ($orig_size = $std_item->getOriginalSize()) {
 
  366                $add_str = 
" (" . $orig_size[
"width"] . 
" x " . $orig_size[
"height"] . 
")";
 
  368            $op1 = 
new ilRadioOption(
$lng->txt(
"cont_resource_size") . $add_str, 
"original");
 
  369            $op1->setInfo(
$lng->txt(
"cont_resource_size_info"));
 
  373            $op1->setInfo(
$lng->txt(
"cont_resource_size_info"));
 
  376        $radio_size->addOption($op1);
 
  379        include_once(
"./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
 
  381                " / " . 
$lng->txt(
"cont_height"), 
"standard_width_height");
 
  382        $width_height->setConstrainProportions(
true);
 
  383        $op2->addSubItem($width_height);
 
  386        if ($a_mode == 
"edit") {
 
  387            $std_item = $this->
object->getMediaItem(
"Standard");
 
  388            if (is_int(strpos($std_item->getFormat(), 
"image"))
 
  389                    && $std_item->getLocationType() == 
"LocalFile") {
 
  391                $op2->addSubItem($resize);
 
  395        $radio_size->setValue(
"original");
 
  397            $radio_size->setValue(
"selected");
 
  401        $radio_size->addOption($op2);
 
  402        $this->form_gui->addItem($radio_size);
 
  406        $caption->setCols(30);
 
  407        $caption->setRows(2);
 
  408        $this->form_gui->addItem($caption);
 
  416        if ($a_mode == 
"edit" && is_int(strpos($std_item->getFormat(), 
"image"))) {
 
  420            $ta->setInfo(
$lng->txt(
"text_repr_info"));
 
  421            $this->form_gui->addItem($ta);
 
  425        if ($a_mode == 
"edit" &&
 
  428                $std_item->getLocation(),
 
  429                $std_item->getFormat()
 
  432                $this->form_gui->addItem($auto);
 
  437                $this->form_gui->addItem($par);
 
  441        if ($a_mode == 
"edit") {
 
  442            $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
  447        $fs_sec->setTitle(
$lng->txt(
"cont_fullscreen"));
 
  448        $this->form_gui->addItem($fs_sec);
 
  452        $radio_prop2->addOption($op1);
 
  453        $op4 = 
new ilRadioOption(
$lng->txt(
"cont_use_same_resource_as_above"), 
"Standard");
 
  454        $radio_prop2->addOption($op4);
 
  460        if ($a_mode == 
"create" || !$full_item || $full_item->getLocationType() != 
"LocalFile") {
 
  461            $up->setRequired(
true);
 
  463        $op2->addSubItem($up);
 
  464        $radio_prop2->addOption($op2);
 
  467        $ref->setInfo(
$lng->txt(
"cont_ref_helptext"));
 
  468        $ref->setRequired(
true);
 
  469        $op3->addSubItem($ref);
 
  470        $radio_prop2->addOption($op3);
 
  471        $radio_prop2->setValue(
"None");
 
  472        $this->form_gui->addItem($radio_prop2);
 
  475        if ($a_mode == 
"edit") {
 
  476            if ($this->object->hasFullscreenItem()) {
 
  478                $format->setValue($full_item->getFormat());
 
  479                $this->form_gui->addItem(
$format);
 
  485        if ($a_mode == 
"edit") {
 
  487            if ($this->object->hasFullscreenItem() && ($orig_size = $full_item->getOriginalSize())) {
 
  488                $add_str = 
" (" . $orig_size[
"width"] . 
" x " . $orig_size[
"height"] . 
")";
 
  490            $op1 = 
new ilRadioOption(
$lng->txt(
"cont_resource_size") . $add_str, 
"original");
 
  491            $op1->setInfo(
$lng->txt(
"cont_resource_size_info"));
 
  495            $op1->setInfo(
$lng->txt(
"cont_resource_size_info"));
 
  498        $radio_size->addOption($op1);
 
  502                " / " . 
$lng->txt(
"cont_height"), 
"full_width_height");
 
  503        $width_height->setConstrainProportions(
true);
 
  504        $op2->addSubItem($width_height);
 
  507        if ($a_mode == 
"edit") {
 
  508            $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
  509            if ($this->object->hasFullscreenItem() &&
 
  510                    is_int(strpos($full_item->getFormat(), 
"image")) &&
 
  511                    $full_item->getLocationType() == 
"LocalFile") {
 
  513                    $lng->txt(
"cont_resize_img"),
 
  516                $op2->addSubItem($resize);
 
  520        $radio_size->setValue(
"original");
 
  521        $radio_size->addOption($op2);
 
  522        $this->form_gui->addItem($radio_size);
 
  526        $caption->setCols(30);
 
  527        $caption->setRows(2);
 
  528        $this->form_gui->addItem($caption);
 
  536        if ($a_mode == 
"edit" && $this->object->hasFullscreenItem() && is_int(strpos($std_item->getFormat(), 
"image"))) {
 
  540            $ta->setInfo(
$lng->txt(
"text_repr_info"));
 
  541            $this->form_gui->addItem($ta);
 
  546        if ($a_mode == 
"edit" && $this->object->hasFullscreenItem() &&
 
  549                $full_item->getLocation(),
 
  550                $full_item->getFormat()
 
  553                $this->form_gui->addItem($auto);
 
  558                $this->form_gui->addItem($par);
 
  562        $this->form_gui->setTitle(
$lng->txt(
"cont_insert_mob"));
 
  563        if ($a_mode == 
"edit") {
 
  564            $this->form_gui->addCommandButton(
"saveProperties", 
$lng->txt(
"save"));
 
  566            $this->form_gui->addCommandButton(
"save", 
$lng->txt(
"save"));
 
  567            $this->form_gui->addCommandButton(
"cancel", 
$lng->txt(
"cancel"));
 
  569        $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
 
  580        $std_item = $this->
object->getMediaItem(
"Standard");
 
  581        if ($std_item->getWidth() == 
"" || $std_item->getHeight() == 
"") {
 
  595        $values[
"standard_title"] = $this->
object->getTitle();
 
  597        $std_item = $this->
object->getMediaItem(
"Standard");
 
  598        if ($std_item->getLocationType() == 
"LocalFile") {
 
  599            $values[
"standard_type"] = 
"File";
 
  600            $values[
"standard_file"] = $std_item->getLocation();
 
  602            $values[
"standard_type"] = 
"Reference";
 
  603            $values[
"standard_reference"] = $std_item->getLocation();
 
  605        $values[
"standard_format"] = $std_item->getFormat();
 
  606        $values[
"standard_width_height"][
"width"] = $std_item->getWidth();
 
  607        $values[
"standard_width_height"][
"height"] = $std_item->getHeight();
 
  608        $values[
"standard_width_height"][
"constr_prop"] = 
true;
 
  610        $values[
"standard_size"] = 
"selected";
 
  612        $orig_size = $std_item->getOriginalSize();
 
  613        if ($std_item->getWidth() == 
"" && $std_item->getHeight() == 
"") {
 
  614            $values[
"standard_size"] = 
"original";
 
  615            $values[
"standard_width_height"][
"width"] = $orig_size[
"width"];
 
  616            $values[
"standard_width_height"][
"height"] = $orig_size[
"height"];
 
  619        $values[
"standard_caption"] = $std_item->getCaption();
 
  620        $values[
"text_representation"] = $std_item->getTextRepresentation();
 
  622            $std_item->getLocation(),
 
  623            $std_item->getFormat()
 
  625            $par = $std_item->getParameters();
 
  626            if ($par[
"autostart"]) {
 
  627                $values[
"standard_autostart"] = 
true;
 
  630            $values[
"standard_parameters"] = $std_item->getParameterString();
 
  634        $values[
"full_size"] = 
"original";
 
  635        if ($this->object->hasFullScreenItem()) {
 
  636            $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
  637            if ($full_item->getLocationType() == 
"LocalFile") {
 
  639                $values[
"full_file"] = $full_item->getLocation();
 
  641                $values[
"full_type"] = 
"Reference";
 
  642                $values[
"full_reference"] = $full_item->getLocation();
 
  644            $values[
"full_format"] = $full_item->getFormat();
 
  645            $values[
"full_width_height"][
"width"] = $full_item->getWidth();
 
  646            $values[
"full_width_height"][
"height"] = $full_item->getHeight();
 
  647            $values[
"full_width_height"][
"constr_prop"] = 
true;
 
  649            $values[
"full_size"] = 
"selected";
 
  651            $orig_size = $full_item->getOriginalSize();
 
  652            if ($full_item->getWidth() == 
"" &&
 
  653                $full_item->getHeight() == 
"") {
 
  654                $values[
"full_size"] = 
"original";
 
  655                $values[
"full_width_height"][
"width"] = $orig_size[
"width"];
 
  656                $values[
"full_width_height"][
"height"] = $orig_size[
"height"];
 
  658            $values[
"full_caption"] = $full_item->getCaption();
 
  660                $full_item->getLocation(),
 
  661                $full_item->getFormat()
 
  663                $par = $full_item->getParameters();
 
  664                if ($par[
"autostart"]) {
 
  665                    $values[
"full_autostart"] = 
true;
 
  668                $values[
"full_parameters"] = $full_item->getParameterString();
 
  670            $values[
"full_text_representation"] = $full_item->getTextRepresentation();
 
  673        $this->form_gui->setValuesByArray(
$values);
 
  685        if ($this->form_gui->checkInput()) {
 
  688            ilUtil::sendSuccess(
$lng->txt(
"saved_media_object"), 
true);
 
  691            $this->form_gui->setValuesByPost();
 
  692            $tpl->setContent($this->form_gui->getHTML());
 
  705        if (!$this->form_gui->checkInput()) {
 
  706            $this->form_gui->setValuesByPost();
 
  719        if (trim(
$_POST[
"standard_title"]) != 
"") {
 
  722            if (
$_POST[
"standard_type"] == 
"File") {
 
  723                $title = $_FILES[
'standard_file'][
'name'];
 
  730        $a_mob->setDescription(
"");
 
  735        $a_mob->createDirectory();
 
  739        $a_mob->addMediaItem($media_item);
 
  740        $media_item->setPurpose(
"Standard");
 
  742        if (
$_POST[
"standard_type"] == 
"File") {
 
  744            $file = $mob_dir . 
"/" . $file_name;
 
  745            ilUtil::moveUploadedFile(
 
  746                $_FILES[
'standard_file'][
'tmp_name'],
 
  756            if (
$_POST[
"standard_size"] != 
"original" &&
 
  757                is_int(strpos(
$format, 
"image"))) {
 
  760                    (
int) 
$_POST[
"standard_width_height"][
"width"],
 
  761                    (
int) 
$_POST[
"standard_width_height"][
"height"],
 
  762                    (
boolean) 
$_POST[
"standard_width_height"][
"contr_prop"]
 
  767            $media_item->setFormat(
$format);
 
  769            $media_item->setLocationType(
"LocalFile");
 
  772            $media_item->setFormat(
$format);
 
  774            $media_item->setLocationType(
"Reference");
 
  776        $a_mob->setDescription(
$format);
 
  783            $media_item->getLocation(),
 
  784            $_POST[
"standard_width_height"][
"constr_prop"],
 
  785            (
$_POST[
"standard_size"] == 
"original"),
 
  786            $_POST[
"standard_width_height"][
"width"],
 
  787            $_POST[
"standard_width_height"][
"height"]
 
  789        $media_item->setWidth($wh[
"width"]);
 
  790        $media_item->setHeight($wh[
"height"]);
 
  791        if ($wh[
"info"] != 
"") {
 
  795        if (
$_POST[
"standard_caption"] != 
"") {
 
  800        $media_item->setHAlign(
"Left");
 
  803        if (
$_POST[
"full_type"] != 
"None") {
 
  805            $a_mob->addMediaItem($media_item2);
 
  806            $media_item2->setPurpose(
"Fullscreen");
 
  809            if (
$_POST[
"full_type"] == 
"File") {
 
  811                if ($_FILES[
'full_file'][
'name'] != 
"") {
 
  813                    $file = $mob_dir . 
"/" . $full_file_name;
 
  814                    ilUtil::moveUploadedFile(
 
  815                        $_FILES[
'full_file'][
'tmp_name'],
 
  822            } elseif (
$_POST[
"full_type"] == 
"Standard" && 
$_POST[
"standard_type"] == 
"File") {
 
  827            if (
$_POST[
"full_type"] == 
"File" ||
 
  828                (
$_POST[
"full_type"] == 
"Standard" && 
$_POST[
"standard_type"] == 
"File")) {
 
  829                if ((
$_POST[
"full_size"] != 
"original" &&
 
  830                        is_int(strpos(
$format, 
"image")))
 
  834                        (
int) 
$_POST[
"full_width_height"][
"width"],
 
  835                        (
int) 
$_POST[
"full_width_height"][
"height"],
 
  836                        (
boolean) 
$_POST[
"full_width_height"][
"constr_prop"]
 
  840                $media_item2->setFormat(
$format);
 
  842                $media_item2->setLocationType(
"LocalFile");
 
  846            if (
$_POST[
"full_type"] == 
"Reference") {
 
  848                if (
$_POST[
"full_reference"] != 
"") {
 
  854            if (
$_POST[
"full_type"] == 
"Reference" ||
 
  855                (
$_POST[
"full_type"] == 
"Standard" && 
$_POST[
"standard_type"] == 
"Reference")) {
 
  856                $media_item2->setFormat(
$format);
 
  858                $media_item2->setLocationType(
"Reference");
 
  867                $media_item2->getLocation(),
 
  868                $_POST[
"full_width_height"][
"constr_prop"],
 
  869                (
$_POST[
"full_size"] == 
"original"),
 
  870                $_POST[
"full_width_height"][
"width"],
 
  871                $_POST[
"full_width_height"][
"height"]
 
  874            $media_item2->setWidth($wh[
"width"]);
 
  875            $media_item2->setHeight($wh[
"height"]);
 
  877            if (
$_POST[
"full_caption"] != 
"") {
 
  883        include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
 
  894        $this->ctrl->returnToParent($this);
 
  908        $tpl->setContent($this->form_gui->getHTML());
 
  921        $std_item = $this->
object->getMediaItem(
"Standard");
 
  922        if ($std_item->getLocationType() == 
"LocalFile" &&
 
  923            is_int(strpos($std_item->getFormat(), 
"image"))
 
  925            $file = $mob_dir . 
"/" . $std_item->getLocation();
 
  928                $std_item->getWidth(),
 
  929                $std_item->getHeight()
 
  936        if ($this->object->hasFullScreenItem()) {
 
  937            $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
  938            if ($full_item->getLocationType() == 
"LocalFile" &&
 
  939                is_int(strpos($full_item->getFormat(), 
"image"))
 
  941                $file = $mob_dir . 
"/" . $full_item->getLocation();
 
  944                    $full_item->getWidth(),
 
  945                    $full_item->getHeight()
 
  948                $full_item->update();
 
  952        $this->ctrl->redirect($this, 
"edit");
 
  961        $std_item = $this->
object->getMediaItem(
"Standard");
 
  964        if ($std_item->getLocationType() == 
"LocalFile") {
 
  965            $file = $mob_dir . 
"/" . $std_item->getLocation();
 
  967            include_once(
"./Services/MediaObjects/classes/class.ilMediaImageUtil.php");
 
  970            $std_item->setWidth(
$size[0]);
 
  971            $std_item->setHeight(
$size[1]);
 
  972            $this->
object->update();
 
  974        $this->ctrl->redirect($this, 
"edit");
 
  983        $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
  986        if ($full_item->getLocationType() == 
"LocalFile") {
 
  987            $file = $mob_dir . 
"/" . $full_item->getLocation();
 
  988            include_once(
"./Services/MediaObjects/classes/class.ilMediaImageUtil.php");
 
  990            $full_item->setWidth(
$size[0]);
 
  991            $full_item->setHeight(
$size[1]);
 
  992            $this->
object->update();
 
  994        $this->ctrl->redirect($this, 
"edit");
 
 1006        if ($this->form_gui->checkInput()) {
 
 1008            $this->
object->setTitle(
$title);
 
 1010            $std_item = $this->
object->getMediaItem(
"Standard");
 
 1012            $format = $std_item->getFormat();
 
 1013            if (
$_POST[
"standard_type"] == 
"Reference") {
 
 1015                $std_item->setFormat(
$format);
 
 1017                $std_item->setLocationType(
"Reference");
 
 1020            if (
$_POST[
"standard_type"] == 
"File") {
 
 1022                if ($_FILES[
'standard_file'][
'name'] != 
"") {
 
 1024                    $file = $mob_dir . 
"/" . $file_name;
 
 1025                    ilUtil::moveUploadedFile(
 
 1026                        $_FILES[
'standard_file'][
'tmp_name'],
 
 1036                } elseif (
$_POST[
"standard_resize"]) {
 
 1043                    if (
$_POST[
"standard_size"] != 
"original" &&
 
 1044                        is_int(strpos(
$format, 
"image"))) {
 
 1047                            (
int) 
$_POST[
"standard_width_height"][
"width"],
 
 1048                            (
int) 
$_POST[
"standard_width_height"][
"height"],
 
 1049                            (
boolean) 
$_POST[
"standard_width_height"][
"contr_prop"]
 
 1052                    $std_item->setFormat(
$format);
 
 1056                $std_item->setLocationType(
"LocalFile");
 
 1058            $this->
object->setDescription(
$format);
 
 1064                $std_item->getLocation(),
 
 1065                $_POST[
"standard_width_height"][
"constr_prop"],
 
 1066                (
$_POST[
"standard_size"] == 
"original"),
 
 1067                $_POST[
"standard_width_height"][
"width"],
 
 1068                $_POST[
"standard_width_height"][
"height"]
 
 1070            if ($wh[
"info"] != 
"") {
 
 1073            $std_item->setWidth($wh[
"width"]);
 
 1074            $std_item->setHeight($wh[
"height"]);
 
 1085                    $std_item->getLocation(),
 
 1086                    $std_item->getFormat()
 
 1088                    if (
$_POST[
"standard_autostart"]) { 
 
 1089                        $std_item->setParameters(
'autostart="true"');
 
 1091                        $std_item->setParameters(
"");
 
 1099            if (
$_POST[
"full_type"] == 
"None") {
 
 1100                if ($this->object->hasFullscreenItem()) {               
 
 1101                    $this->
object->removeMediaItem(
"Fullscreen");
 
 1104                if ($this->object->hasFullscreenItem()) {       
 
 1105                    $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
 1108                    $this->
object->addMediaItem($full_item);
 
 1109                    $full_item->setPurpose(
"Fullscreen");
 
 1112                $format = $full_item->getFormat();
 
 1113                if (
$_POST[
"full_type"] == 
"Reference") {
 
 1115                    $full_item->setFormat(
$format);
 
 1116                    $full_item->setLocationType(
"Reference");
 
 1118                    $type = 
"Reference";
 
 1121                if (
$_POST[
"full_type"] == 
"File") {
 
 1123                    if ($_FILES[
'full_file'][
'name'] != 
"") {
 
 1125                        $file = $mob_dir . 
"/" . $full_file_name;
 
 1126                        ilUtil::moveUploadedFile(
 
 1127                            $_FILES[
'full_file'][
'tmp_name'],
 
 1136                    } elseif (
$_POST[
"full_resize"]) {
 
 1143                        if (
$_POST[
"full_size"] != 
"original" &&
 
 1144                            is_int(strpos(
$format, 
"image"))) {
 
 1147                                (
int) 
$_POST[
"full_width_height"][
"width"],
 
 1148                                (
int) 
$_POST[
"full_width_height"][
"height"],
 
 1149                                (
boolean) 
$_POST[
"full_width_height"][
"contr_prop"]
 
 1152                        $full_item->setFormat(
$format);
 
 1156                    $full_item->setLocationType(
"LocalFile");
 
 1159                if (
$_POST[
"full_type"] == 
"Standard") {
 
 1160                    $format = $std_item->getFormat();
 
 1162                    $full_item->setLocationType($std_item->getLocationType());
 
 1163                    $full_item->setFormat(
$format);
 
 1165                    $type = $std_item->getLocationType();
 
 1166                    if (
$type == 
"LocalFile") {
 
 1171                    if (
$_POST[
"full_size"] != 
"original" &&
 
 1172                        is_int(strpos(
$format, 
"image")) &&
 
 1173                        $full_item->getLocationType() == 
"LocalFile") {
 
 1177                            (
int) 
$_POST[
"full_width_height"][
"width"],
 
 1178                            (
int) 
$_POST[
"full_width_height"][
"height"],
 
 1179                            (
boolean) 
$_POST[
"full_width_height"][
"contr_prop"]
 
 1189                    $full_item->getLocation(),
 
 1190                    $_POST[
"full_width_height"][
"constr_prop"],
 
 1191                    (
$_POST[
"full_size"] == 
"original"),
 
 1192                    $_POST[
"full_width_height"][
"width"],
 
 1193                    $_POST[
"full_width_height"][
"height"]
 
 1195                if ($wh[
"info"] != 
"") {
 
 1199                $full_item->setWidth($wh[
"width"]);
 
 1200                $full_item->setHeight($wh[
"height"]);
 
 1212                        $std_item->getLocation(),
 
 1213                        $std_item->getFormat()
 
 1215                        if (
$_POST[
"full_autostart"]) { 
 
 1216                            $full_item->setParameters(
'autostart="true"');
 
 1218                            $full_item->setParameters(
"");
 
 1227            include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
 
 1230            $this->
object->update();
 
 1231            ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 1232            $this->ctrl->redirect($this, 
"edit");
 
 1234            $this->form_gui->setValuesByPost();
 
 1235            $tpl->setContent($this->form_gui->getHTML());
 
 1246        $std_item = $this->
object->getMediaItem(
"Standard");
 
 1247        if ($this->object->hasFullscreenItem()) {
 
 1248            $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
 1252        require_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
 1256        $cur_subdir = 
$_GET[
"cdir"];
 
 1257        if (
$_GET[
"newdir"] == 
"..") {
 
 1258            $cur_subdir = substr($cur_subdir, 0, strrpos($cur_subdir, 
"/"));
 
 1260            if (!empty(
$_GET[
"newdir"])) {
 
 1261                if (!empty($cur_subdir)) {
 
 1262                    $cur_subdir = $cur_subdir . 
"/" . 
$_GET[
"newdir"];
 
 1264                    $cur_subdir = 
$_GET[
"newdir"];
 
 1269        $cur_subdir = str_replace(
".", 
"", $cur_subdir);
 
 1271        $cur_dir = (!empty($cur_subdir))
 
 1272            ? $mob_dir . 
"/" . $cur_subdir
 
 1276        $this->tpl->addBlockfile(
"ADM_CONTENT", 
"adm_content", 
"tpl.mob_files.html", 
"Services/MediaObjects");
 
 1278        $this->ctrl->setParameter($this, 
"cdir", urlencode($cur_subdir));
 
 1279        $this->tpl->setVariable(
"FORMACTION1", $this->ctrl->getFormAction($this));
 
 1282        $this->tpl->setVariable(
"TXT_NEW_DIRECTORY", $this->lng->txt(
"cont_new_dir"));
 
 1283        $this->tpl->setVariable(
"TXT_NEW_FILE", $this->lng->txt(
"cont_new_file"));
 
 1284        $this->tpl->setVariable(
"CMD_NEW_DIR", 
"createDirectory");
 
 1285        $this->tpl->setVariable(
"CMD_NEW_FILE", 
"uploadFile");
 
 1286        $this->tpl->setVariable(
"BTN_NEW_DIR", $this->lng->txt(
"create"));
 
 1287        $this->tpl->setVariable(
"BTN_NEW_FILE", $this->lng->txt(
"upload"));
 
 1290        $this->tpl->addBlockfile(
"FILE_TABLE", 
"files", 
"tpl.table.html");
 
 1293        $this->tpl->addBlockfile(
"TBL_CONTENT", 
"tbl_content", 
"tpl.mob_file_row.html", 
"Services/MediaObjects");
 
 1297        $obj_str = ($this->call_by_reference) ? 
"" : 
"&obj_id=" . $this->obj_id;
 
 1298        $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 1300        $tbl->setTitle($this->lng->txt(
"cont_files") . 
" " . $cur_subdir);
 
 1303        $tbl->setHeaderNames(array(
"", 
"", $this->lng->txt(
"cont_dir_file"),
 
 1304            $this->lng->txt(
"cont_size"), $this->lng->txt(
"cont_purpose")));
 
 1306        $cols = array(
"", 
"", 
"dir_file", 
"size", 
"purpose");
 
 1307        $header_params = array(
"ref_id" => 
$_GET[
"ref_id"], 
"obj_id" => 
$_GET[
"obj_id"],
 
 1308            "cmd" => 
"editFiles", 
"hier_id" => 
$_GET[
"hier_id"], 
"item_id" => 
$_GET[
"item_id"]);
 
 1309        $tbl->setHeaderVars(
$cols, $header_params);
 
 1310        $tbl->setColumnWidth(array(
"1%", 
"1%", 
"33%", 
"33%", 
"32%"));
 
 1314        $tbl->setOrderDirection(
$_GET[
"sort_order"]);
 
 1317        $tbl->setMaxCount($this->maxcount);             
 
 1320        $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
 
 1324        $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 1325        $this->tpl->setVariable(
"BTN_NAME", 
"deleteFile");
 
 1326        $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
 
 1327        $this->tpl->parseCurrentBlock();
 
 1329        $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 1330        $this->tpl->setVariable(
"BTN_NAME", 
"assignStandard");
 
 1331        $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_assign_std"));
 
 1332        $this->tpl->parseCurrentBlock();
 
 1334        $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
 1335        $this->tpl->setVariable(
"BTN_NAME", 
"assignFullscreen");
 
 1336        $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_assign_full"));
 
 1337        $this->tpl->parseCurrentBlock();
 
 1340        $tbl->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
 
 1346        $tbl->setMaxCount(count($entries));
 
 1347        $entries = array_slice($entries, 
$_GET[
"offset"], 
$_GET[
"limit"]);
 
 1350        if (count($entries) > 0) {
 
 1352            foreach ($entries as $entry) {
 
 1353                if (($entry[
"entry"] == 
".") || ($entry[
"entry"] == 
".." && empty($cur_subdir))) {
 
 1358                if ($entry[
"type"] == 
"dir") {
 
 1359                    $this->tpl->setCurrentBlock(
"FileLink");
 
 1360                    $this->ctrl->setParameter($this, 
"cdir", $cur_subdir);
 
 1361                    $this->ctrl->setParameter($this, 
"newdir", rawurlencode($entry[
"entry"]));
 
 1362                    $this->tpl->setVariable(
"LINK_FILENAME", $this->ctrl->getLinkTarget($this, 
"editFiles"));
 
 1363                    $this->tpl->setVariable(
"TXT_FILENAME", $entry[
"entry"]);
 
 1364                    $this->tpl->parseCurrentBlock();
 
 1366                    $this->tpl->setVariable(
"ICON", 
"<img src=\"" .
 
 1369                    $this->tpl->setCurrentBlock(
"File");
 
 1370                    $this->tpl->setVariable(
"TXT_FILENAME2", $entry[
"entry"]);
 
 1371                    $this->tpl->parseCurrentBlock();
 
 1374                $this->tpl->setCurrentBlock(
"tbl_content");
 
 1376                $this->tpl->setVariable(
"CSS_ROW", $css_row);
 
 1378                $this->tpl->setVariable(
"TXT_SIZE", $entry[
"size"]);
 
 1379                $this->tpl->setVariable(
"CHECKBOX_ID", $entry[
"entry"]);
 
 1380                $compare = (!empty($cur_subdir))
 
 1381                    ? $cur_subdir . 
"/" . $entry[
"entry"]
 
 1384                if ($std_item->getLocation() == $compare) {
 
 1385                    $purpose[] = $this->lng->txt(
"cont_std_view");
 
 1387                if ($this->object->hasFullscreenItem()) {
 
 1388                    if ($full_item->getLocation() == $compare) {
 
 1389                        $purpose[] = $this->lng->txt(
"cont_fullscreen");
 
 1392                $this->tpl->setVariable(
"TXT_PURPOSE", implode($purpose, 
", "));
 
 1394                $this->tpl->parseCurrentBlock();
 
 1398            $this->tpl->setCurrentBlock(
"notfound");
 
 1399            $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
 
 1400            $this->tpl->setVariable(
"NUM_COLS", 4);
 
 1401            $this->tpl->parseCurrentBlock();
 
 1404        $this->tpl->parseCurrentBlock();
 
 1415        $cur_subdir = str_replace(
".", 
"", 
$_GET[
"cdir"]);
 
 1417        $cur_dir = (!empty($cur_subdir))
 
 1418            ? $mob_dir . 
"/" . $cur_subdir
 
 1421        $new_dir = str_replace(
".", 
"", 
$_POST[
"new_dir"]);
 
 1422        $new_dir = str_replace(
"/", 
"", $new_dir);
 
 1424        if (!empty($new_dir)) {
 
 1427        $this->ctrl->saveParameter($this, 
"cdir");
 
 1428        $this->ctrl->redirect($this, 
"editFiles");
 
 1437        $cur_subdir = str_replace(
".", 
"", 
$_GET[
"cdir"]);
 
 1439        $cur_dir = (!empty($cur_subdir))
 
 1440            ? $mob_dir . 
"/" . $cur_subdir
 
 1442        if (is_file($_FILES[
"new_file"][
"tmp_name"])) {
 
 1444            $file = $cur_dir . 
"/" . $file_name;
 
 1445            ilUtil::moveUploadedFile(
 
 1446                $_FILES[
'new_file'][
'tmp_name'],
 
 1452        include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
 
 1455        $this->ctrl->saveParameter($this, 
"cdir");
 
 1456        $this->ctrl->redirect($this, 
"editFiles");
 
 1465        $cur_subdir = dirname($a_file);
 
 1467        $cur_dir = (!empty($cur_subdir))
 
 1468            ? $mob_dir . 
"/" . $cur_subdir
 
 1470        $file = $cur_dir . 
"/" . basename($a_file);
 
 1473        if (!is_file($file)) {
 
 1474            $this->
ilias->raiseError($this->lng->txt(
"cont_select_file"), $this->ilias->error_obj->MESSAGE);
 
 1477        $std_item = $this->
object->getMediaItem(
"Standard");
 
 1478        $std_item->setLocationType(
"LocalFile");
 
 1481        $std_item->setFormat(
$format);
 
 1482        $this->
object->update();
 
 1484        $this->ctrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
 1494        $cur_subdir = dirname($a_file);
 
 1496        $cur_dir = (!empty($cur_subdir))
 
 1497            ? $mob_dir . 
"/" . $cur_subdir
 
 1499        $file = $cur_dir . 
"/" . basename($a_file);
 
 1502        if (!is_file($file)) {
 
 1503            $this->
ilias->raiseError($this->lng->txt(
"cont_select_file"), $this->ilias->error_obj->MESSAGE);
 
 1506        if (!$this->object->hasFullScreenItem()) {      
 
 1507            $std_item = $this->
object->getMediaItem(
"Standard");
 
 1511            $full_item->setMobId($std_item->getMobId());
 
 1513            $full_item->setLocationType(
"LocalFile");
 
 1515            $full_item->setPurpose(
"Fullscreen");
 
 1516            $this->
object->addMediaItem($full_item);
 
 1518            $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
 1520            $full_item->setLocationType(
"LocalFile");
 
 1523            $full_item->setFormat(
$format);
 
 1525        $this->
object->update();
 
 1527        $this->ctrl->redirectByClass(
"ilfilesystemgui", 
"listFiles");
 
 1536        $this->
object->removeMediaItem(
"Fullscreen");
 
 1537        $this->
object->update();
 
 1539        $this->ctrl->redirect($this, 
"edit");
 
 1548        if (!$this->object->hasFullScreenItem()) {
 
 1549            $std_item = $this->
object->getMediaItem(
"Standard");
 
 1551            $full_item->setMobId($std_item->getMobId());
 
 1552            $full_item->setLocation($std_item->getLocation());
 
 1553            $full_item->setLocationType($std_item->getLocationType());
 
 1554            $full_item->setFormat($std_item->getFormat());
 
 1555            $full_item->setWidth($std_item->getWidth());
 
 1556            $full_item->setHeight($std_item->getHeight());
 
 1557            $full_item->setCaption($std_item->getCaption());
 
 1558            $full_item->setTextRepresentation($std_item->getTextRepresentation());
 
 1559            $full_item->setPurpose(
"Fullscreen");
 
 1560            $this->
object->addMediaItem($full_item);
 
 1562            $this->
object->update();
 
 1565        $this->ctrl->redirect($this, 
"edit");
 
 1574        if (!isset(
$_POST[
"file"])) {
 
 1575            $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->ilias->error_obj->MESSAGE);
 
 1578        if (count(
$_POST[
"file"]) > 1) {
 
 1579            $this->
ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"), $this->ilias->error_obj->MESSAGE);
 
 1582        if (
$_POST[
"file"][0] == 
"..") {
 
 1583            $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->ilias->error_obj->MESSAGE);
 
 1586        $cur_subdir = str_replace(
".", 
"", 
$_GET[
"cdir"]);
 
 1588        $cur_dir = (!empty($cur_subdir))
 
 1589            ? $mob_dir . 
"/" . $cur_subdir
 
 1591        $file = $cur_dir . 
"/" . 
$_POST[
"file"][0];
 
 1593            ? $cur_subdir . 
"/" . 
$_POST[
"file"][0]
 
 1596        $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
 1597        $std_item = $this->
object->getMediaItem(
"Standard");
 
 1599        if (
$location == $std_item->getLocation()) {
 
 1600            $this->
ilias->raiseError($this->lng->txt(
"cont_cant_del_std"), $this->
ilias->error_obj->MESSAGE);
 
 1603        if ($this->object->hasFullScreenItem()) {
 
 1604            if (
$location == $full_item->getLocation()) {
 
 1605                $this->
ilias->raiseError($this->lng->txt(
"cont_cant_del_full"), $this->
ilias->error_obj->MESSAGE);
 
 1609        if (@is_dir($file)) {
 
 1611                $this->
ilias->raiseError($this->lng->txt(
"cont_std_is_in_dir"), $this->
ilias->error_obj->MESSAGE);
 
 1614            if ($this->object->hasFullScreenItem()) {
 
 1616                    $this->
ilias->raiseError($this->lng->txt(
"cont_full_is_in_dir"), $this->
ilias->error_obj->MESSAGE);
 
 1621        if (@is_file($file)) {
 
 1625        if (@is_dir($file)) {
 
 1629        $this->ctrl->saveParameter($this, 
"cdir");
 
 1630        $this->ctrl->redirect($this, 
"editFiles");
 
 1655            $lng->txt(
"cont_current_usages"),
 
 1656            $ilCtrl->getLinkTarget($this, 
"showUsages")
 
 1661            $lng->txt(
"cont_all_usages"),
 
 1662            $ilCtrl->getLinkTarget($this, 
"showAllUsages")
 
 1666            $ilTabs->activateSubTab(
"all_usages");
 
 1667            $cmd = 
"showAllUsages";
 
 1669            $ilTabs->activateSubTab(
"current_usages");
 
 1670            $cmd = 
"showUsages";
 
 1673        include_once(
"./Services/MediaObjects/classes/class.ilMediaObjectUsagesTableGUI.php");
 
 1680        $tpl->setContent($usages_table->getHTML());
 
 1692        $tpl = 
new ilTemplate(
"tpl.media_info.html", 
true, 
true, 
"Services/MediaObjects");
 
 1693        $types = array(
"Standard", 
"Fullscreen");
 
 1694        foreach ($types as 
$type) {
 
 1695            if (
$type == 
"Fullscreen" && !$a_mob->hasFullScreenItem()) {
 
 1699            $med = $a_mob->getMediaItem(
$type);
 
 1704            $tpl->setCurrentBlock(
"media_info");
 
 1705            if (
$type == 
"Standard") {
 
 1706                $tpl->setVariable(
"TXT_PURPOSE", 
$lng->txt(
"cont_std_view"));
 
 1708                $tpl->setVariable(
"TXT_PURPOSE", 
$lng->txt(
"cont_fullscreen"));
 
 1710            $tpl->setVariable(
"TXT_TYPE", 
$lng->txt(
"cont_" . strtolower($med->getLocationType())));
 
 1711            $tpl->setVariable(
"VAL_LOCATION", $med->getLocation());
 
 1712            if ($med->getLocationType() == 
"LocalFile") {
 
 1714                if (is_file($file)) {
 
 1715                    $size = filesize($file);
 
 1719                $tpl->setVariable(
"VAL_FILE_SIZE", 
" ($size " . 
$lng->txt(
"bytes") . 
")");
 
 1721            $tpl->setVariable(
"TXT_FORMAT", 
$lng->txt(
"cont_format"));
 
 1722            $tpl->setVariable(
"VAL_FORMAT", $med->getFormat());
 
 1723            if ($med->getWidth() != 
"" && $med->getHeight() != 
"") {
 
 1724                $tpl->setCurrentBlock(
"size");
 
 1725                $tpl->setVariable(
"TXT_SIZE", 
$lng->txt(
"size"));
 
 1726                $tpl->setVariable(
"VAL_SIZE", $med->getWidth() . 
"x" . $med->getHeight());
 
 1727                $tpl->parseCurrentBlock();
 
 1731            if ($orig_size = $med->getOriginalSize()) {
 
 1732                if ($orig_size[
"width"] != $med->getWidth() ||
 
 1733                    $orig_size[
"height"] != $med->getHeight()) {
 
 1734                    $tpl->setCurrentBlock(
"orig_size");
 
 1735                    $tpl->setVariable(
"TXT_ORIG_SIZE", 
$lng->txt(
"cont_orig_size"));
 
 1736                    $tpl->setVariable(
"ORIG_WIDTH", $orig_size[
"width"]);
 
 1737                    $tpl->setVariable(
"ORIG_HEIGHT", $orig_size[
"height"]);
 
 1738                    $tpl->parseCurrentBlock();
 
 1743            if ($med && strlen($med->getCaption())) {
 
 1744                $tpl->setCurrentBlock(
'additional_info');
 
 1745                $tpl->setVariable(
'ADD_INFO', 
$lng->txt(
'cont_caption') . 
': ' . $med->getCaption());
 
 1746                $tpl->parseCurrentBlock();
 
 1750            if (
$type == 
"Standard") {
 
 1751                include_once 
'./Services/MetaData/classes/class.ilMDKeyword.php';
 
 1753                    $tpl->setCurrentBlock(
'additional_info');
 
 1754                    $tpl->setVariable(
'ADD_INFO', 
$lng->txt(
'keywords') . 
': ' . implode(
', ', $kws));
 
 1755                    $tpl->parseCurrentBlock();
 
 1759            $tpl->setCurrentBlock(
"media_info");
 
 1760            $tpl->parseCurrentBlock();
 
 1777        $this->tpl->clearHeader();
 
 1778        if (is_object($this->
object) && strtolower(get_class($this->
object)) == 
"ilobjmediaobject") {
 
 1780            $this->tpl->setTitle($this->object->getTitle());
 
 1784            $this->tpl->setTitle($this->lng->txt(
"cont_create_mob"));
 
 1796        $ilHelp->setScreenIdComponent(
"mob");
 
 1798        if (is_object($this->
object) && strtolower(get_class($this->
object)) == 
"ilobjmediaobject" 
 1799            && $this->object->getId() > 0) {
 
 1801            $this->tabs_gui->addTarget(
 
 1802                "cont_mob_def_prop",
 
 1803                $this->ctrl->getLinkTarget($this, 
"edit"),
 
 1808            $st_item = $this->
object->getMediaItem(
"Standard");
 
 1813                $format = $st_item->getFormat();
 
 1814                if (substr(
$format, 0, 5) == 
"image" && !is_int(strpos(
$format, 
"svg"))) {
 
 1815                    $this->tabs_gui->addTarget(
 
 1816                        "cont_def_map_areas",
 
 1817                        $this->ctrl->getLinkTargetByClass(
 
 1818                            array(
"ilobjmediaobjectgui", 
"ilimagemapeditorgui"),
 
 1822                        "ilimagemapeditorgui" 
 1828            $this->tabs_gui->addTarget(
 
 1830                $this->ctrl->getLinkTarget($this, 
"showUsages"),
 
 1836            $std_item = $this->
object->getMediaItem(
"Standard");
 
 1837            $full_item = $this->
object->getMediaItem(
"Fullscreen");
 
 1839            if ($mset->get(
"file_manager_always") ||
 
 1847                $this->tabs_gui->addTarget(
 
 1849                    $this->ctrl->getLinkTargetByClass(
 
 1850                        array(
"ilobjmediaobjectgui", 
"ilfilesystemgui"),
 
 1858            include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
 1860            $mdtab = $mdgui->getTab(
"ilobjmediaobjectgui");
 
 1862                $this->tabs_gui->addTarget(
 
 1872        if ($this->back_title != 
"") {
 
 1873            $this->tabs_gui->setBackTarget(
 
 1875                $this->ctrl->getParentReturn($this)
 
 1890        include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
 
 1897        $formats_str = implode(
$formats, 
"<br />");
 
 1898        $tpl->setContent($formats_str);
 
 1911        if ($a_tpl == 
null) {
 
 1915        include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
 1916        iljQueryUtil::initjQUery($a_tpl);
 
 1917        include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
 1919        $a_tpl->addJavascript(
"./Services/COPage/js/ilCOPagePres.js");
 
 1921        include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
 1936        $ilTabs->activateTab(
"cont_mob_def_prop");
 
 1940            $lng->txt(
"mob_general"),
 
 1941            $ilCtrl->getLinkTarget($this, 
"edit")
 
 1944        if ($this->object->getMediaItem(
"Standard")->getFormat() == 
"video/webm" ||
 
 1945            $this->object->getMediaItem(
"Standard")->getFormat() == 
"video/mp4") {
 
 1948                $lng->txt(
"mob_subtitles"),
 
 1949                $ilCtrl->getLinkTarget($this, 
"listSubtitleFiles")
 
 1953        $ilTabs->activateSubTab($a_active);
 
 1973        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this), 
true);
 
 1974        include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
 1975        $fi = 
new ilFileInputGUI(
$lng->txt(
"mob_subtitle_file") . 
" (.srt)", 
"subtitle_file");
 
 1976        $fi->setSuffixes(array(
"srt"));
 
 1977        $ilToolbar->addInputItem($fi, 
true);
 
 1980        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1981        include_once(
"./Services/MetaData/classes/class.ilMDLanguageItem.php");
 
 1986        $ilToolbar->addInputItem(
$si, 
true);
 
 1988        $ilToolbar->addFormButton(
$lng->txt(
"upload"), 
"uploadSubtitleFile");
 
 1990        $ilToolbar->addSeparator();
 
 1991        $ilToolbar->addFormButton(
$lng->txt(
"mob_upload_multi_srt"), 
"uploadMultipleSubtitleFileForm");
 
 1993        include_once(
"./Services/MediaObjects/classes/class.ilMobSubtitleTableGUI.php");
 
 2011            ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 2013        $ilCtrl->redirect($this, 
"listSubtitleFiles");
 
 2025        $lng->loadLanguageModule(
"meta");
 
 2027        if (!is_array(
$_POST[
"srt"]) || count(
$_POST[
"srt"]) == 0) {
 
 2029            $ilCtrl->redirect($this, 
"listSubtitleFiles");
 
 2031            include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2033            $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
 2034            $cgui->setHeaderText(
$lng->txt(
"mob_really_delete_srt"));
 
 2035            $cgui->setCancel(
$lng->txt(
"cancel"), 
"listSubtitleFiles");
 
 2036            $cgui->setConfirm(
$lng->txt(
"delete"), 
"deleteSrtFiles");
 
 2039                $cgui->addItem(
"srt[]", 
$i, 
"subtitle_" . 
$i . 
".srt (" . 
$lng->txt(
"meta_l_" . 
$i) . 
")");
 
 2042            $tpl->setContent($cgui->getHTML());
 
 2055            if (strlen(
$i) == 2 && !is_int(strpos(
$i, 
"."))) {
 
 2056                $this->
object->removeAdditionalFile(
"srt/subtitle_" . $i . 
".srt");
 
 2059        ilUtil::sendSuccess(
$lng->txt(
"mob_srt_files_deleted"), 
true);
 
 2060        $ilCtrl->redirect($this, 
"listSubtitleFiles");
 
 2080        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this), 
true);
 
 2081        include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
 2082        $fi = 
new ilFileInputGUI(
$lng->txt(
"mob_subtitle_file") . 
" (.zip)", 
"subtitle_file");
 
 2083        $fi->setSuffixes(array(
"zip"));
 
 2084        $ilToolbar->addInputItem($fi, 
true);
 
 2086        $ilToolbar->addFormButton(
$lng->txt(
"upload"), 
"uploadMultipleSubtitleFile");
 
 2096            $this->ctrl->redirect($this, 
"showMultiSubtitleConfirmationTable");
 
 2099            $this->ctrl->redirect($this, 
"uploadMultipleSubtitleFileForm");
 
 2112        include_once(
"./Services/MediaObjects/classes/class.ilMultiSrtConfirmationTable2GUI.php");
 
 2122        $this->
object->clearMultiSrtDirectory();
 
 2123        $this->ctrl->redirect($this, 
"listSubtitleFiles");
 
 2132        $srt_files = $this->
object->getMultiSrtFiles();
 
 2133        if (is_array(
$_POST[
"file"])) {
 
 2135                foreach ($srt_files as $srt_file) {
 
 2136                    if (
$f == $srt_file[
"filename"]) {
 
 2137                        $this->
object->uploadSrtFile($this->object->getMultiSrtUploadDir() . 
"/" . $srt_file[
"filename"], $srt_file[
"lang"], 
"rename");
 
 2142        $this->
object->clearMultiSrtDirectory();
 
 2143        $ilCtrl->redirect($this, 
"listSubtitleFiles");
 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
Confirmation screen class.
static getSupportedFormatsInfo()
Get all supported formats.
File System Explorer GUI class.
User interface class for map editor.
static lookupKeywords($a_rbac_id, $a_obj_id, $a_return_ids=false)
Lookup Keywords.
TableGUI class for subtitle list.
List srt files from zip file for upload confirmation.
This class represents a non editable value in a property form.
Class ilObjectGUI Basic methods of all Output classes.
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
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
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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 getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static secureLink($a_str)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
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.
static getLocalMaphilightPath()
Get local path of maphilight file.
redirection script todo: (a better solution should control the processing via a xml file)