19 declare(strict_types=1);
31 $has_record_id = $this->
http->wrapper()->query()->has(
'record_id');
32 $is_confirmed = $this->
http->wrapper()->post()->has(
'save_confirmed');
33 $has_save_confirmation = ($this->
getRecord()->getTable()->getSaveConfirmation() && !$has_record_id);
35 if (($media[
'tmp_name'] ??
'') !==
'' && (!$has_save_confirmation || $is_confirmed)) {
37 $mob->setTitle($media[
'name']);
40 if (!is_dir($mob_dir)) {
41 $mob->createDirectory();
44 $mob->addMediaItem($media_item);
45 $media_item->setPurpose(
'Standard');
47 $file_name = str_replace(
' ',
'_', $file_name);
48 $target_file_path = $mob_dir .
'/' . $file_name;
51 if ($has_save_confirmation) {
52 $ilfilehash = $this->
http->wrapper()->post()->retrieve(
54 $this->
refinery->kindlyTo()->string()
64 if (!$this->
upload->hasBeenProcessed()) {
68 if (!$this->
upload->hasUploads()) {
69 throw new ilException($this->
lng->txt(
'upload_error_file_not_found'));
71 $move_file = $media[
'tmp_name'];
82 $this->
getRecord()->getTable()->getCollectionObject()->getId()
84 $media_item->setFormat($format);
86 $media_item->setLocationType(
'LocalFile');
89 $med = $mob->getMediaItem(
'Standard');
96 $return = $mob->getId();
97 if ($this->value !==
null) {
101 if (($media[
'tmp_name'] ??
'') !==
'') {
119 if (is_numeric($file)) {
121 return $mob->getTitle();
135 return $mob->getTitle();
144 $this->
getRecord()->getTable()->getCollectionObject()->getId()
155 if (!$record_field->getValue()) {
AutoloadingIssuesInspection
setValue($value, bool $omit_parsing=false)
Set value for record field.
static extractImage(string $a_file, string $a_target_filename, string $a_target_dir="", int $a_sec=1)
Extract image from video file.
parseExportValue($value)
Function to parse incoming data from form input value $value.
static getASCIIFilename(string $a_filename)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static renameExecutables(string $a_dir)
static supportsImageExtraction(string $a_mime)
Check if mime type supports image extraction.
static http()
Fetches the global http state from ILIAS.
doUpdate()
Update object in database.
parseSortingValue($value, bool $link=true)
Returns sortable value for the specific field-types.
ilDclBaseFieldModel $field
static getCloneOf(int $id, string $type)
static rename(string $a_source, string $a_target)
static getRecordFieldCache(object $record, object $field)
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
ilDclBaseRecordModel $record