ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilObjMediaObjectGUI Class Reference

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

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

Public Member Functions

 __construct ( $a_data, int $a_id=0, bool $a_call_by_reference=false, bool $a_prepare_output=false)
 
 setAdvMdRecordObject (int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
 Set object, that defines the adv md records being used. More...
 
 getAdvMdRecordObject ()
 Get adv md record type. More...
 
 setHeader (string $a_title="")
 
 getHeader ()
 
 setEnabledMapAreas (bool $a_enabledmapareas)
 
 getEnabledMapAreas ()
 
 setWidthPreset (int $a_val)
 Set width preset (e.g. More...
 
 getWidthPreset ()
 
 setHeightPreset (int $a_val)
 Set height preset (e.g. More...
 
 getHeightPreset ()
 
 getForm ()
 
 returnToContextObject ()
 
 setBackTitle (string $a_title)
 
 createObject ()
 create new object form More...
 
 initForm (string $a_mode="create")
 
 getValues ()
 Get values for form. More...
 
 saveObject ()
 create new media object More...
 
 checkFormInput ()
 
 setObjectPerCreationForm (ilObjMediaObject $a_mob)
 Set media object values from creation form. More...
 
 cancelObject ()
 Cancel saving. More...
 
 editObject ()
 
 extractPreviewImageObject ()
 
 resizeImagesObject ()
 resize images to specified size More...
 
 getStandardSizeObject ()
 set original size of standard file More...
 
 getFullscreenSizeObject ()
 set original size of fullscreen file More...
 
 savePropertiesObject ()
 
 showAllUsagesObject ()
 Show all media object usages (incl history) More...
 
 setTabs ()
 set admin tabs More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 setPropertiesSubTabs (string $a_active)
 
 uploadSubtitleFileObject ()
 
 confirmSrtDeletionObject ()
 Confirm srt file deletion. More...
 
 deleteSrtFilesObject ()
 Delete srt files. More...
 
 uploadMultipleSubtitleFileFormObject ()
 
 uploadMultipleSubtitleFileObject ()
 
 showMultiSubtitleConfirmationTableObject ()
 List of srt files in zip file. More...
 
 cancelMultiSrtObject ()
 Cancel Multi Feedback. More...
 
 saveMultiSrtObject ()
 Save selected srt files as new srt files. More...
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _getMediaInfoHTML (ilObjMediaObject $a_mob)
 get media info as html More...
 
static includePresentationJS (?ilGlobalTemplateInterface $a_tpl=null)
 Include media object presentation JS. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

string $header = ""
 
string $target_script = ""
 
bool $enabledmapareas = true
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 assignObject ()
 
 checkFixSize ()
 Check fix size (for map editing hint) More...
 
 generateVTTObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ILIAS MediaObjects MediaObjectManager $media_manager
 
ILIAS MediaObjects Video GUIService $video_gui
 
ilFileServicesSettings $file_service_settings
 
SubtitlesGUIRequest $sub_title_request
 
ilPropertyFormGUI $form_gui
 
int $height_preset = 0
 
int $width_preset = 0
 
string $back_title = ""
 
ilErrorHandling $error
 
ilHelpGUI $help
 
ilTabsGUI $tabs
 
MetadataManager $md
 
int $adv_ref_id = null
 
string $adv_type = null
 
string $adv_subtype = null
 
ILIAS MediaObjects MediaType MediaTypeManager $media_type
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

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

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilObjMediaObjectGUI: ilObjectMetaDataGUI, ilImageMapEditorGUI, ilContainerResourceGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaObjectGUI::__construct (   $a_data,
int  $a_id = 0,
bool  $a_call_by_reference = false,
bool  $a_prepare_output = false 
)
Parameters
mixed$data

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

64 {
65 global $DIC;
66
67 $this->access = $DIC->access();
68 $this->error = $DIC["ilErr"];
69 $this->help = $DIC["ilHelp"];
70 $this->tabs = $DIC->tabs();
71 $this->toolbar = $DIC->toolbar();
72 $this->user = $DIC->user();
73 $lng = $DIC->language();
74 $ilCtrl = $DIC->ctrl();
75 $domain = $DIC->mediaObjects()
76 ->internal()
77 ->domain();
78 $this->media_type = $domain->mediaType();
79
80 $this->ctrl = $ilCtrl;
81 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
82 $this->lng = $lng;
83 $this->back_title = "";
84 $this->type = "mob";
85
86 $this->sub_title_request = $DIC->mediaObjects()
87 ->internal()
88 ->gui()
89 ->subTitles()
90 ->request();
91
93 $this->file_service_settings = $DIC->fileServiceSettings();
94 $this->video_gui = $DIC->mediaObjects()->internal()->gui()->video();
95 $this->md = $DIC->mediaObjects()->internal()->domain()->metadata();
96 $this->media_manager = $domain->mediaObject();
97 }
error(string $a_errmsg)
loadLanguageModule(string $a_module)
Load language module.
ilLanguage $lng
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilObjectGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), error(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getMediaInfoHTML()

static ilObjMediaObjectGUI::_getMediaInfoHTML ( ilObjMediaObject  $a_mob)
static

get media info as html

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

1264 : string {
1265 global $DIC;
1266
1267 $lng = $DIC->language();
1268 $lom_services = $DIC->learningObjectMetadata();
1269 $media_manager = $DIC->mediaObjects()->internal()->domain()->mediaObject();
1270
1271 $tpl = new ilTemplate("tpl.media_info.html", true, true, "components/ILIAS/MediaObjects");
1272 $types = array("Standard", "Fullscreen");
1273 foreach ($types as $type) {
1274 if ($type == "Fullscreen" && !$a_mob->hasFullscreenItem()) {
1275 continue;
1276 }
1277
1278 $med = $a_mob->getMediaItem($type);
1279 if (!$med) {
1280 return "";
1281 }
1282
1283 $tpl->setCurrentBlock("media_info");
1284 if ($type == "Standard") {
1285 $tpl->setVariable("TXT_PURPOSE", $lng->txt("cont_std_view"));
1286 } else {
1287 $tpl->setVariable("TXT_PURPOSE", $lng->txt("cont_fullscreen"));
1288 }
1289 $tpl->setVariable("TXT_TYPE", $lng->txt("cont_" . strtolower($med->getLocationType())));
1290 $tpl->setVariable("VAL_LOCATION", $med->getLocation());
1291 if ($med->getLocationType() == "LocalFile") {
1292
1293 try {
1294 $info = $media_manager->getInfoOfEntry($med->getMobId(), "/" . $med->getLocation());
1295 } catch (Exception $e) {
1296 }
1297
1298 $size = $info["size"] ?? 0;
1299 $tpl->setVariable("VAL_FILE_SIZE", " ($size " . $lng->txt("bytes") . ")");
1300 }
1301 $tpl->setVariable("TXT_FORMAT", $lng->txt("cont_format"));
1302 $tpl->setVariable("VAL_FORMAT", $med->getFormat());
1303 if ($med->getWidth() != "" && $med->getHeight() != "") {
1304 $tpl->setCurrentBlock("size");
1305 $tpl->setVariable("TXT_SIZE", $lng->txt("size"));
1306 $tpl->setVariable("VAL_SIZE", $med->getWidth() . "x" . $med->getHeight());
1308 }
1309
1310 // original size
1311 if ($orig_size = $med->getOriginalSize()) {
1312 if (($orig_size["width"] ?? "") !== $med->getWidth() ||
1313 ($orig_size["height"] ?? "") !== $med->getHeight()) {
1314 $tpl->setCurrentBlock("orig_size");
1315 $tpl->setVariable("TXT_ORIG_SIZE", $lng->txt("cont_orig_size"));
1316 $tpl->setVariable("ORIG_WIDTH", $orig_size["width"]);
1317 $tpl->setVariable("ORIG_HEIGHT", $orig_size["height"]);
1319 }
1320 }
1321
1322 // output caption
1323 if (strlen($med->getCaption())) {
1324 $tpl->setCurrentBlock('additional_info');
1325 $tpl->setVariable('ADD_INFO', $lng->txt('cont_caption') . ': ' . $med->getCaption());
1327 }
1328
1329 // output keywords
1330 if ($type == "Standard") {
1331 $keyword_data = $lom_services
1332 ->read(0, $med->getMobId(), 'mob', $lom_services->paths()->keywords())
1333 ->allData($lom_services->paths()->keywords());
1334 $presentable_keywords = $lom_services->dataHelper()->makePresentableAsList(
1335 ', ',
1336 ...$keyword_data
1337 );
1338 if ($presentable_keywords !== '') {
1339 $tpl->setCurrentBlock('additional_info');
1340 $tpl->setVariable('ADD_INFO', $lng->txt('keywords') . ': ' . $presentable_keywords);
1342 }
1343 }
1344
1345 $tpl->setCurrentBlock("media_info");
1347 }
1348
1349 return $tpl->get();
1350 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ILIAS MediaObjects MediaObjectManager $media_manager
getMediaItem(string $a_purpose)
get item for media purpose
ilGlobalTemplateInterface $tpl
special template class to simplify handling of ITX/PEAR
$info
Definition: entry_point.php:21
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

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

+ Here is the caller graph for this function:

◆ assignObject()

ilObjMediaObjectGUI::assignObject ( )
protected

Reimplemented from ilObjectGUI.

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

180 : void
181 {
182 if ($this->id != 0) {
183 $this->object = new ilObjMediaObject($this->id);
184 }
185 }

◆ cancelMultiSrtObject()

ilObjMediaObjectGUI::cancelMultiSrtObject ( )

Cancel Multi Feedback.

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

1658 : void
1659 {
1660 $this->object->clearMultiSrtDirectory();
1661 $this->ctrl->redirect($this, "listSubtitleFiles");
1662 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelObject()

ilObjMediaObjectGUI::cancelObject ( )

Cancel saving.

Exceptions
ilCtrlException

Reimplemented from ilObjectGUI.

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

863 : void
864 {
865 $this->ctrl->returnToParent($this);
866 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ checkFixSize()

ilObjMediaObjectGUI::checkFixSize ( )
protected

Check fix size (for map editing hint)

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

550 : void
551 {
552 $std_item = $this->object->getMediaItem("Standard");
553 if ($std_item->getWidth() == "" || $std_item->getHeight() == "") {
554 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("mob_no_fixed_size_map_editing"));
555 }
556 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ checkFormInput()

ilObjMediaObjectGUI::checkFormInput ( )

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

665 : bool
666 {
667 if (!$this->form_gui->checkInput()) {
668 $this->form_gui->setValuesByPost();
669 return false;
670 }
671 return true;
672 }

◆ confirmSrtDeletionObject()

ilObjMediaObjectGUI::confirmSrtDeletionObject ( )

Confirm srt file deletion.

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

1562 : void
1563 {
1564 $ilCtrl = $this->ctrl;
1565 $tpl = $this->tpl;
1566 $lng = $this->lng;
1567
1568 $lng->loadLanguageModule("meta");
1569
1570 $srts = $this->sub_title_request->getSrtFiles();
1571 if (count($srts) == 0) {
1572 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
1573 $ilCtrl->redirect($this, "listSubtitleFiles");
1574 } else {
1575 $cgui = new ilConfirmationGUI();
1576 $cgui->setFormAction($ilCtrl->getFormAction($this));
1577 $cgui->setHeaderText($lng->txt("mob_really_delete_srt"));
1578 $cgui->setCancel($lng->txt("cancel"), "listSubtitleFiles");
1579 $cgui->setConfirm($lng->txt("delete"), "deleteSrtFiles");
1580 foreach ($srts as $i) {
1581 $p = explode(":", $i);
1582 $cgui->addItem("srt[]", $i, "subtitle_" . $p[0] . "." . $p[1] . " (" . $lng->txt("meta_l_" . $p[0]) . ")");
1583 }
1584
1585 $tpl->setContent($cgui->getHTML());
1586 }
1587 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.

References $lng.

◆ createObject()

ilObjMediaObjectGUI::createObject ( )

create new object form

Reimplemented from ilObjectGUI.

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

263 : void
264 {
266 $ilHelp = $this->help;
267
268 $ilHelp->setScreenId("create");
269 $this->initForm();
270 $tpl->setContent($this->form_gui->getHTML());
271 }
setScreenId(string $a_id)
initForm(string $a_mode="create")

◆ deleteSrtFilesObject()

ilObjMediaObjectGUI::deleteSrtFilesObject ( )

Delete srt files.

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

1592 : void
1593 {
1594 $lng = $this->lng;
1595 $ilCtrl = $this->ctrl;
1596
1597 $srts = $this->sub_title_request->getSrtFiles();
1598 $deleted = false;
1599 foreach ($srts as $i) {
1600 if (strlen($i) == 6 && !is_int(strpos($i, "."))) {
1601 $p = explode(":", $i);
1602 $this->object->removeAdditionalFile("srt/subtitle_" . $p[0] . "." . $p[1]);
1603 $deleted = true;
1604 }
1605 }
1606 if ($deleted) {
1607 $this->tpl->setOnScreenMessage('success', $lng->txt("mob_srt_files_deleted"), true);
1608 }
1609 $ilCtrl->redirect($this, "listSubtitleFiles");
1610 }

References $lng.

◆ editObject()

ilObjMediaObjectGUI::editObject ( )

Reimplemented from ilObjectGUI.

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

868 : void
869 {
871
872 $this->setPropertiesSubTabs("general");
873 $this->video_gui->addPreviewExtractionToToolbar(
874 $this->object->getId(),
875 self::class
876 );
877 $this->initForm("edit");
878 $this->getValues();
879 $tpl->setContent($this->form_gui->getHTML());
880 }
getValues()
Get values for form.
setPropertiesSubTabs(string $a_active)

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ extractPreviewImageObject()

ilObjMediaObjectGUI::extractPreviewImageObject ( )

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

882 : void
883 {
884 $ilCtrl = $this->ctrl;
885 $this->video_gui->handleExtractionRequest(
886 $this->object->getId()
887 );
888 $ilCtrl->redirect($this, "edit");
889 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ generateVTTObject()

ilObjMediaObjectGUI::generateVTTObject ( )
protected

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

1683 : void
1684 {
1685 $this->media_manager->generateMissingVTT($this->object->getId());
1686 $this->ctrl->redirect($this, "listSubtitleFiles");
1687 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getAdvMdRecordObject()

ilObjMediaObjectGUI::getAdvMdRecordObject ( )

Get adv md record type.

Exceptions
ilMediaObjectsException

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

117 : ?array
118 {
119 if ($this->adv_type == null) {
120 throw new ilMediaObjectsException("Missing obj type (getAdvMdRecordObject)");
121 // seems to be obsolete, since $this->obj_type is non-existent
122 //return [$this->ref_id, $this->obj_type, $this->sub_type];
123 }
125 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getEnabledMapAreas()

ilObjMediaObjectGUI::getEnabledMapAreas ( )

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

144 : bool
145 {
147 }

◆ getForm()

ilObjMediaObjectGUI::getForm ( )

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

176 {
177 return $this->form_gui;
178 }
This class represents a property form user interface.

◆ getFullscreenSizeObject()

ilObjMediaObjectGUI::getFullscreenSizeObject ( )

set original size of fullscreen file

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

958 : void
959 {
960 $full_item = $this->object->getMediaItem("Fullscreen");
961 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
962
963 if ($full_item->getLocationType() == "LocalFile") {
964 $file = $mob_dir . "/" . $full_item->getLocation();
965 $size = ilMediaImageUtil::getImageSize($file);
966 $full_item->setWidth($size[0]);
967 $full_item->setHeight($size[1]);
968 $this->object->update();
969 }
970 $this->ctrl->redirect($this, "edit");
971 }
static getImageSize(string $a_location)
Get image size from location.
static _getDirectory(int $a_mob_id)
Get absolute directory.

References ilObjMediaObject\_getDirectory(), ILIAS\Repository\ctrl(), ilMediaImageUtil\getImageSize(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getHeader()

ilObjMediaObjectGUI::getHeader ( )

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

133 : string
134 {
135 return $this->header;
136 }

◆ getHeightPreset()

ilObjMediaObjectGUI::getHeightPreset ( )

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

170 : int
171 {
173 }

◆ getStandardSizeObject()

ilObjMediaObjectGUI::getStandardSizeObject ( )

set original size of standard file

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

937 : void
938 {
939 $std_item = $this->object->getMediaItem("Standard");
940 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
941
942 if ($std_item->getLocationType() == "LocalFile") {
943 $file = $mob_dir . "/" . $std_item->getLocation();
944
945 $size = ilMediaImageUtil::getImageSize($file);
946
947 $std_item->setWidth($size[0]);
948 $std_item->setHeight($size[1]);
949 $this->object->update();
950 }
951 $this->ctrl->redirect($this, "edit");
952 }

References ilObjMediaObject\_getDirectory(), ILIAS\Repository\ctrl(), ilMediaImageUtil\getImageSize(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getTabs()

ilObjMediaObjectGUI::getTabs ( )

@abstract overwrite in derived GUI class of your object type

Reimplemented from ilObjectGUI.

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

1371 : void
1372 {
1373 $ilHelp = $this->help;
1374
1375 $ilHelp->setScreenIdComponent("mob");
1376
1377 if (is_object($this->object) && strtolower(get_class($this->object)) == "ilobjmediaobject"
1378 && $this->object->getId() > 0) {
1379 // object properties
1380 $this->tabs_gui->addTarget(
1381 "cont_mob_def_prop",
1382 $this->ctrl->getLinkTarget($this, "edit"),
1383 "edit",
1384 get_class($this)
1385 );
1386
1387 $st_item = $this->object->getMediaItem("Standard");
1388
1389 // link areas
1390
1391 if (is_object($st_item) && $this->getEnabledMapAreas()) {
1392 $format = $st_item->getFormat();
1393 if (substr($format, 0, 5) == "image" && !is_int(strpos($format, "svg"))) {
1394 $this->tabs_gui->addTarget(
1395 "cont_def_map_areas",
1396 $this->ctrl->getLinkTargetByClass(
1397 array("ilobjmediaobjectgui", "ilimagemapeditorgui"),
1398 "editMapAreas"
1399 ),
1400 "editMapAreas",
1401 "ilimagemapeditorgui"
1402 );
1403 }
1404 }
1405
1406 // object usages
1407 $this->tabs_gui->addTarget(
1408 "cont_mob_usages",
1409 $this->ctrl->getLinkTarget($this, "showUsages"),
1410 "showUsages",
1411 get_class($this)
1412 );
1413
1414 // object files
1415 $std_item = $this->object->getMediaItem("Standard");
1416 $full_item = $this->object->getMediaItem("Fullscreen");
1417 $mset = new ilSetting("mobs");
1418 if ($mset->get("file_manager_always") ||
1419 ($this->media_type->usesParameterProperty($std_item->getFormat()) ||
1420 (is_object($full_item) && $this->media_type->usesParameterProperty($full_item->getFormat())))
1421 ) {
1422 $this->tabs_gui->addTarget(
1423 "cont_files",
1424 $this->ctrl->getLinkTargetByClass(
1425 array("ilobjmediaobjectgui", ilContainerResourceGUI::class),
1426 ""
1427 ),
1428 "",
1429 "ilContainerResourceGUI"
1430 );
1431 }
1432
1433 $mdgui = new ilObjectMetaDataGUI(null, $this->object->getType(), $this->object->getId());
1434 $mdtab = $mdgui->getTab("ilobjmediaobjectgui");
1435 if ($mdtab) {
1436 $this->tabs_gui->addTarget(
1437 "meta_data",
1438 $mdtab,
1439 "",
1440 "ilmdeditorgui"
1441 );
1442 }
1443 }
1444
1445 // back to upper context
1446 if ($this->back_title != "") {
1447 $this->tabs_gui->setBackTarget(
1448 $this->back_title,
1449 $this->ctrl->getParentReturn($this)
1450 );
1451 }
1452 }
setScreenIdComponent(string $a_comp)
Class ilObjectMetaDataGUI.
ILIAS Setting Class.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getValues()

ilObjMediaObjectGUI::getValues ( )

Get values for form.

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

562 : void
563 {
564 $values = array();
565
566 $values["standard_title"] = $this->object->getTitle();
567
568 $std_item = $this->object->getMediaItem("Standard");
569 if ($std_item->getLocationType() == "LocalFile") {
570 $values["standard_type"] = "File";
571 $values["standard_file"] = $std_item->getLocation();
572 } else {
573 $values["standard_type"] = "Reference";
574 $values["standard_reference"] = $std_item->getLocation();
575 }
576 $values["standard_format"] = $std_item->getFormat();
577 $values["standard_width_height"]["width"] = $std_item->getWidth();
578 $values["standard_width_height"]["height"] = $std_item->getHeight();
579 $values["standard_width_height"]["constr_prop"] = true;
580
581 $values["standard_size"] = "selected";
582
583 $orig_size = $std_item->getOriginalSize();
584 if ($std_item->getWidth() == "" && $std_item->getHeight() == "") {
585 $values["standard_size"] = "original";
586 $values["standard_width_height"]["width"] = $orig_size["width"] ?? "";
587 $values["standard_width_height"]["height"] = $orig_size["height"] ?? "";
588 }
589
590 $values["standard_caption"] = $std_item->getCaption();
591 $values["text_representation"] = $std_item->getTextRepresentation();
592 if ($this->media_type->usesAutoStartParameterOnly(
593 $std_item->getLocation(),
594 $std_item->getFormat()
595 )) {
596 /*$par = $std_item->getParameters();
597 if ($par["autostart"]) {
598 $values["standard_autostart"] = true;
599 }*/
600 } else {
601 $values["standard_parameters"] = $std_item->getParameterString();
602 }
603
604 $values["full_type"] = "None";
605 $values["full_size"] = "original";
606 if ($this->object->hasFullscreenItem()) {
607 $full_item = $this->object->getMediaItem("Fullscreen");
608 if ($full_item->getLocationType() == "LocalFile") {
609 $values["full_type"] = "File";
610 $values["full_file"] = $full_item->getLocation();
611 } else {
612 $values["full_type"] = "Reference";
613 $values["full_reference"] = $full_item->getLocation();
614 }
615 $values["full_format"] = $full_item->getFormat();
616 $values["full_width_height"]["width"] = $full_item->getWidth();
617 $values["full_width_height"]["height"] = $full_item->getHeight();
618 $values["full_width_height"]["constr_prop"] = true;
619
620 $values["full_size"] = "selected";
621
622 $orig_size = $full_item->getOriginalSize();
623 if ($full_item->getWidth() == "" &&
624 $full_item->getHeight() == "") {
625 $values["full_size"] = "original";
626 $values["full_width_height"]["width"] = $orig_size["width"] ?? "";
627 $values["full_width_height"]["height"] = $orig_size["height"] ?? "";
628 }
629 $values["full_caption"] = $full_item->getCaption();
630 if ($this->media_type->usesAutoStartParameterOnly(
631 $full_item->getLocation(),
632 $full_item->getFormat()
633 )) {
634 /*$par = $full_item->getParameters();
635 if ($par["autostart"]) {
636 $values["full_autostart"] = true;
637 }*/
638 } else {
639 $values["full_parameters"] = $full_item->getParameterString();
640 }
641 $values["full_text_representation"] = $full_item->getTextRepresentation();
642 }
643
644 $this->form_gui->setValuesByArray($values);
645 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getWidthPreset()

ilObjMediaObjectGUI::getWidthPreset ( )

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

157 : int
158 {
159 return $this->width_preset;
160 }

◆ includePresentationJS()

static ilObjMediaObjectGUI::includePresentationJS ( ?ilGlobalTemplateInterface  $a_tpl = null)
static

Include media object presentation JS.

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

1459 : void {
1460 global $DIC;
1461
1462 $tpl = $DIC["tpl"];
1463
1464 if ($a_tpl == null) {
1465 $a_tpl = $tpl;
1466 }
1467
1469 $a_tpl->addJavaScript("components/ILIAS/COPage/js/ilCOPagePres.js");
1470
1471 //ilPlayerUtil::initMediaElementJs($a_tpl);
1472 }
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template

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

+ Here is the caller graph for this function:

◆ initForm()

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

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

273 : void
274 {
276 $ilCtrl = $this->ctrl;
277 $add_str = "";
278
279 $std_item = null;
280 $full_item = null;
281 if ($a_mode == "edit") {
282 $std_item = $this->object->getMediaItem("Standard");
283 }
284
285 $this->form_gui = new ilPropertyFormGUI();
286
287 // standard view resource
288 $title = new ilTextInputGUI($lng->txt("title"), "standard_title");
289 $title->setSize(40);
290 $title->setMaxLength(120);
291 $this->form_gui->addItem($title);
292 $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "standard_type");
293 $op1 = new ilRadioOption($lng->txt("cont_file"), "File");
294 $up = new ilFileInputGUI("", "standard_file");
295 $up->setSuffixes(iterator_to_array($this->media_type->getAllowedSuffixes()));
296 //$up->setForbiddenSuffixes(ilObjMediaObject::getForbiddenFileTypes());
297 $up->setInfo("");
298 if ($a_mode == "create" || $std_item->getLocationType() != "LocalFile") {
299 $up->setRequired(true);
300 }
301 $op1->addSubItem($up);
302 $radio_prop->addOption($op1);
303 $op2 = new ilRadioOption($lng->txt("url"), "Reference");
304 $ref = new ilUriInputGUI("", "standard_reference");
305 $ref->setInfo($lng->txt("cont_ref_helptext"));
306 $ref->setRequired(true);
307 $op2->addSubItem($ref);
308 $radio_prop->addOption($op2);
309 $radio_prop->setValue("File");
310 $this->form_gui->addItem($radio_prop);
311
312 // standard format
313 if ($a_mode == "edit") {
314 $format = new ilNonEditableValueGUI($lng->txt("cont_format"), "standard_format");
315 $format->setValue($std_item->getFormat());
316 $this->form_gui->addItem($format);
317 }
318
319 // standard size
320 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "standard_size");
321 if ($a_mode == "edit") {
322 if ($orig_size = $std_item->getOriginalSize()) {
323 $add_str = " (" . ($orig_size["width"] ?? "") . " x " . ($orig_size["height"] ?? "") . ")";
324 }
325 $op1 = new ilRadioOption($lng->txt("cont_resource_size") . $add_str, "original");
326 $op1->setInfo($lng->txt("cont_resource_size_info"));
327 $op2 = new ilRadioOption($lng->txt("cont_custom_size"), "selected");
328 } else {
329 $op1 = new ilRadioOption($lng->txt("cont_orig_size"), "original");
330 $op1->setInfo($lng->txt("cont_resource_size_info"));
331 $op2 = new ilRadioOption($lng->txt("cont_adjust_size"), "selected");
332 }
333 $radio_size->addOption($op1);
334
335 // width height
336 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
337 " / " . $lng->txt("cont_height"), "standard_width_height");
338 if ($a_mode == "edit" && is_int(strpos($std_item->getFormat(), "image"))
339 && $std_item->getLocationType() == "LocalFile") {
340 $width_height->setSupportConstraintsProps(true);
341 $width_height->setConstrainProportions(true);
342 }
343 $op2->addSubItem($width_height);
344
345 // resize image
346 if ($a_mode == "edit") {
347 $std_item = $this->object->getMediaItem("Standard");
348 if (is_int(strpos($std_item->getFormat(), "image"))
349 && $std_item->getLocationType() == "LocalFile") {
350 $resize = new ilCheckboxInputGUI($lng->txt("cont_resize_img"), "standard_resize");
351 $op2->addSubItem($resize);
352 }
353 }
354
355 $radio_size->setValue("original");
356 if ($a_mode == "create" && ($this->getHeightPreset() > 0 || $this->getWidthPreset() > 0)) {
357 $radio_size->setValue("selected");
358 $width_height->setWidth($this->getWidthPreset());
359 $width_height->setHeight($this->getHeightPreset());
360 }
361 $radio_size->addOption($op2);
362 $this->form_gui->addItem($radio_size);
363
364 // standard caption
365 $caption = new ilTextAreaInputGUI($lng->txt("cont_caption"), "standard_caption");
366 $caption->setCols(30);
367 $caption->setRows(2);
368 $this->form_gui->addItem($caption);
369
370 /*$caption = new ilTextInputGUI($lng->txt("cont_caption"), "standard_caption");
371 $caption->setSize(40);
372 $caption->setMaxLength(200);
373 $this->form_gui->addItem($caption);*/
374
375 // text representation (alt text)
376 if ($a_mode == "edit" && $this->media_type->usesAltTextProperty($std_item->getFormat())) {
377 $ta = new ilTextAreaInputGUI($lng->txt("text_repr"), "text_representation");
378 $ta->setCols(30);
379 $ta->setRows(2);
380 $ta->setInfo($lng->txt("text_repr_info"));
381 $this->form_gui->addItem($ta);
382 }
383
384 if ($this->object) {
385 $this->video_gui->addPreviewInput($this->form_gui, $this->object->getId());
386 }
387
388 // standard parameters
389 if ($a_mode == "edit" &&
390 $this->media_type->usesParameterProperty($std_item->getFormat())) {
391 if ($this->media_type->usesAutoStartParameterOnly(
392 $std_item->getLocation(),
393 $std_item->getFormat()
394 )) { // autostart
395 /*$auto = new ilCheckboxInputGUI($lng->txt("cont_autostart"), "standard_autostart");
396 $this->form_gui->addItem($auto);*/
397 } else { // parameters
398 $par = new ilTextAreaInputGUI($lng->txt("cont_parameter"), "standard_parameters");
399 $par->setRows(5);
400 $par->setCols(50);
401 $this->form_gui->addItem($par);
402 }
403 }
404
405 if ($a_mode == "edit") {
406 $full_item = $this->object->getMediaItem("Fullscreen");
407 }
408
409 // fullscreen view resource
410 $fs_sec = new ilFormSectionHeaderGUI();
411 $fs_sec->setTitle($lng->txt("cont_fullscreen"));
412 $this->form_gui->addItem($fs_sec);
413
414 $radio_prop2 = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "full_type");
415 $op1 = new ilRadioOption($lng->txt("cont_none"), "None");
416 $radio_prop2->addOption($op1);
417 $op4 = new ilRadioOption($lng->txt("cont_use_same_resource_as_above"), "Standard");
418 $radio_prop2->addOption($op4);
419 $op2 = new ilRadioOption($lng->txt("cont_file"), "File");
420 $up = new ilFileInputGUI("", "full_file");
421 $up->setSuffixes(iterator_to_array($this->media_type->getAllowedSuffixes()));
422 //$up->setForbiddenSuffixes(ilObjMediaObject::getForbiddenFileTypes());
423 $up->setInfo("");
424 if ($a_mode == "create" || !$full_item || $full_item->getLocationType() != "LocalFile") {
425 $up->setRequired(true);
426 }
427 $op2->addSubItem($up);
428 $radio_prop2->addOption($op2);
429 $op3 = new ilRadioOption($lng->txt("url"), "Reference");
430 $ref = new ilUriInputGUI("", "full_reference");
431 $ref->setInfo($lng->txt("cont_ref_helptext"));
432 $ref->setRequired(true);
433 $op3->addSubItem($ref);
434 $radio_prop2->addOption($op3);
435 $radio_prop2->setValue("None");
436 $this->form_gui->addItem($radio_prop2);
437
438 // fullscreen format
439 if ($a_mode == "edit") {
440 if ($this->object->hasFullscreenItem()) {
441 $format = new ilNonEditableValueGUI($lng->txt("cont_format"), "full_format");
442 $format->setValue($full_item->getFormat());
443 $this->form_gui->addItem($format);
444 }
445 }
446
447 // fullscreen size
448 $full_support_constraint_props = false;
449 $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_size");
450 if ($a_mode == "edit") {
451 $add_str = "";
452 if ($this->object->hasFullscreenItem() && ($orig_size = $full_item->getOriginalSize())) {
453 $add_str = " (" . ($orig_size["width"] ?? "") . " x " . ($orig_size["height"] ?? "") . ")";
454
455 if (is_int(strpos($full_item->getFormat(), "image"))
456 && $full_item->getLocationType() == "LocalFile") {
457 $full_support_constraint_props = true;
458 }
459 }
460 $op1 = new ilRadioOption($lng->txt("cont_resource_size") . $add_str, "original");
461 $op1->setInfo($lng->txt("cont_resource_size_info"));
462 $op2 = new ilRadioOption($lng->txt("cont_custom_size"), "selected");
463 } else {
464 $op1 = new ilRadioOption($lng->txt("cont_orig_size"), "original");
465 $op1->setInfo($lng->txt("cont_resource_size_info"));
466 $op2 = new ilRadioOption($lng->txt("cont_adjust_size"), "selected");
467 }
468 $radio_size->addOption($op1);
469
470 // width/height
471 $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") .
472 " / " . $lng->txt("cont_height"), "full_width_height");
473 if ($full_support_constraint_props) {
474 $width_height->setSupportConstraintsProps(true);
475 $width_height->setConstrainProportions(true);
476 }
477 $op2->addSubItem($width_height);
478
479 // resize image
480 if ($a_mode == "edit") {
481 $full_item = $this->object->getMediaItem("Fullscreen");
482 if ($this->object->hasFullscreenItem() &&
483 is_int(strpos($full_item->getFormat(), "image")) &&
484 $full_item->getLocationType() == "LocalFile") {
485 $resize = new ilCheckboxInputGUI(
486 $lng->txt("cont_resize_img"),
487 "full_resize"
488 );
489 $op2->addSubItem($resize);
490 }
491 }
492
493 $radio_size->setValue("original");
494 $radio_size->addOption($op2);
495 $this->form_gui->addItem($radio_size);
496
497 // fullscreen caption
498 $caption = new ilTextAreaInputGUI($lng->txt("cont_caption"), "full_caption");
499 $caption->setCols(30);
500 $caption->setRows(2);
501 $this->form_gui->addItem($caption);
502
503 /*$caption = new ilTextInputGUI($lng->txt("cont_caption"), "full_caption");
504 $caption->setSize(40);
505 $caption->setMaxLength(200);
506 $this->form_gui->addItem($caption);*/
507
508 // text representation (alt text)
509 if ($a_mode == "edit" && $this->object->hasFullscreenItem() && $this->media_type->usesAltTextProperty($std_item->getFormat())) {
510 $ta = new ilTextAreaInputGUI($lng->txt("text_repr"), "full_text_representation");
511 $ta->setCols(30);
512 $ta->setRows(2);
513 $ta->setInfo($lng->txt("text_repr_info"));
514 $this->form_gui->addItem($ta);
515 }
516
517
518 // fullscreen parameters
519 if ($a_mode == "edit" && $this->object->hasFullscreenItem() &&
520 $this->media_type->usesParameterProperty($full_item->getFormat())) {
521 if ($this->media_type->usesAutoStartParameterOnly(
522 $full_item->getLocation(),
523 $full_item->getFormat()
524 )) {
525 /*$auto = new ilCheckboxInputGUI($lng->txt("cont_autostart"), "full_autostart");
526 $this->form_gui->addItem($auto);*/
527 } else {
528 $par = new ilTextAreaInputGUI($lng->txt("cont_parameter"), "full_parameters");
529 $par->setRows(5);
530 $par->setCols(50);
531 $this->form_gui->addItem($par);
532 }
533 }
534
535
536 if ($a_mode == "edit") {
537 $this->form_gui->setTitle($lng->txt("cont_edit_mob"));
538 $this->form_gui->addCommandButton("saveProperties", $lng->txt("save"));
539 } else {
540 $this->form_gui->setTitle($lng->txt("cont_insert_mob"));
541 $this->form_gui->addCommandButton("save", $lng->txt("save"));
542 $this->form_gui->addCommandButton("cancel", $lng->txt("cancel"));
543 }
544 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
545 }
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.
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.
Legacy Uri input.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $lng, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ resizeImagesObject()

ilObjMediaObjectGUI::resizeImagesObject ( )

resize images to specified size

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

894 : void
895 {
896 // standard item
897 $std_item = $this->object->getMediaItem("Standard");
898 if ($std_item->getLocationType() == "LocalFile" &&
899 is_int(strpos($std_item->getFormat(), "image"))
900 ) {
901 $location = $this->media_manager->resizeImage(
902 $this->object->getId(),
903 $std_item->getLocation(),
904 $std_item->getFormat(),
905 $std_item->getWidth(),
906 $std_item->getHeight()
907 );
908 $std_item->setLocation($location);
909 $std_item->update();
910 }
911
912 // fullscreen item
913 if ($this->object->hasFullscreenItem()) {
914 $full_item = $this->object->getMediaItem("Fullscreen");
915 if ($full_item->getLocationType() == "LocalFile" &&
916 is_int(strpos($full_item->getFormat(), "image"))
917 ) {
918 $location = $this->media_manager->resizeImage(
919 $this->object->getId(),
920 $full_item->getLocation(),
921 $full_item->getFormat(),
922 $full_item->getWidth(),
923 $full_item->getHeight()
924 );
925 $full_item->setLocation($location);
926 $full_item->update();
927 }
928 }
929
930 $this->ctrl->redirect($this, "edit");
931 }
$location
Definition: buildRTE.php:22

References $location, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ returnToContextObject()

ilObjMediaObjectGUI::returnToContextObject ( )
Exceptions
ilCtrlException

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

190 : void
191 {
192 $this->ctrl->returnToParent($this);
193 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveMultiSrtObject()

ilObjMediaObjectGUI::saveMultiSrtObject ( )

Save selected srt files as new srt files.

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

1667 : void
1668 {
1669 $ilCtrl = $this->ctrl;
1670 $srt_files = $this->object->getMultiSrtFiles();
1671 $files = $this->sub_title_request->getFiles();
1672 foreach ($files as $f) {
1673 foreach ($srt_files as $srt_file) {
1674 if ($f == $srt_file["filename"]) {
1675 $this->object->uploadSrtFile($this->object->getMultiSrtUploadDir() . "/" . $srt_file["filename"], $srt_file["lang"], "rename");
1676 }
1677 }
1678 }
1679 $this->object->clearMultiSrtDirectory();
1680 $ilCtrl->redirect($this, "listSubtitleFiles");
1681 }

References Vendor\Package\$f, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ saveObject()

ilObjMediaObjectGUI::saveObject ( )

create new media object

Reimplemented from ilObjectGUI.

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

650 : void
651 {
654 $this->initForm();
655 if ($this->form_gui->checkInput()) {
656 $this->object = new ilObjMediaObject();
657 $this->setObjectPerCreationForm($this->object);
658 $this->tpl->setOnScreenMessage('success', $lng->txt("saved_media_object"), true);
659 } else {
660 $this->form_gui->setValuesByPost();
661 $tpl->setContent($this->form_gui->getHTML());
662 }
663 }
setObjectPerCreationForm(ilObjMediaObject $a_mob)
Set media object values from creation form.

References $lng.

◆ savePropertiesObject()

ilObjMediaObjectGUI::savePropertiesObject ( )

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

973 : void
974 {
977 $file = "";
978 $type = "";
979
980 $this->initForm("edit");
981 $form = $this->form_gui;
982
983 if ($form->checkInput()) {
984 $title = trim($form->getInput("standard_title"));
985 $this->object->setTitle($title);
986
987 $std_item = $this->object->getMediaItem("Standard");
988 $location = $std_item->getLocation();
989 $format = $std_item->getFormat();
990 if ($form->getInput("standard_type") == "Reference") {
991 $format = ilObjMediaObject::getMimeType($form->getInput("standard_reference"), true);
992 $std_item->setFormat($format);
993 $std_item->setLocation(ilUtil::secureLink($form->getInput("standard_reference")));
994 $std_item->setLocationType("Reference");
995 }
996 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
997 if ($form->getInput("standard_type") == "File") {
998 $resize = false;
999 if ($_FILES['standard_file']['name'] != "") {
1000 //$file_name = ilObjMediaObject::fixFilename($_FILES['standard_file']['name']);
1001 $file_name = $_FILES['standard_file']['name'];
1002 $this->media_manager->addFileFromLegacyUpload(
1003 $this->object->getId(),
1004 $_FILES['standard_file']['tmp_name']
1005 );
1006
1007 // get mime type
1008 $format = ilObjMediaObject::getMimeType($file_name, true);
1009 $location = $file_name;
1010
1011 $resize = true;
1012 } elseif ($form->getInput("standard_resize")) {
1013 $file = $mob_dir . "/" . $location;
1014 $resize = true;
1015 }
1016
1017 // resize
1018 if ($resize) {
1019 if ($form->getInput("standard_size") != "original" &&
1020 is_int(strpos($format, "image"))) {
1021 $wh_input = $form->getInput("standard_width_height");
1022 $location = $this->media_manager->resizeImage(
1023 $this->object->getId(),
1024 $location,
1025 $format,
1026 (int) $wh_input["width"],
1027 (int) $wh_input["height"],
1028 (bool) ($wh_input["constr_prop"] ?? false)
1029 );
1030 }
1031 $std_item->setFormat($format);
1032 $std_item->setLocation($location);
1033 }
1034
1035 $std_item->setLocationType("LocalFile");
1036 }
1037 $this->object->setDescription($format);
1038 // determine width and height of known image types
1039 $wh_input = $form->getInput("standard_width_height");
1041 $format,
1042 $form->getInput("standard_type"),
1043 $mob_dir . "/" . $location,
1044 $std_item->getLocation(),
1045 (bool) ($wh_input["constr_prop"] ?? false),
1046 ($form->getInput("standard_size") == "original"),
1047 ($wh_input["width"] == "") ? null : (int) $wh_input["width"],
1048 ($wh_input["height"] == "") ? null : (int) $wh_input["height"]
1049 );
1050 if ($wh["info"] != "") {
1051 $this->tpl->setOnScreenMessage('info', $wh["info"], true);
1052 }
1053 $std_item->setWidth($wh["width"]);
1054 $std_item->setHeight($wh["height"]);
1055
1056 // set caption
1057 $std_item->setCaption($form->getInput("standard_caption"));
1058
1059 // text representation
1060 $std_item->setTextRepresentation($form->getInput("text_representation"));
1061
1062 $this->video_gui->savePreviewInput($form, $this->object->getId());
1063
1064 // set parameters
1065 if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
1066 if (!$this->media_type->usesAutoStartParameterOnly(
1067 $std_item->getLocation(),
1068 $std_item->getFormat()
1069 )) {
1070 $std_item->setParameters($form->getInput("standard_parameters"));
1071 }
1072 }
1073
1074 // "None" selected
1075 if ($form->getInput("full_type") == "None") {
1076 if ($this->object->hasFullscreenItem()) { // delete existing
1077 $this->object->removeMediaItem("Fullscreen");
1078 }
1079 } else { // Not "None" -> we need one
1080 if ($this->object->hasFullscreenItem()) { // take existing one
1081 $full_item = $this->object->getMediaItem("Fullscreen");
1082 } else { // create one
1083 $full_item = new ilMediaItem();
1084 $this->object->addMediaItem($full_item);
1085 $full_item->setPurpose("Fullscreen");
1086 }
1087 $location = $full_item->getLocation();
1088 $format = $full_item->getFormat();
1089 if ($form->getInput("full_type") == "Reference") {
1090 $format = ilObjMediaObject::getMimeType($form->getInput("full_reference"), true);
1091 $full_item->setFormat($format);
1092 $full_item->setLocationType("Reference");
1093 $location = ilUtil::secureLink($form->getInput("full_reference"));
1094 $type = "Reference";
1095 $full_item->setLocation($location);
1096 }
1097 $mob_dir = ilObjMediaObject::_getDirectory($this->object->getId());
1098 if ($form->getInput("full_type") == "File") {
1099 $resize = false;
1100 if ($_FILES['full_file']['name'] != "") {
1101 $full_file_name = $_FILES['full_file']['name'];
1102 $this->media_manager->addFileFromLegacyUpload(
1103 $this->object->getId(),
1104 $_FILES['full_file']['tmp_name']
1105 );
1106
1107 $format = ilObjMediaObject::getMimeType($full_file_name);
1108 $location = $full_file_name;
1109
1110 $resize = true;
1111 } elseif ($form->getInput("full_resize")) {
1112 $resize = true;
1113 }
1114
1115 // resize
1116 if ($resize) {
1117 if ($form->getInput("full_size") != "original" &&
1118 is_int(strpos($format, "image"))) {
1119 $wh_input = $form->getInput("full_width_height");
1120 $location = $this->media_manager->resizeImage(
1121 $this->object->getId(),
1122 $location,
1123 $format,
1124 (int) $wh_input["width"],
1125 (int) $wh_input["height"],
1126 (bool) ($wh_input["constr_prop"] ?? false)
1127 );
1128 }
1129 $full_item->setFormat($format);
1130 $full_item->setLocation($location);
1131 }
1132
1133 $full_item->setLocationType("LocalFile");
1134 $type = "File";
1135 }
1136 if ($form->getInput("full_type") == "Standard") {
1137 $format = $std_item->getFormat();
1138 $location = $std_item->getLocation();
1139 $full_item->setLocationType($std_item->getLocationType());
1140 $full_item->setFormat($format);
1141 $full_item->setLocation($location);
1142 $type = $std_item->getLocationType();
1143 if ($type == "LocalFile") {
1144 $type = "File";
1145 }
1146 // resize image
1147 if ($form->getInput("full_size") != "original" &&
1148 is_int(strpos($format, "image")) &&
1149 $full_item->getLocationType() == "LocalFile") {
1150 $wh_input = $form->getInput("full_width_height");
1151 $location = $this->media_manager->resizeImage(
1152 $this->object->getId(),
1153 $location,
1154 $format,
1155 (int) $wh_input["width"],
1156 (int) $wh_input["height"],
1157 (bool) ($wh_input["constr_prop"] ?? false)
1158 );
1159 }
1160 }
1161
1162 // determine width and height of known image types
1163 $wh_input = $form->getInput("full_width_height");
1165 $format,
1166 $type,
1167 $mob_dir . "/" . $location,
1168 $full_item->getLocation(),
1169 (bool) ($wh_input["constr_prop"] ?? false),
1170 ($form->getInput("full_size") == "original"),
1171 ($wh_input["width"] == "") ? null : (int) $wh_input["width"],
1172 ($wh_input["height"] == "") ? null : (int) $wh_input["height"]
1173 );
1174 if ($wh["info"] != "") {
1175 $this->tpl->setOnScreenMessage('info', $wh["info"], true);
1176 }
1177
1178 $full_item->setWidth($wh["width"]);
1179 $full_item->setHeight($wh["height"]);
1180 $full_item->setLocation($location);
1181
1182 $full_item->setCaption($form->getInput("full_caption"));
1183
1184 // text representation
1185 $full_item->setTextRepresentation($form->getInput("full_text_representation"));
1186
1187
1188 // set parameters
1189 if ($this->media_type->usesParameterProperty($std_item->getFormat())) {
1190 if (!$this->media_type->usesAutoStartParameterOnly(
1191 $std_item->getLocation(),
1192 $std_item->getFormat()
1193 )) {
1194 $full_item->setParameters($form->getInput("full_parameters"));
1195 }
1196 }
1197 }
1198
1199 $this->object->update();
1200 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1201 $this->ctrl->redirect($this, "edit");
1202 } else {
1203 $this->form_gui->setValuesByPost();
1204 $tpl->setContent($this->form_gui->getHTML());
1205 }
1206 }
Class ilMediaItem Media Item, component of a media object (file or reference)
static _determineWidthHeight(string $a_format, string $a_type, string $a_file, string $a_reference, bool $a_constrain_proportions, bool $a_use_original, ?int $a_user_width=null, ?int $a_user_height=null)
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
static secureLink(string $a_str)

References $lng, $location, ilObjMediaObject\_determineWidthHeight(), ilObjMediaObject\_getDirectory(), ILIAS\Repository\ctrl(), ilObjMediaObject\getMimeType(), ILIAS\Repository\object(), and ilUtil\secureLink().

+ Here is the call graph for this function:

◆ setAdvMdRecordObject()

ilObjMediaObjectGUI::setAdvMdRecordObject ( int  $a_adv_ref_id,
string  $a_adv_type,
string  $a_adv_subtype = "-" 
)

Set object, that defines the adv md records being used.

Default is $this->object, but the context may set another object (e.g. media pool for media objects)

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

107 : void {
108 $this->adv_ref_id = $a_adv_ref_id;
109 $this->adv_type = $a_adv_type;
110 $this->adv_subtype = $a_adv_subtype;
111 }

◆ setBackTitle()

ilObjMediaObjectGUI::setBackTitle ( string  $a_title)

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

258 : void
259 {
260 $this->back_title = $a_title;
261 }

◆ setEnabledMapAreas()

ilObjMediaObjectGUI::setEnabledMapAreas ( bool  $a_enabledmapareas)

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

140 : void {
141 $this->enabledmapareas = $a_enabledmapareas;
142 }

◆ setHeader()

ilObjMediaObjectGUI::setHeader ( string  $a_title = "")

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

129 : void {
130 $this->header = $a_title;
131 }

◆ setHeightPreset()

ilObjMediaObjectGUI::setHeightPreset ( int  $a_val)

Set height preset (e.g.

set from media pool)

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

165 : void
166 {
167 $this->height_preset = $a_val;
168 }

◆ setObjectPerCreationForm()

ilObjMediaObjectGUI::setObjectPerCreationForm ( ilObjMediaObject  $a_mob)

Set media object values from creation form.

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

680 : void {
681 $form = $this->form_gui;
682
683 $location = "";
684 $file_name = "";
685 $file = "";
686 $type = "";
687
688 // determinte title and format
689 if (trim($form->getInput("standard_title")) != "") {
690 $title = trim($form->getInput("standard_title"));
691 } else {
692 if ($form->getInput("standard_type") == "File") {
693 $title = $_FILES['standard_file']['name'];
694 } else {
695 $title = $form->getInput("standard_reference");
696 }
697 }
698
699 $a_mob->setTitle($title);
700 $a_mob->setDescription("");
701 $a_mob->create();
702
703 // determine and create mob directory, move uploaded file to directory
704 //$mob_dir = ilFileUtils::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
705 //$a_mob->createDirectory();
706 //$mob_dir = ilObjMediaObject::_getDirectory($a_mob->getId());
707
708
709 if ($form->getInput("standard_type") == "File") {
710 $width = $height = 0;
711 $constr_prop = false;
712 if ($form->getInput("standard_size") != "original") {
713 $wh_input = $form->getInput("standard_width_height");
714 $width = (int) $wh_input["width"];
715 $height = (int) $wh_input["height"];
716 $constr_prop = ($wh_input["constr_prop"] ?? false);
717 }
718 $media_item = $a_mob->addMediaItemFromLegacyUpload(
719 "Standard",
720 $_FILES["standard_file"]["tmp_name"],
721 $_FILES["standard_file"]["name"],
722 $width,
723 $height,
724 $constr_prop
725 );
726 } else { // standard type: reference
727 $media_item = new ilMediaItem();
728 $a_mob->addMediaItem($media_item);
729 $media_item->setPurpose("Standard");
730
731 $format = ilObjMediaObject::getMimeType($form->getInput("standard_reference"), true);
732 $media_item->setFormat($format);
733 $media_item->setLocation(ilUtil::secureLink($form->getInput("standard_reference")));
734 $media_item->setLocationType("Reference");
735
736 try {
737 $a_mob->getExternalMetadata();
738 } catch (Exception $e) {
739 }
740 }
741
742 // determine width and height of known image types
743 /*
744 $wh_input = $form->getInput("standard_width_height");
745 $wh = ilObjMediaObject::_determineWidthHeight(
746 $media_item->getFormat(),
747 $form->getInput("standard_type"),
748 $mob_dir . "/" . $location,
749 $media_item->getLocation(),
750 (bool) ($wh_input["constr_prop"] ?? false),
751 ($form->getInput("standard_size") == "original"),
752 ($wh_input["width"] == "") ? null : (int) $wh_input["width"],
753 ($wh_input["height"] == "") ? null : (int) $wh_input["height"]
754 );
755 $media_item->setWidth($wh["width"]);
756 $media_item->setHeight($wh["height"]);
757 if ($wh["info"] != "") {
758 $this->tpl->setOnScreenMessage('info', $wh["info"], true);
759 }*/
760
761 if ($form->getInput("standard_caption") != "") {
762 $media_item->setCaption($form->getInput("standard_caption"));
763 }
764
765
766 $media_item->setHAlign("Left");
767
768 // fullscreen view
769 if ($form->getInput("full_type") != "None") {
770 $media_item2 = new ilMediaItem();
771 $a_mob->addMediaItem($media_item2);
772 $media_item2->setPurpose("Fullscreen");
773
774 // move file / set format and location
775 if ($form->getInput("full_type") == "File") {
776 $format = $location = "";
777 if ($_FILES['full_file']['name'] != "") {
778 $full_file_name = ilObjMediaObject::fixFilename($_FILES['full_file']['name']);
779 $file = $mob_dir . "/" . $full_file_name;
781 $_FILES['full_file']['tmp_name'],
782 $full_file_name,
783 $file
784 );
785 $format = ilObjMediaObject::getMimeType($file);
786 $location = $full_file_name;
787 }
788 } elseif ($form->getInput("full_type") == "Standard" && $form->getInput("standard_type") == "File") {
789 $location = $file_name;
790 }
791
792 // resize file
793 if ($form->getInput("full_type") == "File" ||
794 ($form->getInput("full_type") == "Standard" && $form->getInput("standard_type") == "File")) {
795 if (($form->getInput("full_size") != "original" &&
796 is_int(strpos($format, "image")))
797 ) {
798 $full_wh_input = $form->getInput("full_width_height");
799 $location = $this->media_manager->resizeImage(
800 $this->object->getId(),
801 $full_file_name,
802 $format,
803 (int) $full_wh_input["width"],
804 (int) $full_wh_input["height"],
805 (bool) ($full_wh_input["constr_prop"] ?? false)
806 );
807 }
808
809 $media_item2->setFormat($format);
810 $media_item2->setLocation($location);
811 $media_item2->setLocationType("LocalFile");
812 $type = "File";
813 }
814
815 if ($form->getInput("full_type") == "Reference") {
816 $format = $location = "";
817 if ($form->getInput("full_reference") != "") {
818 $format = ilObjMediaObject::getMimeType($form->getInput("full_reference"), true);
819 $location = ilUtil::stripSlashes($form->getInput("full_reference"));
820 }
821 }
822
823 if ($form->getInput("full_type") == "Reference" ||
824 ($form->getInput("full_type") == "Standard" && $form->getInput("standard_type") == "Reference")) {
825 $media_item2->setFormat($format);
826 $media_item2->setLocation($location);
827 $media_item2->setLocationType("Reference");
828 $type = "Reference";
829 }
830
831 // determine width and height of known image types
832 /*
833 $wh_input = $form->getInput("full_width_height");
834 $wh = ilObjMediaObject::_determineWidthHeight(
835 $format,
836 $type,
837 $mob_dir . "/" . $location,
838 $media_item2->getLocation(),
839 (bool) ($wh_input["constr_prop"] ?? false),
840 ($form->getInput("full_size") == "original"),
841 ($wh_input["width"] == "") ? null : (int) $wh_input["width"],
842 ($wh_input["height"] == "") ? null : (int) $wh_input["height"]
843 );
844
845 $media_item2->setWidth($wh["width"]);
846 $media_item2->setHeight($wh["height"]);*/
847
848 if ($form->getInput("full_caption") != "") {
849 $media_item2->setCaption($form->getInput("full_caption"));
850 }
851 }
852
853 //ilObjMediaObject::renameExecutables($mob_dir);
854 //ilMediaSvgSanitizer::sanitizeDir($mob_dir); // see #20339
855 $a_mob->update();
856 }
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static fixFilename(string $a_name)
Fix filename of uploaded file.
addMediaItem(ilMediaItem $a_item)
addMediaItemFromLegacyUpload(string $purpose, string $tmp_name, string $name, int $resize_width=0, int $resize_height=0, bool $constrain_proportions=true, bool $deduce_size=false)
create(bool $a_create_meta_data=false, bool $a_save_media_items=true, int $from_mob_id=0)
update(bool $a_upload=false)
setTitle(string $title)
setDescription(string $description)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

◆ setPropertiesSubTabs()

ilObjMediaObjectGUI::setPropertiesSubTabs ( string  $a_active)

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

1476 : void {
1477 $ilTabs = $this->tabs;
1478 $ilCtrl = $this->ctrl;
1479 $lng = $this->lng;
1480
1481 $ilTabs->activateTab("cont_mob_def_prop");
1482
1483 $ilTabs->addSubTab(
1484 "general",
1485 $lng->txt("mob_general"),
1486 $ilCtrl->getLinkTarget($this, "edit")
1487 );
1488
1489 if ($this->object->getMediaItem("Standard")->getFormat() == "video/webm" ||
1490 $this->object->getMediaItem("Standard")->getFormat() == "video/mp4") {
1491 $ilTabs->addSubTab(
1492 "subtitles",
1493 $lng->txt("mob_subtitles"),
1494 $ilCtrl->getLinkTarget($this, "listSubtitleFiles")
1495 );
1496 }
1497
1498 $ilTabs->activateSubTab($a_active);
1499 }

References $lng.

◆ setTabs()

ilObjMediaObjectGUI::setTabs ( )

set admin tabs

Reimplemented from ilObjectGUI.

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

1355 : void
1356 {
1357 // catch feedback message
1358 $this->getTabs();
1359
1360 //$this->tpl->clearHeader();
1361 if (is_object($this->object) && strtolower(get_class($this->object)) == "ilobjmediaobject") {
1362 $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_mob.svg"));
1363 $this->tpl->setTitle($this->object->getTitle());
1364 } else {
1365 //$title = $this->object->getTitle();
1366 $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_mob.svg"));
1367 $this->tpl->setTitle($this->lng->txt("cont_create_mob"));
1368 }
1369 }
getTabs()
@abstract overwrite in derived GUI class of your object type
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ setWidthPreset()

ilObjMediaObjectGUI::setWidthPreset ( int  $a_val)

Set width preset (e.g.

set from media pool)

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

152 : void
153 {
154 $this->width_preset = $a_val;
155 }

◆ showAllUsagesObject()

ilObjMediaObjectGUI::showAllUsagesObject ( )

Show all media object usages (incl history)

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

1211 : void
1212 {
1213 $this->showUsagesObject(true);
1214 }

◆ showMultiSubtitleConfirmationTableObject()

ilObjMediaObjectGUI::showMultiSubtitleConfirmationTableObject ( )

List of srt files in zip file.

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

1645 : void
1646 {
1647 $tpl = $this->tpl;
1648
1649 $this->setPropertiesSubTabs("subtitles");
1650
1651 $tab = new ilMultiSrtConfirmationTable2GUI($this, "showMultiSubtitleConfirmationTable");
1652 $tpl->setContent($tab->getHTML());
1653 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ uploadMultipleSubtitleFileFormObject()

ilObjMediaObjectGUI::uploadMultipleSubtitleFileFormObject ( )

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

1612 : void
1613 {
1614 $ilToolbar = $this->toolbar;
1615 $lng = $this->lng;
1616 $ilCtrl = $this->ctrl;
1617
1618 $this->tpl->setOnScreenMessage('info', $lng->txt("mob_upload_multi_srt_howto"));
1619
1620 $this->setPropertiesSubTabs("subtitles");
1621
1622 // upload file
1623 $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true);
1624 $fi = new ilFileInputGUI($lng->txt("mob_subtitle_file") . " (.zip)", "subtitle_file");
1625 $fi->setSuffixes(array("zip"));
1626 $ilToolbar->addInputItem($fi, true);
1627
1628 $ilToolbar->addFormButton($lng->txt("upload"), "uploadMultipleSubtitleFile");
1629 }
ilToolbarGUI $toolbar

References $lng.

◆ uploadMultipleSubtitleFileObject()

ilObjMediaObjectGUI::uploadMultipleSubtitleFileObject ( )

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

1631 : void
1632 {
1633 try {
1634 $this->object->uploadMultipleSubtitleFile(ilArrayUtil::stripSlashesArray($_FILES["subtitle_file"]));
1635 $this->ctrl->redirect($this, "showMultiSubtitleConfirmationTable");
1636 } catch (ilMediaObjectsException $e) {
1637 $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
1638 $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
1639 }
1640 }
static stripSlashesArray(array $a_arr, bool $a_strip_html=true, string $a_allow="")

References Vendor\Package\$e, ILIAS\Repository\ctrl(), and ilArrayUtil\stripSlashesArray().

+ Here is the call graph for this function:

◆ uploadSubtitleFileObject()

ilObjMediaObjectGUI::uploadSubtitleFileObject ( )

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

1545 : void
1546 {
1547 $lng = $this->lng;
1548 $ilCtrl = $this->ctrl;
1549
1550 if ($this->object->uploadSrtFile(
1551 $_FILES["subtitle_file"]["tmp_name"],
1552 $this->sub_title_request->getLanguage()
1553 )) {
1554 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1555 }
1556 $ilCtrl->redirect($this, "listSubtitleFiles");
1557 }

References $lng, and ILIAS\Repository\object().

+ Here is the call graph for this function:

Field Documentation

◆ $adv_ref_id

int ilObjMediaObjectGUI::$adv_ref_id = null
protected

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

◆ $adv_subtype

string ilObjMediaObjectGUI::$adv_subtype = null
protected

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

◆ $adv_type

string ilObjMediaObjectGUI::$adv_type = null
protected

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

◆ $back_title

string ilObjMediaObjectGUI::$back_title = ""
protected

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

◆ $enabledmapareas

bool ilObjMediaObjectGUI::$enabledmapareas = true

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

◆ $error

ilErrorHandling ilObjMediaObjectGUI::$error
protected

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

◆ $file_service_settings

ilFileServicesSettings ilObjMediaObjectGUI::$file_service_settings
protected

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

◆ $form_gui

ilPropertyFormGUI ilObjMediaObjectGUI::$form_gui
protected

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

◆ $header

string ilObjMediaObjectGUI::$header = ""

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

◆ $height_preset

int ilObjMediaObjectGUI::$height_preset = 0
protected

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

◆ $help

ilHelpGUI ilObjMediaObjectGUI::$help
protected

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

◆ $md

MetadataManager ilObjMediaObjectGUI::$md
protected

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

◆ $media_manager

ILIAS MediaObjects MediaObjectManager ilObjMediaObjectGUI::$media_manager
protected

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

◆ $media_type

ILIAS MediaObjects MediaType MediaTypeManager ilObjMediaObjectGUI::$media_type
protected

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

◆ $sub_title_request

SubtitlesGUIRequest ilObjMediaObjectGUI::$sub_title_request
protected

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

◆ $tabs

ilTabsGUI ilObjMediaObjectGUI::$tabs
protected

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

◆ $target_script

string ilObjMediaObjectGUI::$target_script = ""

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

◆ $video_gui

ILIAS MediaObjects Video GUIService ilObjMediaObjectGUI::$video_gui
protected

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

◆ $width_preset

int ilObjMediaObjectGUI::$width_preset = 0
protected

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


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