d8c1a2e0
Yarik
Big commit artbox
|
1
|
<?php
|
d55d2fe0
Yarik
Multilanguage
|
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
use common\modules\language\widgets\LanguageForm;
use common\modules\product\models\Brand;
use common\modules\product\models\BrandLang;
use yii\helpers\Html;
use yii\web\View;
use yii\widgets\ActiveForm;
/**
* @var View $this
* @var Brand $model
* @var ActiveForm $form
* @var BrandLang[] $model_langs
*/
|
d8c1a2e0
Yarik
Big commit artbox
|
16
17
18
|
?>
<div class="brand-form">
|
d55d2fe0
Yarik
Multilanguage
|
19
|
|
d8c1a2e0
Yarik
Big commit artbox
|
20
21
|
<?php $form = ActiveForm::begin([
'enableClientValidation' => false,
|
d55d2fe0
Yarik
Multilanguage
|
22
|
'options' => [ 'enctype' => 'multipart/form-data' ],
|
d8c1a2e0
Yarik
Big commit artbox
|
23
|
]); ?>
|
d55d2fe0
Yarik
Multilanguage
|
24
|
|
d55d2fe0
Yarik
Multilanguage
|
25
|
<?= $form->field($model, 'image')
|
93c267f7
Yarik
Multilanguage big...
|
26
|
->widget(\kartik\file\FileInput::className(), [
|
d55d2fe0
Yarik
Multilanguage
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
'language' => 'ru',
'options' => [
'accept' => 'image/*',
'multiple' => false,
],
'pluginOptions' => [
'allowedFileExtensions' => [
'jpg',
'gif',
'png',
],
'initialPreview' => !empty( $model->imageUrl ) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '',
'overwriteInitial' => true,
'showRemove' => false,
'showUpload' => false,
'previewFileType' => 'image',
],
]); ?>
|
4a7f93fb
Yarik
Another one admin...
|
46
47
|
<?= $form->field($model, 'in_menu')->dropDownList([\Yii::t('product', 'No'), \Yii::t('product', 'Yes')]); ?>
|
d55d2fe0
Yarik
Multilanguage
|
48
49
50
51
52
53
|
<?= LanguageForm::widget([
'model_langs' => $model_langs,
'formView' => '@backend/views/brand/_form_language',
'form' => $form,
]) ?>
|
d8c1a2e0
Yarik
Big commit artbox
|
54
|
<div class="form-group">
|
d55d2fe0
Yarik
Multilanguage
|
55
56
57
58
59
60
61
|
<?= Html::submitButton($model->isNewRecord ? Yii::t('product', 'Create') : Yii::t('product', 'Update'), [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]) ?>
<?php if($model->isNewRecord) : ?>
<?= Html::submitButton(Yii::t('product', 'Create and continue'), [
'name' => 'create_and_new',
'class' => 'btn btn-primary',
]) ?>
<?php endif ?>
|
d8c1a2e0
Yarik
Big commit artbox
|
62
|
</div>
|
d55d2fe0
Yarik
Multilanguage
|
63
|
|
d8c1a2e0
Yarik
Big commit artbox
|
64
65
66
|
<?php ActiveForm::end(); ?>
</div>
|