From a92850cf18821a85e778f7055dcf08b7d362c972 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 29 Jan 2016 09:45:25 +0200 Subject: [PATCH] firs page --- common/widgets/FieldEditor.php | 9 ++++++++- common/widgets/views/education_field.php | 25 +++++++++++++++++++++++++ console/migrations/m160128_101543_fields.php | 2 +- frontend/views/accounts/_form.php | 7 ++++++- 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 common/widgets/views/education_field.php diff --git a/common/widgets/FieldEditor.php b/common/widgets/FieldEditor.php index baa8112..7373c05 100644 --- a/common/widgets/FieldEditor.php +++ b/common/widgets/FieldEditor.php @@ -1,6 +1,7 @@ where(['table_id'=>$this->item_id, 'table_name'=>$this->model, 'field_type'=>$this->template])->all()) !== null) { + if (($model = Fields::find()->where([ + 'table_id'=>$this->item_id, + 'table_name'=>$this->model, + 'field_type'=>$this->template, + 'language'=>$this->language, + ])->all())) { return $model; diff --git a/common/widgets/views/education_field.php b/common/widgets/views/education_field.php new file mode 100644 index 0000000..94abd72 --- /dev/null +++ b/common/widgets/views/education_field.php @@ -0,0 +1,25 @@ + +
+ + Video + +

Добавить поле

+ + + +
+ + 'form-group'])?> + + + + + +
+ +
+ + + diff --git a/console/migrations/m160128_101543_fields.php b/console/migrations/m160128_101543_fields.php index 034b162..cb5e337 100644 --- a/console/migrations/m160128_101543_fields.php +++ b/console/migrations/m160128_101543_fields.php @@ -15,7 +15,7 @@ class m160128_101543_fields extends Migration 'value' => $this->string(255), 'field_name' => $this->string(), 'field_type' => $this->string(32)->notNull(), - 'language' => $this->integer() + 'language' => $this->string(3) ], $tableOptions); } diff --git a/frontend/views/accounts/_form.php b/frontend/views/accounts/_form.php index 6301ee7..689d820 100644 --- a/frontend/views/accounts/_form.php +++ b/frontend/views/accounts/_form.php @@ -49,7 +49,12 @@ use yii\widgets\ActiveForm; field($user_info, 'about')->textarea(['rows' => 6]) ?> -'', 'item_id'=> $user->id, 'model'=>'User']); ?> +'education', + 'item_id'=> $user->id, + 'model'=>'User', + 'language'=>'ru' +]); ?>
-- libgit2 0.21.4