diff --git a/backend/assets/AnalyticsAsset.php b/backend/assets/AnalyticsAsset.php
old mode 100644
new mode 100755
index 0f0e5b5..0f0e5b5
--- a/backend/assets/AnalyticsAsset.php
+++ b/backend/assets/AnalyticsAsset.php
diff --git a/backend/assets/AppAsset.php b/backend/assets/AppAsset.php
old mode 100644
new mode 100755
index 940c0af..940c0af
--- a/backend/assets/AppAsset.php
+++ b/backend/assets/AppAsset.php
diff --git a/backend/codeception.yml b/backend/codeception.yml
old mode 100644
new mode 100755
index 703b518..703b518
--- a/backend/codeception.yml
+++ b/backend/codeception.yml
diff --git a/backend/config/.gitignore b/backend/config/.gitignore
old mode 100644
new mode 100755
index 42799dd..42799dd
--- a/backend/config/.gitignore
+++ b/backend/config/.gitignore
diff --git a/backend/config/bootstrap.php b/backend/config/bootstrap.php
old mode 100644
new mode 100755
index b3d9bbc..b3d9bbc
--- a/backend/config/bootstrap.php
+++ b/backend/config/bootstrap.php
diff --git a/backend/config/main.php b/backend/config/main.php
old mode 100644
new mode 100755
index 2f069e2..2f069e2
--- a/backend/config/main.php
+++ b/backend/config/main.php
diff --git a/backend/config/params.php b/backend/config/params.php
old mode 100644
new mode 100755
index 7f754b9..7f754b9
--- a/backend/config/params.php
+++ b/backend/config/params.php
diff --git a/backend/config/test.php b/backend/config/test.php
old mode 100644
new mode 100755
index 09536cf..09536cf
--- a/backend/config/test.php
+++ b/backend/config/test.php
diff --git a/backend/controllers/AjaxController.php b/backend/controllers/AjaxController.php
old mode 100644
new mode 100755
index 0c70726..0c70726
--- a/backend/controllers/AjaxController.php
+++ b/backend/controllers/AjaxController.php
diff --git a/backend/controllers/ObjectkbController.php b/backend/controllers/ObjectkbController.php
new file mode 100644
index 0000000..11d6489
--- /dev/null
+++ b/backend/controllers/ObjectkbController.php
@@ -0,0 +1,157 @@
+allSliders = Slider::find()->all();
+
+ }
+ /**
+ * @inheritdoc
+ */
+ public function behaviors()
+ {
+ return [
+ 'verbs' => [
+ 'class' => VerbFilter::className(),
+ 'actions' => [
+ 'delete' => ['POST'],
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * Lists all Objectkb models.
+ * @return mixed
+ */
+ public function actionIndex()
+ {
+ $searchModel = new ObjectkbSearch();
+ $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
+
+ return $this->render('index', [
+ 'searchModel' => $searchModel,
+ 'dataProvider' => $dataProvider,
+ ]);
+ }
+
+ /**
+ * Displays a single Objectkb model.
+ * @param integer $id
+ * @return mixed
+ */
+ public function actionView($id)
+ {
+ return $this->render('view', [
+ 'model' => $this->findModel($id),
+ ]);
+ }
+
+ /**
+ * Creates a new Objectkb model.
+ * If creation is successful, the browser will be redirected to the 'view' page.
+ * @return mixed
+ */
+ public function actionCreate()
+ {
+ $model = new Objectkb();
+ $sliders = $this->allSliders;
+ $model->generateLangs();
+
+ if ($model->load(Yii::$app->request->post()) && $model->save()) {
+ return $this->redirect(
+ [
+ 'view',
+ 'id' => $model->id,
+ ]
+ );
+ } else {
+ return $this->render(
+ 'create',
+ [
+ 'model' => $model,
+ 'modelLangs' => $model->modelLangs,
+ 'sliders' => $sliders,
+ ]
+ );
+ }
+ }
+
+ /**
+ * Updates an existing Objectkb model.
+ * If update is successful, the browser will be redirected to the 'view' page.
+ * @param integer $id
+ * @return mixed
+ */
+ public function actionUpdate($id)
+ {
+ $model = $this->findModel($id);
+ $model->generateLangs();
+
+ if ($model->loadWithLangs(\Yii::$app->request)) {
+ if ($model->saveWithLangs()) {
+ return $this->redirect(
+ [
+ 'view',
+ 'id' => $model->id,
+ ]
+ );
+ }
+ }
+
+ return $this->render('update', [
+ 'model' => $model,
+ 'modelLangs' => $model->modelLangs,
+ 'sliders' => $this->allSliders,
+ ]);
+
+ }
+
+ /**
+ * Deletes an existing Objectkb model.
+ * If deletion is successful, the browser will be redirected to the 'index' page.
+ * @param integer $id
+ * @return mixed
+ */
+ public function actionDelete($id)
+ {
+ $this->findModel($id)->delete();
+
+ return $this->redirect(['index']);
+ }
+
+ /**
+ * Finds the Objectkb model based on its primary key value.
+ * If the model is not found, a 404 HTTP exception will be thrown.
+ * @param integer $id
+ * @return Objectkb the loaded model
+ * @throws NotFoundHttpException if the model cannot be found
+ */
+ protected function findModel($id)
+ {
+ if (($model = Objectkb::findOne($id)) !== null) {
+ return $model;
+ } else {
+ throw new NotFoundHttpException('The requested page does not exist.');
+ }
+ }
+}
diff --git a/backend/controllers/SettingsController.php b/backend/controllers/SettingsController.php
old mode 100644
new mode 100755
index f81bc22..f81bc22
--- a/backend/controllers/SettingsController.php
+++ b/backend/controllers/SettingsController.php
diff --git a/backend/controllers/SiteController.php b/backend/controllers/SiteController.php
old mode 100644
new mode 100755
index 5a51140..5a51140
--- a/backend/controllers/SiteController.php
+++ b/backend/controllers/SiteController.php
diff --git a/backend/controllers/SitemapController.php b/backend/controllers/SitemapController.php
old mode 100644
new mode 100755
index 39e96fe..39e96fe
--- a/backend/controllers/SitemapController.php
+++ b/backend/controllers/SitemapController.php
diff --git a/backend/controllers/SlideController.php b/backend/controllers/SlideController.php
old mode 100644
new mode 100755
index 34afb72..34afb72
--- a/backend/controllers/SlideController.php
+++ b/backend/controllers/SlideController.php
diff --git a/backend/controllers/SliderController.php b/backend/controllers/SliderController.php
old mode 100644
new mode 100755
index 8bb43c9..8bb43c9
--- a/backend/controllers/SliderController.php
+++ b/backend/controllers/SliderController.php
diff --git a/backend/models/.gitkeep b/backend/models/.gitkeep
old mode 100644
new mode 100755
index 72e8ffc..72e8ffc
--- a/backend/models/.gitkeep
+++ b/backend/models/.gitkeep
diff --git a/backend/models/Analytics.php b/backend/models/Analytics.php
old mode 100644
new mode 100755
index 1025072..1025072
--- a/backend/models/Analytics.php
+++ b/backend/models/Analytics.php
diff --git a/backend/runtime/.gitignore b/backend/runtime/.gitignore
old mode 100644
new mode 100755
index c96a04f..c96a04f
--- a/backend/runtime/.gitignore
+++ b/backend/runtime/.gitignore
diff --git a/backend/tests/_bootstrap.php b/backend/tests/_bootstrap.php
old mode 100644
new mode 100755
index 83a1f26..83a1f26
--- a/backend/tests/_bootstrap.php
+++ b/backend/tests/_bootstrap.php
diff --git a/backend/tests/_data/.gitignore b/backend/tests/_data/.gitignore
old mode 100644
new mode 100755
index e69de29..e69de29
--- a/backend/tests/_data/.gitignore
+++ b/backend/tests/_data/.gitignore
diff --git a/backend/tests/_data/login_data.php b/backend/tests/_data/login_data.php
old mode 100644
new mode 100755
index 32aef6e..32aef6e
--- a/backend/tests/_data/login_data.php
+++ b/backend/tests/_data/login_data.php
diff --git a/backend/tests/_output/.gitignore b/backend/tests/_output/.gitignore
old mode 100644
new mode 100755
index d6b7ef3..d6b7ef3
--- a/backend/tests/_output/.gitignore
+++ b/backend/tests/_output/.gitignore
diff --git a/backend/tests/_support/.gitignore b/backend/tests/_support/.gitignore
old mode 100644
new mode 100755
index 36e264c..36e264c
--- a/backend/tests/_support/.gitignore
+++ b/backend/tests/_support/.gitignore
diff --git a/backend/tests/_support/FunctionalTester.php b/backend/tests/_support/FunctionalTester.php
old mode 100644
new mode 100755
index 80a79ed..80a79ed
--- a/backend/tests/_support/FunctionalTester.php
+++ b/backend/tests/_support/FunctionalTester.php
diff --git a/backend/tests/_support/UnitTester.php b/backend/tests/_support/UnitTester.php
old mode 100644
new mode 100755
index 88db6ae..88db6ae
--- a/backend/tests/_support/UnitTester.php
+++ b/backend/tests/_support/UnitTester.php
diff --git a/backend/tests/functional.suite.yml b/backend/tests/functional.suite.yml
old mode 100644
new mode 100755
index acd31d8..acd31d8
--- a/backend/tests/functional.suite.yml
+++ b/backend/tests/functional.suite.yml
diff --git a/backend/tests/functional/LoginCest.php b/backend/tests/functional/LoginCest.php
old mode 100644
new mode 100755
index 604551a..604551a
--- a/backend/tests/functional/LoginCest.php
+++ b/backend/tests/functional/LoginCest.php
diff --git a/backend/tests/functional/_bootstrap.php b/backend/tests/functional/_bootstrap.php
old mode 100644
new mode 100755
index 30ed54b..30ed54b
--- a/backend/tests/functional/_bootstrap.php
+++ b/backend/tests/functional/_bootstrap.php
diff --git a/backend/tests/unit.suite.yml b/backend/tests/unit.suite.yml
old mode 100644
new mode 100755
index 1ba1eb4..1ba1eb4
--- a/backend/tests/unit.suite.yml
+++ b/backend/tests/unit.suite.yml
diff --git a/backend/tests/unit/_bootstrap.php b/backend/tests/unit/_bootstrap.php
old mode 100644
new mode 100755
index e432ce5..e432ce5
--- a/backend/tests/unit/_bootstrap.php
+++ b/backend/tests/unit/_bootstrap.php
diff --git a/backend/views/ajax/_table.php b/backend/views/ajax/_table.php
old mode 100644
new mode 100755
index cff995e..cff995e
--- a/backend/views/ajax/_table.php
+++ b/backend/views/ajax/_table.php
diff --git a/backend/views/layouts/main.php b/backend/views/layouts/main.php
old mode 100644
new mode 100755
index d05a9bc..d05a9bc
--- a/backend/views/layouts/main.php
+++ b/backend/views/layouts/main.php
diff --git a/backend/views/layouts/menu_items.php b/backend/views/layouts/menu_items.php
old mode 100644
new mode 100755
index 4c8c87f..59d585e
--- a/backend/views/layouts/menu_items.php
+++ b/backend/views/layouts/menu_items.php
@@ -83,5 +83,10 @@
'url' => ['/slider/index'],
'icon' => 'bolt',
],
+ [
+ 'label' => \Yii::t('core', 'Наши Объекты'),
+ 'url' => ['/objectkb/index'],
+ 'icon' => 'bolt',
+ ],
]
);
\ No newline at end of file
diff --git a/backend/views/objectkb/_form.php b/backend/views/objectkb/_form.php
new file mode 100644
index 0000000..68e5737
--- /dev/null
+++ b/backend/views/objectkb/_form.php
@@ -0,0 +1,81 @@
+
+
+
diff --git a/backend/views/objectkb/_form_language.php b/backend/views/objectkb/_form_language.php
new file mode 100755
index 0000000..e1eae99
--- /dev/null
+++ b/backend/views/objectkb/_form_language.php
@@ -0,0 +1,36 @@
+field($model_lang, '[' . $language->id . ']aliasValue')
+ ->textInput();
+
+ echo $form->field($model_lang, '[' . $language->id . ']upper_text')
+ ->textInput([ 'maxlength' => true ]);
+
+ echo $form->field($model_lang, '[' . $language->id . ']about_object_text')
+ ->textInput([ 'maxlength' => true ]);
+
+ echo $form->field($model_lang, '[' . $language->id . ']object_name')
+ ->textInput([ 'maxlength' => true ]);
+
+ echo $form->field($model_lang, '[' . $language->id . ']meta_title')
+ ->textInput([ 'maxlength' => true ]);
+
+ echo $form->field($model_lang, '[' . $language->id . ']meta_description')
+ ->textInput([ 'maxlength' => true ]);
+
+ echo $form->field($model_lang, '[' . $language->id . ']h1')
+ ->textInput([ 'maxlength' => true ]);
+
+
+?>
\ No newline at end of file
diff --git a/backend/views/objectkb/_search.php b/backend/views/objectkb/_search.php
new file mode 100644
index 0000000..988ab09
--- /dev/null
+++ b/backend/views/objectkb/_search.php
@@ -0,0 +1,35 @@
+
+
+
+
+ ['index'],
+ 'method' => 'get',
+ ]); ?>
+
+ = $form->field($model, 'id') ?>
+
+ = $form->field($model, 'slider_id') ?>
+
+ = $form->field($model, 'status')->checkbox() ?>
+
+ = $form->field($model, 'sort') ?>
+
+ = $form->field($model, 'image_mini_id') ?>
+
+
+ = Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
+ = Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
+
+
+
+
+
diff --git a/backend/views/objectkb/create.php b/backend/views/objectkb/create.php
new file mode 100644
index 0000000..c16570b
--- /dev/null
+++ b/backend/views/objectkb/create.php
@@ -0,0 +1,25 @@
+title = Yii::t('app', 'Create Objectkb');
+$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Objectkbs'), 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+ = $this->render('_form', [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ 'sliders' => $sliders,
+ ]) ?>
+
+
diff --git a/backend/views/objectkb/index.php b/backend/views/objectkb/index.php
new file mode 100644
index 0000000..6225d77
--- /dev/null
+++ b/backend/views/objectkb/index.php
@@ -0,0 +1,36 @@
+title = Yii::t('app', 'Objectkbs');
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+ render('_search', ['model' => $searchModel]); ?>
+
+
+ = Html::a(Yii::t('app', 'Create Objectkb'), ['create'], ['class' => 'btn btn-success']) ?>
+
+ = GridView::widget([
+ 'dataProvider' => $dataProvider,
+ 'filterModel' => $searchModel,
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+
+ 'id',
+ 'slider_id',
+ 'status:boolean',
+ 'sort',
+ 'image_mini_id',
+
+ ['class' => 'yii\grid\ActionColumn'],
+ ],
+ ]); ?>
+
diff --git a/backend/views/objectkb/update.php b/backend/views/objectkb/update.php
new file mode 100644
index 0000000..37a781c
--- /dev/null
+++ b/backend/views/objectkb/update.php
@@ -0,0 +1,29 @@
+title = Yii::t('app', 'Update {modelClass}: ', [
+ 'modelClass' => 'Objectkb',
+]) . $model->id;
+$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Objectkbs'), 'url' => ['index']];
+$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
+$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
+?>
+
+
+
= Html::encode($this->title) ?>
+
+ = $this->render('_form', [
+ 'model' => $model,
+ 'modelLangs' => $modelLangs,
+ 'sliders' => $sliders,
+ ]) ?>
+
+
diff --git a/backend/views/objectkb/view.php b/backend/views/objectkb/view.php
new file mode 100644
index 0000000..991d9e6
--- /dev/null
+++ b/backend/views/objectkb/view.php
@@ -0,0 +1,39 @@
+title = $model->id;
+$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Objectkbs'), 'url' => ['index']];
+$this->params['breadcrumbs'][] = $this->title;
+?>
+
+
+
= Html::encode($this->title) ?>
+
+
+ = Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
+ = Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
+ 'class' => 'btn btn-danger',
+ 'data' => [
+ 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
+ 'method' => 'post',
+ ],
+ ]) ?>
+
+
+ = DetailView::widget([
+ 'model' => $model,
+ 'attributes' => [
+ 'id',
+ 'slider_id',
+ 'status:boolean',
+ 'sort',
+ 'image_mini_id',
+ ],
+ ]) ?>
+
+
diff --git a/backend/views/settings/_codes_tab.php b/backend/views/settings/_codes_tab.php
old mode 100644
new mode 100755
index a43789a..a43789a
--- a/backend/views/settings/_codes_tab.php
+++ b/backend/views/settings/_codes_tab.php
diff --git a/backend/views/settings/_contact_tab.php b/backend/views/settings/_contact_tab.php
old mode 100644
new mode 100755
index d20c83b..d20c83b
--- a/backend/views/settings/_contact_tab.php
+++ b/backend/views/settings/_contact_tab.php
diff --git a/backend/views/settings/_mail_tab.php b/backend/views/settings/_mail_tab.php
old mode 100644
new mode 100755
index fbb1287..fbb1287
--- a/backend/views/settings/_mail_tab.php
+++ b/backend/views/settings/_mail_tab.php
diff --git a/backend/views/settings/_main_tab.php b/backend/views/settings/_main_tab.php
old mode 100644
new mode 100755
index 186e71e..186e71e
--- a/backend/views/settings/_main_tab.php
+++ b/backend/views/settings/_main_tab.php
diff --git a/backend/views/settings/_social_tab.php b/backend/views/settings/_social_tab.php
old mode 100644
new mode 100755
index 80c161c..80c161c
--- a/backend/views/settings/_social_tab.php
+++ b/backend/views/settings/_social_tab.php
diff --git a/backend/views/settings/codes.php b/backend/views/settings/codes.php
old mode 100644
new mode 100755
index fbc8577..fbc8577
--- a/backend/views/settings/codes.php
+++ b/backend/views/settings/codes.php
diff --git a/backend/views/settings/robots.php b/backend/views/settings/robots.php
old mode 100644
new mode 100755
index b832f85..b832f85
--- a/backend/views/settings/robots.php
+++ b/backend/views/settings/robots.php
diff --git a/backend/views/settings/settings.php b/backend/views/settings/settings.php
old mode 100644
new mode 100755
index 09f9591..09f9591
--- a/backend/views/settings/settings.php
+++ b/backend/views/settings/settings.php
diff --git a/backend/views/site/error.php b/backend/views/site/error.php
old mode 100644
new mode 100755
index 877471a..877471a
--- a/backend/views/site/error.php
+++ b/backend/views/site/error.php
diff --git a/backend/views/site/index.php b/backend/views/site/index.php
old mode 100644
new mode 100755
index 78eaa57..78eaa57
--- a/backend/views/site/index.php
+++ b/backend/views/site/index.php
diff --git a/backend/views/site/instruction.php b/backend/views/site/instruction.php
old mode 100644
new mode 100755
index cf0473d..cf0473d
--- a/backend/views/site/instruction.php
+++ b/backend/views/site/instruction.php
diff --git a/backend/views/site/login.php b/backend/views/site/login.php
old mode 100644
new mode 100755
index e7b4289..e7b4289
--- a/backend/views/site/login.php
+++ b/backend/views/site/login.php
diff --git a/backend/views/sitemap/index.php b/backend/views/sitemap/index.php
old mode 100644
new mode 100755
index ace4e26..ace4e26
--- a/backend/views/sitemap/index.php
+++ b/backend/views/sitemap/index.php
diff --git a/backend/views/sitemap/update.php b/backend/views/sitemap/update.php
old mode 100644
new mode 100755
index 7613798..7613798
--- a/backend/views/sitemap/update.php
+++ b/backend/views/sitemap/update.php
diff --git a/backend/views/slider/_form.php b/backend/views/slider/_form.php
index 2598ec8..949f5b8 100755
--- a/backend/views/slider/_form.php
+++ b/backend/views/slider/_form.php
@@ -1,6 +1,6 @@
checkbox([
'class' => 'flat',
]) ?>
-
-
+
+ = $form->field($model, 'slider_name')->textInput() ?>
+
+
+
= Html::submitButton(
$model->isNewRecord ? Yii::t('core', 'Create') : Yii::t('core', 'Update'),
[ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]
diff --git a/backend/views/slider/index.php b/backend/views/slider/index.php
index 2efc8a6..0b5ff11 100755
--- a/backend/views/slider/index.php
+++ b/backend/views/slider/index.php
@@ -1,6 +1,6 @@
[
[ 'class' => 'yii\grid\SerialColumn' ],
- 'id',
+ 'id:integer',
+ 'slider_name:text',
'status:boolean',
[
'attribute' => 'sort',
diff --git a/backend/web/.gitignore b/backend/web/.gitignore
old mode 100644
new mode 100755
index 25c74e6..25c74e6
--- a/backend/web/.gitignore
+++ b/backend/web/.gitignore
diff --git a/backend/web/css/custom.css b/backend/web/css/custom.css
old mode 100644
new mode 100755
index 7b534d7..7b534d7
--- a/backend/web/css/custom.css
+++ b/backend/web/css/custom.css
diff --git a/backend/web/css/site.css b/backend/web/css/site.css
old mode 100644
new mode 100755
index 2f085b3..2f085b3
--- a/backend/web/css/site.css
+++ b/backend/web/css/site.css
diff --git a/backend/web/favicon.ico b/backend/web/favicon.ico
old mode 100644
new mode 100755
index 580ed73..580ed73
Binary files a/backend/web/favicon.ico and b/backend/web/favicon.ico differ
diff --git a/backend/web/js/analytics.js b/backend/web/js/analytics.js
old mode 100644
new mode 100755
index b28fe75..b28fe75
--- a/backend/web/js/analytics.js
+++ b/backend/web/js/analytics.js
diff --git a/backend/web/js/custom.js b/backend/web/js/custom.js
old mode 100644
new mode 100755
index 1c6f825..1c6f825
--- a/backend/web/js/custom.js
+++ b/backend/web/js/custom.js
diff --git a/backend/web/js/jquery.animateNumber.js b/backend/web/js/jquery.animateNumber.js
old mode 100644
new mode 100755
index 7ea6e6e..7ea6e6e
--- a/backend/web/js/jquery.animateNumber.js
+++ b/backend/web/js/jquery.animateNumber.js
diff --git a/backend/web/robots.txt b/backend/web/robots.txt
old mode 100644
new mode 100755
index 1f53798..1f53798
--- a/backend/web/robots.txt
+++ b/backend/web/robots.txt
diff --git a/common/models/LoginForm.php b/common/models/LoginForm.php
old mode 100644
new mode 100755
index da6de13..da6de13
--- a/common/models/LoginForm.php
+++ b/common/models/LoginForm.php
diff --git a/common/models/Mail.php b/common/models/Mail.php
old mode 100644
new mode 100755
index d98ba7d..d98ba7d
--- a/common/models/Mail.php
+++ b/common/models/Mail.php
diff --git a/common/models/Objectkb.php b/common/models/Objectkb.php
new file mode 100755
index 0000000..e3914dc
--- /dev/null
+++ b/common/models/Objectkb.php
@@ -0,0 +1,109 @@
+ [
+ 'class' => LanguageBehavior::className(),
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'slider_id',
+ 'image_mini_id',
+ ],
+ 'required',
+ ],
+ [
+ [
+ 'slider_id',
+ 'sort',
+ ],
+ 'integer',
+ ],
+ [
+ [ 'status' ],
+ 'boolean',
+ ],
+ [
+ [ 'slider_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Slider::className(),
+ 'targetAttribute' => [ 'slider_id' => 'id' ],
+ ],
+ [
+ [ 'image_mini_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Image::className(),
+ 'targetAttribute' => [ 'image_mini_id' => 'id' ],
+ ],
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => Yii::t('core', 'ID'),
+ 'slider_id' => Yii::t('core', 'Slider ID'),
+ 'status' => Yii::t('core', 'Status'),
+ 'sort' => Yii::t('core', 'Sort'),
+ 'image_mini_id' => Yii::t('core', 'Image Mini'),
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getImage()
+ {
+ return $this->hasOne(Image::className(), [ 'id' => 'image_mini_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getSlider()
+ {
+ return $this->hasOne(Slider::className(), [ 'id' => 'slider_id' ])
+ ->inverseOf('slides');
+ }
+ }
\ No newline at end of file
diff --git a/common/models/ObjectkbLang.php b/common/models/ObjectkbLang.php
new file mode 100755
index 0000000..b9f0b3e
--- /dev/null
+++ b/common/models/ObjectkbLang.php
@@ -0,0 +1,163 @@
+ [
+ 'class' => SlugBehavior::className(),
+ 'action' => 'objectkb/view',
+ 'params' => [
+ 'id' => 'object_id',
+ ],
+ 'fields' => [
+ 'object_name' => 'Object name',
+ 'object.id' => 'Object id',
+ 'upper_text' => 'Object upper text',
+ 'about_object_text' => 'About Object text',
+ 'object.lang.object_name' => 'some stuf',
+ ],
+ ],
+ ];
+ }
+
+ /**
+ * @return array
+ */
+ public function rules()
+ {
+ return [
+ [
+ [
+ 'object_id',
+ 'language_id',
+ 'upper_text',
+ 'about_object_text',
+ 'object_name',
+ 'meta_title',
+ 'meta_description',
+ 'h1',
+ ],
+ 'required',
+ ],
+ [
+ [
+ 'object_id',
+ 'language_id',
+ ],
+ 'integer',
+ ],
+ [
+ [
+ 'aliasValue',
+ 'upper_text',
+ 'about_object_text',
+ 'object_name',
+ 'meta_title',
+ 'meta_description',
+ 'h1',
+ ],
+ 'string',
+ ],
+ [
+ [ 'object_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Objectkb::className(),
+ 'targetAttribute' => [ 'object_id' => 'id' ],
+ ],
+ [
+ [ 'language_id' ],
+ 'exist',
+ 'skipOnError' => true,
+ 'targetClass' => Language::className(),
+ 'targetAttribute' => [ 'language_id' => 'id' ],
+ ],
+// [
+// [ 'alias_id' ],
+// 'exist',
+// 'skipOnError' => true,
+// 'targetClass' => Alias::className(),
+// 'targetAttribute' => [ 'alias_id' => 'id' ],
+// ],
+
+ ];
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'object_id' => Yii::t('core', 'Object ID'),
+ 'language_id' => Yii::t('core', 'Language ID'),
+ 'alias_id' => Yii::t('core', 'alias ID'),
+ 'upper_text' => Yii::t('core', 'Upper Text'),
+ 'about_object_text' => Yii::t('core', 'About object text'),
+ 'object_name' => Yii::t('core', 'Object name'),
+ 'meta_title' => Yii::t('core', 'Meta Title'),
+ 'meta_description' => Yii::t('core', 'Meta Description'),
+ 'h1' => Yii::t('core', 'H1 tag'),
+ ];
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getObject()
+ {
+ return $this->hasOne(Objectkb::className(), [ 'id' => 'object_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getLanguage()
+ {
+ return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]);
+ }
+
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getAlias()
+ {
+ return $this->hasOne(Alias::className(), [ 'id' => 'alias_id' ]);
+ }
+
+ public static function primaryKey()
+ {
+ return [
+ 'object_id',
+ 'language_id',
+ ];
+ }
+
+ }
\ No newline at end of file
diff --git a/common/models/ObjectkbSearch.php b/common/models/ObjectkbSearch.php
new file mode 100644
index 0000000..bac2bde
--- /dev/null
+++ b/common/models/ObjectkbSearch.php
@@ -0,0 +1,76 @@
+ $query,
+ ]);
+
+ $this->load($params);
+
+ if (!$this->validate()) {
+ // uncomment the following line if you do not want to return any records when validation fails
+ // $query->where('0=1');
+ return $dataProvider;
+ }
+
+ // grid filtering conditions
+ $query->andFilterWhere([
+ 'id' => $this->id,
+ 'slider_id' => $this->slider_id,
+ 'status' => $this->status,
+ 'sort' => $this->sort,
+ 'image_mini_id' => $this->image_mini_id,
+ ]);
+
+ return $dataProvider;
+ }
+}
diff --git a/common/models/Settings.php b/common/models/Settings.php
old mode 100644
new mode 100755
index 5ae8905..5ae8905
--- a/common/models/Settings.php
+++ b/common/models/Settings.php
diff --git a/common/models/SitemapDynamic.php b/common/models/SitemapDynamic.php
old mode 100644
new mode 100755
index 7d01f94..7d01f94
--- a/common/models/SitemapDynamic.php
+++ b/common/models/SitemapDynamic.php
diff --git a/common/models/SitemapStatic.php b/common/models/SitemapStatic.php
old mode 100644
new mode 100755
index 24b3be0..24b3be0
--- a/common/models/SitemapStatic.php
+++ b/common/models/SitemapStatic.php
diff --git a/common/models/Slider.php b/common/models/Slider.php
index 24fa872..561fa94 100755
--- a/common/models/Slider.php
+++ b/common/models/Slider.php
@@ -8,6 +8,7 @@
/**
* This is the model class for table "slider".
*
+ * @property string $slider_name
* @property integer $id
* @property boolean $status
* @property integer $sort
@@ -33,6 +34,15 @@
[ 'sort' ],
'integer',
],
+ [
+ ['slider_name'],
+ 'required',
+ ],
+ [
+ ['slider_name'],
+ 'string',
+ 'max' => 30,
+ ]
];
}
@@ -46,15 +56,16 @@
'status' => Yii::t('core', 'Status'),
'sort' => Yii::t('core', 'Sort'),
'on_home_page' => Yii::t('app', "Show on home page"),
+ 'slider_name' => Yii::t('app', "Slider Name"),
];
}
-// /**
-// * @return \yii\db\ActiveQuery
-// */
-// public function getSlides()
-// {
-// return $this->hasMany(Slide::className(), [ 'slider_id' => 'id' ])
-// ->inverseOf('slider');
-// }
+ /**
+ * @return \yii\db\ActiveQuery
+ */
+ public function getSlides()
+ {
+ return $this->hasMany(Slide::className(), [ 'slider_id' => 'id' ])
+ ->inverseOf('slider');
+ }
}
diff --git a/common/models/SliderSearch.php b/common/models/SliderSearch.php
index d5ba080..60a1e5a 100755
--- a/common/models/SliderSearch.php
+++ b/common/models/SliderSearch.php
@@ -27,6 +27,10 @@
[ 'status' ],
'boolean',
],
+ [
+ [ 'slider_name' ],
+ 'string',
+ ],
];
}
@@ -73,6 +77,10 @@
'status' => $this->status,
'sort' => $this->sort,
]
+ )->andFilterWhere(
+ [
+ 'like', 'slider_name', $this->slider_name,
+ ]
);
return $dataProvider;
diff --git a/console/migrations/m180125_122042_add_slider_name_column_to_slider_table.php b/console/migrations/m180125_122042_add_slider_name_column_to_slider_table.php
new file mode 100644
index 0000000..351df5f
--- /dev/null
+++ b/console/migrations/m180125_122042_add_slider_name_column_to_slider_table.php
@@ -0,0 +1,25 @@
+addColumn('slider', 'slider_name', $this->string(30));
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function safeDown()
+ {
+ $this->dropColumn('slider', 'slider_name');
+ }
+}
diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php
index 65daf75..1f16362 100644
--- a/frontend/controllers/SiteController.php
+++ b/frontend/controllers/SiteController.php
@@ -52,7 +52,8 @@
{
$slider = Slider::find()->with("slides.lang.image")
- ->where(['on_home_page'=>true])->one();
+ ->where(['on_home_page'=>true])
+ ->one();
return $this->render(
'index',
--
libgit2 0.21.4