= $form->field($model, 'attachment_type')->widget(DepDrop::class, [
'language' => $appLanguage,
'class' => 'form-control',
'options' => [
'id' => 'attachment_type_field',
'placeholder' => 'Нет типа прикрепляемого документа'
],
'pluginOptions' => [
'depends' => ['related_entity_field'],
'placeholder' => 'Нет типа прикрепляемого документа',
'url' => $model->isNewRecord ? Url::to(['get-types']) : Url::to(['get-types', 'id' => $model->id]),
'loadingText' => 'Загрузка ...',
'initialize' => $model->id !== null,
'params' => ['related_entity_field']
],
]);
?>
= $form->field($model, 'content_link')->textInput(['maxlength' => true]) ?>
= $form->field($model, 'content_html')->textarea([
'class' => 'form-controll',
'style' => 'min-height: 100px; min-width:100%;max-width:100%;'
]) ?>
= $form->field($model, 'file')->widget(
FileInput::class,
[
'class' => 'regulationFileInput',
'language' => $appLanguage,
'options' => [
'multiple' => false,
'id' => "content_file_fields"
],
'pluginOptions' => [
'theme' => 'fa4',
'showClose' => false,
'showRemove' => true,
'showUpload' => false,
'showCaption' => true,
'showPreview' => true,
'overwriteInitial' => true,
'dropZoneEnabled' => false,
'maxFileCount' => 1,
'hideThumbnailContent' => false,
'removeClass' => 'btn btn-danger',
'removeFromPreviewOnError' => true,
'initialPreviewAsData' => true,
'initialPreview' => (empty($model->id)) ? false : Url::to(['download-regulation-file', 'id' => $model->id]),
'initialCaption' => (empty($model->id)) ? false : $model->content_file,
'initialPreviewConfig' => [
[
'caption' => (empty($model->id)) ? false : $model->content_file,
'type' => $model->content_file_extension === 'pdf' ? 'pdf' : 'image',
]
],
'initialPreviewFileType' => $model->content_file_extension === 'pdf' ? 'pdf' : 'image',
'maxFileSize' => iniGet::getUploadMaxFilesize(),
'allowedFileExtensions' => \common\models\Attachment::getExtensionsList(),
],
]
) ?>