5require_once(
'./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php');
25 $has_save_confirmation = ($this->
getRecord()->getTable()->getSaveConfirmation() && !isset(
$_GET[
'record_id']));
26 $is_confirmed = (bool) (isset(
$_POST[
'save_confirmed']));
28 if (is_array(
$file) &&
$file[
'tmp_name'] !=
"" && (!$has_save_confirmation || $is_confirmed)) {
30 $file_obj->setType(
"file");
31 $file_obj->setTitle(
$file[
"name"]);
32 $file_obj->setFileName(
$file[
"name"]);
34 $file_obj->setFileSize(
$file[
"size"]);
35 $file_obj->setMode(
"object");
38 if($has_save_confirmation) {
40 $file_obj->storeUnzipedFile($move_file,
$file[
"name"]);
42 $move_file =
$file[
'tmp_name'];
43 $file_obj->getUploadFile($move_file,
$file[
"name"]);
46 $file_id = $file_obj->getId();
49 }
else if(is_array(
$file) && isset(
$file[
'tmp_name']) &&
$file[
'tmp_name'] !=
"") {
79 if (! $omit_parsing) {
107 $file_name = $file_obj->getFileName();
129 return $file_obj->getTitle();
137 if ($form->getItemByPostVar(
"field_" . $this->getField()->getId())->getDeletionFlag()) {
152 if (!$record_field || !$record_field->getValue()) {
156 $file_old =
new ilObjFile($record_field->getValue(),
false);
157 $file_new = $file_old->cloneObject(
null,
null,
true);
159 $this->
setValue($file_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.
loadValue()
Load the value.
static getRecordFieldCache($record, $field)
static getCloneOf($id, $type)
Class ilDclBaseFieldModel.
parseSortingValue($value, $link=true)
Returns sortable value for the specific field-types.
setValueFromForm($form)
@inheritDoc
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
setValue($value, $omit_parsing=false)
Set value for record field.
parseExportValue($value)
Function to parse incoming data from form input value $value.returns the string/number/etc....
parseValue($value)
Function to parse incoming data from form input value $value.
static getMimeType($a_file='', $a_filename='', $a_mime='')
static _lookupType($a_id, $a_reference=false)
lookup object type
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file