ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjMediaObjectGUI Class Reference

Class ilObjMediaObjectGUI. More...

+ Inheritance diagram for ilObjMediaObjectGUI:
+ Collaboration diagram for ilObjMediaObjectGUI:

Public Member Functions

 ilObjMediaObjectGUI ($a_data, $a_id=0, $a_call_by_reference=false, $a_prepare_output=false)
 
 setHeader ($a_title="")
 
 getHeader ()
 
 setEnabledMapAreas ($a_enabledmapareas)
 Set Enable map areas. More...
 
 getEnabledMapAreas ()
 Get Enable map areas. More...
 
 setWidthPreset ($a_val)
 Set width preset. More...
 
 getWidthPreset ()
 Get width preset. More...
 
 setHeightPreset ($a_val)
 Set height preset. More...
 
 getHeightPreset ()
 Get height preset. More...
 
 getForm ()
 Get form. More...
 
 assignObject ()
 
 returnToContextObject ()
 
executeCommand ()
 Execute current command. More...
 
 setBackTitle ($a_title)
 set title for back tab More...
 
 createObject ()
 create new media object form More...
 
 initForm ($a_mode="create")
 Init creation form. More...
 
 getValues ()
 Get values for form. More...
 
 saveObject ()
 create new media object in dom and update page in db More...
 
 checkFormInput ()
 chechInputForm More...
 
 cancelObject ()
 Cancel saving. More...
 
 editObject ()
 edit media object properties More...
 
 resizeImagesObject ()
 resize images to specified size More...
 
 getStandardSizeObject ()
 set original size of standard file More...
 
 getFullscreenSizeObject ()
 set original size of fullscreen file More...
 
 savePropertiesObject ()
 save properties in db and return to page edit screen More...
 
 editFilesObject ()
 administrate files of media object More...
 
 createDirectoryObject ()
 create directory More...
 
 uploadFileObject ()
 upload file More...
 
 assignStandardObject ()
 assign file to standard view More...
 
 assignFullscreenObject ()
 assign file to fullscreen view More...
 
 removeFullscreenObject ()
 remove fullscreen view More...
 
 addFullscreenObject ()
 add fullscreen view More...
 
 deleteFileObject ()
 delete object file More...
 
 showAllUsagesObject ()
 Show all media object usages (incl history) More...
 
 showUsagesObject ($a_all=false)
 show all usages of mob More...
 
 _getMediaInfoHTML (&$a_mob)
 get media info as html More...
 
 setTabs ()
 set admin tabs More...
 
 getTabs (&$tabs_gui)
 Get Tabs. More...
 
 showVideoToolObject ()
 Show video tools. More...
 
 includePresentationJS ($a_tpl=null)
 Include media object presentation JS. More...
 
 setPropertiesSubTabs ($a_active)
 Set subtabs for properties. More...
 
 listSubtitleFilesObject ()
 List subtitls files. More...
 
 uploadSubtitleFileObject ()
 Upload srt file. More...
 
 confirmSrtDeletionObject ()
 Confirm srt file deletion. More...
 
 deleteSrtFilesObject ()
 Delete srt files. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static setObjectPerCreationForm ($a_mob)
 Set media object values from creation form. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $ctrl
 
 $header
 
 $target_script
 
 $enabledmapareas = true
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Detailed Description

Class ilObjMediaObjectGUI.

Editing User Interface for MediaObjects within LMs (see ILIAS DTD)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ @ilCtrl_Calls ilObjMediaObjectGUI: ilMDEditorGUI, ilImageMapEditorGUI, ilFileSystemGUI

Definition at line 19 of file class.ilObjMediaObjectGUI.php.

Member Function Documentation

◆ _getMediaInfoHTML()

ilObjMediaObjectGUI::_getMediaInfoHTML ( $a_mob)

get media info as html

Definition at line 1665 of file class.ilObjMediaObjectGUI.php.

1666 {
1667 global $lng;
1668
1669 $tpl =& new ilTemplate("tpl.media_info.html", true, true, "Services/MediaObjects");
1670 $types = array("Standard", "Fullscreen");
1671 foreach ($types as $type)
1672 {
1673 if($type == "Fullscreen" && !$a_mob->hasFullScreenItem())
1674 {
1675 continue;
1676 }
1677
1678 $med = $a_mob->getMediaItem($type);
1679 if (!$med)
1680 {
1681 return "";
1682 }
1683
1684 $tpl->setCurrentBlock("media_info");
1685 if ($type == "Standard")
1686 {
1687 $tpl->setVariable("TXT_PURPOSE", $lng->txt("cont_std_view"));
1688 }
1689 else
1690 {
1691 $tpl->setVariable("TXT_PURPOSE", $lng->txt("cont_fullscreen"));
1692 }
1693 $tpl->setVariable("TXT_TYPE", $lng->txt("cont_".strtolower($med->getLocationType())));
1694 $tpl->setVariable("VAL_LOCATION", $med->getLocation());
1695 if ($med->getLocationType() == "LocalFile")
1696 {
1697 $file = ilObjMediaObject::_getDirectory($med->getMobId())."/".$med->getLocation();
1698 if (is_file($file))
1699 {
1700 $size = filesize($file);
1701 }
1702 else
1703 {
1704 $size = 0;
1705 }
1706 $tpl->setVariable("VAL_FILE_SIZE", " ($size ".$lng->txt("bytes").")");
1707 }
1708 $tpl->setVariable("TXT_FORMAT", $lng->txt("cont_format"));
1709 $tpl->setVariable("VAL_FORMAT", $med->getFormat());
1710 if ($med->getWidth() != "" && $med->getHeight() != "")
1711 {
1712 $tpl->setCurrentBlock("size");
1713 $tpl->setVariable("TXT_SIZE", $lng->txt("size"));
1714 $tpl->setVariable("VAL_SIZE", $med->getWidth()."x".$med->getHeight());
1715 $tpl->parseCurrentBlock();
1716 }
1717
1718 // original size
1719 if ($orig_size = $med->getOriginalSize())
1720 {
1721 if ($orig_size["width"] != $med->getWidth() ||
1722 $orig_size["height"] != $med->getHeight())
1723 {
1724 $tpl->setCurrentBlock("orig_size");
1725 $tpl->setVariable("TXT_ORIG_SIZE", $lng->txt("cont_orig_size"));
1726 $tpl->setVariable("ORIG_WIDTH", $orig_size["width"]);
1727 $tpl->setVariable("ORIG_HEIGHT", $orig_size["height"]);
1728 $tpl->parseCurrentBlock();
1729 }
1730 }
1731
1732 // output caption
1733 if($med && strlen($med->getCaption()))
1734 {
1735 $tpl->setCurrentBlock('additional_info');
1736 $tpl->setVariable('ADD_INFO',$lng->txt('cont_caption').': '.$med->getCaption());
1737 $tpl->parseCurrentBlock();
1738 }
1739
1740 // output keywords
1741 if ($type == "Standard")
1742 {
1743 include_once './Services/MetaData/classes/class.ilMDKeyword.php';
1744 if(count($kws = ilMDKeyword::lookupKeywords(0, $med->getMobId())))
1745 {
1746 $tpl->setCurrentBlock('additional_info');
1747 $tpl->setVariable('ADD_INFO',$lng->txt('keywords').': '.implode(', ',$kws));
1748 $tpl->parseCurrentBlock();
1749 }
1750 }
1751
1752 $tpl->setCurrentBlock("media_info");
1753 $tpl->parseCurrentBlock();
1754 }
1755
1756 return $tpl->get();
1757 }
print $file
$size
Definition: RandomTest.php:79
static lookupKeywords($a_rbac_id, $a_obj_id, $a_return_ids=false)
Lookup Keywords.
_getDirectory($a_mob_id)
get directory for files of media object (static)
special template class to simplify handling of ITX/PEAR

References $file, ilObjectGUI\$lng, $size, ilObjectGUI\$tpl, ilObjMediaObject\_getDirectory(), and ilMDKeyword\lookupKeywords().

Referenced by ilMediaPoolTableGUI\fillRow(), and ilClipboardTableGUI\fillRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFullscreenObject()

ilObjMediaObjectGUI::addFullscreenObject ( )

add fullscreen view

Definition at line 1523 of file class.ilObjMediaObjectGUI.php.

1524 {
1525 if (!$this->object->hasFullScreenItem())
1526 {
1527 $std_item =& $this->object->getMediaItem("Standard");
1528 $full_item =& new ilMediaItem();
1529 $full_item->setMobId($std_item->getMobId());
1530 $full_item->setLocation($std_item->getLocation());
1531 $full_item->setLocationType($std_item->getLocationType());
1532 $full_item->setFormat($std_item->getFormat());
1533 $full_item->setWidth($std_item->getWidth());
1534 $full_item->setHeight($std_item->getHeight());
1535 $full_item->setCaption($std_item->getCaption());
1536 $full_item->setTextRepresentation($std_item->getTextRepresentation());
1537 $full_item->setPurpose("Fullscreen");
1538 $this->object->addMediaItem($full_item);
1539
1540 $this->object->update();
1541 }
1542
1543 $this->ctrl->redirect($this, "edit");
1544 }
Class ilMediaItem.

◆ assignFullscreenObject()

ilObjMediaObjectGUI::assignFullscreenObject ( )

assign file to fullscreen view

Definition at line 1452 of file class.ilObjMediaObjectGUI.php.

1453 {
1454 if (!isset($_POST["file"]))
1455 {
1456 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1457 }
1458
1459 if (count($_POST["file"]) > 1)
1460 {
1461 $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1462 }
1463
1464 // determine directory
1465 $cur_subdir = str_replace(".", "", $_GET["cdir"]);
1466 $mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId();
1467 $cur_dir = (!empty($cur_subdir))
1468 ? $mob_dir."/".$cur_subdir
1469 : $mob_dir;
1470 $file = $cur_dir."/".$_POST["file"][0];
1471 $location = (!empty($cur_subdir))
1472 ? $cur_subdir."/".$_POST["file"][0]
1473 : $_POST["file"][0];
1474
1475 if(!is_file($file))
1476 {
1477 $this->ilias->raiseError($this->lng->txt("cont_select_file"),$this->ilias->error_obj->MESSAGE);
1478 }
1479
1480 if(!$this->object->hasFullScreenItem())
1481 { // create new fullscreen item
1482 $std_item =& $this->object->getMediaItem("Standard");
1483 $mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId();
1484 $file = $mob_dir."/".$location;
1485 $full_item =& new ilMediaItem();
1486 $full_item->setMobId($std_item->getMobId());
1487 $full_item->setLocation($location);
1488 $full_item->setLocationType("LocalFile");
1489 $full_item->setFormat(ilObjMediaObject::getMimeType($file));
1490 $full_item->setPurpose("Fullscreen");
1491 $this->object->addMediaItem($full_item);
1492 }
1493 else // alter existing fullscreen item
1494 {
1495 $full_item =& $this->object->getMediaItem("Fullscreen");
1496
1497 $full_item->setLocationType("LocalFile");
1498 $full_item->setLocation($location);
1500 $full_item->setFormat($format);
1501 }
1502 $this->object->update();
1503// $this->ctrl->saveParameter($this, "cdir");
1504 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
1505 }
$location
Definition: buildRTE.php:44
$_GET["client_id"]
static getMimeType($a_file)
get mime type for file
static getWebspaceDir($mode="filesystem")
get webspace directory
$_POST['username']
Definition: cron.php:12
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, $_POST, $file, $location, ilObjMediaObject\getMimeType(), and ilUtil\getWebspaceDir().

+ Here is the call graph for this function:

◆ assignObject()

ilObjMediaObjectGUI::assignObject ( )

Reimplemented from ilObjectGUI.

Definition at line 119 of file class.ilObjMediaObjectGUI.php.

120 {
121 if ($this->id != 0)
122 {
123 $this->object =& new ilObjMediaObject($this->id);
124 }
125 }
Class ilObjMediaObject.

◆ assignStandardObject()

ilObjMediaObjectGUI::assignStandardObject ( )

assign file to standard view

Definition at line 1410 of file class.ilObjMediaObjectGUI.php.

1411 {
1412 if (!isset($_POST["file"]))
1413 {
1414 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1415 }
1416
1417 if (count($_POST["file"]) > 1)
1418 {
1419 $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1420 }
1421
1422 // determine directory
1423 $cur_subdir = str_replace(".", "", $_GET["cdir"]);
1424 $mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId();
1425 $cur_dir = (!empty($cur_subdir))
1426 ? $mob_dir."/".$cur_subdir
1427 : $mob_dir;
1428 $file = $cur_dir."/".$_POST["file"][0];
1429 $location = (!empty($cur_subdir))
1430 ? $cur_subdir."/".$_POST["file"][0]
1431 : $_POST["file"][0];
1432
1433 if(!is_file($file))
1434 {
1435 $this->ilias->raiseError($this->lng->txt("cont_select_file"),$this->ilias->error_obj->MESSAGE);
1436 }
1437
1438 $std_item =& $this->object->getMediaItem("Standard");
1439 $std_item->setLocationType("LocalFile");
1440 $std_item->setLocation($location);
1442 $std_item->setFormat($format);
1443 $this->object->update();
1444// $this->ctrl->saveParameter($this, "cdir");
1445 $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
1446 }

References $_GET, $_POST, $file, $location, ilObjMediaObject\getMimeType(), and ilUtil\getWebspaceDir().

+ Here is the call graph for this function:

◆ cancelObject()

ilObjMediaObjectGUI::cancelObject ( )

Cancel saving.

Definition at line 811 of file class.ilObjMediaObjectGUI.php.

812 {
813 $this->ctrl->returnToParent($this);
814 }

◆ checkFormInput()

ilObjMediaObjectGUI::checkFormInput ( )

chechInputForm

Parameters

return

Definition at line 623 of file class.ilObjMediaObjectGUI.php.

624 {
625 if (!$this->form_gui->checkInput())
626 {
627 $this->form_gui->setValuesByPost();
628 return false;
629 }
630 return true;
631 }

◆ confirmSrtDeletionObject()

ilObjMediaObjectGUI::confirmSrtDeletionObject ( )

Confirm srt file deletion.

Definition at line 1993 of file class.ilObjMediaObjectGUI.php.

1994 {
1995 global $ilCtrl, $tpl, $lng;
1996
1997 $lng->loadLanguageModule("meta");
1998
1999 if (!is_array($_POST["srt"]) || count($_POST["srt"]) == 0)
2000 {
2001 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2002 $ilCtrl->redirect($this, "listSubtitleFiles");
2003 }
2004 else
2005 {
2006 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2007 $cgui = new ilConfirmationGUI();
2008 $cgui->setFormAction($ilCtrl->getFormAction($this));
2009 $cgui->setHeaderText($lng->txt("mob_really_delete_srt"));
2010 $cgui->setCancel($lng->txt("cancel"), "listSubtitleFiles");
2011 $cgui->setConfirm($lng->txt("delete"), "deleteSrtFiles");
2012
2013 foreach ($_POST["srt"] as $i)
2014 {
2015 $cgui->addItem("srt[]", $i, "subtitle_".$i.".srt (".$lng->txt("meta_l_".$i).")");
2016 }
2017
2018 $tpl->setContent($cgui->getHTML());
2019 }
2020 }
Confirmation screen class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilCtrl
Definition: ilias.php:18

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ createDirectoryObject()

ilObjMediaObjectGUI::createDirectoryObject ( )

create directory

Definition at line 1357 of file class.ilObjMediaObjectGUI.php.

1358 {
1359//echo "cdir:".$_GET["cdir"].":<br>";
1360 // determine directory
1361 $cur_subdir = str_replace(".", "", $_GET["cdir"]);
1362 $mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId();
1363 $cur_dir = (!empty($cur_subdir))
1364 ? $mob_dir."/".$cur_subdir
1365 : $mob_dir;
1366
1367 $new_dir = str_replace(".", "", $_POST["new_dir"]);
1368 $new_dir = str_replace("/", "", $new_dir);
1369
1370 if (!empty($new_dir))
1371 {
1372 ilUtil::makeDir($cur_dir."/".$new_dir);
1373 }
1374 $this->ctrl->saveParameter($this, "cdir");
1375 $this->ctrl->redirect($this, "editFiles");
1376 }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References $_GET, $_POST, ilUtil\getWebspaceDir(), and ilUtil\makeDir().

+ Here is the call graph for this function:

◆ createObject()

ilObjMediaObjectGUI::createObject ( )

create new media object form

Reimplemented from ilObjectGUI.

Definition at line 211 of file class.ilObjMediaObjectGUI.php.

212 {
213 global $tpl, $ilHelp;
214
215 $ilHelp->setScreenId("create");
216 $this->initForm();
217 $tpl->setContent($this->form_gui->getHTML());
218 }
initForm($a_mode="create")
Init creation form.

References ilObjectGUI\$tpl, and initForm().

+ Here is the call graph for this function:

◆ deleteFileObject()

ilObjMediaObjectGUI::deleteFileObject ( )

delete object file

Definition at line 1550 of file class.ilObjMediaObjectGUI.php.

1551 {
1552 if (!isset($_POST["file"]))
1553 {
1554 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1555 }
1556
1557 if (count($_POST["file"]) > 1)
1558 {
1559 $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1560 }
1561
1562 if ($_POST["file"][0] == "..")
1563 {
1564 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1565 }
1566
1567 $cur_subdir = str_replace(".", "", $_GET["cdir"]);
1568 $mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId();
1569 $cur_dir = (!empty($cur_subdir))
1570 ? $mob_dir."/".$cur_subdir
1571 : $mob_dir;
1572 $file = $cur_dir."/".$_POST["file"][0];
1573 $location = (!empty($cur_subdir))
1574 ? $cur_subdir."/".$_POST["file"][0]
1575 : $_POST["file"][0];
1576
1577 $full_item =& $this->object->getMediaItem("Fullscreen");
1578 $std_item =& $this->object->getMediaItem("Standard");
1579
1580 if ($location == $std_item->getLocation())
1581 {
1582 $this->ilias->raiseError($this->lng->txt("cont_cant_del_std"),$this->ilias->error_obj->MESSAGE);
1583 }
1584
1585 if($this->object->hasFullScreenItem())
1586 {
1587 if ($location == $full_item->getLocation())
1588 {
1589 $this->ilias->raiseError($this->lng->txt("cont_cant_del_full"),$this->ilias->error_obj->MESSAGE);
1590 }
1591 }
1592
1593 if (@is_dir($file))
1594 {
1595 if (substr($std_item->getLocation(), 0 ,strlen($location)) == $location)
1596 {
1597 $this->ilias->raiseError($this->lng->txt("cont_std_is_in_dir"),$this->ilias->error_obj->MESSAGE);
1598 }
1599
1600 if($this->object->hasFullScreenItem())
1601 {
1602 if (substr($full_item->getLocation(), 0 ,strlen($location)) == $location)
1603 {
1604 $this->ilias->raiseError($this->lng->txt("cont_full_is_in_dir"),$this->ilias->error_obj->MESSAGE);
1605 }
1606 }
1607 }
1608
1609 if (@is_file($file))
1610 {
1611 unlink($file);
1612 }
1613
1614 if (@is_dir($file))
1615 {
1617 }
1618
1619 $this->ctrl->saveParameter($this, "cdir");
1620 $this->ctrl->redirect($this, "editFiles");
1621 }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

References $_GET, $_POST, $file, $location, ilUtil\delDir(), and ilUtil\getWebspaceDir().

+ Here is the call graph for this function:

◆ deleteSrtFilesObject()

ilObjMediaObjectGUI::deleteSrtFilesObject ( )

Delete srt files.

Definition at line 2025 of file class.ilObjMediaObjectGUI.php.

2026 {
2027 global $lng, $ilCtrl;
2028
2029 foreach ($_POST["srt"] as $i)
2030 {
2031 if (strlen($i) == 2 && !is_int(strpos($i, ".")))
2032 {
2033 $this->object->removeAdditionalFile("srt/subtitle_".$i.".srt");
2034 }
2035 }
2036 ilUtil::sendSuccess($lng->txt("mob_srt_files_deleted"), true);
2037 $ilCtrl->redirect($this, "listSubtitleFiles");
2038 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $_POST, $ilCtrl, ilObjectGUI\$lng, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ editFilesObject()

ilObjMediaObjectGUI::editFilesObject ( )

administrate files of media object

Definition at line 1171 of file class.ilObjMediaObjectGUI.php.

1172 {
1173 // standard item
1174 $std_item =& $this->object->getMediaItem("Standard");
1175 if($this->object->hasFullscreenItem())
1176 {
1177 $full_item =& $this->object->getMediaItem("Fullscreen");
1178 }
1179
1180 // create table
1181 require_once("./Services/Table/classes/class.ilTableGUI.php");
1182 $tbl = new ilTableGUI();
1183
1184 // determine directory
1185 $cur_subdir = $_GET["cdir"];
1186 if($_GET["newdir"] == "..")
1187 {
1188 $cur_subdir = substr($cur_subdir, 0, strrpos($cur_subdir, "/"));
1189 }
1190 else
1191 {
1192 if (!empty($_GET["newdir"]))
1193 {
1194 if (!empty($cur_subdir))
1195 {
1196 $cur_subdir = $cur_subdir."/".$_GET["newdir"];
1197 }
1198 else
1199 {
1200 $cur_subdir = $_GET["newdir"];
1201 }
1202 }
1203 }
1204
1205 $cur_subdir = str_replace(".", "", $cur_subdir);
1206 $mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId();
1207 $cur_dir = (!empty($cur_subdir))
1208 ? $mob_dir."/".$cur_subdir
1209 : $mob_dir;
1210
1211 // load files templates
1212 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.mob_files.html", "Services/MediaObjects");
1213
1214 $this->ctrl->setParameter($this, "cdir", urlencode($cur_subdir));
1215 $this->tpl->setVariable("FORMACTION1", $this->ctrl->getFormAction($this));
1216//echo "--".$this->getTargetScript().
1217 //"&hier_id=".$_GET["hier_id"]."&cdir=".$cur_subdir."&cmd=post"."--<br>";
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"));
1224
1225 //
1226 $this->tpl->addBlockfile("FILE_TABLE", "files", "tpl.table.html");
1227
1228 // load template for table content data
1229 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.mob_file_row.html", "Services/MediaObjects");
1230
1231 $num = 0;
1232
1233 $obj_str = ($this->call_by_reference) ? "" : "&obj_id=".$this->obj_id;
1234 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1235
1236 $tbl->setTitle($this->lng->txt("cont_files")." ".$cur_subdir);
1237 //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
1238
1239 $tbl->setHeaderNames(array("", "", $this->lng->txt("cont_dir_file"),
1240 $this->lng->txt("cont_size"), $this->lng->txt("cont_purpose")));
1241
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%"));
1247
1248 // control
1249 $tbl->setOrderColumn($_GET["sort_by"]);
1250 $tbl->setOrderDirection($_GET["sort_order"]);
1251 $tbl->setLimit($_GET["limit"]);
1252 $tbl->setOffset($_GET["offset"]);
1253 $tbl->setMaxCount($this->maxcount); // ???
1254 //$tbl->setMaxCount(30); // ???
1255
1256 $this->tpl->setVariable("COLUMN_COUNTS", 5);
1257
1258 // delete button
1259 $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
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();
1264
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();
1269
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();
1274
1275 // footer
1276 $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
1277 //$tbl->disable("footer");
1278
1279 $entries = ilUtil::getDir($cur_dir);
1280
1281 //$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
1282 $tbl->setMaxCount(count($entries));
1283 $entries = array_slice($entries, $_GET["offset"], $_GET["limit"]);
1284
1285 $tbl->render();
1286 if(count($entries) > 0)
1287 {
1288 $i=0;
1289 foreach($entries as $entry)
1290 {
1291 if(($entry["entry"] == ".") || ($entry["entry"] == ".." && empty($cur_subdir)))
1292 {
1293 continue;
1294 }
1295
1296 //$this->tpl->setVariable("ICON", $obj["title"]);
1297 if($entry["type"] == "dir")
1298 {
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();
1305
1306 $this->tpl->setVariable("ICON", "<img src=\"".
1307 ilUtil::getImagePath("icon_cat.svg")."\">");
1308 }
1309 else
1310 {
1311 $this->tpl->setCurrentBlock("File");
1312 $this->tpl->setVariable("TXT_FILENAME2", $entry["entry"]);
1313 $this->tpl->parseCurrentBlock();
1314 }
1315
1316 $this->tpl->setCurrentBlock("tbl_content");
1317 $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
1318 $this->tpl->setVariable("CSS_ROW", $css_row);
1319
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"]
1324 : $entry["entry"];
1325 $purpose = array();
1326 if ($std_item->getLocation() == $compare)
1327 {
1328 $purpose[] = $this->lng->txt("cont_std_view");
1329 }
1330 if($this->object->hasFullscreenItem())
1331 {
1332 if ($full_item->getLocation() == $compare)
1333 {
1334 $purpose[] = $this->lng->txt("cont_fullscreen");
1335 }
1336 }
1337 $this->tpl->setVariable("TXT_PURPOSE", implode($purpose, ", "));
1338
1339 $this->tpl->parseCurrentBlock();
1340 }
1341 } //if is_array
1342 else
1343 {
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();
1348 }
1349
1350 $this->tpl->parseCurrentBlock();
1351 }
Class ilTableGUI.
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 getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $_GET, ilUtil\getDir(), ilUtil\getImagePath(), ilUtil\getWebspaceDir(), and ilUtil\switchColor().

+ Here is the call graph for this function:

◆ editObject()

ilObjMediaObjectGUI::editObject ( )

edit media object properties

Reimplemented from ilObjectGUI.

Definition at line 819 of file class.ilObjMediaObjectGUI.php.

820 {
821 global $tpl;
822
823 $this->setPropertiesSubTabs("general");
824
825 $this->initForm("edit");
826 $this->getValues();
827 $tpl->setContent($this->form_gui->getHTML());
828 }
getValues()
Get values for form.
setPropertiesSubTabs($a_active)
Set subtabs for properties.

References ilObjectGUI\$tpl, getValues(), initForm(), and setPropertiesSubTabs().

+ Here is the call graph for this function:

◆ executeCommand()

& ilObjMediaObjectGUI::executeCommand ( )

Execute current command.

Reimplemented from ilObjectGUI.

Definition at line 136 of file class.ilObjMediaObjectGUI.php.

137 {
138 global $tpl, $ilAccess, $ilErr;
139
140 $next_class = $this->ctrl->getNextClass($this);
141 $cmd = $this->ctrl->getCmd();
142
143 switch($next_class)
144 {
145 case 'ilmdeditorgui':
146 include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
147
148 $md_gui =& new ilMDEditorGUI(0, $this->object->getId(), $this->object->getType());
149 $md_gui->addObserver($this->object,'MDUpdateListener','General');
150
151 $this->ctrl->forwardCommand($md_gui);
152 break;
153
154 case "ilimagemapeditorgui":
155 require_once("./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php");
156 $image_map_edit = new ilImageMapEditorGUI($this->object);
157 $ret = $this->ctrl->forwardCommand($image_map_edit);
158 $tpl->setContent($ret);
159 break;
160
161 case "ilfilesystemgui":
162 include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
163 $fs_gui =& new ilFileSystemGUI(ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId());
164 $fs_gui->setAllowedSuffixes(ilObjMediaObject::getRestrictedFileTypes());
165 $fs_gui->setForbiddenSuffixes(ilObjMediaObject::getForbiddenFileTypes());
166 $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
167 $fs_gui->setTableId("mobfs".$this->object->getId());
168 $fs_gui->labelFile($this->object->getMediaItem("Standard")->getLocation(),
169 $this->lng->txt("cont_std_view"));
170 if($this->object->hasFullscreenItem())
171 {
172 $fs_gui->labelFile($this->object->getMediaItem("Fullscreen")->getLocation(),
173 $this->lng->txt("cont_fullscreen"));
174 }
175 $fs_gui->addCommand($this, "assignStandardObject", $this->lng->txt("cont_assign_std"));
176 $fs_gui->addCommand($this, "assignFullscreenObject", $this->lng->txt("cont_assign_full"));
177 ilObjMediaObject::renameExecutables(ilObjMediaObject::_getDirectory($this->object->getId())); // see #20187
178 $ret =& $this->ctrl->forwardCommand($fs_gui);
179 ilObjMediaObject::renameExecutables(ilObjMediaObject::_getDirectory($this->object->getId())); // see #20187
180 include_once("./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
181 ilMediaSvgSanitizer::sanitizeDir(ilObjMediaObject::_getDirectory($this->object->getId())); // see #20339
182 break;
183
184
185 default:
186 if (isset($_POST["editImagemapForward"]) ||
187 isset($_POST["editImagemapForward_x"]) ||
188 isset($_POST["editImagemapForward_y"]))
189 {
190 $cmd = "editImagemapForward";
191 }
192 $cmd.= "Object";
193 $ret =& $this->$cmd();
194 break;
195 }
196
197 return $ret;
198 }
File System Explorer GUI class.
User interface class for map editor.
static sanitizeDir($a_path)
Sanitize directory recursively.
static getRestrictedFileTypes()
Get restricted file types (this is for the input form, this list will be empty, if "allowed list" is ...
static getForbiddenFileTypes()
Get forbidden file types.
static renameExecutables($a_dir)
Rename executables.
$cmd
Definition: sahs_server.php:35

References $_POST, $cmd, $ilErr, $ret, ilObjectGUI\$tpl, ilObjMediaObject\_getDirectory(), ilObjMediaObject\getForbiddenFileTypes(), ilObjMediaObject\getRestrictedFileTypes(), ilUtil\getWebspaceDir(), ilObjMediaObject\renameExecutables(), and ilMediaSvgSanitizer\sanitizeDir().

+ Here is the call graph for this function:

◆ getEnabledMapAreas()

ilObjMediaObjectGUI::getEnabledMapAreas ( )

Get Enable map areas.

Returns
boolean Enable map areas

Definition at line 64 of file class.ilObjMediaObjectGUI.php.

References $enabledmapareas.

Referenced by getTabs().

+ Here is the caller graph for this function:

◆ getForm()

ilObjMediaObjectGUI::getForm ( )

Get form.

Returns
object form gui class

Definition at line 114 of file class.ilObjMediaObjectGUI.php.

115 {
116 return $this->form_gui;
117 }

◆ getFullscreenSizeObject()

ilObjMediaObjectGUI::getFullscreenSizeObject ( )

set original size of fullscreen file

Definition at line 898 of file class.ilObjMediaObjectGUI.php.

899 {
900 $full_item =& $this->object->getMediaItem("Fullscreen");
901 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
902
903 if ($full_item->getLocationType() == "LocalFile")
904 {
905 $file = $mob_dir."/".$full_item->getLocation();
906 include_once("./Services/MediaObjects/classes/class.ilMediaImageUtil.php");
908 $full_item->setWidth($size[0]);
909 $full_item->setHeight($size[1]);
910 $this->object->update();
911 }
912 $this->ctrl->redirect($this, "edit");
913 }
static getImageSize($a_location)
Get image size from location.

References $file, $size, ilObjMediaObject\_getDirectory(), and ilMediaImageUtil\getImageSize().

+ Here is the call graph for this function:

◆ getHeader()

ilObjMediaObjectGUI::getHeader ( )

Definition at line 44 of file class.ilObjMediaObjectGUI.php.

References $header.

◆ getHeightPreset()

ilObjMediaObjectGUI::getHeightPreset ( )

Get height preset.

Returns
int height preset

Definition at line 104 of file class.ilObjMediaObjectGUI.php.

105 {
106 return $this->height_preset;
107 }

Referenced by initForm().

+ Here is the caller graph for this function:

◆ getStandardSizeObject()

ilObjMediaObjectGUI::getStandardSizeObject ( )

set original size of standard file

Definition at line 875 of file class.ilObjMediaObjectGUI.php.

876 {
877 $std_item = $this->object->getMediaItem("Standard");
878 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
879
880 if ($std_item->getLocationType() == "LocalFile")
881 {
882 $file = $mob_dir."/".$std_item->getLocation();
883
884 include_once("./Services/MediaObjects/classes/class.ilMediaImageUtil.php");
886
887 $std_item->setWidth($size[0]);
888 $std_item->setHeight($size[1]);
889 $this->object->update();
890 }
891 $this->ctrl->redirect($this, "edit");
892 }

References $file, $size, ilObjMediaObject\_getDirectory(), and ilMediaImageUtil\getImageSize().

+ Here is the call graph for this function:

◆ getTabs()

ilObjMediaObjectGUI::getTabs ( $tabs_gui)

Get Tabs.

Reimplemented from ilObjectGUI.

Definition at line 1789 of file class.ilObjMediaObjectGUI.php.

1790 {
1791 global $ilTabs, $ilHelp;
1792
1793 $ilHelp->setScreenIdComponent("mob");
1794
1795 //$tabs_gui->setTargetScript($this->ctrl->getLinkTarget($this));
1796 if (is_object($this->object) && strtolower(get_class($this->object)) == "ilobjmediaobject"
1797 && $this->object->getId() > 0)
1798 {
1799 // object properties
1800 $ilTabs->addTarget("cont_mob_def_prop",
1801 $this->ctrl->getLinkTarget($this, "edit"), "edit",
1802 get_class($this));
1803
1804 $st_item =& $this->object->getMediaItem("Standard");
1805
1806 // video tools
1807 if (substr($st_item->getFormat(), 0, 6) == "video/" && DEVMODE)
1808 {
1809 $ilTabs->addTarget("mob_video_tools",
1810 $this->ctrl->getLinkTargetByClass("ilobjmediaobjectgui", "showVideoTool"),
1811 "showVideoTool", "ilobjmediaobjectgui");
1812 }
1813
1814 // link areas
1815
1816 if (is_object($st_item) && $this->getEnabledMapAreas())
1817 {
1818 $format = $st_item->getFormat();
1819 if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg")))
1820 {
1821 $ilTabs->addTarget("cont_def_map_areas",
1822 $this->ctrl->getLinkTargetByClass(
1823 array("ilobjmediaobjectgui", "ilimagemapeditorgui"), "editMapAreas"), "editMapAreas",
1824 "ilimagemapeditorgui");
1825 }
1826 }
1827
1828 // object usages
1829 $ilTabs->addTarget("cont_mob_usages",
1830 $this->ctrl->getLinkTarget($this, "showUsages"), "showUsages",
1831 get_class($this));
1832
1833 // object files
1834 $std_item = $this->object->getMediaItem("Standard");
1835 $full_item = $this->object->getMediaItem("Fullscreen");
1836 $mset = new ilSetting("mobs");
1837 if ($mset->get("file_manager_always") ||
1838 (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes()) ||
1839 (is_object($full_item) && !in_array($full_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())))
1840 )
1841 {
1842// $ilTabs->addTarget("cont_files",
1843// $this->ctrl->getLinkTarget($this, "editFiles"), "editFiles",
1844// get_class($this));
1845
1846 $ilTabs->addTarget("cont_files",
1847 $this->ctrl->getLinkTargetByClass(
1848 array("ilobjmediaobjectgui", "ilfilesystemgui"), "listFiles"), "",
1849 "ilfilesystemgui");
1850 }
1851
1852 $ilTabs->addTarget("meta_data",
1853 $this->ctrl->getLinkTargetByClass(
1854 array("ilobjmediaobjectgui", "ilmdeditorgui"),'listSection'),
1855 "", "ilmdeditorgui");
1856
1857 }
1858
1859 // back to upper context
1860 if ($this->back_title != "")
1861 {
1862 $tabs_gui->setBackTarget($this->back_title,
1863 $this->ctrl->getParentReturn($this));
1864 }
1865 }
getEnabledMapAreas()
Get Enable map areas.
static _getSimpleMimeTypes()
Get simple mime types that deactivate parameter property files tab in ILIAS.
ILIAS Setting Class.

References ilObjMediaObject\_getSimpleMimeTypes(), and getEnabledMapAreas().

Referenced by setTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValues()

ilObjMediaObjectGUI::getValues ( )

Get values for form.

Definition at line 496 of file class.ilObjMediaObjectGUI.php.

497 {
498 $values = array();
499
500 $values["standard_title"] = $this->object->getTitle();
501
502 $std_item = $this->object->getMediaItem("Standard");
503 if ($std_item->getLocationType() == "LocalFile")
504 {
505 $values["standard_type"] = "File";
506 $values["standard_file"] = $std_item->getLocation();
507 }
508 else
509 {
510 $values["standard_type"] = "Reference";
511 $values["standard_reference"] = $std_item->getLocation();
512 }
513 $values["standard_format"] = $std_item->getFormat();
514 $values["standard_width_height"]["width"] = $std_item->getWidth();
515 $values["standard_width_height"]["height"] = $std_item->getHeight();
516 $values["standard_width_height"]["constr_prop"] = true;
517
518 $values["standard_size"] = "selected";
519
520 if ($orig_size = $std_item->getOriginalSize())
521 {
522 if ($orig_size["width"] == $std_item->getWidth() &&
523 $orig_size["height"] == $std_item->getHeight())
524 {
525 $values["standard_size"] = "original";
526 }
527 }
528 $values["standard_caption"] = $std_item->getCaption();
529 $values["text_representation"] = $std_item->getTextRepresentation();
530 if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(),
531 $std_item->getFormat()))
532 {
533 $par = $std_item->getParameters();
534 if ($par["autostart"])
535 {
536 $values["standard_autostart"] = true;
537 }
538 }
539 else
540 {
541 $values["standard_parameters"] = $std_item->getParameterString();
542 }
543
544 $values["full_type"] = "None";
545 $values["full_size"] = "original";
546 if ($this->object->hasFullScreenItem())
547 {
548 $full_item = $this->object->getMediaItem("Fullscreen");
549 if ($full_item->getLocationType() == "LocalFile")
550 {
551 $values["full_type"] = "File";
552 $values["full_file"] = $full_item->getLocation();
553 }
554 else
555 {
556 $values["full_type"] = "Reference";
557 $values["full_reference"] = $full_item->getLocation();
558 }
559 $values["full_format"] = $full_item->getFormat();
560 $values["full_width_height"]["width"] = $full_item->getWidth();
561 $values["full_width_height"]["height"] = $full_item->getHeight();
562 $values["full_width_height"]["constr_prop"] = true;
563
564 $values["full_size"] = "selected";
565
566 if ($orig_size = $full_item->getOriginalSize())
567 {
568 if ($orig_size["width"] == $full_item->getWidth() &&
569 $orig_size["height"] == $full_item->getHeight())
570 {
571 $values["full_size"] = "original";
572 }
573 }
574 $values["full_caption"] = $full_item->getCaption();
575 if (ilObjMediaObject::_useAutoStartParameterOnly($full_item->getLocation(),
576 $full_item->getFormat()))
577 {
578 $par = $full_item->getParameters();
579 if ($par["autostart"])
580 {
581 $values["full_autostart"] = true;
582 }
583 }
584 else
585 {
586 $values["full_parameters"] = $full_item->getParameterString();
587 }
588 $values["full_text_representation"] = $full_item->getTextRepresentation();
589 }
590
591 $this->form_gui->setValuesByArray($values);
592 }
static _useAutoStartParameterOnly($a_loc, $a_format)
Check whether only autostart parameter should be supported (instead of parameters input field.

References ilObjMediaObject\_useAutoStartParameterOnly().

Referenced by editObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWidthPreset()

ilObjMediaObjectGUI::getWidthPreset ( )

Get width preset.

Returns
int width preset

Definition at line 84 of file class.ilObjMediaObjectGUI.php.

85 {
86 return $this->width_preset;
87 }

Referenced by initForm().

+ Here is the caller graph for this function:

◆ ilObjMediaObjectGUI()

ilObjMediaObjectGUI::ilObjMediaObjectGUI (   $a_data,
  $a_id = 0,
  $a_call_by_reference = false,
  $a_prepare_output = false 
)

Definition at line 26 of file class.ilObjMediaObjectGUI.php.

27 {
28 global $lng, $ilCtrl;
29
30 $this->ctrl =& $ilCtrl;
31 parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
32 $this->lng =& $lng;
33 $this->back_title = "";
34 $this->type = "mob";
35
36 $lng->loadLanguageModule("mob");
37 }

References $ilCtrl, and ilObjectGUI\$lng.

◆ includePresentationJS()

ilObjMediaObjectGUI::includePresentationJS (   $a_tpl = null)

Include media object presentation JS.

Definition at line 1892 of file class.ilObjMediaObjectGUI.php.

1893 {
1894 global $tpl;
1895
1896 if ($a_tpl == null)
1897 {
1898 $a_tpl = $tpl;
1899 }
1900
1901 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1902 iljQueryUtil::initjQUery($a_tpl);
1903 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
1904 $a_tpl->addJavascript(iljQueryUtil::getLocalMaphilightPath());
1905 $a_tpl->addJavascript("./Services/COPage/js/ilCOPagePres.js");
1906
1907 include_once("./Services/MediaObjects/classes/class.ilPlayerUtil.php");
1909 }
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
getLocalMaphilightPath()
Get local path of maphilight file.

References ilObjectGUI\$tpl, iljQueryUtil\getLocalMaphilightPath(), and ilPlayerUtil\initMediaElementJs().

Referenced by ilPageObjectGUI\displayMedia(), ilImageMapEditorGUI\executeCommand(), ilObjMediaPoolGUI\getPreviewModalHTML(), ilLMPresentationGUI\ilMedia(), ilObjMediaPoolGUI\showMedia(), and ilPageObjectGUI\showPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilObjMediaObjectGUI::initForm (   $a_mode = "create")

Init creation form.

Definition at line 223 of file class.ilObjMediaObjectGUI.php.

224 {
225 global $lng, $ilCtrl;
226
227 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
228
229 if ($a_mode == "edit")
230 {
231 $std_item = $this->object->getMediaItem("Standard");
232 }
233
234 $this->form_gui = new ilPropertyFormGUI();
235
236 // standard view resource
237 $title = new ilTextInputGUI($lng->txt("title"), "standard_title");
238 $title->setSize(40);
239 $title->setMaxLength(120);
240 $this->form_gui->addItem($title);
241 $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "standard_type");
242 $op1 = new ilRadioOption($lng->txt("cont_file"), "File");
243 $up = new ilFileInputGUI("", "standard_file");
245 $up->setForbiddenSuffixes(ilObjMediaObject::getForbiddenFileTypes());
246 $up->setInfo("");
247 $op1->addSubItem($up);
248 $radio_prop->addOption($op1);
249 $op2 = new ilRadioOption($lng->txt("url"), "Reference");
250 $ref = new ilTextInputGUI("", "standard_reference");
251 $ref->setInfo($lng->txt("cont_ref_helptext"));
252 $op2->addSubItem($ref);
253 $radio_prop->addOption($op2);
254 $radio_prop->setValue("File");
255 $this->form_gui->addItem($radio_prop);
256
257 // standard format
258 if ($a_mode == "edit")
259 {
260 $format = new ilNonEditableValueGUI($lng->txt("cont_format"), "standard_format");
261 $format->setValue($std_item->getFormat());
262 $this->form_gui->addItem($format);
263 }
264
265 // standard size
266 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "standard_size");
267 if ($a_mode == "edit")
268 {
269 if ($orig_size = $std_item->getOriginalSize())
270 {
271 $add_str = " (".$orig_size["width"]." x ".$orig_size["height"].")";
272 }
273 $op1 = new ilRadioOption($lng->txt("cont_resource_size").$add_str, "original");
274 $op2 = new ilRadioOption($lng->txt("cont_custom_size"), "selected");
275 }
276 else
277 {
278 $op1 = new ilRadioOption($lng->txt("cont_orig_size"), "original");
279 $op2 = new ilRadioOption($lng->txt("cont_adjust_size"), "selected");
280 }
281 $radio_size->addOption($op1);
282
283 // width height
284 include_once("./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php");
285 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width").
286 " / ".$lng->txt("cont_height"), "standard_width_height");
287 $width_height->setConstrainProportions(true);
288 $op2->addSubItem($width_height);
289
290 // resize image
291 if ($a_mode == "edit")
292 {
293 $std_item = $this->object->getMediaItem("Standard");
294 if (is_int(strpos($std_item->getFormat(), "image"))
295 && $std_item->getLocationType() == "LocalFile")
296 {
297 $resize = new ilCheckboxInputGUI($lng->txt("cont_resize_img")
298 , "standard_resize");
299 $op2->addSubItem($resize);
300 }
301 }
302
303 $radio_size->setValue("original");
304 if ($a_mode == "create" && ($this->getHeightPreset() > 0 || $this->getWidthPreset() > 0))
305 {
306 $radio_size->setValue("selected");
307 $width_height->setWidth($this->getWidthPreset());
308 $width_height->setHeight($this->getHeightPreset());
309 }
310 $radio_size->addOption($op2);
311 $this->form_gui->addItem($radio_size);
312
313 // standard caption
314 $caption = new ilTextAreaInputGUI($lng->txt("cont_caption"), "standard_caption");
315 $caption->setCols(30);
316 $caption->setRows(2);
317 $this->form_gui->addItem($caption);
318
319 /*$caption = new ilTextInputGUI($lng->txt("cont_caption"), "standard_caption");
320 $caption->setSize(40);
321 $caption->setMaxLength(200);
322 $this->form_gui->addItem($caption);*/
323
324 // text representation (alt text)
325 if ($a_mode == "edit" && is_int(strpos($std_item->getFormat(), "image")))
326 {
327 $ta = new ilTextAreaInputGUI($lng->txt("text_repr"), "text_representation");
328 $ta->setCols(30);
329 $ta->setRows(2);
330 $ta->setInfo($lng->txt("text_repr_info"));
331 $this->form_gui->addItem($ta);
332 }
333
334 // standard parameters
335 if ($a_mode == "edit" &&
336 !in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes()))
337 {
338 if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(),
339 $std_item->getFormat())) // autostart
340 {
341 $auto = new ilCheckboxInputGUI($lng->txt("cont_autostart"), "standard_autostart");
342 $this->form_gui->addItem($auto);
343 }
344 else // parameters
345 {
346 $par = new ilTextAreaInputGUI($lng->txt("cont_parameter"), "standard_parameters");
347 $par->setRows(5);
348 $par->setCols(50);
349 $this->form_gui->addItem($par);
350 }
351 }
352
353 if ($a_mode == "edit")
354 {
355 $full_item = $this->object->getMediaItem("Fullscreen");
356 }
357
358 // fullscreen view resource
359 $fs_sec = new ilFormSectionHeaderGUI();
360 $fs_sec->setTitle($lng->txt("cont_fullscreen"));
361 $this->form_gui->addItem($fs_sec);
362
363 $radio_prop2 = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "full_type");
364 $op1 = new ilRadioOption($lng->txt("cont_none"), "None");
365 $radio_prop2->addOption($op1);
366 $op4 = new ilRadioOption($lng->txt("cont_use_same_resource_as_above"), "Standard");
367 $radio_prop2->addOption($op4);
368 $op2 = new ilRadioOption($lng->txt("cont_file"), "File");
369 $up = new ilFileInputGUI("", "full_file");
371 $up->setForbiddenSuffixes(ilObjMediaObject::getForbiddenFileTypes());
372 $up->setInfo("");
373 $op2->addSubItem($up);
374 $radio_prop2->addOption($op2);
375 $op3 = new ilRadioOption($lng->txt("url"), "Reference");
376 $ref = new ilTextInputGUI("", "full_reference");
377 $ref->setInfo($lng->txt("cont_ref_helptext"));
378 $op3->addSubItem($ref);
379 $radio_prop2->addOption($op3);
380 $radio_prop2->setValue("None");
381 $this->form_gui->addItem($radio_prop2);
382
383 // fullscreen format
384 if ($a_mode == "edit")
385 {
386 if ($this->object->hasFullscreenItem())
387 {
388 $format = new ilNonEditableValueGUI($lng->txt("cont_format"), "full_format");
389 $format->setValue($full_item->getFormat());
390 $this->form_gui->addItem($format);
391 }
392 }
393
394 // fullscreen size
395 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_size");
396 if ($a_mode == "edit")
397 {
398 $add_str = "";
399 if ($this->object->hasFullscreenItem() && ($orig_size = $full_item->getOriginalSize()))
400 {
401 $add_str = " (".$orig_size["width"]." x ".$orig_size["height"].")";
402 }
403 $op1 = new ilRadioOption($lng->txt("cont_resource_size").$add_str, "original");
404 $op2 = new ilRadioOption($lng->txt("cont_custom_size"), "selected");
405 }
406 else
407 {
408 $op1 = new ilRadioOption($lng->txt("cont_orig_size"), "original");
409 $op2 = new ilRadioOption($lng->txt("cont_adjust_size"), "selected");
410 }
411 $radio_size->addOption($op1);
412
413 // width/height
414 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width").
415 " / ".$lng->txt("cont_height"), "full_width_height");
416 $width_height->setConstrainProportions(true);
417 $op2->addSubItem($width_height);
418
419 // resize image
420 if ($a_mode == "edit")
421 {
422 $full_item = $this->object->getMediaItem("Fullscreen");
423 if ($this->object->hasFullscreenItem() &&
424 is_int(strpos($full_item->getFormat(), "image")) &&
425 $full_item->getLocationType() == "LocalFile")
426 {
427 $resize = new ilCheckboxInputGUI($lng->txt("cont_resize_img"),
428 "full_resize");
429 $op2->addSubItem($resize);
430 }
431 }
432
433 $radio_size->setValue("original");
434 $radio_size->addOption($op2);
435 $this->form_gui->addItem($radio_size);
436
437 // fullscreen caption
438 $caption = new ilTextAreaInputGUI($lng->txt("cont_caption"), "full_caption");
439 $caption->setCols(30);
440 $caption->setRows(2);
441 $this->form_gui->addItem($caption);
442
443 /*$caption = new ilTextInputGUI($lng->txt("cont_caption"), "full_caption");
444 $caption->setSize(40);
445 $caption->setMaxLength(200);
446 $this->form_gui->addItem($caption);*/
447
448 // text representation (alt text)
449 if ($a_mode == "edit" && $this->object->hasFullscreenItem() && is_int(strpos($std_item->getFormat(), "image")))
450 {
451 $ta = new ilTextAreaInputGUI($lng->txt("text_repr"), "full_text_representation");
452 $ta->setCols(30);
453 $ta->setRows(2);
454 $ta->setInfo($lng->txt("text_repr_info"));
455 $this->form_gui->addItem($ta);
456 }
457
458
459 // fullscreen parameters
460 if ($a_mode == "edit" && $this->object->hasFullscreenItem() &&
461 !in_array($full_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes()))
462 {
463 if (ilObjMediaObject::_useAutoStartParameterOnly($full_item->getLocation(),
464 $full_item->getFormat()))
465 {
466 $auto = new ilCheckboxInputGUI($lng->txt("cont_autostart"), "full_autostart");
467 $this->form_gui->addItem($auto);
468 }
469 else
470 {
471 $par = new ilTextAreaInputGUI($lng->txt("cont_parameter"), "full_parameters");
472 $par->setRows(5);
473 $par->setCols(50);
474 $this->form_gui->addItem($par);
475 }
476 }
477
478 $this->form_gui->setTitle($lng->txt("cont_insert_mob"));
479 if ($a_mode == "edit")
480 {
481 $this->form_gui->addCommandButton("saveProperties", $lng->txt("save"));
482 }
483 else
484 {
485 $this->form_gui->addCommandButton("save", $lng->txt("save"));
486 $this->form_gui->addCommandButton("cancel", $lng->txt("cancel"));
487 }
488 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
489
490 }
This class represents a checkbox property in a property form.
This class represents a file property in a property form.
This class represents a section header in a property form.
This class represents a non editable value in a property form.
getWidthPreset()
Get width preset.
getHeightPreset()
Get height preset.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text area property in a property form.
This class represents a text property in a property form.
This class represents a width/height item in a property form.

References $ilCtrl, ilObjectGUI\$lng, ilObjMediaObject\_getSimpleMimeTypes(), ilObjMediaObject\_useAutoStartParameterOnly(), ilObjMediaObject\getForbiddenFileTypes(), getHeightPreset(), ilObjMediaObject\getRestrictedFileTypes(), and getWidthPreset().

Referenced by createObject(), editObject(), saveObject(), and savePropertiesObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listSubtitleFilesObject()

ilObjMediaObjectGUI::listSubtitleFilesObject ( )

List subtitls files.

Parameters

return

Definition at line 1943 of file class.ilObjMediaObjectGUI.php.

1944 {
1945 global $ilToolbar, $tpl, $ilCtrl, $lng, $ilUser;
1946
1947 $this->setPropertiesSubTabs("subtitles");
1948
1949 // upload file
1950 $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true);
1951 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
1952 $fi = new ilFileInputGUI($lng->txt("mob_subtitle_file")." (.srt)", "subtitle_file");
1953 $fi->setSuffixes(array("srt"));
1954 $ilToolbar->addInputItem($fi, true);
1955
1956 // language
1957 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1958 include_once("./Services/MetaData/classes/class.ilMDLanguageItem.php");
1960 $si = new ilSelectInputGUI($this->lng->txt("mob_language"), "language");
1961 $si->setOptions($options);
1962 $si->setValue($ilUser->getLanguage());
1963 $ilToolbar->addInputItem($si, true);
1964
1965 $ilToolbar->addFormButton($lng->txt("upload"), "uploadSubtitleFile");
1966
1967 include_once("./Services/MediaObjects/classes/class.ilMobSubtitleTableGUI.php");
1968 $tab = new ilMobSubtitleTableGUI($this, "listSubtitleFiles", $this->object);
1969
1970 $tpl->setContent($tab->getHTML());
1971 }
TableGUI class for subtitle list.
This class represents a selection list property in a property form.
if(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15

References $ilCtrl, $ilUser, ilObjectGUI\$lng, $options, $si, $tab, ilObjectGUI\$tpl, ilMDLanguageItem\_getLanguages(), and setPropertiesSubTabs().

+ Here is the call graph for this function:

◆ removeFullscreenObject()

ilObjMediaObjectGUI::removeFullscreenObject ( )

remove fullscreen view

Definition at line 1511 of file class.ilObjMediaObjectGUI.php.

1512 {
1513 $this->object->removeMediaItem("Fullscreen");
1514 $this->object->update();
1515
1516 $this->ctrl->redirect($this, "edit");
1517 }

◆ resizeImagesObject()

ilObjMediaObjectGUI::resizeImagesObject ( )

resize images to specified size

Definition at line 834 of file class.ilObjMediaObjectGUI.php.

835 {
836 // directory
837 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
838
839 // standard item
840 $std_item =& $this->object->getMediaItem("Standard");
841 if ($std_item->getLocationType() == "LocalFile" &&
842 is_int(strpos($std_item->getFormat(), "image"))
843 )
844 {
845 $file = $mob_dir."/".$std_item->getLocation();
846 $location = ilObjMediaObject::_resizeImage($file, $std_item->getWidth(),
847 $std_item->getHeight());
848 $std_item->setLocation($location);
849 $std_item->update();
850 }
851
852 // fullscreen item
853 if($this->object->hasFullScreenItem())
854 {
855 $full_item =& $this->object->getMediaItem("Fullscreen");
856 if ($full_item->getLocationType() == "LocalFile" &&
857 is_int(strpos($full_item->getFormat(), "image"))
858 )
859 {
860 $file = $mob_dir."/".$full_item->getLocation();
861 $location = ilObjMediaObject::_resizeImage($file, $full_item->getWidth(),
862 $full_item->getHeight());
863 $full_item->setLocation($location);
864 $full_item->update();
865 }
866 }
867
868 $this->ctrl->redirect($this, "edit");
869 }
_resizeImage($a_file, $a_width, $a_height, $a_constrain_prop=false)
resize image and return new image file ("_width_height" string appended)

References $file, $location, ilObjMediaObject\_getDirectory(), and ilObjMediaObject\_resizeImage().

+ Here is the call graph for this function:

◆ returnToContextObject()

ilObjMediaObjectGUI::returnToContextObject ( )

Definition at line 127 of file class.ilObjMediaObjectGUI.php.

128 {
129 $this->ctrl->returnToParent($this);
130 }

◆ saveObject()

ilObjMediaObjectGUI::saveObject ( )

create new media object in dom and update page in db

Reimplemented from ilObjectGUI.

Definition at line 597 of file class.ilObjMediaObjectGUI.php.

598 {
599 global $tpl, $lng;
600
601 $this->initForm();
602 if ($this->form_gui->checkInput())
603 {
604 $this->object = new ilObjMediaObject();
606 ilUtil::sendSuccess($lng->txt("saved_media_object"), true);
607 return $this->object;
608 }
609 else
610 {
611 $this->form_gui->setValuesByPost();
612 $tpl->setContent($this->form_gui->getHTML());
613 return false;
614 }
615 }
static setObjectPerCreationForm($a_mob)
Set media object values from creation form.

References ilObjectGUI\$lng, ilObjectGUI\$object, ilObjectGUI\$tpl, initForm(), ilUtil\sendSuccess(), and setObjectPerCreationForm().

+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjMediaObjectGUI::savePropertiesObject ( )

save properties in db and return to page edit screen

Definition at line 918 of file class.ilObjMediaObjectGUI.php.

919 {
920 global $lng, $tpl;
921
922 $this->initForm("edit");
923 if ($this->form_gui->checkInput())
924 {
925 $title = trim($_POST["standard_title"]);
926 $this->object->setTitle($title);
927
928 $std_item = $this->object->getMediaItem("Standard");
929 $location = $std_item->getLocation();
930 $format = $std_item->getFormat();
931 if ($_POST["standard_type"] == "Reference")
932 {
933 $format = ilObjMediaObject::getMimeType(ilUtil::stripSlashes($_POST["standard_reference"]));
934 $std_item->setFormat($format);
935 $std_item->setLocation(ilUtil::secureLink(ilUtil::stripSlashes($_POST["standard_reference"])));
936 $std_item->setLocationType("Reference");
937 }
938 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
939 if ($_POST["standard_type"] == "File")
940 {
941 $resize = false;
942 if ($_FILES['standard_file']['name'] != "")
943 {
944 $file_name = ilObjMediaObject::fixFilename($_FILES['standard_file']['name']);
945 $file = $mob_dir."/".$file_name;
946 ilUtil::moveUploadedFile($_FILES['standard_file']['tmp_name'],
947 $file_name, $file);
948
949 // get mime type
951 $location = $file_name;
952
953 $resize = true;
954 }
955 else if ($_POST["standard_resize"])
956 {
957 $file = $mob_dir."/".$location;
958 $resize = true;
959 }
960
961 // resize
962 if ($resize)
963 {
964 if ($_POST["standard_size"] != "original" &&
965 is_int(strpos($format, "image")))
966 {
967 $location = ilObjMediaObject::_resizeImage($file, (int) $_POST["standard_width_height"]["width"],
968 (int) $_POST["standard_width_height"]["height"], (boolean) $_POST["standard_width_height"]["contr_prop"]);
969 }
970 $std_item->setFormat($format);
971 $std_item->setLocation($location);
972 }
973
974 $std_item->setLocationType("LocalFile");
975 }
976 $this->object->setDescription($format);
977
978 // determine width and height of known image types
979 $wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format,
980 $_POST["standard_type"], $mob_dir."/".$location, $std_item->getLocation(),
981 $_POST["standard_width_height"]["constr_prop"], ($_POST["standard_size"] == "original"),
982 $_POST["standard_width_height"]["width"], $_POST["standard_width_height"]["height"]);
983 if ($wh["info"] != "")
984 {
985 ilUtil::sendInfo($wh["info"], true);
986 }
987
988 $std_item->setWidth($wh["width"]);
989 $std_item->setHeight($wh["height"]);
990
991 // set caption
992 $std_item->setCaption(ilUtil::stripSlashes($_POST["standard_caption"]));
993
994 // text representation
995 $std_item->setTextRepresentation(ilUtil::stripSlashes($_POST["text_representation"]));
996
997 // set parameters
998 if (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes()))
999 {
1000 if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(),
1001 $std_item->getFormat()))
1002 {
1003 if ($_POST["standard_autostart"]) // save only autostart flag
1004 {
1005 $std_item->setParameters('autostart="true"');
1006 }
1007 else
1008 {
1009 $std_item->setParameters("");
1010 }
1011 }
1012 else
1013 {
1014 $std_item->setParameters(ilUtil::stripSlashes(utf8_decode($_POST["standard_parameters"])));
1015 }
1016 }
1017
1018 // "None" selected
1019 if ($_POST["full_type"] == "None")
1020 {
1021 if ($this->object->hasFullscreenItem()) // delete existing
1022 {
1023 $this->object->removeMediaItem("Fullscreen");
1024 }
1025 }
1026 else // Not "None" -> we need one
1027 {
1028 if ($this->object->hasFullscreenItem()) // take existing one
1029 {
1030 $full_item = $this->object->getMediaItem("Fullscreen");
1031 }
1032 else // create one
1033 {
1034 $full_item = new ilMediaItem();
1035 $this->object->addMediaItem($full_item);
1036 $full_item->setPurpose("Fullscreen");
1037 }
1038 $location = $full_item->getLocation();
1039 $format = $full_item->getFormat();
1040 if ($_POST["full_type"] == "Reference")
1041 {
1042 $format = ilObjMediaObject::getMimeType(ilUtil::stripSlashes($_POST["full_reference"]));
1043 $full_item->setFormat($format);
1044 $full_item->setLocationType("Reference");
1045 $location = ilUtil::stripSlashes($_POST["full_reference"]);
1046 $type = "Reference";
1047 }
1048 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
1049 if ($_POST["full_type"] == "File")
1050 {
1051 $resize = false;
1052 if ($_FILES['full_file']['name'] != "")
1053 {
1054 $full_file_name = ilObjMediaObject::fixFilename($_FILES['full_file']['name']);
1055 $file = $mob_dir."/".$full_file_name;
1056 ilUtil::moveUploadedFile($_FILES['full_file']['tmp_name'],
1057 $full_file_name, $file);
1058
1060 $location = $full_file_name;
1061
1062 $resize = true;
1063 }
1064 else if ($_POST["full_resize"])
1065 {
1066 $file = $mob_dir."/".$location;
1067 $resize = true;
1068 }
1069
1070 // resize
1071 if ($resize)
1072 {
1073 if ($_POST["full_size"] != "original" &&
1074 is_int(strpos($format, "image")))
1075 {
1076 $location = ilObjMediaObject::_resizeImage($file, (int) $_POST["full_width_height"]["width"],
1077 (int) $_POST["full_width_height"]["height"], (boolean) $_POST["full_width_height"]["contr_prop"]);
1078 }
1079 $full_item->setFormat($format);
1080 $full_item->setLocation($location);
1081 }
1082
1083 $full_item->setLocationType("LocalFile");
1084 $type = "File";
1085 }
1086 if ($_POST["full_type"] == "Standard")
1087 {
1088 $format = $std_item->getFormat();
1089 $location = $std_item->getLocation();
1090 $full_item->setLocationType($std_item->getLocationType());
1091 $full_item->setFormat($format);
1092 $full_item->setLocation($location);
1093 $type = $std_item->getLocationType();
1094 if ($type == "LocalFile")
1095 {
1096 $type = "File";
1097 }
1098 // resize image
1099//echo "-".$_POST["full_size"]."-".is_int(strpos($format, "image"))."-".$full_item->getLocationType()."-";
1100 if ($_POST["full_size"] != "original" &&
1101 is_int(strpos($format, "image")) &&
1102 $full_item->getLocationType() == "LocalFile")
1103 {
1104 $file = $mob_dir."/".$location;
1105 $location = ilObjMediaObject::_resizeImage($file, (int) $_POST["full_width_height"]["width"],
1106 (int) $_POST["full_width_height"]["height"], (boolean) $_POST["full_width_height"]["contr_prop"]);
1107 }
1108 }
1109
1110 // determine width and height of known image types
1111 $wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format,
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"] != "")
1116 {
1117 ilUtil::sendInfo($wh["info"], true);
1118 }
1119
1120 $full_item->setWidth($wh["width"]);
1121 $full_item->setHeight($wh["height"]);
1122 $full_item->setLocation($location);
1123
1124 $full_item->setCaption(ilUtil::stripSlashes($_POST["full_caption"]));
1125
1126 // text representation
1127 $full_item->setTextRepresentation(ilUtil::stripSlashes($_POST["full_text_representation"]));
1128
1129
1130 // set parameters
1131 if (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes()))
1132 {
1133 if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(),
1134 $std_item->getFormat()))
1135 {
1136 if ($_POST["full_autostart"]) // save only autostart flag
1137 {
1138 $full_item->setParameters('autostart="true"');
1139 }
1140 else
1141 {
1142 $full_item->setParameters("");
1143 }
1144 }
1145 else
1146 {
1147 $full_item->setParameters(ilUtil::stripSlashes(utf8_decode($_POST["full_parameters"])));
1148 }
1149 }
1150 }
1151
1153 include_once("./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
1154 ilMediaSvgSanitizer::sanitizeDir(ilObjMediaObject::_getDirectory($this->object->getId())); // see #20339
1155
1156 $this->object->update();
1157 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1158 $this->ctrl->redirect($this, "edit");
1159 }
1160 else
1161 {
1162 $this->form_gui->setValuesByPost();
1163 $tpl->setContent($this->form_gui->getHTML());
1164 }
1165 }
static _determineWidthHeight($a_def_width, $a_def_height, $a_format, $a_type, $a_file, $a_reference, $a_constrain_proportions, $a_use_original, $a_user_width, $a_user_height)
Determine width and height.
static fixFilename($a_name)
Fix filename of uploaded file.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static secureLink($a_str)

References $_POST, $file, ilObjectGUI\$lng, $location, ilObjectGUI\$tpl, ilObjMediaObject\_determineWidthHeight(), ilObjMediaObject\_getDirectory(), ilObjMediaObject\_getSimpleMimeTypes(), ilObjMediaObject\_resizeImage(), ilObjMediaObject\_useAutoStartParameterOnly(), ilObjMediaObject\fixFilename(), ilObjMediaObject\getMimeType(), initForm(), ilUtil\moveUploadedFile(), ilObjMediaObject\renameExecutables(), ilMediaSvgSanitizer\sanitizeDir(), ilUtil\secureLink(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ setBackTitle()

ilObjMediaObjectGUI::setBackTitle (   $a_title)

set title for back tab

Definition at line 203 of file class.ilObjMediaObjectGUI.php.

204 {
205 $this->back_title = $a_title;
206 }

◆ setEnabledMapAreas()

ilObjMediaObjectGUI::setEnabledMapAreas (   $a_enabledmapareas)

Set Enable map areas.

Parameters
boolean$a_enabledmapareasEnable map areas

Definition at line 54 of file class.ilObjMediaObjectGUI.php.

55 {
56 $this->enabledmapareas = $a_enabledmapareas;
57 }

◆ setHeader()

ilObjMediaObjectGUI::setHeader (   $a_title = "")

Definition at line 39 of file class.ilObjMediaObjectGUI.php.

40 {
41 $this->header = $a_title;
42 }

◆ setHeightPreset()

ilObjMediaObjectGUI::setHeightPreset (   $a_val)

Set height preset.

Parameters
intheight preset

Definition at line 94 of file class.ilObjMediaObjectGUI.php.

95 {
96 $this->height_preset = $a_val;
97 }

◆ setObjectPerCreationForm()

static ilObjMediaObjectGUI::setObjectPerCreationForm (   $a_mob)
static

Set media object values from creation form.

Definition at line 637 of file class.ilObjMediaObjectGUI.php.

638 {
639 // determinte title and format
640 if (trim($_POST["standard_title"]) != "")
641 {
642 $title = trim($_POST["standard_title"]);
643 }
644 else
645 {
646 if ($_POST["standard_type"] == "File")
647 {
648 $title = $_FILES['standard_file']['name'];
649 }
650 else
651 {
652 $title = ilUtil::stripSlashes($_POST["standard_reference"]);
653 }
654 }
655
656 $a_mob->setTitle($title);
657 $a_mob->setDescription("");
658 $a_mob->create();
659
660 // determine and create mob directory, move uploaded file to directory
661 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
662 $a_mob->createDirectory();
663 $mob_dir = ilObjMediaObject::_getDirectory($a_mob->getId());
664
665 $media_item =& new ilMediaItem();
666 $a_mob->addMediaItem($media_item);
667 $media_item->setPurpose("Standard");
668
669 if ($_POST["standard_type"] == "File")
670 {
671 $file_name = ilObjMediaObject::fixFilename($_FILES['standard_file']['name']);
672 $file = $mob_dir."/".$file_name;
673 ilUtil::moveUploadedFile($_FILES['standard_file']['tmp_name'],
674 $file_name, $file);
675
676 // get mime type
678 $location = $file_name;
679
680 // resize standard images
681 if ($_POST["standard_size"] != "original" &&
682 is_int(strpos($format, "image")))
683 {
684 $location = ilObjMediaObject::_resizeImage($file, (int) $_POST["standard_width_height"]["width"],
685 (int) $_POST["standard_width_height"]["height"], (boolean) $_POST["standard_width_height"]["contr_prop"]);
686 }
687
688 // set real meta and object data
689 $media_item->setFormat($format);
690 $media_item->setLocation($location);
691 $media_item->setLocationType("LocalFile");
692 }
693 else // standard type: reference
694 {
695 $format = ilObjMediaObject::getMimeType(ilUtil::stripSlashes($_POST["standard_reference"]));
696 $media_item->setFormat($format);
697 $media_item->setLocation(ilUtil::secureLink(ilUtil::stripSlashes($_POST["standard_reference"])));
698 $media_item->setLocationType("Reference");
699 }
700 $a_mob->setDescription($format);
701
702 // determine width and height of known image types
703 $wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format,
704 $_POST["standard_type"], $mob_dir."/".$location, $media_item->getLocation(),
705 $_POST["standard_width_height"]["constr_prop"], ($_POST["standard_size"] == "original"),
706 $_POST["standard_width_height"]["width"], $_POST["standard_width_height"]["height"]);
707 $media_item->setWidth($wh["width"]);
708 $media_item->setHeight($wh["height"]);
709 if ($wh["info"] != "")
710 {
711 ilUtil::sendInfo($wh["info"], true);
712 }
713
714 if ($_POST["standard_caption"] != "")
715 {
716 $media_item->setCaption(ilUtil::stripSlashes($_POST["standard_caption"]));
717 }
718
719
720 $media_item->setHAlign("Left");
721
722 // fullscreen view
723 if ($_POST["full_type"] != "None")
724 {
725 $media_item2 = new ilMediaItem();
726 $a_mob->addMediaItem($media_item2);
727 $media_item2->setPurpose("Fullscreen");
728
729 // move file / set format and location
730 if ($_POST["full_type"] == "File")
731 {
732 $format = $location = "";
733 if ($_FILES['full_file']['name'] != "")
734 {
735 $full_file_name = ilObjMediaObject::fixFilename($_FILES['full_file']['name']);
736 $file = $mob_dir."/".$full_file_name;
737 ilUtil::moveUploadedFile($_FILES['full_file']['tmp_name'],
738 $full_file_name, $file);
740 $location = $full_file_name;
741 }
742 }
743 else if ($_POST["full_type"] == "Standard" && $_POST["standard_type"] == "File")
744 {
745 $location = $file_name;
746 }
747
748 // resize file
749 if ($_POST["full_type"] == "File" ||
750 ($_POST["full_type"] == "Standard" && $_POST["standard_type"] == "File"))
751 {
752 if (($_POST["full_size"] != "original" &&
753 is_int(strpos($format, "image")))
754 )
755 {
756 $location = ilObjMediaObject::_resizeImage($file, (int) $_POST["full_width_height"]["width"],
757 (int) $_POST["full_width_height"]["height"], (boolean) $_POST["full_width_height"]["constr_prop"]);
758 }
759
760 $media_item2->setFormat($format);
761 $media_item2->setLocation($location);
762 $media_item2->setLocationType("LocalFile");
763 $type = "File";
764 }
765
766 if ($_POST["full_type"] == "Reference")
767 {
768 $format = $location = "";
769 if ($_POST["full_reference"] != "")
770 {
771 $format = ilObjMediaObject::getMimeType($_POST["full_reference"]);
772 $location = ilUtil::stripSlashes($_POST["full_reference"]);
773 }
774 }
775
776 if ($_POST["full_type"] == "Reference" ||
777 ($_POST["full_type"] == "Standard" && $_POST["standard_type"] == "Reference"))
778 {
779 $media_item2->setFormat($format);
780 $media_item2->setLocation($location);
781 $media_item2->setLocationType("Reference");
782 $type = "Reference";
783 }
784
785 // determine width and height of known image types
786 $wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format,
787 $type, $mob_dir."/".$location, $media_item2->getLocation(),
788 $_POST["full_width_height"]["constr_prop"], ($_POST["full_size"] == "original"),
789 $_POST["full_width_height"]["width"], $_POST["full_width_height"]["height"]);
790
791 $media_item2->setWidth($wh["width"]);
792 $media_item2->setHeight($wh["height"]);
793
794 if ($_POST["full_caption"] != "")
795 {
796 $media_item2->setCaption(ilUtil::stripSlashes($_POST["full_caption"]));
797 }
798
799 }
800
802 include_once("./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
803 ilMediaSvgSanitizer::sanitizeDir($mob_dir); // see #20339
804 $a_mob->update();
805 }

References $_POST, $file, $location, ilObjMediaObject\_determineWidthHeight(), ilObjMediaObject\_getDirectory(), ilObjMediaObject\_resizeImage(), ilObjMediaObject\fixFilename(), ilObjMediaObject\getMimeType(), ilUtil\moveUploadedFile(), ilObjMediaObject\renameExecutables(), ilMediaSvgSanitizer\sanitizeDir(), ilUtil\secureLink(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

Referenced by ilPCMediaObjectGUI\create(), and saveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPropertiesSubTabs()

ilObjMediaObjectGUI::setPropertiesSubTabs (   $a_active)

Set subtabs for properties.

Parameters
string$a_activeactive tab id

Definition at line 1916 of file class.ilObjMediaObjectGUI.php.

1917 {
1918 global $ilTabs, $ilCtrl, $lng;
1919
1920 $ilTabs->activateTab("cont_mob_def_prop");
1921
1922 $ilTabs->addSubTab("general",
1923 $lng->txt("mob_general"),
1924 $ilCtrl->getLinkTarget($this, "edit"));
1925
1926 if ($this->object->getMediaItem("Standard")->getFormat() == "video/webm" ||
1927 $this->object->getMediaItem("Standard")->getFormat() == "video/mp4")
1928 {
1929 $ilTabs->addSubTab("subtitles",
1930 $lng->txt("mob_subtitles"),
1931 $ilCtrl->getLinkTarget($this, "listSubtitleFiles"));
1932 }
1933
1934 $ilTabs->activateSubTab($a_active);
1935 }

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by editObject(), and listSubtitleFilesObject().

+ Here is the caller graph for this function:

◆ setTabs()

ilObjMediaObjectGUI::setTabs ( )

set admin tabs

Reimplemented from ilObjectGUI.

Definition at line 1763 of file class.ilObjMediaObjectGUI.php.

1764 {
1765//echo "setAdminTabs should not be called.";
1766
1767 // catch feedback message
1768 $this->getTabs($this->tabs_gui);
1769
1770 //$tabs_gui->setTargetScript($this->ctrl->getLinkTarget($this));
1771 $this->tpl->clearHeader();
1772 if (is_object($this->object) && strtolower(get_class($this->object)) == "ilobjmediaobject")
1773 {
1774 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
1775 $this->tpl->setTitle($this->object->getTitle());
1776 }
1777 else
1778 {
1779 //$title = $this->object->getTitle();
1780 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_mob.svg"));
1781 $this->tpl->setTitle($this->lng->txt("cont_create_mob"));
1782 }
1783 }

References ilUtil\getImagePath(), and getTabs().

+ Here is the call graph for this function:

◆ setWidthPreset()

ilObjMediaObjectGUI::setWidthPreset (   $a_val)

Set width preset.

Parameters
intwidth preset

Definition at line 74 of file class.ilObjMediaObjectGUI.php.

75 {
76 $this->width_preset = $a_val;
77 }

◆ showAllUsagesObject()

ilObjMediaObjectGUI::showAllUsagesObject ( )

Show all media object usages (incl history)

Definition at line 1626 of file class.ilObjMediaObjectGUI.php.

1627 {
1628 $this->showUsagesObject(true);
1629 }
showUsagesObject($a_all=false)
show all usages of mob

References showUsagesObject().

+ Here is the call graph for this function:

◆ showUsagesObject()

ilObjMediaObjectGUI::showUsagesObject (   $a_all = false)

show all usages of mob

Definition at line 1635 of file class.ilObjMediaObjectGUI.php.

1636 {
1637 global $tpl, $ilTabs, $ilTabs, $lng, $ilCtrl;
1638
1639 $ilTabs->addSubTab("current_usages", $lng->txt("cont_current_usages"),
1640 $ilCtrl->getLinkTarget($this, "showUsages"));
1641
1642 $ilTabs->addSubTab("all_usages", $lng->txt("cont_all_usages"),
1643 $ilCtrl->getLinkTarget($this, "showAllUsages"));
1644
1645 if ($a_all)
1646 {
1647 $ilTabs->activateSubTab("all_usages");
1648 $cmd = "showAllUsages";
1649 }
1650 else
1651 {
1652 $ilTabs->activateSubTab("current_usages");
1653 $cmd = "showUsages";
1654 }
1655
1656 include_once("./Services/MediaObjects/classes/class.ilMediaObjectUsagesTableGUI.php");
1657 $usages_table = new ilMediaObjectUsagesTableGUI($this, $cmd,
1658 $this->object, $a_all);
1659 $tpl->setContent($usages_table->getHTML());
1660 }
TableGUI class for media object usages listing.

References $cmd, $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\$tpl.

Referenced by showAllUsagesObject().

+ Here is the caller graph for this function:

◆ showVideoToolObject()

ilObjMediaObjectGUI::showVideoToolObject ( )

Show video tools.

Parameters

return

Definition at line 1873 of file class.ilObjMediaObjectGUI.php.

1874 {
1875 global $tpl;
1876
1877 include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
1878
1879 /*$codecs = ilFFmpeg::getSupportedCodecsInfo();
1880 $codec_str = implode($codecs, "<br />");
1881 $tpl->setContent($codec_str);*/
1882
1884 $formats_str = implode($formats, "<br />");
1885 $tpl->setContent($formats_str);
1886 }
static getSupportedFormatsInfo()
Get all supported formats.

References ilObjectGUI\$tpl, and ilFFmpeg\getSupportedFormatsInfo().

+ Here is the call graph for this function:

◆ uploadFileObject()

ilObjMediaObjectGUI::uploadFileObject ( )

upload file

Definition at line 1381 of file class.ilObjMediaObjectGUI.php.

1382 {
1383 // determine directory
1384 $cur_subdir = str_replace(".", "", $_GET["cdir"]);
1385 $mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$this->object->getId();
1386 $cur_dir = (!empty($cur_subdir))
1387 ? $mob_dir."/".$cur_subdir
1388 : $mob_dir;
1389 if (is_file($_FILES["new_file"]["tmp_name"]))
1390 {
1391 //move_uploaded_file($_FILES["new_file"]["tmp_name"],
1392 //$cur_dir."/".$_FILES["new_file"]["name"]);
1393 $file_name = ilObjMediaObject::fixFilename($_FILES["new_file"]["name"]);
1394 $file = $cur_dir."/".$file_name;
1395 ilUtil::moveUploadedFile($_FILES['new_file']['tmp_name'],
1396 $file_name, $file);
1397
1398 }
1400 include_once("./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
1401 ilMediaSvgSanitizer::sanitizeDir($mob_dir); // see #20339
1402
1403 $this->ctrl->saveParameter($this, "cdir");
1404 $this->ctrl->redirect($this, "editFiles");
1405 }
if(!file_exists(getcwd().'/ilias.ini.php')) if(isset( $_GET["client_id"]))
registration confirmation script for ilias
Definition: confirmReg.php:20

References $_GET, $file, ilObjMediaObject\fixFilename(), ilUtil\getWebspaceDir(), if, ilUtil\moveUploadedFile(), ilObjMediaObject\renameExecutables(), and ilMediaSvgSanitizer\sanitizeDir().

+ Here is the call graph for this function:

◆ uploadSubtitleFileObject()

ilObjMediaObjectGUI::uploadSubtitleFileObject ( )

Upload srt file.

Parameters

return

Definition at line 1979 of file class.ilObjMediaObjectGUI.php.

1980 {
1981 global $lng, $ilCtrl;
1982
1983 if ($this->object->uploadSrtFile($_FILES["subtitle_file"]["tmp_name"], ilUtil::stripSlashes($_POST["language"])))
1984 {
1985 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1986 }
1987 $ilCtrl->redirect($this, "listSubtitleFiles");
1988 }

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilObjMediaObjectGUI::$ctrl

Definition at line 21 of file class.ilObjMediaObjectGUI.php.

◆ $enabledmapareas

ilObjMediaObjectGUI::$enabledmapareas = true

Definition at line 24 of file class.ilObjMediaObjectGUI.php.

Referenced by getEnabledMapAreas().

◆ $header

ilObjMediaObjectGUI::$header

Definition at line 22 of file class.ilObjMediaObjectGUI.php.

Referenced by getHeader().

◆ $target_script

ilObjMediaObjectGUI::$target_script

Definition at line 23 of file class.ilObjMediaObjectGUI.php.


The documentation for this class was generated from the following file: