22        $has_save_confirmation = ($this->
getRecord()->getTable()->getSaveConfirmation() && !isset(
$_GET[
'record_id']));
 
   23        $is_confirmed = (bool) (isset(
$_POST[
'save_confirmed']));
 
   25        if (is_array($media) && $media[
'tmp_name'] != 
"" && (!$has_save_confirmation || $is_confirmed)) {
 
   27            $mob->setTitle($media[
'name']);
 
   30            if (!is_dir($mob_dir)) {
 
   31                $mob->createDirectory();
 
   34            $mob->addMediaItem($media_item);
 
   35            $media_item->setPurpose(
"Standard");
 
   37            $file_name = str_replace(
" ", 
"_", $file_name);
 
   38            $file = $mob_dir . 
"/" . $file_name;
 
   41            if ($has_save_confirmation) {
 
   43                ilUtil::moveUploadedFile($move_file, $file_name, 
$file);
 
   45                ilUtil::moveUploadedFile($media[
'tmp_name'], $file_name, 
$file);
 
   53                list($width, $height, 
$type, $attr) = getimagesize(
$file);
 
   57                if ($new_width || $new_height) {
 
   59                    if ($new_height < $height && $new_width < $width) {
 
   61                        if (!$new_height || !$new_width) {
 
   75            $media_item->setFormat(
$format);
 
   77            $media_item->setLocationType(
"LocalFile");
 
   80            include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
 
   82                $med = $mob->getMediaItem(
"Standard");
 
   87                } 
catch (Exception $e) {
 
   93            $return = $mob->getId();
 
   95        } elseif (is_array($media) && isset($media[
'tmp_name']) && $media[
'tmp_name'] != 
'') {
 
  115        if (is_numeric(
$file)) {
 
  117            $mob_name = $mob->getTitle();
 
  149        return $mob->getTitle();
 
  159        if (
$form->getItemByPostVar(
"field_" . $this->getField()->getId())->getDeletionFlag()) {
 
  172        if (!$record_field || !$record_field->getValue()) {
 
  177        $mob_new = $mob_old->duplicate();
 
  179        $this->
setValue($mob_new->getId(), 
true);
 
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
addHiddenItem($a_post_var, $a_value)
Add hidden item.
Class ilDclBaseFieldModel.
doUpdate()
Update object in database.
setValue($value, $omit_parsing=false)
Set value for record field.
static getRecordFieldCache($record, $field)
static getCloneOf($id, $type)
Class ilDclMobRecordFieldModel.
parseValue($value)
Function to parse incoming data from form input value $value.
parseSortingValue($value, $link=true)
Returns sortable value for the specific field-types.
parseExportValue($value)
Function to parse incoming data from form input value $value.
setValueFromForm($form)
@inheritDoc
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
static supportsImageExtraction($a_mime)
Check if mime type supports image extraction.
static extractImage( $a_file, $a_target_filename, $a_target_dir="", $a_sec=1)
Extract image from video file.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
if(isset($_POST['submit'])) $form
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file