Commit 754fc7d953a52d3cab9dfa54975df5d7f686c47a
1 parent
ab4d7cb1
Удалил временные файлы -i18n
Showing
8 changed files
with
0 additions
and
374 deletions
Show diff stats
backend/controllers/PageController-i18n.php deleted
1 | -<?php | |
2 | - | |
3 | -namespace backend\controllers; | |
4 | - | |
5 | -use Yii; | |
6 | -use common\models\Page; | |
7 | -use backend\models\SearchPage; | |
8 | -use yii\web\Controller; | |
9 | -use yii\web\NotFoundHttpException; | |
10 | -use yii\filters\VerbFilter; | |
11 | - | |
12 | -/** | |
13 | - * PageController implements the CRUD actions for Page model. | |
14 | - */ | |
15 | -class PageController extends Controller | |
16 | -{ | |
17 | - public function behaviors() | |
18 | - { | |
19 | - return [ | |
20 | - 'verbs' => [ | |
21 | - 'class' => VerbFilter::className(), | |
22 | - 'actions' => [ | |
23 | - 'delete' => ['post'], | |
24 | - ], | |
25 | - ], | |
26 | - ]; | |
27 | - } | |
28 | - | |
29 | - /** | |
30 | - * Lists all Page models. | |
31 | - * @return mixed | |
32 | - */ | |
33 | - public function actionIndex() | |
34 | - { | |
35 | - $searchModel = new SearchPage(); | |
36 | - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | |
37 | - | |
38 | - return $this->render('index', [ | |
39 | - 'searchModel' => $searchModel, | |
40 | - 'dataProvider' => $dataProvider, | |
41 | - ]); | |
42 | - } | |
43 | - | |
44 | - /** | |
45 | - * Displays a single Page model. | |
46 | - * @param integer $id | |
47 | - * @return mixed | |
48 | - */ | |
49 | - public function actionView($id) | |
50 | - { | |
51 | - return $this->render('view', [ | |
52 | - 'model' => $this->findModel($id), | |
53 | - ]); | |
54 | - } | |
55 | - | |
56 | - /** | |
57 | - * Creates a new Page model. | |
58 | - * If creation is successful, the browser will be redirected to the 'view' page. | |
59 | - * @return mixed | |
60 | - */ | |
61 | - public function actionCreate() | |
62 | - { | |
63 | - $model = new Page(); | |
64 | - | |
65 | - if ($model->load(Yii::$app->request->post()) && $model->save()) { | |
66 | - return $this->redirect(['view', 'id' => $model->page_id]); | |
67 | - } else { | |
68 | - return $this->render('create', [ | |
69 | - 'model' => $model, | |
70 | - ]); | |
71 | - } | |
72 | - } | |
73 | - | |
74 | - /** | |
75 | - * Updates an existing Page model. | |
76 | - * If update is successful, the browser will be redirected to the 'view' page. | |
77 | - * @param integer $id | |
78 | - * @return mixed | |
79 | - */ | |
80 | - public function actionUpdate($id) | |
81 | - { | |
82 | - $model = $this->findModel($id); | |
83 | - | |
84 | - if ($model->load(Yii::$app->request->post()) && $model->save()) { | |
85 | - return $this->redirect(['view', 'id' => $model->page_id]); | |
86 | - } else { | |
87 | - return $this->render('update', [ | |
88 | - 'model' => $model, | |
89 | - ]); | |
90 | - } | |
91 | - } | |
92 | - | |
93 | - /** | |
94 | - * Deletes an existing Page model. | |
95 | - * If deletion is successful, the browser will be redirected to the 'index' page. | |
96 | - * @param integer $id | |
97 | - * @return mixed | |
98 | - */ | |
99 | - public function actionDelete($id) | |
100 | - { | |
101 | - $this->findModel($id)->delete(); | |
102 | - | |
103 | - return $this->redirect(['index']); | |
104 | - } | |
105 | - | |
106 | - /** | |
107 | - * Finds the Page model based on its primary key value. | |
108 | - * If the model is not found, a 404 HTTP exception will be thrown. | |
109 | - * @param integer $id | |
110 | - * @return Page the loaded model | |
111 | - * @throws NotFoundHttpException if the model cannot be found | |
112 | - */ | |
113 | - protected function findModel($id) | |
114 | - { | |
115 | - if (($model = Page::findOne($id)) !== null) { | |
116 | - return $model; | |
117 | - } else { | |
118 | - throw new NotFoundHttpException('The requested page does not exist.'); | |
119 | - } | |
120 | - } | |
121 | -} |
backend/models/SearchPage-i18n.php deleted
1 | -common/messages/1/field.php<?php | |
2 | - | |
3 | -namespace backend\models; | |
4 | - | |
5 | -use Yii; | |
6 | -use yii\base\Model; | |
7 | -use yii\data\ActiveDataProvider; | |
8 | -use common\models\Page; | |
9 | - | |
10 | -/** | |
11 | - * SearchPage represents the model behind the search form about `common\models\Page`. | |
12 | - */ | |
13 | -class SearchPage extends Page | |
14 | -{ | |
15 | - /** | |
16 | - * @inheritdoc | |
17 | - */ | |
18 | - public function rules() | |
19 | - { | |
20 | - return [ | |
21 | - [['page_id', 'template_id', 'image_id', 'show'], 'integer'], | |
22 | - [['date_add'], 'safe'], | |
23 | - ]; | |
24 | - } | |
25 | - | |
26 | - /** | |
27 | - * @inheritdoc | |
28 | - */ | |
29 | - public function scenarios() | |
30 | - { | |
31 | - // bypass scenarios() implementation in the parent class | |
32 | - return Model::scenarios(); | |
33 | - } | |
34 | - | |
35 | - /** | |
36 | - * Creates data provider instance with search query applied | |
37 | - * | |
38 | - * @param array $params | |
39 | - * | |
40 | - * @return ActiveDataProvider | |
41 | - */ | |
42 | - public function search($params) | |
43 | - { | |
44 | - $query = Page::find(); | |
45 | - | |
46 | - $dataProvider = new ActiveDataProvider([ | |
47 | - 'query' => $query, | |
48 | - ]); | |
49 | - | |
50 | - $this->load($params); | |
51 | - | |
52 | - if (!$this->validate()) { | |
53 | - // uncomment the following line if you do not want to return any records when validation fails | |
54 | - // $query->where('0=1'); | |
55 | - return $dataProvider; | |
56 | - } | |
57 | - | |
58 | - $query->andFilterWhere([ | |
59 | - 'page_id' => $this->page_id, | |
60 | - 'date_add' => $this->date_add, | |
61 | - 'template_id' => $this->template_id, | |
62 | - 'image_id' => $this->image_id, | |
63 | - 'show' => $this->show, | |
64 | - ]); | |
65 | - | |
66 | - return $dataProvider; | |
67 | - } | |
68 | -} |
backend/views/page-i18n/_form.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\ActiveForm; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Page */ | |
8 | -/* @var $form yii\widgets\ActiveForm */ | |
9 | -?> | |
10 | - | |
11 | -<div class="page-form"> | |
12 | - | |
13 | - <?php $form = ActiveForm::begin(); ?> | |
14 | - | |
15 | - <?= $form->field($model, 'date_add')->textInput() ?> | |
16 | - | |
17 | - <?= $form->field($model, 'template_id')->textInput() ?> | |
18 | - | |
19 | - <?= $form->field($model, 'image_id')->textInput() ?> | |
20 | - | |
21 | - <?= $form->field($model, 'show')->textInput() ?> | |
22 | - | |
23 | - <div class="form-group"> | |
24 | - <?= Html::submitButton($model->isNewRecord ? Yii::t('field', 'Create') : Yii::t('field', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | |
25 | - </div> | |
26 | - | |
27 | - <?php ActiveForm::end(); ?> | |
28 | - | |
29 | -</div> |
backend/views/page-i18n/_search.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\ActiveForm; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model backend\models\SearchPage */ | |
8 | -/* @var $form yii\widgets\ActiveForm */ | |
9 | -?> | |
10 | - | |
11 | -<div class="page-search"> | |
12 | - | |
13 | - <?php $form = ActiveForm::begin([ | |
14 | - 'action' => ['index'], | |
15 | - 'method' => 'get', | |
16 | - ]); ?> | |
17 | - | |
18 | - <?= $form->field($model, 'page_id') ?> | |
19 | - | |
20 | - <?= $form->field($model, 'date_add') ?> | |
21 | - | |
22 | - <?= $form->field($model, 'template_id') ?> | |
23 | - | |
24 | - <?= $form->field($model, 'image_id') ?> | |
25 | - | |
26 | - <?= $form->field($model, 'show') ?> | |
27 | - | |
28 | - <div class="form-group"> | |
29 | - <?= Html::submitButton(Yii::t('field', 'Search'), ['class' => 'btn btn-primary']) ?> | |
30 | - <?= Html::resetButton(Yii::t('field', 'Reset'), ['class' => 'btn btn-default']) ?> | |
31 | - </div> | |
32 | - | |
33 | - <?php ActiveForm::end(); ?> | |
34 | - | |
35 | -</div> |
backend/views/page-i18n/create.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | - | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Page */ | |
8 | - | |
9 | -$this->title = Yii::t('field', 'Create Page'); | |
10 | -$this->params['breadcrumbs'][] = ['label' => Yii::t('field', 'Pages'), 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
12 | -?> | |
13 | -<div class="page-create"> | |
14 | - | |
15 | - <h1><?= Html::encode($this->title) ?></h1> | |
16 | - | |
17 | - <?= $this->render('_form', [ | |
18 | - 'model' => $model, | |
19 | - ]) ?> | |
20 | - | |
21 | -</div> |
backend/views/page-i18n/index.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\grid\GridView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $searchModel backend\models\SearchPage */ | |
8 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | |
9 | - | |
10 | -$this->title = Yii::t('field', 'Pages'); | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
12 | -?> | |
13 | -<div class="page-index"> | |
14 | - | |
15 | - <h1><?= Html::encode($this->title) ?></h1> | |
16 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
17 | - | |
18 | - <p> | |
19 | - <?= Html::a(Yii::t('field', 'Create Page'), ['create'], ['class' => 'btn btn-success']) ?> | |
20 | - </p> | |
21 | - | |
22 | - <?= GridView::widget([ | |
23 | - 'dataProvider' => $dataProvider, | |
24 | - 'filterModel' => $searchModel, | |
25 | - 'columns' => [ | |
26 | - ['class' => 'yii\grid\SerialColumn'], | |
27 | - | |
28 | - 'page_id', | |
29 | - 'date_add', | |
30 | - 'template_id', | |
31 | - 'image_id', | |
32 | - 'show', | |
33 | - | |
34 | - ['class' => 'yii\grid\ActionColumn'], | |
35 | - ], | |
36 | - ]); ?> | |
37 | - | |
38 | -</div> |
backend/views/page-i18n/update.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | - | |
5 | -/* @var $this yii\web\View */ | |
6 | -/* @var $model common\models\Page */ | |
7 | - | |
8 | -$this->title = Yii::t('field', 'Update {modelClass}: ', [ | |
9 | - 'modelClass' => 'Page', | |
10 | -]) . ' ' . $model->page_id; | |
11 | -$this->params['breadcrumbs'][] = ['label' => Yii::t('field', 'Pages'), 'url' => ['index']]; | |
12 | -$this->params['breadcrumbs'][] = ['label' => $model->page_id, 'url' => ['view', 'id' => $model->page_id]]; | |
13 | -$this->params['breadcrumbs'][] = Yii::t('field', 'Update'); | |
14 | -?> | |
15 | -<div class="page-update"> | |
16 | - | |
17 | - <h1><?= Html::encode($this->title) ?></h1> | |
18 | - | |
19 | - <?= $this->render('_form', [ | |
20 | - 'model' => $model, | |
21 | - ]) ?> | |
22 | - | |
23 | -</div> |
backend/views/page-i18n/view.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\DetailView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Page */ | |
8 | - | |
9 | -$this->title = $model->page_id; | |
10 | -$this->params['breadcrumbs'][] = ['label' => Yii::t('field', 'Pages'), 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
12 | -?> | |
13 | -<div class="page-view"> | |
14 | - | |
15 | - <h1><?= Html::encode($this->title) ?></h1> | |
16 | - | |
17 | - <p> | |
18 | - <?= Html::a(Yii::t('field', 'Update'), ['update', 'id' => $model->page_id], ['class' => 'btn btn-primary']) ?> | |
19 | - <?= Html::a(Yii::t('field', 'Delete'), ['delete', 'id' => $model->page_id], [ | |
20 | - 'class' => 'btn btn-danger', | |
21 | - 'data' => [ | |
22 | - 'confirm' => Yii::t('field', 'Are you sure you want to delete this item?'), | |
23 | - 'method' => 'post', | |
24 | - ], | |
25 | - ]) ?> | |
26 | - </p> | |
27 | - | |
28 | - <?= DetailView::widget([ | |
29 | - 'model' => $model, | |
30 | - 'attributes' => [ | |
31 | - 'page_id', | |
32 | - 'date_add', | |
33 | - 'template_id', | |
34 | - 'image_id', | |
35 | - 'show', | |
36 | - ], | |
37 | - ]) ?> | |
38 | - | |
39 | -</div> |