mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Add file upload type of extra vars
This commit is contained in:
parent
373c563469
commit
0a625662f7
5 changed files with 36 additions and 0 deletions
|
|
@ -329,6 +329,7 @@ $lang->column_type_list['date'] = 'Date';
|
||||||
$lang->column_type_list['time'] = 'Time';
|
$lang->column_type_list['time'] = 'Time';
|
||||||
$lang->column_type_list['timezone'] = 'Time zone';
|
$lang->column_type_list['timezone'] = 'Time zone';
|
||||||
$lang->column_type_list['number'] = 'Number';
|
$lang->column_type_list['number'] = 'Number';
|
||||||
|
$lang->column_type_list['file'] = 'File upload';
|
||||||
$lang->column_name = 'Column Name';
|
$lang->column_name = 'Column Name';
|
||||||
$lang->column_title = 'Column Title';
|
$lang->column_title = 'Column Title';
|
||||||
$lang->default_value = 'Default Value';
|
$lang->default_value = 'Default Value';
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,7 @@ $lang->column_type_list['date'] = '날짜';
|
||||||
$lang->column_type_list['time'] = '시간';
|
$lang->column_type_list['time'] = '시간';
|
||||||
$lang->column_type_list['timezone'] = '표준 시간대';
|
$lang->column_type_list['timezone'] = '표준 시간대';
|
||||||
$lang->column_type_list['number'] = '숫자';
|
$lang->column_type_list['number'] = '숫자';
|
||||||
|
$lang->column_type_list['file'] = '파일 업로드';
|
||||||
$lang->column_name = '입력항목 이름';
|
$lang->column_name = '입력항목 이름';
|
||||||
$lang->column_title = '입력항목 제목';
|
$lang->column_title = '입력항목 제목';
|
||||||
$lang->default_value = '기본값';
|
$lang->default_value = '기본값';
|
||||||
|
|
|
||||||
|
|
@ -349,6 +349,12 @@ class Value
|
||||||
return escape($value, false);
|
return escape($value, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process the file upload type.
|
||||||
|
if ($type === 'file')
|
||||||
|
{
|
||||||
|
return $value ? intval($value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
// Escape and return all other types.
|
// Escape and return all other types.
|
||||||
return escape($value, false);
|
return escape($value, false);
|
||||||
}
|
}
|
||||||
|
|
@ -423,6 +429,8 @@ class Value
|
||||||
return sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2));
|
return sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2));
|
||||||
case 'timezone':
|
case 'timezone':
|
||||||
return DateTime::getTimezoneList()[$value] ?? '';
|
return DateTime::getTimezoneList()[$value] ?? '';
|
||||||
|
case 'file':
|
||||||
|
return $value;
|
||||||
default:
|
default:
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@
|
||||||
@case ('time')
|
@case ('time')
|
||||||
@include ('form_types/datetime')
|
@include ('form_types/datetime')
|
||||||
@break
|
@break
|
||||||
|
@case ('file')
|
||||||
|
@include ('form_types/file_upload')
|
||||||
|
@break
|
||||||
@default
|
@default
|
||||||
@include ('form_types/text')
|
@include ('form_types/text')
|
||||||
@endswitch
|
@endswitch
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
@if ($value)
|
||||||
|
@php
|
||||||
|
$file = FileModel::getFile(intval($value));
|
||||||
|
@endphp
|
||||||
|
@if ($file)
|
||||||
|
<div class="uploaded_file">
|
||||||
|
<span class="filename">{{ $file->source_filename }}</span>
|
||||||
|
<span class="filesize">({{ FileHandler::filesize($file->file_size) }})</span>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="_delete_{{ $input_name }}" value="Y" />
|
||||||
|
@lang('common.cmd_delete')
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<input type="file" name="{{ $input_name }}"
|
||||||
|
id="{{ $input_id }}"|if="$input_id" class="file rx_ev_file"
|
||||||
|
style="{{ $definition->style }}"|if="$definition->style"
|
||||||
|
@required(toBool($definition->is_required))
|
||||||
|
@disabled(toBool($definition->is_disabled))
|
||||||
|
@readonly(toBool($definition->is_readonly))
|
||||||
|
/>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue