From 0829b346c10199fc542f057aa3c2daa5a031f7d7 Mon Sep 17 00:00:00 2001 From: andryeyev Date: Thu, 3 Dec 2015 12:58:30 +0200 Subject: [PATCH] - термины --- backend/controllers/PageController.php | 155 ----------------------------------------------------------------------------------------------------------------------------------------------------------- backend/controllers/TerminController.php | 121 ------------------------------------------------------------------------------------------------------------------------- backend/controllers/Termin_langController.php | 174 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ backend/controllers/_LanguageController.php | 141 --------------------------------------------------------------------------------------------------------------------------------------------- backend/models/_Language.php | 47 ----------------------------------------------- backend/views/page/_form.php | 59 ----------------------------------------------------------- backend/views/page/_search.php | 35 ----------------------------------- backend/views/page/create.php | 21 --------------------- backend/views/page/index.php | 38 -------------------------------------- backend/views/page/update.php | 21 --------------------- backend/views/page/view.php | 40 ---------------------------------------- backend/views/termin/_form.php | 31 ------------------------------- backend/views/termin/_search.php | 37 ------------------------------------- backend/views/termin/create.php | 21 --------------------- backend/views/termin/index.php | 39 --------------------------------------- backend/views/termin/update.php | 21 --------------------- backend/views/termin/view.php | 40 ---------------------------------------- backend/views/termin_lang/_form.php | 23 ----------------------- backend/views/termin_lang/_search.php | 31 ------------------------------- backend/views/termin_lang/create.php | 22 ---------------------- backend/views/termin_lang/index.php | 44 -------------------------------------------- backend/views/termin_lang/update.php | 21 --------------------- backend/views/termin_lang/view.php | 37 ------------------------------------- common/models/Page.php | 176 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- common/models/PageLang.php | 57 --------------------------------------------------------- common/models/ShopCategory.php | 86 -------------------------------------------------------------------------------------- common/models/TerminLang.php | 52 ---------------------------------------------------- common/models/TerminOption.php | 46 ---------------------------------------------- frontend/controllers/PageController.php | 41 ----------------------------------------- frontend/views/page/home.php | 1 - frontend/views/page/page.php | 12 ------------ 31 files changed, 0 insertions(+), 1690 deletions(-) delete mode 100644 backend/controllers/PageController.php delete mode 100644 backend/controllers/TerminController.php delete mode 100644 backend/controllers/Termin_langController.php delete mode 100644 backend/controllers/_LanguageController.php delete mode 100644 backend/models/_Language.php delete mode 100644 backend/views/page/_form.php delete mode 100644 backend/views/page/_search.php delete mode 100644 backend/views/page/create.php delete mode 100644 backend/views/page/index.php delete mode 100644 backend/views/page/update.php delete mode 100644 backend/views/page/view.php delete mode 100644 backend/views/termin/_form.php delete mode 100644 backend/views/termin/_search.php delete mode 100644 backend/views/termin/create.php delete mode 100644 backend/views/termin/index.php delete mode 100644 backend/views/termin/update.php delete mode 100644 backend/views/termin/view.php delete mode 100644 backend/views/termin_lang/_form.php delete mode 100644 backend/views/termin_lang/_search.php delete mode 100644 backend/views/termin_lang/create.php delete mode 100644 backend/views/termin_lang/index.php delete mode 100644 backend/views/termin_lang/update.php delete mode 100644 backend/views/termin_lang/view.php delete mode 100644 common/models/Page.php delete mode 100644 common/models/PageLang.php delete mode 100644 common/models/ShopCategory.php delete mode 100644 common/models/TerminLang.php delete mode 100644 common/models/TerminOption.php delete mode 100644 frontend/controllers/PageController.php delete mode 100644 frontend/views/page/home.php delete mode 100644 frontend/views/page/page.php diff --git a/backend/controllers/PageController.php b/backend/controllers/PageController.php deleted file mode 100644 index caacd9f..0000000 --- a/backend/controllers/PageController.php +++ /dev/null @@ -1,155 +0,0 @@ - [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'delete' => ['post'], - ], - ], - ]; - } - - - /** - * Lists all Page models. - * @return mixed - */ - public function actionIndex() - { - $searchModel = new SearchPage(); - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); - - return $this->render('index', [ - 'searchModel' => $searchModel, - 'dataProvider' => $dataProvider, - ]); - } - - /** - * Displays a single Page model. - * @param integer $id - * @return mixed - */ - public function actionView($id) - { - return $this->render('view', [ - 'model' => $this->findModel($id), - ]); - } - - /** - * Creates a new Page model. - * If creation is successful, the browser will be redirected to the 'view' page. - * @return mixed - */ - public function actionCreate() - { - $model = new Page(); - - if ($model->load(Yii::$app->request->post()) && $model->save()) - { - // сохраняем в таблицу page_lang - $model2 = new PageLang(); - - // передаем переменные - $model2->attributes = $_POST['Page']; - $model2->page_id = $model->page_id; - $model2->lang_id = Yii::$app->lang_id; - - // сохраняем - $model2->save(); - - return $this->redirect(['view', 'id' => $model->page_id]); - } - else - { - return $this->render('create', [ - 'model' => $model, - ]); - } - } - - /** - * Updates an existing Page 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); - - if ($model->load(Yii::$app->request->post()) && $model->save()) - { - // сохраняем в таблицу page_lang - $model2 = new PageLang(); - - // передаем переменные - if ($array = $model->findPageLangField($_POST['Page'])) - { - // сохраняем - $model2->updateAll($array, ['page_id' => $id, 'lang_id' => Yii::$app->lang_id]); - } - - return $this->redirect(['view', 'id' => $model->page_id]); - } - else - { - return $this->render('update', [ - 'model' => $model, - ]); - } - } - - /** - * Deletes an existing Page model. - * If deletion is successful, the browser will be redirected to the 'index' page. - * @param integer $id - * @return mixed - */ - public function actionDelete($id) - { - // удаляем page - $this->findModel($id)->delete(); - - // удаляем page_lang - $model2 = new PageLang(); - $model2->deleteAll('page_id = '.(int)$id); - - return $this->redirect(['index']); - } - - /** - * Finds the Page model based on its primary key value. - * If the model is not found, a 404 HTTP exception will be thrown. - * @param integer $id - * @return Page the loaded model - * @throws NotFoundHttpException if the model cannot be found - */ - protected function findModel($id) - { - if (($model = Page::findOne(['page_id' => $id])) !== null) { - return $model; - } else { - throw new NotFoundHttpException('The requested page does not exist.'); - } - } -} diff --git a/backend/controllers/TerminController.php b/backend/controllers/TerminController.php deleted file mode 100644 index 2611e03..0000000 --- a/backend/controllers/TerminController.php +++ /dev/null @@ -1,121 +0,0 @@ - [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'delete' => ['post'], - ], - ], - ]; - } - - /** - * Lists all Termin models. - * @return mixed - */ - public function actionIndex() - { - $searchModel = new SearchTermin(); - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); - - return $this->render('index', [ - 'searchModel' => $searchModel, - 'dataProvider' => $dataProvider, - ]); - } - - /** - * Displays a single Termin model. - * @param integer $id - * @return mixed - */ - public function actionView($id) - { - return $this->render('view', [ - 'model' => $this->findModel($id), - ]); - } - - /** - * Creates a new Termin model. - * If creation is successful, the browser will be redirected to the 'view' page. - * @return mixed - */ - public function actionCreate() - { - $model = new Termin(); - - if ($model->load(Yii::$app->request->post()) && $model->save()) { - return $this->redirect(['view', 'id' => $model->termin_id]); - } else { - return $this->render('create', [ - 'model' => $model, - ]); - } - } - - /** - * Updates an existing Termin 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); - - if ($model->load(Yii::$app->request->post()) && $model->save()) { - return $this->redirect(['view', 'id' => $model->termin_id]); - } else { - return $this->render('update', [ - 'model' => $model, - ]); - } - } - - /** - * Deletes an existing Termin 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 Termin model based on its primary key value. - * If the model is not found, a 404 HTTP exception will be thrown. - * @param integer $id - * @return Termin the loaded model - * @throws NotFoundHttpException if the model cannot be found - */ - protected function findModel($id) - { - if (($model = Termin::findOne($id)) !== null) { - return $model; - } else { - throw new NotFoundHttpException('The requested page does not exist.'); - } - } -} diff --git a/backend/controllers/Termin_langController.php b/backend/controllers/Termin_langController.php deleted file mode 100644 index cd0e23a..0000000 --- a/backend/controllers/Termin_langController.php +++ /dev/null @@ -1,174 +0,0 @@ -castyl(); - - return [ - 'verbs' => [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'delete' => ['post'], - ], - ], - ]; - } - - public function castyl() - { - $this->lang_id = isset ($_GET['lang_id']) ? $_GET['lang_id'] : 1; - } - - /** - * Lists all TerminLang models. - * @return mixed - */ - public function actionIndex() - { - $searchModel = new TerminLangSearch(); - $searchModel->lang_id = $this->lang_id; - - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); - - return $this->render('index', [ - 'searchModel' => $searchModel, - 'dataProvider' => $dataProvider, - ]); - } - - /** - * Displays a single TerminLang model. - * @param integer $termin_id - * @param integer $lang_id - * @return mixed - */ - public function actionView($termin_id) - { - return $this->render('view', [ - 'model' => $this->findModel($termin_id, $this->lang_id), - ]); - } - - /** - * Creates a new TerminLang model. - * If creation is successful, the browser will be redirected to the 'view' page. - * @return mixed - */ - public function actionCreate() - { - $termin = new Termin(); - $termin_lang = new TerminLang(); - - if ($termin_lang->load(Yii::$app->request->post())) { - - $termin->termin_id = ''; - $termin->save(); - $termin_lang->termin_id = $termin->termin_id; - $termin_lang->save(); - - return $this->redirect(['index']); - } else { - return $this->render('create', [ - 'termin_lang' => $termin_lang, - 'termin' => $termin, - ]); - } - } - - public function actionCreate_parent($termin_id) - { - $termin = new Termin(); - $termin_lang = new TerminLang(); - $termin_option = new TerminOption(); - - if ($termin_lang->load(Yii::$app->request->post())) { - - $termin->termin_id = ''; - $termin->save(); - // var_dump($termin->termin_id);die(); - $termin_lang->termin_id = $termin->termin_id; - $termin_lang->save(); - - $termin_option->termin_id = $termin->termin_id; - $termin_option->termin_pid = $termin_id; - $termin_option->save(); - - - return $this->redirect(['index']); - } else { - return $this->render('create', [ - 'termin_lang' => $termin_lang, - 'termin' => $termin, - ]); - } - } - - /** - * Updates an existing TerminLang model. - * If update is successful, the browser will be redirected to the 'view' page. - * @param integer $termin_id - * @param integer $lang_id - * @return mixed - */ - public function actionUpdate($termin_id) - { - $model = $this->findModel($termin_id, $this->lang_id); - - if ($model->load(Yii::$app->request->post()) && $model->save()) { - return $this->redirect(['view', 'termin_id' => $model->termin_id, 'lang_id' => $model->lang_id]); - } else { - return $this->render('update', [ - 'model' => $model, - ]); - } - } - - /** - * Deletes an existing TerminLang model. - * If deletion is successful, the browser will be redirected to the 'index' page. - * @param integer $termin_id - * @param integer $lang_id - * @return mixed - */ - public function actionDelete($termin_id) - { - $this->findModel($termin_id, $this->lang_id)->delete(); - - return $this->redirect(['index']); - } - - /** - * Finds the TerminLang model based on its primary key value. - * If the model is not found, a 404 HTTP exception will be thrown. - * @param integer $termin_id - * @param integer $lang_id - * @return TerminLang the loaded model - * @throws NotFoundHttpException if the model cannot be found - */ - protected function findModel($termin_id) - { - if (($model = TerminLang::findOne(['termin_id' => $termin_id, 'lang_id' => $this->lang_id])) !== null) { - return $model; - } else { - throw new NotFoundHttpException('The requested page does not exist.'); - } - } -} diff --git a/backend/controllers/_LanguageController.php b/backend/controllers/_LanguageController.php deleted file mode 100644 index 1f7eb4c..0000000 --- a/backend/controllers/_LanguageController.php +++ /dev/null @@ -1,141 +0,0 @@ - [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'delete' => ['post'], - ], - ], - ]; - } - - /** - * Lists all Language models. - * @return mixed - */ - public function init() { - parent::init(); - $this->layoutdata = $this->layoutData(); - } - public function layoutData() { - $searchModel = new LanguageSearch(); - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); - return [ - 'searchModel' => $searchModel, - 'dataProvider' => $dataProvider, - ]; - } - public function actionIndex() - { - return $this->render('index', $this->layoutdata); - } - - /** - * Displays a single Language model. - * @param integer $id - * @return mixed - */ - public function actionView($id) - { - return $this->render('view', [ - 'model' => $this->findModel($id), - 'layoutdata' => $this->layoutdata - ]); - } - - /** - * Creates a new Language model. - * If creation is successful, the browser will be redirected to the 'view' page. - * @return mixed - */ - public function actionCreate() - { - $model[0] = new Language(); - $model[1] = new LanguageLang(); - if ($model[0]->load(Yii::$app->request->post()) && $model[0]->save()) { - $model[1]->language_id = $model[0]->language_id; - if($model[1]->load(Yii::$app->request->post()) && $model[1]->save()) { - return $this->redirect(['view', 'id' => $model[0]->language_id]); - } else { - return $this->render('create', [ - 'model' => $model, - 'layoutdata' => $this->layoutdata - ]); - } - } else { - return $this->render('create', [ - 'model' => $model, - 'layoutdata' => $this->layoutdata - ]); - } - } - - /** - * Updates an existing Language model. - * If update is successful, the browser will be redirected to the 'view' page. - * @param integer $id - * @return mixed - */ - public function actionUpdate($id) - { - $model[0] = $this->findModel($id); - $model[1] = LanguageLang::findOne(['language_id' => $id]); - - if ($model[0]->load(Yii::$app->request->post()) && $model[1]->load(Yii::$app->request->post()) && $model[0]->save() && $model[1]->save()) { - return $this->redirect(['view', 'id' => $model[0]->language_id]); - } else { - return $this->render('update', [ - 'model' => $model, - 'layoutdata' => $this->layoutdata - ]); - } - } - - /** - * Deletes an existing Language 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 Language model based on its primary key value. - * If the model is not found, a 404 HTTP exception will be thrown. - * @param integer $id - * @return Language the loaded model - * @throws NotFoundHttpException if the model cannot be found - */ - protected function findModel($id) - { - if (($model = Language::findOne($id)) !== null) { - return $model; - } else { - throw new NotFoundHttpException('The requested page does not exist.'); - } - } -} diff --git a/backend/models/_Language.php b/backend/models/_Language.php deleted file mode 100644 index da88d99..0000000 --- a/backend/models/_Language.php +++ /dev/null @@ -1,47 +0,0 @@ - 4] - ]; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'language_id' => Yii::t('app', 'Language ID'), - 'lang_code' => Yii::t('app', 'Lang Code'), - 'is_default' => Yii::t('app', 'Is Default'), - ]; - } -} diff --git a/backend/views/page/_form.php b/backend/views/page/_form.php deleted file mode 100644 index c85b816..0000000 --- a/backend/views/page/_form.php +++ /dev/null @@ -1,59 +0,0 @@ - - -
- - - -

- - date_add)) - { - $model->date_add = date('Y-m-d'); - } - - echo $form->field($model, 'date_add')->widget(\yii\jui\DatePicker::classname(), [ - 'language' => yii::$app->language, - 'dateFormat' => 'yyyy-MM-dd', - ]); - ?> - - field($model, 'template_id')->textInput() ?> - - field($model, 'image_id')->textInput() ?> - - field($model, 'show')->dropDownList(['1' => Yii::t('action', 'show'), '0' => Yii::t('action', 'hide')]) ?> - -

- - field($model, 'title')->textInput() ?> - - field($model, 'meta_title')->textarea() ?> - - field($model, 'meta_description')->textarea() ?> - - field($model, 'text')->textarea(['row' => 4]) ?> - - field($model, 'page_alias')->textInput() ?> - -
- isNewRecord ? - Yii::t('action', 'add') : - Yii::t('action', 'update'), - ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary'] - ) ?> -
- - - -
diff --git a/backend/views/page/_search.php b/backend/views/page/_search.php deleted file mode 100644 index ebda0db..0000000 --- a/backend/views/page/_search.php +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/backend/views/page/create.php b/backend/views/page/create.php deleted file mode 100644 index d47a8ad..0000000 --- a/backend/views/page/create.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Create Page'; -$this->params['breadcrumbs'][] = ['label' => 'Pages', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/page/index.php b/backend/views/page/index.php deleted file mode 100644 index 5acfc48..0000000 --- a/backend/views/page/index.php +++ /dev/null @@ -1,38 +0,0 @@ -title = 'Pages'; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- render('_search', ['model' => $searchModel]); ?> - -

- 'btn btn-success']) ?> -

- - $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'page_id', - 'date_add', - 'title', - 'template_id', - 'show', - - ['class' => 'yii\grid\ActionColumn'], - ], - ]); ?> - -
diff --git a/backend/views/page/update.php b/backend/views/page/update.php deleted file mode 100644 index 13329df..0000000 --- a/backend/views/page/update.php +++ /dev/null @@ -1,21 +0,0 @@ -title = Yii::t('action', 'edit').': ' . ' ' . $model->title; -$this->params['breadcrumbs'][] = ['label' => Yii::t('field', 'page'), 'url' => ['index']]; -$this->params['breadcrumbs'][] = ['label' => $model->page_id, 'url' => [Yii::t('action', 'view'), 'id' => $model->page_id]]; -$this->params['breadcrumbs'][] = Yii::t('action', 'update'); -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/page/view.php b/backend/views/page/view.php deleted file mode 100644 index 9937c04..0000000 --- a/backend/views/page/view.php +++ /dev/null @@ -1,40 +0,0 @@ -title = $model->page_id; -$this->params['breadcrumbs'][] = ['label' => Yii::t('field', 'n, page', ['n' => 1]), 'url' => ['index']]; -$this->params['breadcrumbs'][] = Yii::t('field', 'n, page', ['n' => 'few']); -?> -
- -

title) ?>

- -

- $model->page_id], ['class' => 'btn btn-primary']) ?> - $model->page_id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', - ], - ]) ?> -

- - $model, - 'attributes' => [ - 'page_id', - 'date_add', - 'template_id', - 'image_id', - 'show', - ], - ]) ?> - -
diff --git a/backend/views/termin/_form.php b/backend/views/termin/_form.php deleted file mode 100644 index ed83ac3..0000000 --- a/backend/views/termin/_form.php +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - - field($model, 'termin_pid')->textInput() ?> - - field($model, 'lfr')->textInput() ?> - - field($model, 'rgt')->textInput() ?> - - field($model, 'termin_type_id')->textInput() ?> - - field($model, 'page_id')->textInput() ?> - -
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
- - - -
diff --git a/backend/views/termin/_search.php b/backend/views/termin/_search.php deleted file mode 100644 index f277fc9..0000000 --- a/backend/views/termin/_search.php +++ /dev/null @@ -1,37 +0,0 @@ - - - diff --git a/backend/views/termin/create.php b/backend/views/termin/create.php deleted file mode 100644 index da30cd9..0000000 --- a/backend/views/termin/create.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Create Termin'; -$this->params['breadcrumbs'][] = ['label' => 'Termins', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/termin/index.php b/backend/views/termin/index.php deleted file mode 100644 index 41cc932..0000000 --- a/backend/views/termin/index.php +++ /dev/null @@ -1,39 +0,0 @@ -title = 'Termins'; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- render('_search', ['model' => $searchModel]); ?> - -

- 'btn btn-success']) ?> -

- - $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'termin_id', - 'termin_pid', - 'lfr', - 'rgt', - 'termin_type_id', - // 'page_id', - - ['class' => 'yii\grid\ActionColumn'], - ], - ]); ?> - -
diff --git a/backend/views/termin/update.php b/backend/views/termin/update.php deleted file mode 100644 index 7eaf4d5..0000000 --- a/backend/views/termin/update.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Update Termin: ' . ' ' . $model->termin_id; -$this->params['breadcrumbs'][] = ['label' => 'Termins', 'url' => ['index']]; -$this->params['breadcrumbs'][] = ['label' => $model->termin_id, 'url' => ['view', 'id' => $model->termin_id]]; -$this->params['breadcrumbs'][] = 'Update'; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/termin/view.php b/backend/views/termin/view.php deleted file mode 100644 index 5142687..0000000 --- a/backend/views/termin/view.php +++ /dev/null @@ -1,40 +0,0 @@ -title = $model->termin_id; -$this->params['breadcrumbs'][] = ['label' => 'Termins', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- -

- $model->termin_id], ['class' => 'btn btn-primary']) ?> - $model->termin_id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', - ], - ]) ?> -

- - $model, - 'attributes' => [ - 'termin_id', - 'termin_pid', - 'lfr', - 'rgt', - 'termin_type_id', - 'page_id', - ], - ]) ?> - -
diff --git a/backend/views/termin_lang/_form.php b/backend/views/termin_lang/_form.php deleted file mode 100644 index 2fa07db..0000000 --- a/backend/views/termin_lang/_form.php +++ /dev/null @@ -1,23 +0,0 @@ - - -
- - - - field($termin_lang, 'termin_title')->textInput(['maxlength' => 256]) ?> - -
- isNewRecord ? 'Create' : 'Update', ['class' => $termin_lang->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
- - - -
diff --git a/backend/views/termin_lang/_search.php b/backend/views/termin_lang/_search.php deleted file mode 100644 index 3ba1e0c..0000000 --- a/backend/views/termin_lang/_search.php +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/backend/views/termin_lang/create.php b/backend/views/termin_lang/create.php deleted file mode 100644 index 52bb7eb..0000000 --- a/backend/views/termin_lang/create.php +++ /dev/null @@ -1,22 +0,0 @@ -title = 'Добавить Термин'; -$this->params['breadcrumbs'][] = ['label' => 'Termin Langs', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- - render('_form', [ - 'termin_lang' => $termin_lang, - 'termin' => $termin, - ]) ?> - -
diff --git a/backend/views/termin_lang/index.php b/backend/views/termin_lang/index.php deleted file mode 100644 index 31cc157..0000000 --- a/backend/views/termin_lang/index.php +++ /dev/null @@ -1,44 +0,0 @@ -title = 'Термин'; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- render('_search', ['model' => $searchModel]); ?> - -

- 'btn btn-success']) ?> -

- - $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'termin_id', - 'termin_title', - 'lang_id', - - [ - 'class' => 'yii\grid\ActionColumn', - 'template' => '{create} {view} {update} {delete} {create_parent}', - 'buttons' => [ - 'create_parent' => function ($url, $model, $key) { - return Html::a('', $url); - } - ], - ], - ], - ]); ?> - -
diff --git a/backend/views/termin_lang/update.php b/backend/views/termin_lang/update.php deleted file mode 100644 index 7832d9e..0000000 --- a/backend/views/termin_lang/update.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Редактировать Термин: ' . ' ' . $model->termin_id; -$this->params['breadcrumbs'][] = ['label' => 'Termin Langs', 'url' => ['index']]; -$this->params['breadcrumbs'][] = ['label' => $model->termin_id, 'url' => ['view', 'termin_id' => $model->termin_id, 'lang_id' => $model->lang_id]]; -$this->params['breadcrumbs'][] = 'Update'; -?> -
- -

title) ?>

- - render('_form', [ - 'termin_lang' => $model, - ]) ?> - -
diff --git a/backend/views/termin_lang/view.php b/backend/views/termin_lang/view.php deleted file mode 100644 index 7712564..0000000 --- a/backend/views/termin_lang/view.php +++ /dev/null @@ -1,37 +0,0 @@ -title = 'Термин: '.$model->termin_title; -$this->params['breadcrumbs'][] = ['label' => 'Термин', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- -

- $model->termin_id, 'lang_id' => $model->lang_id], ['class' => 'btn btn-primary']) ?> - $model->termin_id, 'lang_id' => $model->lang_id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', - ], - ]) ?> -

- - $model, - 'attributes' => [ - 'termin_id', - 'termin_title', - 'lang_id', - ], - ]) ?> - -
diff --git a/common/models/Page.php b/common/models/Page.php deleted file mode 100644 index 0e1a676..0000000 --- a/common/models/Page.php +++ /dev/null @@ -1,176 +0,0 @@ -data = PageLang::find()->where(['page_id' => $this->page_id, 'lang_id' => yii::$app->lang_id])->one(); - } - - public function getDataByKey($key) - { - if (! $this->data) - { - $this->getData(); - } - - return isset ($this->data[$key]) ? $this->data[$key] : ''; - } - - // ==== DATA PAGE LANG FIELD ==== - - public function getTitle() - { - return $this->getDataByKey('title'); - } - - public function getMeta_title() - { - return $this->getDataByKey('meta_title'); - } - - public function getMeta_description() - { - return $this->getDataByKey('meta_description'); - } - - public function getText() - { - return $this->getDataByKey('text'); - } - - public function getPage_alias() - { - return $this->getDataByKey('page_alias'); - } - - // ==== PAGE LANG FILTER FIELD ==== - - public function findPageLangField($post) - { - if (! $this->data) - { - $this->getData(); - } - - if (empty ($this->data) || empty ($post)) - { - return false; - } - - $result = array (); - - foreach ($post as $key1 => $row1) - { - foreach ($this->data as $key2 => $row2) - { - if ($key1 == $key2) - { - $result[$key1] = $row1; - } - } - } - - return $result; - } - - // ==== FRONT ==== - - static function getPageByUrl ($url) - { - return yii::$app->db->createCommand(' - SELECT - `termin`.termin_id, `termin`.page_id, - `page`.show, - `template`.template_file - FROM `termin` - INNER JOIN `termin_lang` ON `termin_lang`.termin_id = `termin`.termin_id - AND `termin_lang`.lang_id = '.yii::$app->lang_id.' - AND `termin_lang`.termin_alias = "'.$url.'" - INNER JOIN `page` ON `page`.page_id = `termin`.page_id - INNER JOIN `template` ON `template`.template_id = `termin_lang`.template_id - ')->queryOne(); - } - - static function isShow ($page) - { - return $page['show'] == 1 ? true : false; - } - - static function getPageById ($page_id) - { - return yii::$app->db->createCommand(' - SELECT * - FROM `termin` - INNER JOIN `termin_lang` ON `termin_lang`.termin_id = `termin`.termin_id - AND `termin_lang`.lang_id = '.yii::$app->lang_id.' - INNER JOIN `page` ON `page`.page_id = `termin`.page_id - INNER JOIN `page_lang` ON `page_lang`.page_id = `page`.page_id - AND `page_lang`.lang_id = '.yii::$app->lang_id.' - WHERE `termin`.termin_id = "'.(int)$page_id.'" - ')->queryOne(); - } - - // ==== YII ==== - - /** - * @inheritdoc - */ - public function rules() - { - return [ - [['date_add', 'template_id', 'image_id', 'show'], 'required'], - [['date_add'], 'safe'], - [['template_id', 'image_id', 'show'], 'integer'] - ]; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'page_id' => Yii::t('field', 'page'), - 'date_add' => Yii::t('field', 'date_add'), - 'template_id' => Yii::t('field', 'template'), - 'image_id' => Yii::t('field', 'image'), - 'show' => Yii::t('field', 'show'), - - 'title' => Yii::t('field', 'title'), - 'meta_title' => Yii::t('field', 'meta_title'), - 'meta_description' => Yii::t('field', 'meta_description'), - 'text' => Yii::t('field', 'text'), - 'page_alias' => Yii::t('field', 'page_alias'), - 'lang_id' => Yii::t('field', 'lang_id'), - ]; - } - -} diff --git a/common/models/PageLang.php b/common/models/PageLang.php deleted file mode 100644 index e5a23d3..0000000 --- a/common/models/PageLang.php +++ /dev/null @@ -1,57 +0,0 @@ - 256], - [['meta_title', 'meta_description'], 'string', 'max' => 512] - ]; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'page_id' => Yii::t('field', 'page'), - 'title' => Yii::t('field', 'title'), - 'meta_title' => Yii::t('field', 'meta_title'), - 'meta_description' => Yii::t('field', 'meta_description'), - 'text' => Yii::t('field', 'text'), - 'page_alias' => Yii::t('field', 'page_alias'), - 'lang_id' => Yii::t('field', 'lang_id'), - ]; - } -} diff --git a/common/models/ShopCategory.php b/common/models/ShopCategory.php deleted file mode 100644 index b4c5f53..0000000 --- a/common/models/ShopCategory.php +++ /dev/null @@ -1,86 +0,0 @@ -db->createCommand(' - SELECT - `termin_relation`.termin_id, - `termin_relation`.termin_pid, - `termin_lang`.termin_title - FROM `termin_relation` - INNER JOIN `termin_lang` ON `termin_lang`.termin_id = `termin_relation`.termin_id - AND `termin_lang`.lang_id = '.yii::$app->lang_id.' - INNER JOIN `template` ON `template`.template_id = `termin_lang`.template_id - ORDER BY `termin_relation`.termin_id ASC, `termin_relation`.termin_pid ASC - ')->queryAll(); - } - - // =================== - // ==== STRUCTURE ==== - // =================== - - var $mass = array (); - - public function build () - { - if ($this->mass = self::get ()) - { - return $this->getRecrusive (8); - } - } - - public function findChild ($id) - { - $mass = array (); - - foreach ($this->mass as $row) - { - if ($row['termin_pid'] == $id) - { - $mass[] = $row; - } - } - - return $mass; - } - - public function getRecrusive ($menu_id) - { - $items = $this->findChild($menu_id); - - if (! empty ($items)) - { - echo ''; - } - - } - - // ===== - -} diff --git a/common/models/TerminLang.php b/common/models/TerminLang.php deleted file mode 100644 index 50b41c8..0000000 --- a/common/models/TerminLang.php +++ /dev/null @@ -1,52 +0,0 @@ - 'Термин ID', - 'termin_title' => 'Название', - 'lang_id' => 'ID языка', - ]; - } - - public function getMenu() - { - return $this->hasMany(Menu::className(), ['termin_id' => 'termin_id']); - } -} diff --git a/common/models/TerminOption.php b/common/models/TerminOption.php deleted file mode 100644 index 717f4df..0000000 --- a/common/models/TerminOption.php +++ /dev/null @@ -1,46 +0,0 @@ - 'Termin ID', - 'termin_pid' => 'Termin Pid', - 'sortorder' => 'Sortorder', - ]; - } -} diff --git a/frontend/controllers/PageController.php b/frontend/controllers/PageController.php deleted file mode 100644 index da9aa35..0000000 --- a/frontend/controllers/PageController.php +++ /dev/null @@ -1,41 +0,0 @@ -view->title = $page['meta_title']; - - // meta_desc - Yii::$app->view->registerMetaTag([ - 'name' => 'description', - 'content' => $page['meta_description'], - ]); - } - else - { - echo '404'; - die; - } - - return $this->render($controller_name, $page); - } - -} \ No newline at end of file diff --git a/frontend/views/page/home.php b/frontend/views/page/home.php deleted file mode 100644 index 0247178..0000000 --- a/frontend/views/page/home.php +++ /dev/null @@ -1 +0,0 @@ -home \ No newline at end of file diff --git a/frontend/views/page/page.php b/frontend/views/page/page.php deleted file mode 100644 index 1b37f65..0000000 --- a/frontend/views/page/page.php +++ /dev/null @@ -1,12 +0,0 @@ -registerCssFile('css-file.css'); - - // JS - $this->registerJsFile('script.js'); - - echo $text; -?> \ No newline at end of file -- libgit2 0.21.4