5 require_once(
'./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php');
6 require_once(
'./Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordFieldModel.php');
23 $has_save_confirmation = ($this->
getRecord()->getTable()->getSaveConfirmation() && !isset(
$_GET[
'record_id']));
24 $is_confirmed = (bool) (isset(
$_POST[
'save_confirmed']));
26 if (is_array($media) && $media[
'tmp_name'] !=
"" && (!$has_save_confirmation || $is_confirmed)) {
28 $mob->setTitle($media[
'name']);
31 if (!is_dir($mob_dir)) {
32 $mob->createDirectory();
35 $mob->addMediaItem($media_item);
36 $media_item->setPurpose(
"Standard");
38 $file_name = str_replace(
" ",
"_", $file_name);
39 $file = $mob_dir .
"/" . $file_name;
42 if($has_save_confirmation) {
53 if ($format ==
'image/jpeg') {
54 list($width, $height, $type, $attr) = getimagesize(
$file);
58 if ($new_width || $new_height) {
60 if ($new_height < $height && $new_width < $width) {
62 if (!$new_height || !$new_width) {
76 $media_item->setFormat($format);
78 $media_item->setLocationType(
"LocalFile");
81 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
83 $med = $mob->getMediaItem(
"Standard");
94 $return = $mob->getId();
96 }
else if(is_array($media) && isset($media[
'tmp_name']) && $media[
'tmp_name'] !=
'') {
115 if (is_numeric(
$file)) {
117 $mob_name = $mob->getTitle();
147 return $mob->getTitle();
156 if ($form->getItemByPostVar(
"field_" . $this->getField()->getId())->getDeletionFlag()) {
168 if (!$record_field || !$record_field->getValue()) {
static getCloneOf($id, $type)
Class ilDclBaseFieldModel.
addHiddenItem($a_post_var, $a_value)
Add hidden item.
setValue($value, $omit_parsing=false)
Set value for record field.
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
parseSortingValue($value, $link=true)
Returns sortable value for the specific field-types.
static extractImage($a_file, $a_target_filename, $a_target_dir="", $a_sec=1)
Extract image from video file.
parseExportValue($value)
Function to parse incoming data from form input value $value.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
doUpdate()
Update object in database.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getRecordFieldCache($record, $field)
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
Class ilDclMobRecordFieldModel.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
Confirmation screen class.
static supportsImageExtraction($a_mime)
Check if mime type supports image extraction.