Commit f1ea4c0130e0ec30cf6f97f603c1e6078a24c50a
1 parent
e3105834
lang_id => language_id
Showing
43 changed files
with
110 additions
and
110 deletions
Show diff stats
backend/controllers/LanguageController.php
@@ -156,14 +156,14 @@ class LanguageController extends Controller | @@ -156,14 +156,14 @@ class LanguageController extends Controller | ||
156 | $langs = array(); | 156 | $langs = array(); |
157 | if(!empty($children)) { | 157 | if(!empty($children)) { |
158 | foreach($children as $child) { | 158 | foreach($children as $child) { |
159 | - $langs = OptionLang::findAll(['option_lang_id' => $child->option_id]); | 159 | + $langs = OptionLang::findAll(['option_language_id' => $child->option_id]); |
160 | foreach($langs as $lang) { | 160 | foreach($langs as $lang) { |
161 | $lang->delete(); | 161 | $lang->delete(); |
162 | } | 162 | } |
163 | $child->delete(); | 163 | $child->delete(); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | - $langs = OptionLang::findAll(['option_lang_id' => $id]); | 166 | + $langs = OptionLang::findAll(['option_language_id' => $id]); |
167 | foreach($langs as $lang) { | 167 | foreach($langs as $lang) { |
168 | $lang->delete(); | 168 | $lang->delete(); |
169 | } | 169 | } |
backend/models/Import.php
@@ -42,7 +42,7 @@ class Import extends \yii\db\ActiveRecord | @@ -42,7 +42,7 @@ class Import extends \yii\db\ActiveRecord | ||
42 | $termin_pid = 8; | 42 | $termin_pid = 8; |
43 | // $template_id шаблон каьегорий | 43 | // $template_id шаблон каьегорий |
44 | $template_id = 3; | 44 | $template_id = 3; |
45 | - $lang_id = 2; | 45 | + $language_id = 2; |
46 | $type = 'H'; | 46 | $type = 'H'; |
47 | 47 | ||
48 | // массив для импортп товаров | 48 | // массив для импортп товаров |
@@ -69,7 +69,7 @@ class Import extends \yii\db\ActiveRecord | @@ -69,7 +69,7 @@ class Import extends \yii\db\ActiveRecord | ||
69 | // массив для поиска/добавления термина | 69 | // массив для поиска/добавления термина |
70 | $basic = [ | 70 | $basic = [ |
71 | 'type' => $type, | 71 | 'type' => $type, |
72 | - 'lang_id' => $lang_id, | 72 | + 'language_id' => $language_id, |
73 | 'template_id' => $template_id, | 73 | 'template_id' => $template_id, |
74 | ]; | 74 | ]; |
75 | 75 |
backend/models/Menu.php
@@ -80,7 +80,7 @@ class Menu extends \yii\db\ActiveRecord | @@ -80,7 +80,7 @@ class Menu extends \yii\db\ActiveRecord | ||
80 | AND menu_location.menu_location_name = \''.$location_name.'\' | 80 | AND menu_location.menu_location_name = \''.$location_name.'\' |
81 | INNER JOIN termin ON termin.termin_id = menu.termin_id | 81 | INNER JOIN termin ON termin.termin_id = menu.termin_id |
82 | INNER JOIN termin_lang ON termin_lang.termin_id = menu.termin_id | 82 | INNER JOIN termin_lang ON termin_lang.termin_id = menu.termin_id |
83 | - AND termin_lang.lang_id = '.Yii::$app->params['lang_id'].' | 83 | + AND termin_lang.language_id = '.Yii::$app->params['language_id'].' |
84 | ORDER BY menu.level ASC, menu.sortorder ASC | 84 | ORDER BY menu.level ASC, menu.sortorder ASC |
85 | ')->queryAll(); | 85 | ')->queryAll(); |
86 | /* | 86 | /* |
@@ -90,7 +90,7 @@ class Menu extends \yii\db\ActiveRecord | @@ -90,7 +90,7 @@ class Menu extends \yii\db\ActiveRecord | ||
90 | ->join( | 90 | ->join( |
91 | 'INNER JOIN', | 91 | 'INNER JOIN', |
92 | 'termin_lang.termin_id = menu.termin_id', | 92 | 'termin_lang.termin_id = menu.termin_id', |
93 | - ['lang_id' => yii::$app->params['lang_id']]) | 93 | + ['language_id' => yii::$app->params['language_id']]) |
94 | ->all(); | 94 | ->all(); |
95 | */ | 95 | */ |
96 | } | 96 | } |
backend/models/MenuLocation.php
@@ -59,6 +59,6 @@ class MenuLocation extends \yii\db\ActiveRecord | @@ -59,6 +59,6 @@ class MenuLocation extends \yii\db\ActiveRecord | ||
59 | */ | 59 | */ |
60 | public function getLangs() | 60 | public function getLangs() |
61 | { | 61 | { |
62 | - return $this->hasMany(Language::className(), ['language_id' => 'lang_id'])->viaTable('menu_location_lang', ['menu_location_id' => 'menu_location_id']); | 62 | + return $this->hasMany(Language::className(), ['language_id' => 'language_id'])->viaTable('menu_location_lang', ['menu_location_id' => 'menu_location_id']); |
63 | } | 63 | } |
64 | } | 64 | } |
backend/models/MenuLocationLang.php
@@ -9,7 +9,7 @@ use Yii; | @@ -9,7 +9,7 @@ use Yii; | ||
9 | * | 9 | * |
10 | * @property integer $menu_location_id | 10 | * @property integer $menu_location_id |
11 | * @property string $menu_location_title | 11 | * @property string $menu_location_title |
12 | - * @property integer $lang_id | 12 | + * @property integer $language_id |
13 | * | 13 | * |
14 | * @property Language $lang | 14 | * @property Language $lang |
15 | * @property MenuLocation $menuLocation | 15 | * @property MenuLocation $menuLocation |
@@ -30,8 +30,8 @@ class MenuLocationLang extends \yii\db\ActiveRecord | @@ -30,8 +30,8 @@ class MenuLocationLang extends \yii\db\ActiveRecord | ||
30 | public function rules() | 30 | public function rules() |
31 | { | 31 | { |
32 | return [ | 32 | return [ |
33 | - [['menu_location_id', 'menu_location_title', 'lang_id'], 'required'], | ||
34 | - [['menu_location_id', 'lang_id'], 'integer'], | 33 | + [['menu_location_id', 'menu_location_title', 'language_id'], 'required'], |
34 | + [['menu_location_id', 'language_id'], 'integer'], | ||
35 | [['menu_location_title'], 'string', 'max' => 250] | 35 | [['menu_location_title'], 'string', 'max' => 250] |
36 | ]; | 36 | ]; |
37 | } | 37 | } |
@@ -44,7 +44,7 @@ class MenuLocationLang extends \yii\db\ActiveRecord | @@ -44,7 +44,7 @@ class MenuLocationLang extends \yii\db\ActiveRecord | ||
44 | return [ | 44 | return [ |
45 | 'menu_location_id' => Yii::t('app', 'Menu Location ID'), | 45 | 'menu_location_id' => Yii::t('app', 'Menu Location ID'), |
46 | 'menu_location_title' => Yii::t('app', 'Menu Location Title'), | 46 | 'menu_location_title' => Yii::t('app', 'Menu Location Title'), |
47 | - 'lang_id' => Yii::t('app', 'Lang ID'), | 47 | + 'language_id' => Yii::t('app', 'Lang ID'), |
48 | ]; | 48 | ]; |
49 | } | 49 | } |
50 | 50 | ||
@@ -53,7 +53,7 @@ class MenuLocationLang extends \yii\db\ActiveRecord | @@ -53,7 +53,7 @@ class MenuLocationLang extends \yii\db\ActiveRecord | ||
53 | */ | 53 | */ |
54 | public function getLang() | 54 | public function getLang() |
55 | { | 55 | { |
56 | - return $this->hasOne(Language::className(), ['language_id' => 'lang_id']); | 56 | + return $this->hasOne(Language::className(), ['language_id' => 'language_id']); |
57 | } | 57 | } |
58 | 58 | ||
59 | /** | 59 | /** |
backend/models/NewOptionsLang.php
@@ -9,7 +9,7 @@ use Yii; | @@ -9,7 +9,7 @@ use Yii; | ||
9 | * | 9 | * |
10 | * @property integer $primary | 10 | * @property integer $primary |
11 | * @property integer $id | 11 | * @property integer $id |
12 | - * @property integer $lang_id | 12 | + * @property integer $language_id |
13 | * @property string $value | 13 | * @property string $value |
14 | */ | 14 | */ |
15 | class NewOptionsLang extends \yii\db\ActiveRecord | 15 | class NewOptionsLang extends \yii\db\ActiveRecord |
@@ -32,7 +32,7 @@ class NewOptionsLang extends \yii\db\ActiveRecord | @@ -32,7 +32,7 @@ class NewOptionsLang extends \yii\db\ActiveRecord | ||
32 | { | 32 | { |
33 | return [ | 33 | return [ |
34 | [['id', 'value'], 'required'], | 34 | [['id', 'value'], 'required'], |
35 | - [['id', 'lang_id'], 'integer'], | 35 | + [['id', 'language_id'], 'integer'], |
36 | [['value'], 'string'] | 36 | [['value'], 'string'] |
37 | ]; | 37 | ]; |
38 | } | 38 | } |
@@ -45,7 +45,7 @@ class NewOptionsLang extends \yii\db\ActiveRecord | @@ -45,7 +45,7 @@ class NewOptionsLang extends \yii\db\ActiveRecord | ||
45 | return [ | 45 | return [ |
46 | 'primary' => Yii::t('app', 'Primary'), | 46 | 'primary' => Yii::t('app', 'Primary'), |
47 | 'id' => Yii::t('app', 'ID'), | 47 | 'id' => Yii::t('app', 'ID'), |
48 | - 'lang_id' => Yii::t('app', 'Lang ID'), | 48 | + 'language_id' => Yii::t('app', 'Lang ID'), |
49 | 'value' => Yii::t('app', 'Value'), | 49 | 'value' => Yii::t('app', 'Value'), |
50 | ]; | 50 | ]; |
51 | } | 51 | } |
backend/models/NewOptionsLangSearch.php
@@ -18,7 +18,7 @@ class NewOptionsLangSearch extends NewOptionsLang | @@ -18,7 +18,7 @@ class NewOptionsLangSearch extends NewOptionsLang | ||
18 | public function rules() | 18 | public function rules() |
19 | { | 19 | { |
20 | return [ | 20 | return [ |
21 | - [['primary', 'id', 'lang_id'], 'integer'], | 21 | + [['primary', 'id', 'language_id'], 'integer'], |
22 | [['value'], 'safe'], | 22 | [['value'], 'safe'], |
23 | ]; | 23 | ]; |
24 | } | 24 | } |
@@ -58,7 +58,7 @@ class NewOptionsLangSearch extends NewOptionsLang | @@ -58,7 +58,7 @@ class NewOptionsLangSearch extends NewOptionsLang | ||
58 | $query->andFilterWhere([ | 58 | $query->andFilterWhere([ |
59 | 'primary' => $this->primary, | 59 | 'primary' => $this->primary, |
60 | 'id' => $this->id, | 60 | 'id' => $this->id, |
61 | - 'lang_id' => $this->lang_id, | 61 | + 'language_id' => $this->language_id, |
62 | ]); | 62 | ]); |
63 | 63 | ||
64 | $query->andFilterWhere(['like', 'value', $this->value]); | 64 | $query->andFilterWhere(['like', 'value', $this->value]); |
backend/models/Termin.php
@@ -57,7 +57,7 @@ class Termin extends \yii\db\ActiveRecord | @@ -57,7 +57,7 @@ class Termin extends \yii\db\ActiveRecord | ||
57 | 57 | ||
58 | /** | 58 | /** |
59 | * Выполняет поиск по параметрам | 59 | * Выполняет поиск по параметрам |
60 | - * @param array $param принимает [termin_id, lang_id, return_one, return_field, show_all] | 60 | + * @param array $param принимает [termin_id, language_id, return_one, return_field, show_all] |
61 | * @return array one | array all | string значение масива | 61 | * @return array one | array all | string значение масива |
62 | */ | 62 | */ |
63 | public function finInfo (array $params = []) | 63 | public function finInfo (array $params = []) |
@@ -65,7 +65,7 @@ class Termin extends \yii\db\ActiveRecord | @@ -65,7 +65,7 @@ class Termin extends \yii\db\ActiveRecord | ||
65 | Tools::ifNotExist ($params, array ( | 65 | Tools::ifNotExist ($params, array ( |
66 | 'termin_id' => false, | 66 | 'termin_id' => false, |
67 | 'termin_pid' => false, | 67 | 'termin_pid' => false, |
68 | - 'lang_id' => Yii::$app->params['lang_id'], | 68 | + 'language_id' => Yii::$app->params['language_id'], |
69 | 'return_one' => false, | 69 | 'return_one' => false, |
70 | 'return_field' => false, | 70 | 'return_field' => false, |
71 | 'show_all' => false, | 71 | 'show_all' => false, |
@@ -92,9 +92,9 @@ class Termin extends \yii\db\ActiveRecord | @@ -92,9 +92,9 @@ class Termin extends \yii\db\ActiveRecord | ||
92 | 'termin.termin_id = termin_lang.termin_id' | 92 | 'termin.termin_id = termin_lang.termin_id' |
93 | ); | 93 | ); |
94 | 94 | ||
95 | - if ($params['lang_id']) | 95 | + if ($params['language_id']) |
96 | { | 96 | { |
97 | - $WHERE['termin_lang.lang_id'] = $params['lang_id']; | 97 | + $WHERE['termin_lang.language_id'] = $params['language_id']; |
98 | } | 98 | } |
99 | 99 | ||
100 | // структура | 100 | // структура |
@@ -169,7 +169,7 @@ class Termin extends \yii\db\ActiveRecord | @@ -169,7 +169,7 @@ class Termin extends \yii\db\ActiveRecord | ||
169 | */ | 169 | */ |
170 | public function getLangs() | 170 | public function getLangs() |
171 | { | 171 | { |
172 | - return $this->hasMany(Language::className(), ['language_id' => 'lang_id']) | 172 | + return $this->hasMany(Language::className(), ['language_id' => 'language_id']) |
173 | ->viaTable('termin_lang', ['termin_id' => 'termin_id']); | 173 | ->viaTable('termin_lang', ['termin_id' => 'termin_id']); |
174 | } | 174 | } |
175 | 175 |
backend/models/TerminLang.php
@@ -8,7 +8,7 @@ use Yii; | @@ -8,7 +8,7 @@ use Yii; | ||
8 | * This is the model class for table "termin_lang". | 8 | * This is the model class for table "termin_lang". |
9 | * | 9 | * |
10 | * @property integer $termin_id | 10 | * @property integer $termin_id |
11 | - * @property integer $lang_id | 11 | + * @property integer $language_id |
12 | * @property string $termin_title | 12 | * @property string $termin_title |
13 | * @property string $termin_alias | 13 | * @property string $termin_alias |
14 | * | 14 | * |
@@ -31,8 +31,8 @@ class TerminLang extends \yii\db\ActiveRecord | @@ -31,8 +31,8 @@ class TerminLang extends \yii\db\ActiveRecord | ||
31 | public function rules() | 31 | public function rules() |
32 | { | 32 | { |
33 | return [ | 33 | return [ |
34 | - [['lang_id'], 'required'], | ||
35 | - [['lang_id'], 'integer'], | 34 | + [['language_id'], 'required'], |
35 | + [['language_id'], 'integer'], | ||
36 | [['termin_title', 'termin_alias'], 'string', 'max' => 250] | 36 | [['termin_title', 'termin_alias'], 'string', 'max' => 250] |
37 | ]; | 37 | ]; |
38 | } | 38 | } |
@@ -44,7 +44,7 @@ class TerminLang extends \yii\db\ActiveRecord | @@ -44,7 +44,7 @@ class TerminLang extends \yii\db\ActiveRecord | ||
44 | { | 44 | { |
45 | return [ | 45 | return [ |
46 | 'termin_id' => Yii::t('app', 'Termin ID'), | 46 | 'termin_id' => Yii::t('app', 'Termin ID'), |
47 | - 'lang_id' => Yii::t('app', 'Lang ID'), | 47 | + 'language_id' => Yii::t('app', 'Lang ID'), |
48 | 'termin_title' => Yii::t('app', 'Termin Title'), | 48 | 'termin_title' => Yii::t('app', 'Termin Title'), |
49 | 'termin_alias' => Yii::t('app', 'Termin Alias'), | 49 | 'termin_alias' => Yii::t('app', 'Termin Alias'), |
50 | ]; | 50 | ]; |
@@ -55,7 +55,7 @@ class TerminLang extends \yii\db\ActiveRecord | @@ -55,7 +55,7 @@ class TerminLang extends \yii\db\ActiveRecord | ||
55 | */ | 55 | */ |
56 | public function getLang() | 56 | public function getLang() |
57 | { | 57 | { |
58 | - return $this->hasOne(Language::className(), ['language_id' => 'lang_id']); | 58 | + return $this->hasOne(Language::className(), ['language_id' => 'language_id']); |
59 | } | 59 | } |
60 | 60 | ||
61 | /** | 61 | /** |
backend/views/admin-menu/view.php
@@ -10,26 +10,26 @@ $this->title = Yii::t('app', 'Admin Menus').': '.$model->name; | @@ -10,26 +10,26 @@ $this->title = Yii::t('app', 'Admin Menus').': '.$model->name; | ||
10 | $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['index']]; | 10 | $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['index']]; |
11 | $this->params['breadcrumbs'][] = $this->title; | 11 | $this->params['breadcrumbs'][] = $this->title; |
12 | ?> | 12 | ?> |
13 | -<div class="admin-menu-view box box-primary"> | ||
14 | 13 | ||
15 | - <?= DetailView::widget([ | 14 | +<div class="admin-menu-view box box-primary"> |
15 | +<?= DetailView::widget([ | ||
16 | 'model' => $model, | 16 | 'model' => $model, |
17 | 'attributes' => [ | 17 | 'attributes' => [ |
18 | - 'id', | ||
19 | - 'parent_id', | ||
20 | - 'active', | 18 | + 'admin_menu_id', |
19 | + 'admin_menu_pid', | ||
20 | + 'status', | ||
21 | 'hide_min', | 21 | 'hide_min', |
22 | 'sort', | 22 | 'sort', |
23 | 'name', | 23 | 'name', |
24 | 'path', | 24 | 'path', |
25 | - 'params', | 25 | + 'param', |
26 | ], | 26 | ], |
27 | ]) ?> | 27 | ]) ?> |
28 | 28 | ||
29 | <div class="box-footer with-border"> | 29 | <div class="box-footer with-border"> |
30 | <p> | 30 | <p> |
31 | - <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary btn-flat']) ?> | ||
32 | - <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | 31 | + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->admin_menu_id], ['class' => 'btn btn-primary btn-flat']) ?> |
32 | + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->admin_menu_id], [ | ||
33 | 'class' => 'btn btn-danger btn-flat', | 33 | 'class' => 'btn btn-danger btn-flat', |
34 | 'data' => [ | 34 | 'data' => [ |
35 | 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | 35 | 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), |
@@ -39,5 +39,5 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -39,5 +39,5 @@ $this->params['breadcrumbs'][] = $this->title; | ||
39 | <?= Html::a(Yii::t('app', 'Back'), ['index'], ['class' => 'btn btn-default btn-flat']) ?> | 39 | <?= Html::a(Yii::t('app', 'Back'), ['index'], ['class' => 'btn btn-default btn-flat']) ?> |
40 | </p> | 40 | </p> |
41 | </div> | 41 | </div> |
42 | - | ||
43 | -</div> | 42 | + |
43 | +</div> | ||
44 | \ No newline at end of file | 44 | \ No newline at end of file |
backend/views/blog/articles.php
@@ -21,7 +21,7 @@ echo GridView::widget([ | @@ -21,7 +21,7 @@ echo GridView::widget([ | ||
21 | 'class' => Column::className(), | 21 | 'class' => Column::className(), |
22 | 'header' => Yii::t('app', 'Name'), | 22 | 'header' => Yii::t('app', 'Name'), |
23 | 'content' => function($model, $key, $index, $column) { | 23 | 'content' => function($model, $key, $index, $column) { |
24 | - return $model->getArticleLangs()->where(['lang_id' => Language::getDefaultLang()->language_id])->one()->name; | 24 | + return $model->getArticleLangs()->where(['language_id' => Language::getDefaultLang()->language_id])->one()->name; |
25 | } | 25 | } |
26 | ], | 26 | ], |
27 | [ | 27 | [ |
backend/views/language/_form_adress_edit.php
@@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | @@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | ||
21 | <?php if($row->hasErrors()) { ?><div class="help-block"><?php echo $modellang[$id][0]->getFirstError('value');?></div> <?php } ?> | 21 | <?php if($row->hasErrors()) { ?><div class="help-block"><?php echo $modellang[$id][0]->getFirstError('value');?></div> <?php } ?> |
22 | <?php | 22 | <?php |
23 | if($row->translate) { | 23 | if($row->translate) { |
24 | - foreach($row->getLangs() as $lang_id => $lang) { | 24 | + foreach($row->getLangs() as $language_id => $lang) { |
25 | ?> | 25 | ?> |
26 | <div class="form-group"> | 26 | <div class="form-group"> |
27 | <div class="col-xs-1"><?=$lang['lang_code']?></div> | 27 | <div class="col-xs-1"><?=$lang['lang_code']?></div> |
backend/views/language/view_adress.php
@@ -24,7 +24,7 @@ echo $this->render('layout'); | @@ -24,7 +24,7 @@ echo $this->render('layout'); | ||
24 | [ | 24 | [ |
25 | 'class' => 'yii\grid\Column', | 25 | 'class' => 'yii\grid\Column', |
26 | 'content' => function($model, $key, $index, $column) { | 26 | 'content' => function($model, $key, $index, $column) { |
27 | - return OptionLang::find()->select('value')->where(['lang_id' => 0, 'id' => $model->option_id])->scalar(); | 27 | + return OptionLang::find()->select('value')->where(['language_id' => 0, 'id' => $model->option_id])->scalar(); |
28 | }, | 28 | }, |
29 | 'header' => Yii::t('app', 'adress_name') | 29 | 'header' => Yii::t('app', 'adress_name') |
30 | ], | 30 | ], |
backend/views/new-options-lang/_form.php
@@ -14,7 +14,7 @@ use yii\widgets\ActiveForm; | @@ -14,7 +14,7 @@ use yii\widgets\ActiveForm; | ||
14 | 14 | ||
15 | <?= $form->field($model, 'id')->textInput() ?> | 15 | <?= $form->field($model, 'id')->textInput() ?> |
16 | 16 | ||
17 | - <?= $form->field($model, 'lang_id')->textInput() ?> | 17 | + <?= $form->field($model, 'language_id')->textInput() ?> |
18 | 18 | ||
19 | <?= $form->field($model, 'value')->textarea(['rows' => 6]) ?> | 19 | <?= $form->field($model, 'value')->textarea(['rows' => 6]) ?> |
20 | 20 |
backend/views/new-options-lang/_search.php
@@ -19,7 +19,7 @@ use yii\widgets\ActiveForm; | @@ -19,7 +19,7 @@ use yii\widgets\ActiveForm; | ||
19 | 19 | ||
20 | <?= $form->field($model, 'id') ?> | 20 | <?= $form->field($model, 'id') ?> |
21 | 21 | ||
22 | - <?= $form->field($model, 'lang_id') ?> | 22 | + <?= $form->field($model, 'language_id') ?> |
23 | 23 | ||
24 | <?= $form->field($model, 'value') ?> | 24 | <?= $form->field($model, 'value') ?> |
25 | 25 |
backend/views/new-options-lang/index.php
@@ -27,7 +27,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -27,7 +27,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
27 | 27 | ||
28 | 'primary', | 28 | 'primary', |
29 | 'id', | 29 | 'id', |
30 | - 'lang_id', | 30 | + 'language_id', |
31 | 'value:ntext', | 31 | 'value:ntext', |
32 | 32 | ||
33 | ['class' => 'yii\grid\ActionColumn'], | 33 | ['class' => 'yii\grid\ActionColumn'], |
backend/views/new-options-lang/view.php
@@ -30,7 +30,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -30,7 +30,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
30 | 'attributes' => [ | 30 | 'attributes' => [ |
31 | 'primary', | 31 | 'primary', |
32 | 'id', | 32 | 'id', |
33 | - 'lang_id', | 33 | + 'language_id', |
34 | 'value:ntext', | 34 | 'value:ntext', |
35 | ], | 35 | ], |
36 | ]) ?> | 36 | ]) ?> |
backend/views/option/_form_edit.php
@@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | @@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | ||
21 | <?php if($row->hasErrors()) { ?><div class="help-block"><?php echo $modellang[$id][0]->getFirstError('value');?></div> <?php } ?> | 21 | <?php if($row->hasErrors()) { ?><div class="help-block"><?php echo $modellang[$id][0]->getFirstError('value');?></div> <?php } ?> |
22 | <?php | 22 | <?php |
23 | if($row->translate) { | 23 | if($row->translate) { |
24 | - foreach($row->getLangs() as $lang_id => $lang) { | 24 | + foreach($row->getLangs() as $language_id => $lang) { |
25 | ?> | 25 | ?> |
26 | <div class="form-group"> | 26 | <div class="form-group"> |
27 | <div class="col-xs-1"><?=$lang['lang_code']?></div> | 27 | <div class="col-xs-1"><?=$lang['lang_code']?></div> |
backend/views/termin/_form.php
@@ -37,8 +37,8 @@ use yii\helpers\ArrayHelper; | @@ -37,8 +37,8 @@ use yii\helpers\ArrayHelper; | ||
37 | 37 | ||
38 | <?= $form->field($model_lang, 'termin_alias')->textInput() ?> | 38 | <?= $form->field($model_lang, 'termin_alias')->textInput() ?> |
39 | 39 | ||
40 | - <?= Html::activeHiddenInput ($model_lang, 'lang_id', [ | ||
41 | - 'value' => ($model_lang->lang_id != 0 ? $model_lang->lang_id : Yii::$app->params['lang_id']), | 40 | + <?= Html::activeHiddenInput ($model_lang, 'language_id', [ |
41 | + 'value' => ($model_lang->language_id != 0 ? $model_lang->language_id : Yii::$app->params['language_id']), | ||
42 | ]) ?> | 42 | ]) ?> |
43 | 43 | ||
44 | <div class="form-group"> | 44 | <div class="form-group"> |
backend/web/js/option.js
@@ -71,7 +71,7 @@ $(function() { | @@ -71,7 +71,7 @@ $(function() { | ||
71 | var path = form[id].handler; | 71 | var path = form[id].handler; |
72 | var view = form[id].view; | 72 | var view = form[id].view; |
73 | var model = form[id].model; | 73 | var model = form[id].model; |
74 | - $.get(path, { lang_id: lang, widget_id: id, ajaxView: view, model: model }, function(data) { | 74 | + $.get(path, { language_id: lang, widget_id: id, ajaxView: view, model: model }, function(data) { |
75 | $('#'+id+'-tabs li').removeClass('active'); | 75 | $('#'+id+'-tabs li').removeClass('active'); |
76 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); | 76 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); |
77 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); | 77 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); |
@@ -92,7 +92,7 @@ $(function() { | @@ -92,7 +92,7 @@ $(function() { | ||
92 | var flag = $(this).find('span').first().clone(); | 92 | var flag = $(this).find('span').first().clone(); |
93 | var el = $(this); | 93 | var el = $(this); |
94 | var id = $(this).attr('href').substr(1); | 94 | var id = $(this).attr('href').substr(1); |
95 | - $.get(form[id], { lang_id: lang, widget_id: id }, function(data) { | 95 | + $.get(form[id], { language_id: lang, widget_id: id }, function(data) { |
96 | $('#'+id+'-tabs li').removeClass('active'); | 96 | $('#'+id+'-tabs li').removeClass('active'); |
97 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); | 97 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); |
98 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); | 98 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); |
common/components/LangUrlManager.php
@@ -9,16 +9,16 @@ class LangUrlManager extends UrlManager | @@ -9,16 +9,16 @@ class LangUrlManager extends UrlManager | ||
9 | { | 9 | { |
10 | public function createUrl ($params) | 10 | public function createUrl ($params) |
11 | { | 11 | { |
12 | - if (isset ($params['lang_id'])) | 12 | + if (isset ($params['language_id'])) |
13 | { | 13 | { |
14 | //Если указан идентификатор языка, то делаем попытку найти язык в БД, | 14 | //Если указан идентификатор языка, то делаем попытку найти язык в БД, |
15 | //иначе работаем с языком по умолчанию | 15 | //иначе работаем с языком по умолчанию |
16 | - if (($lang_code = Language::findOne($params['lang_id'])) === null) | 16 | + if (($lang_code = Language::findOne($params['language_id'])) === null) |
17 | { | 17 | { |
18 | $lang_code = Language::getDefaultLang(); | 18 | $lang_code = Language::getDefaultLang(); |
19 | } | 19 | } |
20 | 20 | ||
21 | - unset ($params['lang_id']); | 21 | + unset ($params['language_id']); |
22 | 22 | ||
23 | } | 23 | } |
24 | else | 24 | else |
common/models/Catalog.php
@@ -23,21 +23,21 @@ class Catalog extends Model | @@ -23,21 +23,21 @@ class Catalog extends Model | ||
23 | termin_lang.termin_title | 23 | termin_lang.termin_title |
24 | FROM termin_structure | 24 | FROM termin_structure |
25 | INNER JOIN termin_lang ON termin_lang.termin_id = termin_structure.termin_id | 25 | INNER JOIN termin_lang ON termin_lang.termin_id = termin_structure.termin_id |
26 | - AND termin_lang.lang_id = '.Yii::$app->params['lang_id'].' | 26 | + AND termin_lang.language_id = '.Yii::$app->params['language_id'].' |
27 | ORDER BY termin_structure.termin_id ASC, termin_structure.termin_pid ASC | 27 | ORDER BY termin_structure.termin_id ASC, termin_structure.termin_pid ASC |
28 | ')->queryAll(); | 28 | ')->queryAll(); |
29 | } | 29 | } |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * Выполняет поиск по параметрам | 32 | * Выполняет поиск по параметрам |
33 | - * @param array $param принимает [catalog_id, lang_id, return_one, return_field, show_all] | 33 | + * @param array $param принимает [catalog_id, language_id, return_one, return_field, show_all] |
34 | * @return array one | array all | string значение масива | 34 | * @return array one | array all | string значение масива |
35 | */ | 35 | */ |
36 | public function finInfo (array $params = []) | 36 | public function finInfo (array $params = []) |
37 | { | 37 | { |
38 | Tools::ifNotExist ($params, array ( | 38 | Tools::ifNotExist ($params, array ( |
39 | 'catalog_id' => false, | 39 | 'catalog_id' => false, |
40 | - 'lang_id' => false, | 40 | + 'language_id' => false, |
41 | 'return_one' => false, | 41 | 'return_one' => false, |
42 | 'return_field' => false, | 42 | 'return_field' => false, |
43 | 'show_all' => false, | 43 | 'show_all' => false, |
@@ -57,9 +57,9 @@ class Catalog extends Model | @@ -57,9 +57,9 @@ class Catalog extends Model | ||
57 | $WHERE['catalog.catalog_id'] = $params['catalog_id']; | 57 | $WHERE['catalog.catalog_id'] = $params['catalog_id']; |
58 | } | 58 | } |
59 | 59 | ||
60 | - if ($params['lang_id']) | 60 | + if ($params['language_id']) |
61 | { | 61 | { |
62 | - $WHERE['catalog_i18n.lang_id'] = $params['lang_id']; | 62 | + $WHERE['catalog_i18n.language_id'] = $params['language_id']; |
63 | } | 63 | } |
64 | 64 | ||
65 | if (! empty ($WHERE)) | 65 | if (! empty ($WHERE)) |
@@ -144,7 +144,7 @@ class Catalog extends Model | @@ -144,7 +144,7 @@ class Catalog extends Model | ||
144 | */ | 144 | */ |
145 | public function getRelationCatalogLangPlus() | 145 | public function getRelationCatalogLangPlus() |
146 | { | 146 | { |
147 | - return $this->getRelationCatalogLang()->where(['lang_id' => yii::$app->params['lang_id']]); | 147 | + return $this->getRelationCatalogLang()->where(['language_id' => yii::$app->params['language_id']]); |
148 | } | 148 | } |
149 | 149 | ||
150 | /** | 150 | /** |
common/modules/blog/controllers/AjaxController.php
@@ -27,9 +27,9 @@ class AjaxController extends Controller | @@ -27,9 +27,9 @@ class AjaxController extends Controller | ||
27 | return true; | 27 | return true; |
28 | } | 28 | } |
29 | 29 | ||
30 | - public function actionCategoryForm($lang_id, $widget_id) | 30 | + public function actionCategoryForm($language_id, $widget_id) |
31 | { | 31 | { |
32 | - $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $lang_id])->one(); | 32 | + $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $language_id])->one(); |
33 | if(!$model) { | 33 | if(!$model) { |
34 | throw new NotFoundHttpException('Language not found'); | 34 | throw new NotFoundHttpException('Language not found'); |
35 | } | 35 | } |
@@ -37,9 +37,9 @@ class AjaxController extends Controller | @@ -37,9 +37,9 @@ class AjaxController extends Controller | ||
37 | return $this->renderAjax('_category_form', ['model' => $model, 'category_lang' => $category_lang, 'widget_id' => $widget_id]); | 37 | return $this->renderAjax('_category_form', ['model' => $model, 'category_lang' => $category_lang, 'widget_id' => $widget_id]); |
38 | } | 38 | } |
39 | 39 | ||
40 | - public function actionArticleForm($lang_id, $widget_id) | 40 | + public function actionArticleForm($language_id, $widget_id) |
41 | { | 41 | { |
42 | - $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $lang_id])->one(); | 42 | + $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $language_id])->one(); |
43 | if(!$model) { | 43 | if(!$model) { |
44 | throw new NotFoundHttpException('Language not found'); | 44 | throw new NotFoundHttpException('Language not found'); |
45 | } | 45 | } |
@@ -47,9 +47,9 @@ class AjaxController extends Controller | @@ -47,9 +47,9 @@ class AjaxController extends Controller | ||
47 | return $this->renderAjax('_article_form', ['model' => $model, 'article_lang' => $article_lang, 'widget_id' => $widget_id]); | 47 | return $this->renderAjax('_article_form', ['model' => $model, 'article_lang' => $article_lang, 'widget_id' => $widget_id]); |
48 | } | 48 | } |
49 | 49 | ||
50 | - public function actionArticleMediaForm($lang_id, $widget_id, $type) | 50 | + public function actionArticleMediaForm($language_id, $widget_id, $type) |
51 | { | 51 | { |
52 | - $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $lang_id])->one(); | 52 | + $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $language_id])->one(); |
53 | if(!$model) { | 53 | if(!$model) { |
54 | throw new NotFoundHttpException('Language not found'); | 54 | throw new NotFoundHttpException('Language not found'); |
55 | } | 55 | } |
@@ -60,9 +60,9 @@ class AjaxController extends Controller | @@ -60,9 +60,9 @@ class AjaxController extends Controller | ||
60 | return $this->renderAjax('_article_media_form', ['model' => $model, 'article_lang' => $article_lang, 'widget_id' => $widget_id, 'type' => $type]); | 60 | return $this->renderAjax('_article_media_form', ['model' => $model, 'article_lang' => $article_lang, 'widget_id' => $widget_id, 'type' => $type]); |
61 | } | 61 | } |
62 | 62 | ||
63 | - public function actionArticleCategoryMediaForm($lang_id, $widget_id, $type) | 63 | + public function actionArticleCategoryMediaForm($language_id, $widget_id, $type) |
64 | { | 64 | { |
65 | - $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $lang_id])->one(); | 65 | + $model = Language::find()->where(['>=', 'language_id', 1])->andWhere(['status' => 1, 'language_id' => $language_id])->one(); |
66 | if(!$model) { | 66 | if(!$model) { |
67 | throw new NotFoundHttpException('Language not found'); | 67 | throw new NotFoundHttpException('Language not found'); |
68 | } | 68 | } |
@@ -124,9 +124,9 @@ class AjaxController extends Controller | @@ -124,9 +124,9 @@ class AjaxController extends Controller | ||
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
127 | - public function actionMultilangForm($model, $ajaxView, $widget_id, $lang_id = NULL) | 127 | + public function actionMultilangForm($model, $ajaxView, $widget_id, $language_id = NULL) |
128 | { | 128 | { |
129 | - $model = new $model(['language_id' => $lang_id]); | 129 | + $model = new $model(['language_id' => $language_id]); |
130 | return $this->renderAjax($ajaxView, ['model' => $model, 'widget_id' => $widget_id]); | 130 | return $this->renderAjax($ajaxView, ['model' => $model, 'widget_id' => $widget_id]); |
131 | } | 131 | } |
132 | } | 132 | } |
common/modules/blog/models/ArticleCategoryLang.php
@@ -8,7 +8,7 @@ use Yii; | @@ -8,7 +8,7 @@ use Yii; | ||
8 | /** | 8 | /** |
9 | * This is the model class for table "article_category_lang". | 9 | * This is the model class for table "article_category_lang". |
10 | * | 10 | * |
11 | - * @property integer $article_category_lang_id | 11 | + * @property integer $article_category_language_id |
12 | * @property integer $language_id | 12 | * @property integer $language_id |
13 | * @property integer $article_category_id | 13 | * @property integer $article_category_id |
14 | * @property string $text | 14 | * @property string $text |
@@ -69,7 +69,7 @@ class ArticleCategoryLang extends \yii\db\ActiveRecord | @@ -69,7 +69,7 @@ class ArticleCategoryLang extends \yii\db\ActiveRecord | ||
69 | public function attributeLabels() | 69 | public function attributeLabels() |
70 | { | 70 | { |
71 | return [ | 71 | return [ |
72 | - 'article_category_lang_id' => Yii::t('app', 'ID'), | 72 | + 'article_category_language_id' => Yii::t('app', 'ID'), |
73 | 'language_id' => Yii::t('app', 'Lang ID'), | 73 | 'language_id' => Yii::t('app', 'Lang ID'), |
74 | 'article_category_id' => Yii::t('app', 'Category ID'), | 74 | 'article_category_id' => Yii::t('app', 'Category ID'), |
75 | 'text' => Yii::t('app', 'Text'), | 75 | 'text' => Yii::t('app', 'Text'), |
common/modules/blog/models/ArticleLang.php
@@ -8,7 +8,7 @@ use common\models\Language; | @@ -8,7 +8,7 @@ use common\models\Language; | ||
8 | /** | 8 | /** |
9 | * This is the model class for table "article_lang". | 9 | * This is the model class for table "article_lang". |
10 | * | 10 | * |
11 | - * @property integer $article_lang_id | 11 | + * @property integer $article_language_id |
12 | * @property integer $language_id | 12 | * @property integer $language_id |
13 | * @property integer $article_id | 13 | * @property integer $article_id |
14 | * @property string $text | 14 | * @property string $text |
@@ -52,7 +52,7 @@ class ArticleLang extends \yii\db\ActiveRecord | @@ -52,7 +52,7 @@ class ArticleLang extends \yii\db\ActiveRecord | ||
52 | public function attributeLabels() | 52 | public function attributeLabels() |
53 | { | 53 | { |
54 | return [ | 54 | return [ |
55 | - 'article_lang_id' => Yii::t('app', 'ID'), | 55 | + 'article_language_id' => Yii::t('app', 'ID'), |
56 | 'language_id' => Yii::t('app', 'Lang ID'), | 56 | 'language_id' => Yii::t('app', 'Lang ID'), |
57 | 'article_id' => Yii::t('app', 'Article ID'), | 57 | 'article_id' => Yii::t('app', 'Article ID'), |
58 | 'text' => Yii::t('app', 'Text'), | 58 | 'text' => Yii::t('app', 'Text'), |
common/modules/blog/views/article/_form.php
@@ -130,7 +130,7 @@ $uploaddir = \Yii::getAlias('@saveImageDir'); | @@ -130,7 +130,7 @@ $uploaddir = \Yii::getAlias('@saveImageDir'); | ||
130 | ?> | 130 | ?> |
131 | <div role="" class="tab-pane <?php if($first) { echo 'active main-tab'; } ?>" id="<?=$multilang->id?>-<?=$index?>"> | 131 | <div role="" class="tab-pane <?php if($first) { echo 'active main-tab'; } ?>" id="<?=$multilang->id?>-<?=$index?>"> |
132 | 132 | ||
133 | - <?= $form->field($article_langs[$index], "[$index]lang_id")->label(false)->hiddenInput(['value' => $index]) ?> | 133 | + <?= $form->field($article_langs[$index], "[$index]language_id")->label(false)->hiddenInput(['value' => $index]) ?> |
134 | 134 | ||
135 | <?= $form->field($article_langs[$index], "[$index]text")->widget(CKEditor::className(),['editorOptions' => [ 'preset' => 'full', 'inline' => false, ], ]); ?> | 135 | <?= $form->field($article_langs[$index], "[$index]text")->widget(CKEditor::className(),['editorOptions' => [ 'preset' => 'full', 'inline' => false, ], ]); ?> |
136 | 136 |
common/translation/ru/app.php
@@ -86,7 +86,7 @@ return [ | @@ -86,7 +86,7 @@ return [ | ||
86 | 'meta_description' => 'Meta Description', | 86 | 'meta_description' => 'Meta Description', |
87 | 'text' => 'Текст', | 87 | 'text' => 'Текст', |
88 | 'page_alias' => 'alias', | 88 | 'page_alias' => 'alias', |
89 | - 'lang_id' => 'ID языка', | 89 | + 'language_id' => 'ID языка', |
90 | 'common' => 'Общее', | 90 | 'common' => 'Общее', |
91 | 'lang' => 'Языковые переменные', | 91 | 'lang' => 'Языковые переменные', |
92 | 'termin' => 'Термин', | 92 | 'termin' => 'Термин', |
common/translation/uk/app.php
@@ -14,7 +14,7 @@ return [ | @@ -14,7 +14,7 @@ return [ | ||
14 | 'meta_description' => 'Meta Description', | 14 | 'meta_description' => 'Meta Description', |
15 | 'text' => 'Текст', | 15 | 'text' => 'Текст', |
16 | 'page_alias' => 'alias', | 16 | 'page_alias' => 'alias', |
17 | - 'lang_id' => 'ID мови', | 17 | + 'language_id' => 'ID мови', |
18 | 'common' => 'Загальне', | 18 | 'common' => 'Загальне', |
19 | 'lang' => 'Мовні змінні', | 19 | 'lang' => 'Мовні змінні', |
20 | 'termin' => 'Термін', | 20 | 'termin' => 'Термін', |
frontend/controllers/OptionValuesController.php
@@ -68,7 +68,7 @@ class OptionValuesController extends Controller | @@ -68,7 +68,7 @@ class OptionValuesController extends Controller | ||
68 | foreach($post['OptionValues']['option_value_text'] as $lang => $value) { | 68 | foreach($post['OptionValues']['option_value_text'] as $lang => $value) { |
69 | $models[$lang] = new OptionValues(); | 69 | $models[$lang] = new OptionValues(); |
70 | $models[$lang]->load(Yii::$app->request->post()); | 70 | $models[$lang]->load(Yii::$app->request->post()); |
71 | - $models[$lang]->option_lang_id = $lang; | 71 | + $models[$lang]->option_language_id = $lang; |
72 | $models[$lang]->option_value_text = $value; | 72 | $models[$lang]->option_value_text = $value; |
73 | if($first && $id) { | 73 | if($first && $id) { |
74 | $models[$lang]->option_value_parent = $id; | 74 | $models[$lang]->option_value_parent = $id; |
frontend/controllers/SiteController.php
@@ -303,10 +303,10 @@ class SiteController extends Controller | @@ -303,10 +303,10 @@ class SiteController extends Controller | ||
303 | $option_values[$key] = new OptionValues(); | 303 | $option_values[$key] = new OptionValues(); |
304 | $option_values[$key]['option_value_id'] = $options_to_values[$key]->getAttribute('option_value_id'); | 304 | $option_values[$key]['option_value_id'] = $options_to_values[$key]->getAttribute('option_value_id'); |
305 | $option_values[$key]['option_value_text'] = $val['option_value']; | 305 | $option_values[$key]['option_value_text'] = $val['option_value']; |
306 | - if($options_to_values[$key]->option->getAttribute('option_translatable') == 0 || empty($val['option_lang_id'])) { | ||
307 | - $option_values[$key]['option_lang_id'] = 0; | 306 | + if($options_to_values[$key]->option->getAttribute('option_translatable') == 0 || empty($val['option_language_id'])) { |
307 | + $option_values[$key]['option_language_id'] = 0; | ||
308 | } else { | 308 | } else { |
309 | - $option_values[$key]['option_lang_id'] = $val['option_lang_id']; | 309 | + $option_values[$key]['option_language_id'] = $val['option_language_id']; |
310 | } | 310 | } |
311 | if(!$option_values[$key]->save()) { | 311 | if(!$option_values[$key]->save()) { |
312 | $options_to_values[$key]->delete(); | 312 | $options_to_values[$key]->delete(); |
frontend/models/Language.php
@@ -61,6 +61,6 @@ class Language extends \yii\db\ActiveRecord | @@ -61,6 +61,6 @@ class Language extends \yii\db\ActiveRecord | ||
61 | */ | 61 | */ |
62 | public function getOptionValues() | 62 | public function getOptionValues() |
63 | { | 63 | { |
64 | - return $this->hasMany(OptionValues::className(), ['option_lang_id' => 'language_id']); | 64 | + return $this->hasMany(OptionValues::className(), ['option_language_id' => 'language_id']); |
65 | } | 65 | } |
66 | } | 66 | } |
frontend/models/LanguageLang.php
@@ -9,7 +9,7 @@ use Yii; | @@ -9,7 +9,7 @@ use Yii; | ||
9 | * | 9 | * |
10 | * @property integer $language_id | 10 | * @property integer $language_id |
11 | * @property string $lang_title | 11 | * @property string $lang_title |
12 | - * @property integer $lang_id | 12 | + * @property integer $language_id |
13 | * | 13 | * |
14 | * @property Language $language | 14 | * @property Language $language |
15 | */ | 15 | */ |
@@ -43,7 +43,7 @@ class LanguageLang extends \yii\db\ActiveRecord | @@ -43,7 +43,7 @@ class LanguageLang extends \yii\db\ActiveRecord | ||
43 | return [ | 43 | return [ |
44 | 'language_id' => Yii::t('app', 'Language ID'), | 44 | 'language_id' => Yii::t('app', 'Language ID'), |
45 | 'lang_title' => Yii::t('app', 'Lang Title'), | 45 | 'lang_title' => Yii::t('app', 'Lang Title'), |
46 | - 'lang_id' => Yii::t('app', 'Lang ID'), | 46 | + 'language_id' => Yii::t('app', 'Lang ID'), |
47 | ]; | 47 | ]; |
48 | } | 48 | } |
49 | 49 |
frontend/models/Option.php
@@ -60,7 +60,7 @@ class Option extends \yii\db\ActiveRecord | @@ -60,7 +60,7 @@ class Option extends \yii\db\ActiveRecord | ||
60 | public static function change($id, $post, $modeldb, $model_id) { | 60 | public static function change($id, $post, $modeldb, $model_id) { |
61 | $models[$id] = Option::findOne($id); | 61 | $models[$id] = Option::findOne($id); |
62 | $modellang[$id] = array(); | 62 | $modellang[$id] = array(); |
63 | - $langs = OptionLang::findAll(['option_lang_id' => $id]); | 63 | + $langs = OptionLang::findAll(['option_language_id' => $id]); |
64 | foreach($langs as $lang) { | 64 | foreach($langs as $lang) { |
65 | $modellang[$id][$lang->language_id] = $lang; | 65 | $modellang[$id][$lang->language_id] = $lang; |
66 | } | 66 | } |
@@ -78,7 +78,7 @@ class Option extends \yii\db\ActiveRecord | @@ -78,7 +78,7 @@ class Option extends \yii\db\ActiveRecord | ||
78 | foreach($post['Option'] as $key => $option) { | 78 | foreach($post['Option'] as $key => $option) { |
79 | if(in_array($key, array('model', 'model_id'))) { continue; } | 79 | if(in_array($key, array('model', 'model_id'))) { continue; } |
80 | if(empty($option['value'][$models[$key]->name]) && !empty($option['lang'])) { | 80 | if(empty($option['value'][$models[$key]->name]) && !empty($option['lang'])) { |
81 | - foreach($option['lang'] as $lang_id => $lang) { | 81 | + foreach($option['lang'] as $language_id => $lang) { |
82 | if(!empty($lang)) { | 82 | if(!empty($lang)) { |
83 | $option['value'][$models[$key]->name] = $lang; | 83 | $option['value'][$models[$key]->name] = $lang; |
84 | break; | 84 | break; |
@@ -92,16 +92,16 @@ class Option extends \yii\db\ActiveRecord | @@ -92,16 +92,16 @@ class Option extends \yii\db\ActiveRecord | ||
92 | $modellang[$key][0]->addError('value', 'Value must be set'); | 92 | $modellang[$key][0]->addError('value', 'Value must be set'); |
93 | } | 93 | } |
94 | if(!empty($option['lang'])) { | 94 | if(!empty($option['lang'])) { |
95 | - foreach($option['lang'] as $lang_id => $lang) { | ||
96 | - if(empty($modellang[$key][$lang_id])) { | ||
97 | - $modellang[$key][$lang_id] = new OptionLang(); | ||
98 | - $modellang[$key][$lang_id]->option_id = $models[$key]->option_id; | ||
99 | - $modellang[$key][$lang_id]->language_id = $lang_id; | ||
100 | - $modellang[$key][$lang_id]->value = $lang; | 95 | + foreach($option['lang'] as $language_id => $lang) { |
96 | + if(empty($modellang[$key][$language_id])) { | ||
97 | + $modellang[$key][$language_id] = new OptionLang(); | ||
98 | + $modellang[$key][$language_id]->option_id = $models[$key]->option_id; | ||
99 | + $modellang[$key][$language_id]->language_id = $language_id; | ||
100 | + $modellang[$key][$language_id]->value = $lang; | ||
101 | } else { | 101 | } else { |
102 | - $modellang[$key][$lang_id]->value = $lang; | 102 | + $modellang[$key][$language_id]->value = $lang; |
103 | } | 103 | } |
104 | - if(!$modellang[$key][$lang_id]->save()) { | 104 | + if(!$modellang[$key][$language_id]->save()) { |
105 | $ok = 0; | 105 | $ok = 0; |
106 | } | 106 | } |
107 | } | 107 | } |
frontend/models/OptionLang.php
@@ -8,7 +8,7 @@ use Yii; | @@ -8,7 +8,7 @@ use Yii; | ||
8 | * This is the model class for table "option_lang". | 8 | * This is the model class for table "option_lang". |
9 | * | 9 | * |
10 | * @property integer $id | 10 | * @property integer $id |
11 | - * @property integer $lang_id | 11 | + * @property integer $language_id |
12 | * @property string $value | 12 | * @property string $value |
13 | */ | 13 | */ |
14 | class OptionLang extends \yii\db\ActiveRecord | 14 | class OptionLang extends \yii\db\ActiveRecord |
frontend/models/OptionLangSearch.php
@@ -18,7 +18,7 @@ class OptionLangSearch extends OptionLang | @@ -18,7 +18,7 @@ class OptionLangSearch extends OptionLang | ||
18 | public function rules() | 18 | public function rules() |
19 | { | 19 | { |
20 | return [ | 20 | return [ |
21 | - [['option_lang_id', 'option_id', 'language_id'], 'integer'], | 21 | + [['option_language_id', 'option_id', 'language_id'], 'integer'], |
22 | [['value'], 'safe'], | 22 | [['value'], 'safe'], |
23 | ]; | 23 | ]; |
24 | } | 24 | } |
@@ -56,7 +56,7 @@ class OptionLangSearch extends OptionLang | @@ -56,7 +56,7 @@ class OptionLangSearch extends OptionLang | ||
56 | } | 56 | } |
57 | 57 | ||
58 | $query->andFilterWhere([ | 58 | $query->andFilterWhere([ |
59 | - 'option_lang_id' => $this->option_lang_id, | 59 | + 'option_language_id' => $this->option_language_id, |
60 | 'option_id' => $this->option_id, | 60 | 'option_id' => $this->option_id, |
61 | 'language_id' => $this->language_id, | 61 | 'language_id' => $this->language_id, |
62 | ]); | 62 | ]); |
frontend/models/OptionValues.php
@@ -10,7 +10,7 @@ use Yii; | @@ -10,7 +10,7 @@ use Yii; | ||
10 | * @property integer $option_value_id | 10 | * @property integer $option_value_id |
11 | * @property string $option_key | 11 | * @property string $option_key |
12 | * @property string $option_value_text | 12 | * @property string $option_value_text |
13 | - * @property integer $option_lang_id | 13 | + * @property integer $option_language_id |
14 | * @property integer $option_value_parent | 14 | * @property integer $option_value_parent |
15 | * @property integer $option_user | 15 | * @property integer $option_user |
16 | * | 16 | * |
@@ -33,7 +33,7 @@ class OptionValues extends \yii\db\ActiveRecord | @@ -33,7 +33,7 @@ class OptionValues extends \yii\db\ActiveRecord | ||
33 | { | 33 | { |
34 | return [ | 34 | return [ |
35 | [['option_key', 'option_value_text'], 'required'], | 35 | [['option_key', 'option_value_text'], 'required'], |
36 | - [['option_lang_id', 'option_value_parent', 'option_user'], 'integer'], | 36 | + [['option_language_id', 'option_value_parent', 'option_user'], 'integer'], |
37 | [['option_key'], 'string', 'max' => 200] | 37 | [['option_key'], 'string', 'max' => 200] |
38 | ]; | 38 | ]; |
39 | } | 39 | } |
@@ -47,7 +47,7 @@ class OptionValues extends \yii\db\ActiveRecord | @@ -47,7 +47,7 @@ class OptionValues extends \yii\db\ActiveRecord | ||
47 | 'option_value_id' => Yii::t('app', 'Option Value ID'), | 47 | 'option_value_id' => Yii::t('app', 'Option Value ID'), |
48 | 'option_key' => Yii::t('app', 'Option Key'), | 48 | 'option_key' => Yii::t('app', 'Option Key'), |
49 | 'option_value_text' => Yii::t('app', 'Option Value Text'), | 49 | 'option_value_text' => Yii::t('app', 'Option Value Text'), |
50 | - 'option_lang_id' => Yii::t('app', 'Option Lang ID'), | 50 | + 'option_language_id' => Yii::t('app', 'Option Lang ID'), |
51 | 'option_value_parent' => Yii::t('app', 'Option Value Parent'), | 51 | 'option_value_parent' => Yii::t('app', 'Option Value Parent'), |
52 | 'option_user' => Yii::t('app', 'Option User'), | 52 | 'option_user' => Yii::t('app', 'Option User'), |
53 | ]; | 53 | ]; |
@@ -58,7 +58,7 @@ class OptionValues extends \yii\db\ActiveRecord | @@ -58,7 +58,7 @@ class OptionValues extends \yii\db\ActiveRecord | ||
58 | */ | 58 | */ |
59 | public function getOptionLang() | 59 | public function getOptionLang() |
60 | { | 60 | { |
61 | - return $this->hasOne(Language::className(), ['language_id' => 'option_lang_id']); | 61 | + return $this->hasOne(Language::className(), ['language_id' => 'option_language_id']); |
62 | } | 62 | } |
63 | public function getLanguages() { | 63 | public function getLanguages() { |
64 | return (new LanguageLang())->find()->orderBy('language_id ASC')->asArray()->all(); | 64 | return (new LanguageLang())->find()->orderBy('language_id ASC')->asArray()->all(); |
frontend/models/OptionValuesSearch.php
@@ -18,7 +18,7 @@ class OptionValuesSearch extends OptionValues | @@ -18,7 +18,7 @@ class OptionValuesSearch extends OptionValues | ||
18 | public function rules() | 18 | public function rules() |
19 | { | 19 | { |
20 | return [ | 20 | return [ |
21 | - [['option_value_id', 'option_lang_id', 'option_value_parent', 'option_user'], 'integer'], | 21 | + [['option_value_id', 'option_language_id', 'option_value_parent', 'option_user'], 'integer'], |
22 | [['option_key', 'option_value_text'], 'safe'], | 22 | [['option_key', 'option_value_text'], 'safe'], |
23 | ]; | 23 | ]; |
24 | } | 24 | } |
@@ -57,7 +57,7 @@ class OptionValuesSearch extends OptionValues | @@ -57,7 +57,7 @@ class OptionValuesSearch extends OptionValues | ||
57 | 57 | ||
58 | $query->andFilterWhere([ | 58 | $query->andFilterWhere([ |
59 | 'option_value_id' => $this->option_value_id, | 59 | 'option_value_id' => $this->option_value_id, |
60 | - 'option_lang_id' => $this->option_lang_id, | 60 | + 'option_language_id' => $this->option_language_id, |
61 | 'option_value_parent' => $this->option_value_parent, | 61 | 'option_value_parent' => $this->option_value_parent, |
62 | 'option_user' => $this->option_user, | 62 | 'option_user' => $this->option_user, |
63 | ]); | 63 | ]); |
frontend/views/option-values/_form.php
@@ -17,7 +17,7 @@ use yii\widgets\ActiveForm; | @@ -17,7 +17,7 @@ use yii\widgets\ActiveForm; | ||
17 | <div class="optionvalues-option_value_text-active"> | 17 | <div class="optionvalues-option_value_text-active"> |
18 | <?= $form->field($model, 'option_value_text', ['enableClientValidation' => false])->label($model->getAttributeLabel('option_key').' | <span class="glyphicon glyphicon-globe add-langs"></span>')->textInput() ?> | 18 | <?= $form->field($model, 'option_value_text', ['enableClientValidation' => false])->label($model->getAttributeLabel('option_key').' | <span class="glyphicon glyphicon-globe add-langs"></span>')->textInput() ?> |
19 | 19 | ||
20 | - <?= $form->field($model, 'option_lang_id')->dropDownList($model->getDropDownArray()) ?> | 20 | + <?= $form->field($model, 'option_language_id')->dropDownList($model->getDropDownArray()) ?> |
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | <?= $form->field($model, 'option_value_parent')->dropDownList($model->getUserOptionsArray()) ?> | 23 | <?= $form->field($model, 'option_value_parent')->dropDownList($model->getUserOptionsArray()) ?> |
@@ -46,7 +46,7 @@ use yii\widgets\ActiveForm; | @@ -46,7 +46,7 @@ use yii\widgets\ActiveForm; | ||
46 | $(document).on('click', '.add-langs', function() { | 46 | $(document).on('click', '.add-langs', function() { |
47 | var group = $(this).parent().attr('for'); | 47 | var group = $(this).parent().attr('for'); |
48 | $(this).parent().parent().appendTo('.reserved_inputs'); | 48 | $(this).parent().parent().appendTo('.reserved_inputs'); |
49 | - $('.field-optionvalues-option_lang_id').appendTo('.reserved_inputs'); | 49 | + $('.field-optionvalues-option_language_id').appendTo('.reserved_inputs'); |
50 | $('.'+group+'-lang').appendTo('.'+group+'-active'); | 50 | $('.'+group+'-lang').appendTo('.'+group+'-active'); |
51 | }); | 51 | }); |
52 | $(document).on('click', '.remove-langs', function() { | 52 | $(document).on('click', '.remove-langs', function() { |
@@ -54,7 +54,7 @@ use yii\widgets\ActiveForm; | @@ -54,7 +54,7 @@ use yii\widgets\ActiveForm; | ||
54 | $(this).parent().parent().appendTo('.reserved_inputs'); | 54 | $(this).parent().parent().appendTo('.reserved_inputs'); |
55 | console.log('field-'+group); | 55 | console.log('field-'+group); |
56 | $('.reserved_inputs .field-'+group).appendTo('.'+group+'-active'); | 56 | $('.reserved_inputs .field-'+group).appendTo('.'+group+'-active'); |
57 | - $('.field-optionvalues-option_lang_id').appendTo('.'+group+'-active'); | 57 | + $('.field-optionvalues-option_language_id').appendTo('.'+group+'-active'); |
58 | }); | 58 | }); |
59 | }); | 59 | }); |
60 | </script> | 60 | </script> |
61 | \ No newline at end of file | 61 | \ No newline at end of file |
frontend/views/option-values/_search.php
@@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | @@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | ||
21 | 21 | ||
22 | <?= $form->field($model, 'option_value_text') ?> | 22 | <?= $form->field($model, 'option_value_text') ?> |
23 | 23 | ||
24 | - <?= $form->field($model, 'option_lang_id') ?> | 24 | + <?= $form->field($model, 'option_language_id') ?> |
25 | 25 | ||
26 | <?= $form->field($model, 'option_value_parent') ?> | 26 | <?= $form->field($model, 'option_value_parent') ?> |
27 | 27 |
frontend/views/option-values/index.php
@@ -28,7 +28,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -28,7 +28,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
28 | 'option_value_id', | 28 | 'option_value_id', |
29 | 'option_key', | 29 | 'option_key', |
30 | 'option_value_text:ntext', | 30 | 'option_value_text:ntext', |
31 | - 'option_lang_id', | 31 | + 'option_language_id', |
32 | 'option_value_parent', | 32 | 'option_value_parent', |
33 | // 'option_user', | 33 | // 'option_user', |
34 | 34 |
frontend/views/option-values/view.php
@@ -31,7 +31,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -31,7 +31,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
31 | 'option_value_id', | 31 | 'option_value_id', |
32 | 'option_key', | 32 | 'option_key', |
33 | 'option_value_text:ntext', | 33 | 'option_value_text:ntext', |
34 | - 'option_lang_id', | 34 | + 'option_language_id', |
35 | 'option_value_parent', | 35 | 'option_value_parent', |
36 | 'option_user', | 36 | 'option_user', |
37 | ], | 37 | ], |
frontend/views/option/_form_edit.php
@@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | @@ -21,7 +21,7 @@ use yii\widgets\ActiveForm; | ||
21 | <?php if($row->hasErrors()) { ?><div class="help-block"><?php echo $modellang[$id][0]->getFirstError('value');?></div> <?php } ?> | 21 | <?php if($row->hasErrors()) { ?><div class="help-block"><?php echo $modellang[$id][0]->getFirstError('value');?></div> <?php } ?> |
22 | <?php | 22 | <?php |
23 | if($row->translate) { | 23 | if($row->translate) { |
24 | - foreach($row->getLangs() as $lang_id => $lang) { | 24 | + foreach($row->getLangs() as $language_id => $lang) { |
25 | ?> | 25 | ?> |
26 | <div class="form-group"> | 26 | <div class="form-group"> |
27 | <div class="col-xs-1"><?=$lang['lang_code']?></div> | 27 | <div class="col-xs-1"><?=$lang['lang_code']?></div> |
frontend/web/js/option.js
@@ -72,7 +72,7 @@ $(function() { | @@ -72,7 +72,7 @@ $(function() { | ||
72 | var path = form[id].handler; | 72 | var path = form[id].handler; |
73 | var view = form[id].view; | 73 | var view = form[id].view; |
74 | var model = form[id].model; | 74 | var model = form[id].model; |
75 | - $.get(path, { lang_id: lang, widget_id: id, ajaxView: view, model: model }, function(data) { | 75 | + $.get(path, { language_id: lang, widget_id: id, ajaxView: view, model: model }, function(data) { |
76 | $('#'+id+'-tabs li').removeClass('active'); | 76 | $('#'+id+'-tabs li').removeClass('active'); |
77 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); | 77 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); |
78 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); | 78 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); |
@@ -92,7 +92,7 @@ $(function() { | @@ -92,7 +92,7 @@ $(function() { | ||
92 | var flag = $(this).find('span').first().clone(); | 92 | var flag = $(this).find('span').first().clone(); |
93 | var el = $(this); | 93 | var el = $(this); |
94 | var id = $(this).attr('href').substr(1); | 94 | var id = $(this).attr('href').substr(1); |
95 | - $.get(form[id], { lang_id: lang, widget_id: id }, function(data) { | 95 | + $.get(form[id], { language_id: lang, widget_id: id }, function(data) { |
96 | $('#'+id+'-tabs li').removeClass('active'); | 96 | $('#'+id+'-tabs li').removeClass('active'); |
97 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); | 97 | $('#'+id+'-tabs').append('<li role="lang_inputs" class="active" data-lang="'+lang+'"><a href="#'+id+'-'+lang+'" aria-controls="'+id+'-'+lang+'" role="tab" data-toggle="tab">'+$('<p>').append($(flag)).html()+'</a></li>'); |
98 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); | 98 | $('#tab-content-'+id+' .tab-pane.active').removeClass('active'); |