593851ec
Alexey Boroda
First commit
|
1
2
|
<?php
|
933c16cb
Yarik
Pre stable ready
|
3
|
use artbox\core\components\imagemanager\components\ImageManagerInputWidget;
|
ee588281
Alexey Boroda
-Blog backend ready
|
4
5
6
|
use artbox\core\widgets\LanguageForm;
use artbox\weblog\models\Category;
use artbox\weblog\models\CategoryLang;
|
593851ec
Alexey Boroda
First commit
|
7
|
use kartik\select2\Select2;
|
593851ec
Alexey Boroda
First commit
|
8
|
use yii\helpers\Html;
|
593851ec
Alexey Boroda
First commit
|
9
10
|
use yii\web\View;
use yii\widgets\ActiveForm;
|
593851ec
Alexey Boroda
First commit
|
11
12
|
/**
|
ee588281
Alexey Boroda
-Blog backend ready
|
13
14
15
16
17
|
* @var View $this
* @var Category $model
* @var ActiveForm $form
* @var CategoryLang[] $modelLangs
* @var array $parentCategories
|
593851ec
Alexey Boroda
First commit
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
*/
?>
<div class="blog-category-form">
<?php $form = ActiveForm::begin(
[
'options' => [ 'enctype' => 'multipart/form-data' ],
]
); ?>
<?php
echo LanguageForm::widget(
[
'modelLangs' => $modelLangs,
|
ee588281
Alexey Boroda
-Blog backend ready
|
34
|
'formView' => '@artbox/weblog/views/blog-category/_form_language',
|
593851ec
Alexey Boroda
First commit
|
35
36
37
38
39
|
'form' => $form,
]
);
?>
|
ee588281
Alexey Boroda
-Blog backend ready
|
40
|
<?= $form->field($model, 'image_id')
|
593851ec
Alexey Boroda
First commit
|
41
|
->widget(
|
ee588281
Alexey Boroda
-Blog backend ready
|
42
|
ImageManagerInputWidget::className(),
|
593851ec
Alexey Boroda
First commit
|
43
|
[
|
ee588281
Alexey Boroda
-Blog backend ready
|
44
45
46
47
48
49
|
'aspectRatio' => ( 16 / 9 ),
//set the aspect ratio
'showPreview' => true,
//false to hide the preview
'showDeletePickedImageConfirm' => false,
//on true show warning before detach image
|
593851ec
Alexey Boroda
First commit
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
]
); ?>
<?= $form->field($model, 'sort')
->textInput() ?>
<?php echo $form->field($model, 'parent_id')
->widget(
Select2::className(),
[
'data' => $parentCategories,
'options' => [ 'placeholder' => \Yii::t('blog', 'Has no parent rubric') ],
'pluginOptions' => [
'allowClear' => true,
],
]
);
?>
<?= $form->field($model, 'status')
|
ee588281
Alexey Boroda
-Blog backend ready
|
70
71
72
73
74
75
76
77
78
79
80
81
|
->checkbox(
[
'class' => 'flat',
]
) ?>
<div class="form-group">
<?= Html::submitButton(
$model->isNewRecord ? 'Create' : 'Update',
[ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
) ?>
</div>
|
593851ec
Alexey Boroda
First commit
|
82
83
84
85
|
<?php ActiveForm::end(); ?>
</div>
|