mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51: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['timezone'] = 'Time zone';
|
||||
$lang->column_type_list['number'] = 'Number';
|
||||
$lang->column_type_list['file'] = 'File upload';
|
||||
$lang->column_name = 'Column Name';
|
||||
$lang->column_title = 'Column Title';
|
||||
$lang->default_value = 'Default Value';
|
||||
|
|
|
|||
|
|
@ -331,6 +331,7 @@ $lang->column_type_list['date'] = '날짜';
|
|||
$lang->column_type_list['time'] = '시간';
|
||||
$lang->column_type_list['timezone'] = '표준 시간대';
|
||||
$lang->column_type_list['number'] = '숫자';
|
||||
$lang->column_type_list['file'] = '파일 업로드';
|
||||
$lang->column_name = '입력항목 이름';
|
||||
$lang->column_title = '입력항목 제목';
|
||||
$lang->default_value = '기본값';
|
||||
|
|
|
|||
|
|
@ -349,6 +349,12 @@ class Value
|
|||
return escape($value, false);
|
||||
}
|
||||
|
||||
// Process the file upload type.
|
||||
if ($type === 'file')
|
||||
{
|
||||
return $value ? intval($value) : null;
|
||||
}
|
||||
|
||||
// Escape and return all other types.
|
||||
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));
|
||||
case 'timezone':
|
||||
return DateTime::getTimezoneList()[$value] ?? '';
|
||||
case 'file':
|
||||
return $value;
|
||||
default:
|
||||
return $value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@
|
|||
@case ('time')
|
||||
@include ('form_types/datetime')
|
||||
@break
|
||||
@case ('file')
|
||||
@include ('form_types/file_upload')
|
||||
@break
|
||||
@default
|
||||
@include ('form_types/text')
|
||||
@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