Commit 559be889fa4b4aa7b281e3471ccf3efc45225de6
0 parents
Init test-9
Showing
1615 changed files
with
94134 additions
and
0 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 1615 files are displayed.
1 | +++ a/.gitignore | ||
1 | +# yii console command | ||
2 | +/yii | ||
3 | + | ||
4 | +# phpstorm project files | ||
5 | +.idea | ||
6 | + | ||
7 | +# netbeans project files | ||
8 | +nbproject | ||
9 | + | ||
10 | +# zend studio for eclipse project files | ||
11 | +.buildpath | ||
12 | +.project | ||
13 | +.settings | ||
14 | + | ||
15 | +# windows thumbnail cache | ||
16 | +Thumbs.db | ||
17 | + | ||
18 | +# composer vendor dir | ||
19 | +/vendor | ||
20 | + | ||
21 | +# composer itself is not needed | ||
22 | +composer.phar | ||
23 | + | ||
24 | +# Mac DS_Store Files | ||
25 | +.DS_Store | ||
26 | + | ||
27 | +# phpunit itself is not needed | ||
28 | +phpunit.phar | ||
29 | +# local phpunit config | ||
30 | +/phpunit.xml | ||
31 | + | ||
32 | +/old | ||
0 | \ No newline at end of file | 33 | \ No newline at end of file |
1 | +++ a/.htaccess | ||
1 | +<IfModule mod_rewrite.c> | ||
2 | + Options +FollowSymlinks | ||
3 | + RewriteEngine On | ||
4 | +</IfModule> | ||
5 | + | ||
6 | +<IfModule mod_rewrite.c> | ||
7 | + RewriteBase / | ||
8 | + | ||
9 | + RewriteRule ^storage/(.*)?$ /storage/$1 [L,PT] | ||
10 | + | ||
11 | + RewriteCond %{REQUEST_URI} ^/(admin) | ||
12 | + RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L] | ||
13 | + RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L] | ||
14 | + RewriteRule ^admin/js/(.*)$ backend/web/js/$1 [L] | ||
15 | + RewriteRule ^admin/images/(.*)$ backend/web/images/$1 [L] | ||
16 | + RewriteRule ^admin/fonts/(.*)$ backend/web/fonts/$1 [L] | ||
17 | + | ||
18 | + RewriteCond %{REQUEST_URI} !^/backend/web/(assets|css|js|images)/ | ||
19 | + RewriteCond %{REQUEST_URI} ^/(admin) | ||
20 | + RewriteRule ^.*$ backend/web/index.php [L] | ||
21 | + | ||
22 | + RewriteCond %{REQUEST_URI} ^/(assets|css) | ||
23 | + RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L] | ||
24 | + RewriteRule ^css/(.*)$ frontend/web/css/$1 [L] | ||
25 | + RewriteRule ^js/(.*)$ frontend/web/js/$1 [L] | ||
26 | + RewriteRule ^images/(.*)$ frontend/web/images/$1 [L] | ||
27 | + RewriteRule ^files/(.*)$ frontend/web/files/$1 [L] | ||
28 | + RewriteRule ^count_form/(.*)$ frontend/web/count_form/$1 [L] | ||
29 | + | ||
30 | + RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|js|images|files|count_form)/ | ||
31 | + RewriteCond %{REQUEST_URI} !index.php | ||
32 | + RewriteCond %{REQUEST_FILENAME} !-f [OR] | ||
33 | + RewriteCond %{REQUEST_FILENAME} !-d | ||
34 | + RewriteRule ^.*$ frontend/web/index.php | ||
35 | +</IfModule> | ||
0 | \ No newline at end of file | 36 | \ No newline at end of file |
1 | +++ a/LICENSE.md | ||
1 | +The Yii framework is free software. It is released under the terms of | ||
2 | +the following BSD License. | ||
3 | + | ||
4 | +Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com) | ||
5 | +All rights reserved. | ||
6 | + | ||
7 | +Redistribution and use in source and binary forms, with or without | ||
8 | +modification, are permitted provided that the following conditions | ||
9 | +are met: | ||
10 | + | ||
11 | + * Redistributions of source code must retain the above copyright | ||
12 | + notice, this list of conditions and the following disclaimer. | ||
13 | + * Redistributions in binary form must reproduce the above copyright | ||
14 | + notice, this list of conditions and the following disclaimer in | ||
15 | + the documentation and/or other materials provided with the | ||
16 | + distribution. | ||
17 | + * Neither the name of Yii Software LLC nor the names of its | ||
18 | + contributors may be used to endorse or promote products derived | ||
19 | + from this software without specific prior written permission. | ||
20 | + | ||
21 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
22 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
23 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
24 | +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
25 | +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
26 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
27 | +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
28 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
29 | +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
30 | +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
31 | +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
32 | +POSSIBILITY OF SUCH DAMAGE. |
1 | +++ a/README.md | ||
1 | +Yii 2 Advanced Project Template | ||
2 | +=============================== | ||
3 | + | ||
4 | +Yii 2 Advanced Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for | ||
5 | +developing complex Web applications with multiple tiers. | ||
6 | + | ||
7 | +The template includes three tiers: front end, back end, and console, each of which | ||
8 | +is a separate Yii application. | ||
9 | + | ||
10 | +The template is designed to work in a team development environment. It supports | ||
11 | +deploying the application in different environments. | ||
12 | + | ||
13 | +Documentation is at [docs/guide/README.md](docs/guide/README.md). | ||
14 | + | ||
15 | +[](https://packagist.org/packages/yiisoft/yii2-app-advanced) | ||
16 | +[](https://packagist.org/packages/yiisoft/yii2-app-advanced) | ||
17 | +[](https://travis-ci.org/yiisoft/yii2-app-advanced) | ||
18 | + | ||
19 | +DIRECTORY STRUCTURE | ||
20 | +------------------- | ||
21 | + | ||
22 | +``` | ||
23 | +common | ||
24 | + config/ contains shared configurations | ||
25 | + mail/ contains view files for e-mails | ||
26 | + models/ contains model classes used in both backend and frontend | ||
27 | +console | ||
28 | + config/ contains console configurations | ||
29 | + controllers/ contains console controllers (commands) | ||
30 | + migrations/ contains database migrations | ||
31 | + models/ contains console-specific model classes | ||
32 | + runtime/ contains files generated during runtime | ||
33 | +backend | ||
34 | + assets/ contains application assets such as JavaScript and CSS | ||
35 | + config/ contains backend configurations | ||
36 | + controllers/ contains Web controller classes | ||
37 | + models/ contains backend-specific model classes | ||
38 | + runtime/ contains files generated during runtime | ||
39 | + views/ contains view files for the Web application | ||
40 | + web/ contains the entry script and Web resources | ||
41 | +frontend | ||
42 | + assets/ contains application assets such as JavaScript and CSS | ||
43 | + config/ contains frontend configurations | ||
44 | + controllers/ contains Web controller classes | ||
45 | + models/ contains frontend-specific model classes | ||
46 | + runtime/ contains files generated during runtime | ||
47 | + views/ contains view files for the Web application | ||
48 | + web/ contains the entry script and Web resources | ||
49 | + widgets/ contains frontend widgets | ||
50 | +vendor/ contains dependent 3rd-party packages | ||
51 | +environments/ contains environment-based overrides | ||
52 | +tests contains various tests for the advanced application | ||
53 | + codeception/ contains tests developed with Codeception PHP Testing Framework | ||
54 | +``` |
1 | +++ a/backend/assets/AppAsset.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * @link http://www.yiiframework.com/ | ||
4 | + * @copyright Copyright (c) 2008 Yii Software LLC | ||
5 | + * @license http://www.yiiframework.com/license/ | ||
6 | + */ | ||
7 | + | ||
8 | +namespace backend\assets; | ||
9 | + | ||
10 | +use yii\web\AssetBundle; | ||
11 | + | ||
12 | +/** | ||
13 | + * @author Qiang Xue <qiang.xue@gmail.com> | ||
14 | + * @since 2.0 | ||
15 | + */ | ||
16 | +class AppAsset extends AssetBundle | ||
17 | +{ | ||
18 | + public $basePath = '@webroot'; | ||
19 | + public $baseUrl = '@web'; | ||
20 | + public $css = [ | ||
21 | + 'css/site.css', | ||
22 | + ]; | ||
23 | + public $js = [ | ||
24 | + ]; | ||
25 | + public $depends = [ | ||
26 | + 'yii\web\YiiAsset', | ||
27 | + 'yii\bootstrap\BootstrapAsset', | ||
28 | + ]; | ||
29 | +} |
1 | +++ a/backend/config/main.php | ||
1 | +<?php | ||
2 | +$params = array_merge( | ||
3 | + require(__DIR__ . '/../../common/config/params.php'), | ||
4 | + require(__DIR__ . '/../../common/config/params-local.php'), | ||
5 | + require(__DIR__ . '/params.php'), | ||
6 | + require(__DIR__ . '/params-local.php') | ||
7 | +); | ||
8 | + | ||
9 | +return [ | ||
10 | + 'id' => 'app-backend', | ||
11 | + 'basePath' => dirname(__DIR__), | ||
12 | + 'controllerNamespace' => 'backend\controllers', | ||
13 | + 'bootstrap' => ['log'], | ||
14 | + 'modules' => [], | ||
15 | + 'components' => [ | ||
16 | + 'user' => [ | ||
17 | + 'identityClass' => 'common\models\User', | ||
18 | + 'enableAutoLogin' => true, | ||
19 | + ], | ||
20 | + 'log' => [ | ||
21 | + 'traceLevel' => YII_DEBUG ? 3 : 0, | ||
22 | + 'targets' => [ | ||
23 | + [ | ||
24 | + 'class' => 'yii\log\FileTarget', | ||
25 | + 'levels' => ['error', 'warning'], | ||
26 | + ], | ||
27 | + ], | ||
28 | + ], | ||
29 | + 'errorHandler' => [ | ||
30 | + 'errorAction' => 'site/error', | ||
31 | + ], | ||
32 | + 'request'=>[ | ||
33 | + 'class' => 'common\components\Request', | ||
34 | + 'web'=> '/backend/web', | ||
35 | + 'adminUrl' => '/admin' | ||
36 | + ], | ||
37 | + 'urlManagerFrontEnd' => [ | ||
38 | + 'class' => 'yii\web\urlManager', | ||
39 | + 'baseUrl' => '/', | ||
40 | + 'web' => '/frontend/web', | ||
41 | + 'enablePrettyUrl' => true, | ||
42 | + 'showScriptName' => false, | ||
43 | + ], | ||
44 | + 'view' => [ | ||
45 | + 'theme' => [ | ||
46 | + 'pathMap' => [ | ||
47 | + '@app/views' => '@app/views/adminlte' | ||
48 | + ], | ||
49 | + ], | ||
50 | + ], | ||
51 | + ], | ||
52 | + 'params' => $params, | ||
53 | + 'language' => 'ru-RU', | ||
54 | +]; |
1 | +++ a/backend/controllers/ClientsController.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\controllers; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use backend\models\Clients; | ||
7 | +use backend\models\ClientsSearch; | ||
8 | +use yii\web\Controller; | ||
9 | +use yii\web\NotFoundHttpException; | ||
10 | +use yii\filters\VerbFilter; | ||
11 | +use yii\web\UploadedFile; | ||
12 | +use yii\helpers\Html; | ||
13 | +use yii\helpers\Url; | ||
14 | + | ||
15 | + | ||
16 | +/** | ||
17 | + * ClientsController implements the CRUD actions for Clients model. | ||
18 | + */ | ||
19 | +class ClientsController extends Controller | ||
20 | +{ | ||
21 | + public $file; | ||
22 | + | ||
23 | + public function behaviors() | ||
24 | + { | ||
25 | + return [ | ||
26 | + 'verbs' => [ | ||
27 | + 'class' => VerbFilter::className(), | ||
28 | + 'actions' => [ | ||
29 | + 'delete' => ['post'], | ||
30 | + ], | ||
31 | + ], | ||
32 | + ]; | ||
33 | + } | ||
34 | + | ||
35 | + /** | ||
36 | + * Lists all Clients models. | ||
37 | + * @return mixed | ||
38 | + */ | ||
39 | + public function actionIndex() | ||
40 | + { | ||
41 | + $searchModel = new ClientsSearch(); | ||
42 | + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | ||
43 | + | ||
44 | + return $this->render('index', [ | ||
45 | + 'searchModel' => $searchModel, | ||
46 | + 'dataProvider' => $dataProvider, | ||
47 | + ]); | ||
48 | + } | ||
49 | + | ||
50 | + /** | ||
51 | + * Displays a single Clients model. | ||
52 | + * @param integer $id | ||
53 | + * @return mixed | ||
54 | + */ | ||
55 | + public function actionView($id) | ||
56 | + { | ||
57 | + $model = $this->findModel($id); | ||
58 | + $model->logo = Html::img('/'. $model->logo); | ||
59 | + return $this->render('view', [ | ||
60 | + 'model' => $model, | ||
61 | + ]); | ||
62 | + } | ||
63 | + | ||
64 | + /** | ||
65 | + * Creates a new Clients model. | ||
66 | + * If creation is successful, the browser will be redirected to the 'view' page. | ||
67 | + * @return mixed | ||
68 | + */ | ||
69 | + public function actionCreate() | ||
70 | + { | ||
71 | + $model = new Clients(); | ||
72 | + | ||
73 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
74 | + $this->_uploadLogo($model); | ||
75 | + return $this->redirect(['view', 'id' => $model->id]); | ||
76 | + } else { | ||
77 | + return $this->render('create', [ | ||
78 | + 'model' => $model, | ||
79 | + ]); | ||
80 | + } | ||
81 | + } | ||
82 | + | ||
83 | + /** | ||
84 | + * Updates an existing Clients model. | ||
85 | + * If update is successful, the browser will be redirected to the 'view' page. | ||
86 | + * @param integer $id | ||
87 | + * @return mixed | ||
88 | + */ | ||
89 | + public function actionUpdate($id) | ||
90 | + { | ||
91 | + $model = $this->findModel($id); | ||
92 | + | ||
93 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
94 | + $this->_uploadLogo($model); | ||
95 | + return $this->redirect(['view', 'id' => $model->id]); | ||
96 | + } else { | ||
97 | + return $this->render('update', [ | ||
98 | + 'model' => $model, | ||
99 | + ]); | ||
100 | + } | ||
101 | + } | ||
102 | + | ||
103 | + private function _uploadLogo($model) { | ||
104 | + $file = UploadedFile::getInstance($model, 'file'); | ||
105 | + if (!empty($file)) { | ||
106 | + $model->file = $file; | ||
107 | + $fileName = 'clients/' . $model->file->basename . '.' . $model->file->extension; | ||
108 | + $filePath = Yii::getAlias( '@filesDir' ) .'/'. $fileName; | ||
109 | + $i = 1; | ||
110 | + while (file_exists($filePath)) { | ||
111 | + $fileName = 'clients/' . $model->file->basename .'_'. $i . '.' . $model->file->extension; | ||
112 | + $filePath = Yii::getAlias( '@filesDir' ) .'/'. $fileName; | ||
113 | + $i++; | ||
114 | + } | ||
115 | + $model->file->saveAs( $filePath ); | ||
116 | + $model->logo = $fileName; | ||
117 | + } else { | ||
118 | +// $model->logo = null; | ||
119 | + } | ||
120 | + $model->save(); | ||
121 | + } | ||
122 | + | ||
123 | + /** | ||
124 | + * Deletes an existing Clients model. | ||
125 | + * If deletion is successful, the browser will be redirected to the 'index' page. | ||
126 | + * @param integer $id | ||
127 | + * @return mixed | ||
128 | + */ | ||
129 | + public function actionDelete($id) | ||
130 | + { | ||
131 | + $this->findModel($id)->delete(); | ||
132 | + | ||
133 | + return $this->redirect(['index']); | ||
134 | + } | ||
135 | + | ||
136 | + /** | ||
137 | + * Finds the Clients model based on its primary key value. | ||
138 | + * If the model is not found, a 404 HTTP exception will be thrown. | ||
139 | + * @param integer $id | ||
140 | + * @return Clients the loaded model | ||
141 | + * @throws NotFoundHttpException if the model cannot be found | ||
142 | + */ | ||
143 | + protected function findModel($id) | ||
144 | + { | ||
145 | + if (($model = Clients::findOne($id)) !== null) { | ||
146 | + return $model; | ||
147 | + } else { | ||
148 | + throw new NotFoundHttpException('The requested page does not exist.'); | ||
149 | + } | ||
150 | + } | ||
151 | +} |
1 | +++ a/backend/controllers/DepartmentsController.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\controllers; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use backend\models\Departments; | ||
7 | +use backend\models\DepartmentsSearch; | ||
8 | +use yii\web\Controller; | ||
9 | +use yii\web\NotFoundHttpException; | ||
10 | +use yii\filters\VerbFilter; | ||
11 | + | ||
12 | +/** | ||
13 | + * DepartmentsController implements the CRUD actions for Departments model. | ||
14 | + */ | ||
15 | +class DepartmentsController 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 Departments models. | ||
31 | + * @return mixed | ||
32 | + */ | ||
33 | + public function actionIndex() | ||
34 | + { | ||
35 | + $searchModel = new DepartmentsSearch(); | ||
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 Departments 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 Departments 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 Departments(); | ||
64 | + | ||
65 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
66 | + return $this->redirect(['view', 'id' => $model->id]); | ||
67 | + } else { | ||
68 | + return $this->render('create', [ | ||
69 | + 'model' => $model, | ||
70 | + ]); | ||
71 | + } | ||
72 | + } | ||
73 | + | ||
74 | + /** | ||
75 | + * Updates an existing Departments 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->id]); | ||
86 | + } else { | ||
87 | + return $this->render('update', [ | ||
88 | + 'model' => $model, | ||
89 | + ]); | ||
90 | + } | ||
91 | + } | ||
92 | + | ||
93 | + /** | ||
94 | + * Deletes an existing Departments 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 Departments 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 Departments the loaded model | ||
111 | + * @throws NotFoundHttpException if the model cannot be found | ||
112 | + */ | ||
113 | + protected function findModel($id) | ||
114 | + { | ||
115 | + if (($model = Departments::findOne($id)) !== null) { | ||
116 | + return $model; | ||
117 | + } else { | ||
118 | + throw new NotFoundHttpException('The requested page does not exist.'); | ||
119 | + } | ||
120 | + } | ||
121 | +} |
1 | +++ a/backend/controllers/SiteController.php | ||
1 | +<?php | ||
2 | +namespace backend\controllers; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\filters\AccessControl; | ||
6 | +use yii\web\Controller; | ||
7 | +use common\models\LoginForm; | ||
8 | +use yii\filters\VerbFilter; | ||
9 | + | ||
10 | +/** | ||
11 | + * Site controller | ||
12 | + */ | ||
13 | +class SiteController extends Controller | ||
14 | +{ | ||
15 | + /** | ||
16 | + * @inheritdoc | ||
17 | + */ | ||
18 | + public function behaviors() | ||
19 | + { | ||
20 | + return [ | ||
21 | + 'access' => [ | ||
22 | + 'class' => AccessControl::className(), | ||
23 | + 'rules' => [ | ||
24 | + [ | ||
25 | + 'actions' => ['login', 'error'], | ||
26 | + 'allow' => true, | ||
27 | + ], | ||
28 | + [ | ||
29 | + 'actions' => ['logout', 'index'], | ||
30 | + 'allow' => true, | ||
31 | + 'roles' => ['@'], | ||
32 | + ], | ||
33 | + ], | ||
34 | + ], | ||
35 | + 'verbs' => [ | ||
36 | + 'class' => VerbFilter::className(), | ||
37 | + 'actions' => [ | ||
38 | + 'logout' => ['post'], | ||
39 | + ], | ||
40 | + ], | ||
41 | + ]; | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * @inheritdoc | ||
46 | + */ | ||
47 | + public function actions() | ||
48 | + { | ||
49 | + return [ | ||
50 | + 'error' => [ | ||
51 | + 'class' => 'yii\web\ErrorAction', | ||
52 | + ], | ||
53 | + ]; | ||
54 | + } | ||
55 | + | ||
56 | + public function actionIndex() | ||
57 | + { | ||
58 | + return $this->render('index'); | ||
59 | + } | ||
60 | + | ||
61 | + public function actionLogin() | ||
62 | + { | ||
63 | + if (!\Yii::$app->user->isGuest) { | ||
64 | + return $this->goHome(); | ||
65 | + } | ||
66 | + | ||
67 | + $model = new LoginForm(); | ||
68 | + if ($model->load(Yii::$app->request->post()) && $model->login()) { | ||
69 | + return $this->goBack(); | ||
70 | + } else { | ||
71 | + return $this->render('login', [ | ||
72 | + 'model' => $model, | ||
73 | + ]); | ||
74 | + } | ||
75 | + } | ||
76 | + | ||
77 | + public function actionLogout() | ||
78 | + { | ||
79 | + Yii::$app->user->logout(); | ||
80 | + | ||
81 | + return $this->goHome(); | ||
82 | + } | ||
83 | +} |
1 | +++ a/backend/controllers/TeamController.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\controllers; | ||
4 | + | ||
5 | +use backend\models\TeamSkils; | ||
6 | +use backend\models\TeamBooks; | ||
7 | +use Yii; | ||
8 | +use backend\models\Team; | ||
9 | +use backend\models\TeamSearch; | ||
10 | +use yii\web\Controller; | ||
11 | +use yii\web\NotFoundHttpException; | ||
12 | +use yii\filters\VerbFilter; | ||
13 | +use yii\web\UploadedFile; | ||
14 | +use yii\helpers\Html; | ||
15 | +use yii\helpers\Url; | ||
16 | +use pavlinter\multifields\ModelHelper; | ||
17 | +use yii\web\Response; | ||
18 | +use yii\helpers\ArrayHelper; | ||
19 | + | ||
20 | +/** | ||
21 | + * TeamController implements the CRUD actions for Team model. | ||
22 | + */ | ||
23 | +class TeamController extends Controller | ||
24 | +{ | ||
25 | + public function behaviors() | ||
26 | + { | ||
27 | + return [ | ||
28 | + 'verbs' => [ | ||
29 | + 'class' => VerbFilter::className(), | ||
30 | + 'actions' => [ | ||
31 | + 'delete' => ['post'], | ||
32 | + ], | ||
33 | + ], | ||
34 | + ]; | ||
35 | + } | ||
36 | + | ||
37 | + /** | ||
38 | + * Lists all Team models. | ||
39 | + * @return mixed | ||
40 | + */ | ||
41 | + public function actionIndex() | ||
42 | + { | ||
43 | + $searchModel = new TeamSearch(); | ||
44 | + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | ||
45 | + | ||
46 | + return $this->render('index', [ | ||
47 | + 'searchModel' => $searchModel, | ||
48 | + 'dataProvider' => $dataProvider, | ||
49 | + ]); | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
53 | + * Displays a single Team model. | ||
54 | + * @param integer $id | ||
55 | + * @return mixed | ||
56 | + */ | ||
57 | + public function actionView($id) | ||
58 | + { | ||
59 | + return $this->render('view', [ | ||
60 | + 'model' => $this->findModel($id), | ||
61 | + ]); | ||
62 | + } | ||
63 | + | ||
64 | + /** | ||
65 | + * Creates a new Team model. | ||
66 | + * If creation is successful, the browser will be redirected to the 'view' page. | ||
67 | + * @return mixed | ||
68 | + */ | ||
69 | + public function actionCreate() | ||
70 | + { | ||
71 | + $model = new Team(); | ||
72 | + | ||
73 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
74 | + $this->_uploadFile($model, 'file', 'photo', 'team'); | ||
75 | + $this->_uploadFile($model, 'file2', 'photo_big', 'team/big'); | ||
76 | + return $this->redirect(['view', 'id' => $model->id]); | ||
77 | + } else { | ||
78 | + return $this->render('create', [ | ||
79 | + 'model' => $model, | ||
80 | + ]); | ||
81 | + } | ||
82 | + } | ||
83 | + | ||
84 | + /** | ||
85 | + * Updates an existing Team model. | ||
86 | + * If update is successful, the browser will be redirected to the 'view' page. | ||
87 | + * @param integer $id | ||
88 | + * @return mixed | ||
89 | + */ | ||
90 | + public function actionUpdate($id) | ||
91 | + { | ||
92 | + $model = $this->findModel($id); | ||
93 | + | ||
94 | + // Get skills | ||
95 | + $skills = TeamSkils::find()->where(['team_id' => $id])->indexBy('id')->all(); | ||
96 | + if (empty($skills)) { | ||
97 | + $skills[] = new TeamSkils(['scenario' => 'multiFields']); | ||
98 | + } else { | ||
99 | + foreach ($skills as &$skill) { | ||
100 | + $skill->scenario = 'multiFields'; | ||
101 | + } | ||
102 | + } | ||
103 | + | ||
104 | + // Get books | ||
105 | + $books = TeamBooks::find()->where(['team_id' => $id])->indexBy('id')->all(); | ||
106 | + if (empty($books)) { | ||
107 | + $books[] = new TeamBooks(['scenario' => 'multiFields']); | ||
108 | + } else { | ||
109 | + foreach ($books as &$book) { | ||
110 | + $book->scenario = 'multiFields'; | ||
111 | + } | ||
112 | + } | ||
113 | + | ||
114 | + | ||
115 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
116 | + $this->_uploadFile($model, 'file', 'photo', 'team'); | ||
117 | + $this->_uploadFile($model, 'file2', 'photo_big', 'team/big'); | ||
118 | + | ||
119 | + $this->_updateSkills($model, Yii::$app->request->post('TeamSkils'), $skills); | ||
120 | + $this->_updateBooks($model, Yii::$app->request->post('TeamBooks'), $books); | ||
121 | + | ||
122 | + return $this->redirect(['view', 'id' => $model->id]); | ||
123 | + } else { | ||
124 | + return $this->render('update', [ | ||
125 | + 'model' => $model, | ||
126 | + 'skills' => $skills, | ||
127 | + 'books' => $books, | ||
128 | + ]); | ||
129 | + } | ||
130 | + } | ||
131 | + | ||
132 | + private function _updateSkills($model, $post = [], $exists = []) { | ||
133 | + $exists_ids = []; | ||
134 | + foreach ( $exists as $row ) { | ||
135 | + if ($row->id > 0) | ||
136 | + $exists_ids[$row->id] = $row->id; | ||
137 | + } | ||
138 | + | ||
139 | + foreach ($post as $id => $data) { | ||
140 | + if ($id > 0 && in_array($id, $exists_ids)) { | ||
141 | + unset($exists_ids[$id]); | ||
142 | + // Exists row | ||
143 | + $modelRow = TeamSkils::findOne($id); | ||
144 | + if ($modelRow) { | ||
145 | + $dataArray = [ | ||
146 | + 'TeamSkils' => [ | ||
147 | + 'title' => $data['title'], | ||
148 | + 'value' => floatval(str_replace([',', ' '], ['.', ''], trim($data['value']))) | ||
149 | + ] | ||
150 | + ]; | ||
151 | + $modelRow->load( $dataArray ); | ||
152 | + $modelRow->save(); | ||
153 | + } | ||
154 | + } else { | ||
155 | + // New row | ||
156 | + if (empty($data['title'])) continue; | ||
157 | + | ||
158 | + $modelRow = new TeamSkils(); | ||
159 | + $dataArray = [ | ||
160 | + 'TeamSkils' => [ | ||
161 | + 'team_id' => $model->id, | ||
162 | + 'title' => $data['title'], | ||
163 | + 'value' => floatval(str_replace([',', ' '], ['.', ''], trim($data['value']))) | ||
164 | + ] | ||
165 | + ]; | ||
166 | + | ||
167 | + $modelRow->load( $dataArray ); | ||
168 | + $modelRow->save(); | ||
169 | + } | ||
170 | + } | ||
171 | + | ||
172 | + foreach ( $exists_ids as $id ) { | ||
173 | + $this->findModel($id)->delete(); | ||
174 | + } | ||
175 | + } | ||
176 | + | ||
177 | + private function _updateBooks($model, $post = [], $exists = []) { | ||
178 | + $exists_ids = []; | ||
179 | + foreach ( $exists as $row ) { | ||
180 | + if ($row->id > 0) | ||
181 | + $exists_ids[$row->id] = $row->id; | ||
182 | + } | ||
183 | + | ||
184 | + foreach ($post as $id => $data) { | ||
185 | + if ($id > 0 && in_array($id, $exists_ids)) { | ||
186 | + unset($exists_ids[$id]); | ||
187 | + // Exists row | ||
188 | + $modelRow = TeamBooks::findOne($id); | ||
189 | + if ($modelRow) { | ||
190 | + $dataArray = [ | ||
191 | + 'TeamBooks' => [ | ||
192 | + 'title' => $data['title'] | ||
193 | + ] | ||
194 | + ]; | ||
195 | + $modelRow->load( $dataArray ); | ||
196 | + $modelRow->save(); | ||
197 | + | ||
198 | + $files = UploadedFile::getInstances($model, $varnameFile); | ||
199 | + | ||
200 | +// $this->_uploadFiles($modelRow, 'TeamBooks[1]', 'cover', 'team/books'); | ||
201 | + } | ||
202 | + } else { | ||
203 | + // New row | ||
204 | + if (empty($data['title'])) continue; | ||
205 | + | ||
206 | + $modelRow = new TeamBooks(); | ||
207 | + $dataArray = [ | ||
208 | + 'TeamBooks' => [ | ||
209 | + 'team_id' => $model->id, | ||
210 | + 'title' => $data['title'], | ||
211 | + 'cover' => '' | ||
212 | + ] | ||
213 | + ]; | ||
214 | + | ||
215 | + $modelRow->load( $dataArray ); | ||
216 | + $modelRow->save(); | ||
217 | + | ||
218 | + $this->_uploadFiles($modelRow, 'TeamBooks', 'cover', 'team/books'); | ||
219 | + } | ||
220 | + } | ||
221 | + | ||
222 | + foreach ( $exists_ids as $id ) { | ||
223 | + $this->findModel($id)->delete(); | ||
224 | + } | ||
225 | + } | ||
226 | + | ||
227 | + private function _uploadFile($model, $varnameFile, $varnameField, $dir = 'team') { | ||
228 | + $file = UploadedFile::getInstance($model, $varnameFile); | ||
229 | + | ||
230 | + if (!empty($file)) { | ||
231 | + $fileName = $dir .'/' . $file->basename . '.' . $file->extension; | ||
232 | + $filePath = Yii::getAlias( '@filesDir' ) .'/'. $fileName; | ||
233 | + $i = 1; | ||
234 | + while (file_exists($filePath)) { | ||
235 | + $fileName = $dir. '/' . $file->basename .'_'. $i . '.' . $file->extension; | ||
236 | + $filePath = Yii::getAlias( '@filesDir' ) .'/'. $fileName; | ||
237 | + $i++; | ||
238 | + } | ||
239 | + $file->saveAs( $filePath ); | ||
240 | + $model->{$varnameField} = $fileName; | ||
241 | + $model->save(); | ||
242 | + } | ||
243 | + } | ||
244 | + | ||
245 | + private function _uploadFiles($model, $varnameFile, $varnameField, $dir = 'team') { | ||
246 | + $file = UploadedFile::getInstances($model, $varnameFile); | ||
247 | + | ||
248 | + if (!empty($file)) { | ||
249 | + $fileName = $dir .'/' . $file->basename . '.' . $file->extension; | ||
250 | + $filePath = Yii::getAlias( '@filesDir' ) .'/'. $fileName; | ||
251 | + $i = 1; | ||
252 | + while (file_exists($filePath)) { | ||
253 | + $fileName = $dir. '/' . $file->basename .'_'. $i . '.' . $file->extension; | ||
254 | + $filePath = Yii::getAlias( '@filesDir' ) .'/'. $fileName; | ||
255 | + $i++; | ||
256 | + } | ||
257 | + $file->saveAs( $filePath ); | ||
258 | + $model->{$varnameField} = $fileName; | ||
259 | + $model->save(); | ||
260 | + } | ||
261 | + } | ||
262 | + | ||
263 | + /** | ||
264 | + * Deletes an existing Team model. | ||
265 | + * If deletion is successful, the browser will be redirected to the 'index' page. | ||
266 | + * @param integer $id | ||
267 | + * @return mixed | ||
268 | + */ | ||
269 | + public function actionDelete($id) | ||
270 | + { | ||
271 | + $this->findModel($id)->delete(); | ||
272 | + | ||
273 | + return $this->redirect(['index']); | ||
274 | + } | ||
275 | + | ||
276 | + public function actionDeleteSkill() | ||
277 | + { | ||
278 | + $id = Yii::$app->request->post('id'); | ||
279 | + $model = TeamSkils::findOne($id); | ||
280 | + if ($model !== null) { | ||
281 | + $model->delete(); | ||
282 | + } | ||
283 | + Yii::$app->response->format = Response::FORMAT_JSON; | ||
284 | + return ['r' => 1]; | ||
285 | + } | ||
286 | + | ||
287 | + /** | ||
288 | + * Finds the Team model based on its primary key value. | ||
289 | + * If the model is not found, a 404 HTTP exception will be thrown. | ||
290 | + * @param integer $id | ||
291 | + * @return Team the loaded model | ||
292 | + * @throws NotFoundHttpException if the model cannot be found | ||
293 | + */ | ||
294 | + protected function findModel($id) | ||
295 | + { | ||
296 | + if (($model = Team::findOne($id)) !== null) { | ||
297 | + return $model; | ||
298 | + } else { | ||
299 | + throw new NotFoundHttpException('The requested page does not exist.'); | ||
300 | + } | ||
301 | + } | ||
302 | +} |
1 | +++ a/backend/controllers/TeamSkilsController.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\controllers; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use backend\models\TeamSkils; | ||
7 | +use yii\data\ActiveDataProvider; | ||
8 | +use yii\web\Controller; | ||
9 | +use yii\web\NotFoundHttpException; | ||
10 | +use yii\filters\VerbFilter; | ||
11 | + | ||
12 | +/** | ||
13 | + * TeamSkilsController implements the CRUD actions for TeamSkils model. | ||
14 | + */ | ||
15 | +class TeamSkilsController 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 TeamSkils models. | ||
31 | + * @return mixed | ||
32 | + */ | ||
33 | + public function actionIndex() | ||
34 | + { | ||
35 | + $dataProvider = new ActiveDataProvider([ | ||
36 | + 'query' => TeamSkils::find(), | ||
37 | + ]); | ||
38 | + | ||
39 | + return $this->render('index', [ | ||
40 | + 'dataProvider' => $dataProvider, | ||
41 | + ]); | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * Displays a single TeamSkils 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 TeamSkils 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 TeamSkils(); | ||
64 | + | ||
65 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
66 | + return $this->redirect(['view', 'id' => $model->id]); | ||
67 | + } else { | ||
68 | + return $this->render('create', [ | ||
69 | + 'model' => $model, | ||
70 | + ]); | ||
71 | + } | ||
72 | + } | ||
73 | + | ||
74 | + /** | ||
75 | + * Updates an existing TeamSkils 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->id]); | ||
86 | + } else { | ||
87 | + return $this->render('update', [ | ||
88 | + 'model' => $model, | ||
89 | + ]); | ||
90 | + } | ||
91 | + } | ||
92 | + | ||
93 | + /** | ||
94 | + * Deletes an existing TeamSkils 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 TeamSkils 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 TeamSkils the loaded model | ||
111 | + * @throws NotFoundHttpException if the model cannot be found | ||
112 | + */ | ||
113 | + protected function findModel($id) | ||
114 | + { | ||
115 | + if (($model = TeamSkils::findOne($id)) !== null) { | ||
116 | + return $model; | ||
117 | + } else { | ||
118 | + throw new NotFoundHttpException('The requested page does not exist.'); | ||
119 | + } | ||
120 | + } | ||
121 | +} |
1 | +++ a/backend/models/Clients.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "clients". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property string $title | ||
12 | + * @property string $description | ||
13 | + * @property string $logo | ||
14 | + * @property integer $visible | ||
15 | + * @property integer $position | ||
16 | + */ | ||
17 | +class Clients extends \yii\db\ActiveRecord | ||
18 | +{ | ||
19 | + public $file; | ||
20 | + /** | ||
21 | + * @inheritdoc | ||
22 | + */ | ||
23 | + public static function tableName() | ||
24 | + { | ||
25 | + return 'clients'; | ||
26 | + } | ||
27 | + | ||
28 | + /** | ||
29 | + * @inheritdoc | ||
30 | + */ | ||
31 | + public function rules() | ||
32 | + { | ||
33 | + return [ | ||
34 | + [['title'], 'required'], | ||
35 | + [['description'], 'string'], | ||
36 | + [['visible', 'position'], 'integer'], | ||
37 | + [['title'], 'string', 'max' => 200], | ||
38 | + [['file'], 'file'], | ||
39 | + [['logo'], 'string', 'max' => 255], | ||
40 | + [['link'], 'string', 'max' => 255] | ||
41 | + ]; | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * @inheritdoc | ||
46 | + */ | ||
47 | + public function attributeLabels() | ||
48 | + { | ||
49 | + return [ | ||
50 | + 'id' => Yii::t('app', 'ID'), | ||
51 | + 'title' => Yii::t('app', 'Title'), | ||
52 | + 'description' => Yii::t('app', 'Description'), | ||
53 | + 'file' => Yii::t('app', 'Logo'), | ||
54 | + 'link' => Yii::t('app', 'Link'), | ||
55 | + 'visible' => Yii::t('app', 'Status'), | ||
56 | +// 'position' => Yii::t('app', 'Position'), | ||
57 | + ]; | ||
58 | + } | ||
59 | +} |
1 | +++ a/backend/models/ClientsSearch.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use yii\base\Model; | ||
7 | +use yii\data\ActiveDataProvider; | ||
8 | +use backend\models\Clients; | ||
9 | + | ||
10 | +/** | ||
11 | + * ClientsSearch represents the model behind the search form about `backend\models\Clients`. | ||
12 | + */ | ||
13 | +class ClientsSearch extends Clients | ||
14 | +{ | ||
15 | + /** | ||
16 | + * @inheritdoc | ||
17 | + */ | ||
18 | + public function rules() | ||
19 | + { | ||
20 | + return [ | ||
21 | + [['id', 'visible', 'position'], 'integer'], | ||
22 | + [['title', 'description', 'link'], '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 = Clients::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 | + 'id' => $this->id, | ||
60 | + 'visible' => $this->visible, | ||
61 | + 'position' => $this->position, | ||
62 | + ]); | ||
63 | + | ||
64 | + $query->andFilterWhere(['like', 'title', $this->title]) | ||
65 | + ->andFilterWhere(['like', 'description', $this->description]) | ||
66 | + ->andFilterWhere(['like', 'link', $this->link]); | ||
67 | + | ||
68 | + return $dataProvider; | ||
69 | + } | ||
70 | +} |
1 | +++ a/backend/models/Departments.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "departments". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property string $title | ||
12 | + * @property string $description | ||
13 | + * @property integer $visible | ||
14 | + * | ||
15 | + * @property Team[] $teams | ||
16 | + */ | ||
17 | +class Departments extends \yii\db\ActiveRecord | ||
18 | +{ | ||
19 | + /** | ||
20 | + * @inheritdoc | ||
21 | + */ | ||
22 | + public static function tableName() | ||
23 | + { | ||
24 | + return 'departments'; | ||
25 | + } | ||
26 | + | ||
27 | + /** | ||
28 | + * @inheritdoc | ||
29 | + */ | ||
30 | + public function rules() | ||
31 | + { | ||
32 | + return [ | ||
33 | + [['title'], 'required'], | ||
34 | + [['description'], 'string'], | ||
35 | + [['visible'], 'integer'], | ||
36 | + [['title'], 'string', 'max' => 150] | ||
37 | + ]; | ||
38 | + } | ||
39 | + | ||
40 | + /** | ||
41 | + * @inheritdoc | ||
42 | + */ | ||
43 | + public function attributeLabels() | ||
44 | + { | ||
45 | + return [ | ||
46 | + 'id' => Yii::t('app', 'ID'), | ||
47 | + 'title' => Yii::t('app', 'Title'), | ||
48 | + 'description' => Yii::t('app', 'Description'), | ||
49 | + 'visible' => Yii::t('app', 'Visible'), | ||
50 | + ]; | ||
51 | + } | ||
52 | + | ||
53 | + /** | ||
54 | + * @return \yii\db\ActiveQuery | ||
55 | + */ | ||
56 | + public function getTeams() | ||
57 | + { | ||
58 | + return $this->hasMany(Team::className(), ['department_id' => 'id']); | ||
59 | + } | ||
60 | +} |
1 | +++ a/backend/models/DepartmentsSearch.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use yii\base\Model; | ||
7 | +use yii\data\ActiveDataProvider; | ||
8 | +use backend\models\Departments; | ||
9 | + | ||
10 | +/** | ||
11 | + * DepartmentsSearch represents the model behind the search form about `backend\models\Departments`. | ||
12 | + */ | ||
13 | +class DepartmentsSearch extends Departments | ||
14 | +{ | ||
15 | + /** | ||
16 | + * @inheritdoc | ||
17 | + */ | ||
18 | + public function rules() | ||
19 | + { | ||
20 | + return [ | ||
21 | + [['id', 'visible'], 'integer'], | ||
22 | + [['title', 'description'], '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 = Departments::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 | + 'id' => $this->id, | ||
60 | + 'visible' => $this->visible, | ||
61 | + ]); | ||
62 | + | ||
63 | + $query->andFilterWhere(['like', 'title', $this->title]) | ||
64 | + ->andFilterWhere(['like', 'description', $this->description]); | ||
65 | + | ||
66 | + return $dataProvider; | ||
67 | + } | ||
68 | +} |
1 | +++ a/backend/models/Team.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use backend\models\TeamSkils; | ||
7 | + | ||
8 | +/** | ||
9 | + * This is the model class for table "team". | ||
10 | + * | ||
11 | + * @property integer $id | ||
12 | + * @property integer $department_id | ||
13 | + * @property integer $user_id | ||
14 | + * @property string $name | ||
15 | + * @property string $name2 | ||
16 | + * @property string $email | ||
17 | + * @property string $job | ||
18 | + * @property string $zodiac | ||
19 | + * @property integer $iq | ||
20 | + * @property string $soc_vk | ||
21 | + * @property string $soc_fb | ||
22 | + * @property string $soc_tw | ||
23 | + * @property string $soc_li | ||
24 | + * @property string $interests_caption | ||
25 | + * @property string $skils_caption | ||
26 | + * @property string $books_caption | ||
27 | + * @property string $films_caption | ||
28 | + * @property string $description | ||
29 | + * @property string $photo | ||
30 | + * @property string $photo_big | ||
31 | + * @property integer $visible | ||
32 | + * | ||
33 | + * @property Departments $department | ||
34 | + * @property TeamFilms[] $teamFilms | ||
35 | + * @property TeamHumors[] $teamHumors | ||
36 | + * @property TeamInterests[] $teamInterests | ||
37 | + * @property TeamSkils[] $teamSkils | ||
38 | + */ | ||
39 | +class Team extends \yii\db\ActiveRecord | ||
40 | +{ | ||
41 | + public $file; | ||
42 | + public $file2; | ||
43 | + | ||
44 | + /** | ||
45 | + * @inheritdoc | ||
46 | + */ | ||
47 | + public static function tableName() | ||
48 | + { | ||
49 | + return 'team'; | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
53 | + * @inheritdoc | ||
54 | + */ | ||
55 | + public function rules() | ||
56 | + { | ||
57 | + return [ | ||
58 | + [['department_id', 'name', 'name2', 'job'], 'required'], | ||
59 | + [['department_id', 'user_id', 'iq', 'visible'], 'integer'], | ||
60 | + [['zodiac', 'interests_caption', 'skils_caption', 'books_caption', 'films_caption', 'description'], 'string'], | ||
61 | + [['name', 'name2', 'job'], 'string', 'max' => 150], | ||
62 | + [['file', 'file2'], 'file'], | ||
63 | + [['email', 'soc_vk', 'soc_fb', 'soc_tw', 'soc_li'], 'string', 'max' => 255] | ||
64 | + ]; | ||
65 | + } | ||
66 | + | ||
67 | + /** | ||
68 | + * @inheritdoc | ||
69 | + */ | ||
70 | + public function attributeLabels() | ||
71 | + { | ||
72 | + return [ | ||
73 | + 'id' => Yii::t('app', 'ID'), | ||
74 | + 'department_id' => Yii::t('app', 'Department ID'), | ||
75 | + 'user_id' => Yii::t('app', 'User ID'), | ||
76 | + 'name' => Yii::t('app', 'Name'), | ||
77 | + 'name2' => Yii::t('app', 'Name2'), | ||
78 | + 'email' => Yii::t('app', 'Email'), | ||
79 | + 'job' => Yii::t('app', 'Job'), | ||
80 | + 'zodiac' => Yii::t('app', 'Zodiac'), | ||
81 | + 'iq' => Yii::t('app', 'Iq'), | ||
82 | + 'soc_vk' => Yii::t('app', 'Soc Vk'), | ||
83 | + 'soc_fb' => Yii::t('app', 'Soc Fb'), | ||
84 | + 'soc_tw' => Yii::t('app', 'Soc Tw'), | ||
85 | + 'soc_li' => Yii::t('app', 'Soc Li'), | ||
86 | + 'interests_caption' => Yii::t('app', 'Interests Caption'), | ||
87 | + 'skils_caption' => Yii::t('app', 'Skils Caption'), | ||
88 | + 'books_caption' => Yii::t('app', 'Books Caption'), | ||
89 | + 'films_caption' => Yii::t('app', 'Films Caption'), | ||
90 | + 'description' => Yii::t('app', 'Description'), | ||
91 | + 'file' => Yii::t('app', 'Photo'), | ||
92 | + 'file2' => Yii::t('app', 'Photo Big'), | ||
93 | + 'visible' => Yii::t('app', 'Visible'), | ||
94 | + ]; | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * @return \yii\db\ActiveQuery | ||
99 | + */ | ||
100 | + public function getDepartment() | ||
101 | + { | ||
102 | + return $this->hasOne(Departments::className(), ['id' => 'department_id']); | ||
103 | + } | ||
104 | + | ||
105 | + /** | ||
106 | + * @return \yii\db\ActiveQuery | ||
107 | + */ | ||
108 | + public function getTeamFilms() | ||
109 | + { | ||
110 | + return $this->hasMany(TeamFilms::className(), ['team_id' => 'id']); | ||
111 | + } | ||
112 | + | ||
113 | + /** | ||
114 | + * @return \yii\db\ActiveQuery | ||
115 | + */ | ||
116 | + public function getTeamHumors() | ||
117 | + { | ||
118 | + return $this->hasMany(TeamHumors::className(), ['team_id' => 'id']); | ||
119 | + } | ||
120 | + | ||
121 | + /** | ||
122 | + * @return \yii\db\ActiveQuery | ||
123 | + */ | ||
124 | + public function getTeamInterests() | ||
125 | + { | ||
126 | + return $this->hasMany(TeamInterests::className(), ['team_id' => 'id']); | ||
127 | + } | ||
128 | + | ||
129 | + /** | ||
130 | + * @return \yii\db\ActiveQuery | ||
131 | + */ | ||
132 | + public function getTeamSkils() | ||
133 | + { | ||
134 | + return $this->hasMany(TeamSkils::className(), ['team_id' => 'id']); | ||
135 | + } | ||
136 | + | ||
137 | + /** | ||
138 | + * @return \yii\db\ActiveQuery | ||
139 | + */ | ||
140 | +// public function getUser() | ||
141 | +// { | ||
142 | +// return $this->hasMany(UserSkils::className(), ['user_id' => 'id']); | ||
143 | +// } | ||
144 | +} |
1 | +++ a/backend/models/TeamBooks.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "team_books". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property integer $team_id | ||
12 | + * @property string $title | ||
13 | + * @property string $cover | ||
14 | + */ | ||
15 | +class TeamBooks extends \yii\db\ActiveRecord | ||
16 | +{ | ||
17 | + public $books_file; | ||
18 | + /** | ||
19 | + * @inheritdoc | ||
20 | + */ | ||
21 | + public static function tableName() | ||
22 | + { | ||
23 | + return 'team_books'; | ||
24 | + } | ||
25 | + | ||
26 | + /** | ||
27 | + * @inheritdoc | ||
28 | + */ | ||
29 | + public function rules() | ||
30 | + { | ||
31 | + return [ | ||
32 | + [['team_id', 'title'], 'required'], | ||
33 | + [['team_id'], 'integer'], | ||
34 | + [['title'], 'string', 'max' => 120], | ||
35 | + [['books_file'], 'file'], | ||
36 | + [['cover'], 'string', 'max' => 255] | ||
37 | + ]; | ||
38 | + } | ||
39 | + | ||
40 | + /** | ||
41 | + * @inheritdoc | ||
42 | + */ | ||
43 | + public function attributeLabels() | ||
44 | + { | ||
45 | + return [ | ||
46 | + 'id' => Yii::t('app', 'ID'), | ||
47 | + 'team_id' => Yii::t('app', 'Team ID'), | ||
48 | + 'title' => Yii::t('app', 'Title'), | ||
49 | + 'books_file' => Yii::t('app', 'Cover'), | ||
50 | + ]; | ||
51 | + } | ||
52 | +} |
1 | +++ a/backend/models/TeamSearch.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use yii\base\Model; | ||
7 | +use yii\data\ActiveDataProvider; | ||
8 | +use backend\models\Team; | ||
9 | + | ||
10 | +/** | ||
11 | + * TeamSearch represents the model behind the search form about `app\models\Team`. | ||
12 | + */ | ||
13 | +class TeamSearch extends Team | ||
14 | +{ | ||
15 | + /** | ||
16 | + * @inheritdoc | ||
17 | + */ | ||
18 | + public function rules() | ||
19 | + { | ||
20 | + return [ | ||
21 | + [['id', 'department_id', 'user_id', 'iq', 'visible'], 'integer'], | ||
22 | + [['name', 'name2', 'email', 'job', 'zodiac', 'soc_vk', 'soc_fb', 'soc_tw', 'soc_li', 'interests_caption', 'skils_caption', 'books_caption', 'films_caption', 'description', 'photo', 'photo_big'], '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 = Team::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 | + 'id' => $this->id, | ||
60 | + 'department_id' => $this->department_id, | ||
61 | + 'user_id' => $this->user_id, | ||
62 | + 'iq' => $this->iq, | ||
63 | + 'visible' => $this->visible, | ||
64 | + ]); | ||
65 | + | ||
66 | + $query->andFilterWhere(['like', 'name', $this->name]) | ||
67 | + ->andFilterWhere(['like', 'name2', $this->name2]) | ||
68 | + ->andFilterWhere(['like', 'email', $this->email]) | ||
69 | + ->andFilterWhere(['like', 'job', $this->job]) | ||
70 | + ->andFilterWhere(['like', 'zodiac', $this->zodiac]) | ||
71 | + ->andFilterWhere(['like', 'soc_vk', $this->soc_vk]) | ||
72 | + ->andFilterWhere(['like', 'soc_fb', $this->soc_fb]) | ||
73 | + ->andFilterWhere(['like', 'soc_tw', $this->soc_tw]) | ||
74 | + ->andFilterWhere(['like', 'soc_li', $this->soc_li]) | ||
75 | + ->andFilterWhere(['like', 'interests_caption', $this->interests_caption]) | ||
76 | + ->andFilterWhere(['like', 'skils_caption', $this->skils_caption]) | ||
77 | + ->andFilterWhere(['like', 'books_caption', $this->books_caption]) | ||
78 | + ->andFilterWhere(['like', 'films_caption', $this->films_caption]) | ||
79 | + ->andFilterWhere(['like', 'description', $this->description]) | ||
80 | + ->andFilterWhere(['like', 'photo', $this->photo]) | ||
81 | + ->andFilterWhere(['like', 'photo_big', $this->photo_big]); | ||
82 | + | ||
83 | + return $dataProvider; | ||
84 | + } | ||
85 | +} |
1 | +++ a/backend/models/TeamSkils.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "team_skils". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property integer $team_id | ||
12 | + * @property string $title | ||
13 | + * @property double $value | ||
14 | + * | ||
15 | + * @property Team $team | ||
16 | + */ | ||
17 | +class TeamSkils extends \yii\db\ActiveRecord | ||
18 | +{ | ||
19 | + /** | ||
20 | + * @inheritdoc | ||
21 | + */ | ||
22 | + public static function tableName() | ||
23 | + { | ||
24 | + return 'team_skils'; | ||
25 | + } | ||
26 | + | ||
27 | + /** | ||
28 | + * @inheritdoc | ||
29 | + */ | ||
30 | + public function rules() | ||
31 | + { | ||
32 | + return [ | ||
33 | + [['team_id', 'title', 'value'], 'required'], | ||
34 | + [['team_id'], 'integer'], | ||
35 | + [['value'], 'number'], | ||
36 | + [['title'], 'string', 'max' => 120] | ||
37 | + ]; | ||
38 | + } | ||
39 | + | ||
40 | + /** | ||
41 | + * @inheritdoc | ||
42 | + */ | ||
43 | + public function attributeLabels() | ||
44 | + { | ||
45 | + return [ | ||
46 | + 'id' => Yii::t('app', 'ID'), | ||
47 | + 'team_id' => Yii::t('app', 'Team ID'), | ||
48 | + 'title' => Yii::t('app', 'Title'), | ||
49 | + 'value' => Yii::t('app', 'Value'), | ||
50 | + ]; | ||
51 | + } | ||
52 | + | ||
53 | + /** | ||
54 | + * @return \yii\db\ActiveQuery | ||
55 | + */ | ||
56 | + public function getTeam() | ||
57 | + { | ||
58 | + return $this->hasOne(Team::className(), ['id' => 'team_id']); | ||
59 | + } | ||
60 | +} |
1 | +++ a/backend/models/User.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "user". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property string $username | ||
12 | + * @property string $auth_key | ||
13 | + * @property string $password_hash | ||
14 | + * @property string $password_reset_token | ||
15 | + * @property string $email | ||
16 | + * @property integer $status | ||
17 | + * @property integer $created_at | ||
18 | + * @property integer $updated_at | ||
19 | + * | ||
20 | + * @property Team[] $teams | ||
21 | + */ | ||
22 | +class User extends \yii\db\ActiveRecord | ||
23 | +{ | ||
24 | + /** | ||
25 | + * @inheritdoc | ||
26 | + */ | ||
27 | + public static function tableName() | ||
28 | + { | ||
29 | + return 'user'; | ||
30 | + } | ||
31 | + | ||
32 | + /** | ||
33 | + * @inheritdoc | ||
34 | + */ | ||
35 | + public function rules() | ||
36 | + { | ||
37 | + return [ | ||
38 | + [['username', 'auth_key', 'password_hash', 'email', 'created_at', 'updated_at'], 'required'], | ||
39 | + [['status', 'created_at', 'updated_at'], 'integer'], | ||
40 | + [['username', 'password_hash', 'password_reset_token', 'email'], 'string', 'max' => 255], | ||
41 | + [['auth_key'], 'string', 'max' => 32], | ||
42 | + [['username'], 'unique'], | ||
43 | + [['email'], 'unique'], | ||
44 | + [['password_reset_token'], 'unique'] | ||
45 | + ]; | ||
46 | + } | ||
47 | + | ||
48 | + /** | ||
49 | + * @inheritdoc | ||
50 | + */ | ||
51 | + public function attributeLabels() | ||
52 | + { | ||
53 | + return [ | ||
54 | + 'id' => Yii::t('app', 'ID'), | ||
55 | + 'username' => Yii::t('app', 'Username'), | ||
56 | + 'auth_key' => Yii::t('app', 'Auth Key'), | ||
57 | + 'password_hash' => Yii::t('app', 'Password Hash'), | ||
58 | + 'password_reset_token' => Yii::t('app', 'Password Reset Token'), | ||
59 | + 'email' => Yii::t('app', 'Email'), | ||
60 | + 'status' => Yii::t('app', 'Status'), | ||
61 | + 'created_at' => Yii::t('app', 'Created At'), | ||
62 | + 'updated_at' => Yii::t('app', 'Updated At'), | ||
63 | + ]; | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * @return \yii\db\ActiveQuery | ||
68 | + */ | ||
69 | + public function getTeams() | ||
70 | + { | ||
71 | + return $this->hasMany(Team::className(), ['user_id' => 'id']); | ||
72 | + } | ||
73 | +} |
1 | +++ a/backend/views/adminlte/layouts/content.php | ||
1 | +<?php | ||
2 | +use yii\widgets\Breadcrumbs; | ||
3 | +use dmstr\widgets\Alert; | ||
4 | + | ||
5 | +?> | ||
6 | +<div class="content-wrapper"> | ||
7 | + <section class="content-header"> | ||
8 | + <?php if (isset($this->blocks['content-header'])) { ?> | ||
9 | + <h1><?= $this->blocks['content-header'] ?></h1> | ||
10 | + <?php } else { ?> | ||
11 | + <h1> | ||
12 | + <?php | ||
13 | + if ($this->title !== null) { | ||
14 | + echo \yii\helpers\Html::encode($this->title); | ||
15 | + } else { | ||
16 | + echo \yii\helpers\Inflector::camel2words( | ||
17 | + \yii\helpers\Inflector::id2camel($this->context->module->id) | ||
18 | + ); | ||
19 | + echo ($this->context->module->id !== \Yii::$app->id) ? '<small>Module</small>' : ''; | ||
20 | + } ?> | ||
21 | + </h1> | ||
22 | + <?php } ?> | ||
23 | + | ||
24 | + <?= | ||
25 | + Breadcrumbs::widget( | ||
26 | + [ | ||
27 | + 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | ||
28 | + ] | ||
29 | + ) ?> | ||
30 | + </section> | ||
31 | + | ||
32 | + <section class="content"> | ||
33 | + <?= Alert::widget() ?> | ||
34 | + <?= $content ?> | ||
35 | + </section> | ||
36 | +</div> | ||
37 | + | ||
38 | +<footer class="main-footer"> | ||
39 | + <div class="pull-right hidden-xs"> | ||
40 | + <b>Version</b> 2.0 | ||
41 | + </div> | ||
42 | + <strong>Copyright © 2014-2015 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights | ||
43 | + reserved. | ||
44 | +</footer> | ||
45 | + | ||
46 | +<!-- Control Sidebar --> | ||
47 | +<aside class="control-sidebar control-sidebar-dark"> | ||
48 | + <!-- Create the tabs --> | ||
49 | + <ul class="nav nav-tabs nav-justified control-sidebar-tabs"> | ||
50 | + <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li> | ||
51 | + <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li> | ||
52 | + </ul> | ||
53 | + <!-- Tab panes --> | ||
54 | + <div class="tab-content"> | ||
55 | + <!-- Home tab content --> | ||
56 | + <div class="tab-pane" id="control-sidebar-home-tab"> | ||
57 | + <h3 class="control-sidebar-heading">Recent Activity</h3> | ||
58 | + <ul class='control-sidebar-menu'> | ||
59 | + <li> | ||
60 | + <a href='javascript::;'> | ||
61 | + <i class="menu-icon fa fa-birthday-cake bg-red"></i> | ||
62 | + | ||
63 | + <div class="menu-info"> | ||
64 | + <h4 class="control-sidebar-subheading">Langdon's Birthday</h4> | ||
65 | + | ||
66 | + <p>Will be 23 on April 24th</p> | ||
67 | + </div> | ||
68 | + </a> | ||
69 | + </li> | ||
70 | + <li> | ||
71 | + <a href='javascript::;'> | ||
72 | + <i class="menu-icon fa fa-user bg-yellow"></i> | ||
73 | + | ||
74 | + <div class="menu-info"> | ||
75 | + <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4> | ||
76 | + | ||
77 | + <p>New phone +1(800)555-1234</p> | ||
78 | + </div> | ||
79 | + </a> | ||
80 | + </li> | ||
81 | + <li> | ||
82 | + <a href='javascript::;'> | ||
83 | + <i class="menu-icon fa fa-envelope-o bg-light-blue"></i> | ||
84 | + | ||
85 | + <div class="menu-info"> | ||
86 | + <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4> | ||
87 | + | ||
88 | + <p>nora@example.com</p> | ||
89 | + </div> | ||
90 | + </a> | ||
91 | + </li> | ||
92 | + <li> | ||
93 | + <a href='javascript::;'> | ||
94 | + <i class="menu-icon fa fa-file-code-o bg-green"></i> | ||
95 | + | ||
96 | + <div class="menu-info"> | ||
97 | + <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4> | ||
98 | + | ||
99 | + <p>Execution time 5 seconds</p> | ||
100 | + </div> | ||
101 | + </a> | ||
102 | + </li> | ||
103 | + </ul> | ||
104 | + <!-- /.control-sidebar-menu --> | ||
105 | + | ||
106 | + <h3 class="control-sidebar-heading">Tasks Progress</h3> | ||
107 | + <ul class='control-sidebar-menu'> | ||
108 | + <li> | ||
109 | + <a href='javascript::;'> | ||
110 | + <h4 class="control-sidebar-subheading"> | ||
111 | + Custom Template Design | ||
112 | + <span class="label label-danger pull-right">70%</span> | ||
113 | + </h4> | ||
114 | + | ||
115 | + <div class="progress progress-xxs"> | ||
116 | + <div class="progress-bar progress-bar-danger" style="width: 70%"></div> | ||
117 | + </div> | ||
118 | + </a> | ||
119 | + </li> | ||
120 | + <li> | ||
121 | + <a href='javascript::;'> | ||
122 | + <h4 class="control-sidebar-subheading"> | ||
123 | + Update Resume | ||
124 | + <span class="label label-success pull-right">95%</span> | ||
125 | + </h4> | ||
126 | + | ||
127 | + <div class="progress progress-xxs"> | ||
128 | + <div class="progress-bar progress-bar-success" style="width: 95%"></div> | ||
129 | + </div> | ||
130 | + </a> | ||
131 | + </li> | ||
132 | + <li> | ||
133 | + <a href='javascript::;'> | ||
134 | + <h4 class="control-sidebar-subheading"> | ||
135 | + Laravel Integration | ||
136 | + <span class="label label-waring pull-right">50%</span> | ||
137 | + </h4> | ||
138 | + | ||
139 | + <div class="progress progress-xxs"> | ||
140 | + <div class="progress-bar progress-bar-warning" style="width: 50%"></div> | ||
141 | + </div> | ||
142 | + </a> | ||
143 | + </li> | ||
144 | + <li> | ||
145 | + <a href='javascript::;'> | ||
146 | + <h4 class="control-sidebar-subheading"> | ||
147 | + Back End Framework | ||
148 | + <span class="label label-primary pull-right">68%</span> | ||
149 | + </h4> | ||
150 | + | ||
151 | + <div class="progress progress-xxs"> | ||
152 | + <div class="progress-bar progress-bar-primary" style="width: 68%"></div> | ||
153 | + </div> | ||
154 | + </a> | ||
155 | + </li> | ||
156 | + </ul> | ||
157 | + <!-- /.control-sidebar-menu --> | ||
158 | + | ||
159 | + </div> | ||
160 | + <!-- /.tab-pane --> | ||
161 | + | ||
162 | + <!-- Settings tab content --> | ||
163 | + <div class="tab-pane" id="control-sidebar-settings-tab"> | ||
164 | + <form method="post"> | ||
165 | + <h3 class="control-sidebar-heading">General Settings</h3> | ||
166 | + | ||
167 | + <div class="form-group"> | ||
168 | + <label class="control-sidebar-subheading"> | ||
169 | + Report panel usage | ||
170 | + <input type="checkbox" class="pull-right" checked/> | ||
171 | + </label> | ||
172 | + | ||
173 | + <p> | ||
174 | + Some information about this general settings option | ||
175 | + </p> | ||
176 | + </div> | ||
177 | + <!-- /.form-group --> | ||
178 | + | ||
179 | + <div class="form-group"> | ||
180 | + <label class="control-sidebar-subheading"> | ||
181 | + Allow mail redirect | ||
182 | + <input type="checkbox" class="pull-right" checked/> | ||
183 | + </label> | ||
184 | + | ||
185 | + <p> | ||
186 | + Other sets of options are available | ||
187 | + </p> | ||
188 | + </div> | ||
189 | + <!-- /.form-group --> | ||
190 | + | ||
191 | + <div class="form-group"> | ||
192 | + <label class="control-sidebar-subheading"> | ||
193 | + Expose author name in posts | ||
194 | + <input type="checkbox" class="pull-right" checked/> | ||
195 | + </label> | ||
196 | + | ||
197 | + <p> | ||
198 | + Allow the user to show his name in blog posts | ||
199 | + </p> | ||
200 | + </div> | ||
201 | + <!-- /.form-group --> | ||
202 | + | ||
203 | + <h3 class="control-sidebar-heading">Chat Settings</h3> | ||
204 | + | ||
205 | + <div class="form-group"> | ||
206 | + <label class="control-sidebar-subheading"> | ||
207 | + Show me as online | ||
208 | + <input type="checkbox" class="pull-right" checked/> | ||
209 | + </label> | ||
210 | + </div> | ||
211 | + <!-- /.form-group --> | ||
212 | + | ||
213 | + <div class="form-group"> | ||
214 | + <label class="control-sidebar-subheading"> | ||
215 | + Turn off notifications | ||
216 | + <input type="checkbox" class="pull-right"/> | ||
217 | + </label> | ||
218 | + </div> | ||
219 | + <!-- /.form-group --> | ||
220 | + | ||
221 | + <div class="form-group"> | ||
222 | + <label class="control-sidebar-subheading"> | ||
223 | + Delete chat history | ||
224 | + <a href="javascript::;" class="text-red pull-right"><i class="fa fa-trash-o"></i></a> | ||
225 | + </label> | ||
226 | + </div> | ||
227 | + <!-- /.form-group --> | ||
228 | + </form> | ||
229 | + </div> | ||
230 | + <!-- /.tab-pane --> | ||
231 | + </div> | ||
232 | +</aside><!-- /.control-sidebar --> | ||
233 | +<!-- Add the sidebar's background. This div must be placed | ||
234 | + immediately after the control sidebar --> | ||
235 | +<div class='control-sidebar-bg'></div> | ||
0 | \ No newline at end of file | 236 | \ No newline at end of file |
1 | +++ a/backend/views/adminlte/layouts/header.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | + | ||
4 | +/* @var $this \yii\web\View */ | ||
5 | +/* @var $content string */ | ||
6 | +?> | ||
7 | + | ||
8 | +<header class="main-header"> | ||
9 | + | ||
10 | + <?= Html::a('<span class="logo-mini">ArtWeb</span><span class="logo-lg">' . Yii::$app->name . '</span>', Yii::$app->homeUrl, ['class' => 'logo']) ?> | ||
11 | + | ||
12 | + <nav class="navbar navbar-static-top" role="navigation"> | ||
13 | + | ||
14 | + <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"> | ||
15 | + <span class="sr-only">Toggle navigation</span> | ||
16 | + </a> | ||
17 | + <?php | ||
18 | + /* | ||
19 | + <div class="navbar-custom-menu"> | ||
20 | + | ||
21 | + <ul class="nav navbar-nav"> | ||
22 | + | ||
23 | + <!-- Messages: style can be found in dropdown.less--> | ||
24 | + <li class="dropdown messages-menu"> | ||
25 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"> | ||
26 | + <i class="fa fa-envelope-o"></i> | ||
27 | + <span class="label label-success">4</span> | ||
28 | + </a> | ||
29 | + <ul class="dropdown-menu"> | ||
30 | + <li class="header">You have 4 messages</li> | ||
31 | + <li> | ||
32 | + <!-- inner menu: contains the actual data --> | ||
33 | + <ul class="menu"> | ||
34 | + <li><!-- start message --> | ||
35 | + <a href="#"> | ||
36 | + <div class="pull-left"> | ||
37 | + <img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="img-circle" | ||
38 | + alt="User Image"/> | ||
39 | + </div> | ||
40 | + <h4> | ||
41 | + Support Team | ||
42 | + <small><i class="fa fa-clock-o"></i> 5 mins</small> | ||
43 | + </h4> | ||
44 | + <p>Why not buy a new awesome theme?</p> | ||
45 | + </a> | ||
46 | + </li> | ||
47 | + <!-- end message --> | ||
48 | + <li> | ||
49 | + <a href="#"> | ||
50 | + <div class="pull-left"> | ||
51 | + <img src="<?= $directoryAsset ?>/img/user3-128x128.jpg" class="img-circle" | ||
52 | + alt="user image"/> | ||
53 | + </div> | ||
54 | + <h4> | ||
55 | + AdminLTE Design Team | ||
56 | + <small><i class="fa fa-clock-o"></i> 2 hours</small> | ||
57 | + </h4> | ||
58 | + <p>Why not buy a new awesome theme?</p> | ||
59 | + </a> | ||
60 | + </li> | ||
61 | + <li> | ||
62 | + <a href="#"> | ||
63 | + <div class="pull-left"> | ||
64 | + <img src="<?= $directoryAsset ?>/img/user4-128x128.jpg" class="img-circle" | ||
65 | + alt="user image"/> | ||
66 | + </div> | ||
67 | + <h4> | ||
68 | + Developers | ||
69 | + <small><i class="fa fa-clock-o"></i> Today</small> | ||
70 | + </h4> | ||
71 | + <p>Why not buy a new awesome theme?</p> | ||
72 | + </a> | ||
73 | + </li> | ||
74 | + <li> | ||
75 | + <a href="#"> | ||
76 | + <div class="pull-left"> | ||
77 | + <img src="<?= $directoryAsset ?>/img/user3-128x128.jpg" class="img-circle" | ||
78 | + alt="user image"/> | ||
79 | + </div> | ||
80 | + <h4> | ||
81 | + Sales Department | ||
82 | + <small><i class="fa fa-clock-o"></i> Yesterday</small> | ||
83 | + </h4> | ||
84 | + <p>Why not buy a new awesome theme?</p> | ||
85 | + </a> | ||
86 | + </li> | ||
87 | + <li> | ||
88 | + <a href="#"> | ||
89 | + <div class="pull-left"> | ||
90 | + <img src="<?= $directoryAsset ?>/img/user4-128x128.jpg" class="img-circle" | ||
91 | + alt="user image"/> | ||
92 | + </div> | ||
93 | + <h4> | ||
94 | + Reviewers | ||
95 | + <small><i class="fa fa-clock-o"></i> 2 days</small> | ||
96 | + </h4> | ||
97 | + <p>Why not buy a new awesome theme?</p> | ||
98 | + </a> | ||
99 | + </li> | ||
100 | + </ul> | ||
101 | + </li> | ||
102 | + <li class="footer"><a href="#">See All Messages</a></li> | ||
103 | + </ul> | ||
104 | + </li> | ||
105 | + <li class="dropdown notifications-menu"> | ||
106 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"> | ||
107 | + <i class="fa fa-bell-o"></i> | ||
108 | + <span class="label label-warning">10</span> | ||
109 | + </a> | ||
110 | + <ul class="dropdown-menu"> | ||
111 | + <li class="header">You have 10 notifications</li> | ||
112 | + <li> | ||
113 | + <!-- inner menu: contains the actual data --> | ||
114 | + <ul class="menu"> | ||
115 | + <li> | ||
116 | + <a href="#"> | ||
117 | + <i class="fa fa-users text-aqua"></i> 5 new members joined today | ||
118 | + </a> | ||
119 | + </li> | ||
120 | + <li> | ||
121 | + <a href="#"> | ||
122 | + <i class="fa fa-warning text-yellow"></i> Very long description here that may | ||
123 | + not fit into the page and may cause design problems | ||
124 | + </a> | ||
125 | + </li> | ||
126 | + <li> | ||
127 | + <a href="#"> | ||
128 | + <i class="fa fa-users text-red"></i> 5 new members joined | ||
129 | + </a> | ||
130 | + </li> | ||
131 | + | ||
132 | + <li> | ||
133 | + <a href="#"> | ||
134 | + <i class="fa fa-shopping-cart text-green"></i> 25 sales made | ||
135 | + </a> | ||
136 | + </li> | ||
137 | + <li> | ||
138 | + <a href="#"> | ||
139 | + <i class="fa fa-user text-red"></i> You changed your username | ||
140 | + </a> | ||
141 | + </li> | ||
142 | + </ul> | ||
143 | + </li> | ||
144 | + <li class="footer"><a href="#">View all</a></li> | ||
145 | + </ul> | ||
146 | + </li> | ||
147 | + <!-- Tasks: style can be found in dropdown.less --> | ||
148 | + <li class="dropdown tasks-menu"> | ||
149 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"> | ||
150 | + <i class="fa fa-flag-o"></i> | ||
151 | + <span class="label label-danger">9</span> | ||
152 | + </a> | ||
153 | + <ul class="dropdown-menu"> | ||
154 | + <li class="header">You have 9 tasks</li> | ||
155 | + <li> | ||
156 | + <!-- inner menu: contains the actual data --> | ||
157 | + <ul class="menu"> | ||
158 | + <li><!-- Task item --> | ||
159 | + <a href="#"> | ||
160 | + <h3> | ||
161 | + Design some buttons | ||
162 | + <small class="pull-right">20%</small> | ||
163 | + </h3> | ||
164 | + <div class="progress xs"> | ||
165 | + <div class="progress-bar progress-bar-aqua" style="width: 20%" | ||
166 | + role="progressbar" aria-valuenow="20" aria-valuemin="0" | ||
167 | + aria-valuemax="100"> | ||
168 | + <span class="sr-only">20% Complete</span> | ||
169 | + </div> | ||
170 | + </div> | ||
171 | + </a> | ||
172 | + </li> | ||
173 | + <!-- end task item --> | ||
174 | + <li><!-- Task item --> | ||
175 | + <a href="#"> | ||
176 | + <h3> | ||
177 | + Create a nice theme | ||
178 | + <small class="pull-right">40%</small> | ||
179 | + </h3> | ||
180 | + <div class="progress xs"> | ||
181 | + <div class="progress-bar progress-bar-green" style="width: 40%" | ||
182 | + role="progressbar" aria-valuenow="20" aria-valuemin="0" | ||
183 | + aria-valuemax="100"> | ||
184 | + <span class="sr-only">40% Complete</span> | ||
185 | + </div> | ||
186 | + </div> | ||
187 | + </a> | ||
188 | + </li> | ||
189 | + <!-- end task item --> | ||
190 | + <li><!-- Task item --> | ||
191 | + <a href="#"> | ||
192 | + <h3> | ||
193 | + Some task I need to do | ||
194 | + <small class="pull-right">60%</small> | ||
195 | + </h3> | ||
196 | + <div class="progress xs"> | ||
197 | + <div class="progress-bar progress-bar-red" style="width: 60%" | ||
198 | + role="progressbar" aria-valuenow="20" aria-valuemin="0" | ||
199 | + aria-valuemax="100"> | ||
200 | + <span class="sr-only">60% Complete</span> | ||
201 | + </div> | ||
202 | + </div> | ||
203 | + </a> | ||
204 | + </li> | ||
205 | + <!-- end task item --> | ||
206 | + <li><!-- Task item --> | ||
207 | + <a href="#"> | ||
208 | + <h3> | ||
209 | + Make beautiful transitions | ||
210 | + <small class="pull-right">80%</small> | ||
211 | + </h3> | ||
212 | + <div class="progress xs"> | ||
213 | + <div class="progress-bar progress-bar-yellow" style="width: 80%" | ||
214 | + role="progressbar" aria-valuenow="20" aria-valuemin="0" | ||
215 | + aria-valuemax="100"> | ||
216 | + <span class="sr-only">80% Complete</span> | ||
217 | + </div> | ||
218 | + </div> | ||
219 | + </a> | ||
220 | + </li> | ||
221 | + <!-- end task item --> | ||
222 | + </ul> | ||
223 | + </li> | ||
224 | + <li class="footer"> | ||
225 | + <a href="#">View all tasks</a> | ||
226 | + </li> | ||
227 | + </ul> | ||
228 | + </li> | ||
229 | + <!-- User Account: style can be found in dropdown.less --> | ||
230 | + | ||
231 | + <li class="dropdown user user-menu"> | ||
232 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"> | ||
233 | + <img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="user-image" alt="User Image"/> | ||
234 | + <span class="hidden-xs">Alexander Pierce</span> | ||
235 | + </a> | ||
236 | + <ul class="dropdown-menu"> | ||
237 | + <!-- User image --> | ||
238 | + <li class="user-header"> | ||
239 | + <img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="img-circle" | ||
240 | + alt="User Image"/> | ||
241 | + | ||
242 | + <p> | ||
243 | + Alexander Pierce - Web Developer | ||
244 | + <small>Member since Nov. 2012</small> | ||
245 | + </p> | ||
246 | + </li> | ||
247 | + <!-- Menu Body --> | ||
248 | + <li class="user-body"> | ||
249 | + <div class="col-xs-4 text-center"> | ||
250 | + <a href="#">Followers</a> | ||
251 | + </div> | ||
252 | + <div class="col-xs-4 text-center"> | ||
253 | + <a href="#">Sales</a> | ||
254 | + </div> | ||
255 | + <div class="col-xs-4 text-center"> | ||
256 | + <a href="#">Friends</a> | ||
257 | + </div> | ||
258 | + </li> | ||
259 | + <!-- Menu Footer--> | ||
260 | + <li class="user-footer"> | ||
261 | + <div class="pull-left"> | ||
262 | + <a href="#" class="btn btn-default btn-flat">Profile</a> | ||
263 | + </div> | ||
264 | + <div class="pull-right"> | ||
265 | + <?= Html::a( | ||
266 | + 'Sign out', | ||
267 | + ['/site/logout'], | ||
268 | + ['data-method' => 'post', 'class' => 'btn btn-default btn-flat'] | ||
269 | + ) ?> | ||
270 | + </div> | ||
271 | + </li> | ||
272 | + </ul> | ||
273 | + </li> | ||
274 | + | ||
275 | + <!-- User Account: style can be found in dropdown.less --> | ||
276 | + <li> | ||
277 | + <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> | ||
278 | + </li> | ||
279 | + </ul> | ||
280 | + </div> | ||
281 | + */ | ||
282 | + ?> | ||
283 | + </nav> | ||
284 | +</header> |
1 | +++ a/backend/views/adminlte/layouts/left.php | ||
1 | +<aside class="main-sidebar"> | ||
2 | + | ||
3 | + <section class="sidebar"> | ||
4 | + | ||
5 | + <!-- Sidebar user panel --> | ||
6 | + <!--<div class="user-panel"> | ||
7 | + <div class="pull-left image"> | ||
8 | + <img src="<?/*= $directoryAsset */?>/img/user2-160x160.jpg" class="img-circle" alt="User Image"/> | ||
9 | + </div> | ||
10 | + <div class="pull-left info"> | ||
11 | + <p>Alexander Pierce</p> | ||
12 | + | ||
13 | + <a href="#"><i class="fa fa-circle text-success"></i> Online</a> | ||
14 | + </div> | ||
15 | + </div>--> | ||
16 | + | ||
17 | + <!-- search form --> | ||
18 | + <form action="#" method="get" class="sidebar-form"> | ||
19 | + <div class="input-group"> | ||
20 | + <input type="text" name="q" class="form-control" placeholder="Search..."/> | ||
21 | + <span class="input-group-btn"> | ||
22 | + <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i> | ||
23 | + </button> | ||
24 | + </span> | ||
25 | + </div> | ||
26 | + </form> | ||
27 | + <!-- /.search form --> | ||
28 | + | ||
29 | + <?= dmstr\widgets\Menu::widget( | ||
30 | + [ | ||
31 | + 'options' => ['class' => 'sidebar-menu'], | ||
32 | + 'items' => [ | ||
33 | + [ | ||
34 | + 'label' => 'Компания', | ||
35 | + 'url' => '#', | ||
36 | + 'items' => [ | ||
37 | + ['label' => 'Команда', 'url' => ['/team']], | ||
38 | + [ 'label' => 'Отделы', 'url' => ['/departments']], | ||
39 | + ] | ||
40 | + ], | ||
41 | + [ 'label' => 'Клиенты', 'url' => ['/clients']], | ||
42 | + | ||
43 | + ['label' => 'Menu', 'options' => ['class' => 'header']], | ||
44 | + ['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii']], | ||
45 | + ['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug']], | ||
46 | + ['label' => 'Login', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest], | ||
47 | + [ | ||
48 | + 'label' => 'Same tools', | ||
49 | + 'icon' => 'fa fa-share', | ||
50 | + 'url' => '#', | ||
51 | + 'items' => [ | ||
52 | + ['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii'],], | ||
53 | + ['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug'],], | ||
54 | + [ | ||
55 | + 'label' => 'Level One', | ||
56 | + 'icon' => 'fa fa-circle-o', | ||
57 | + 'url' => '#', | ||
58 | + 'items' => [ | ||
59 | + ['label' => 'Level Two', 'icon' => 'fa fa-circle-o', 'url' => '#',], | ||
60 | + [ | ||
61 | + 'label' => 'Level Two', | ||
62 | + 'icon' => 'fa fa-circle-o', | ||
63 | + 'url' => '#', | ||
64 | + 'items' => [ | ||
65 | + ['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',], | ||
66 | + ['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',], | ||
67 | + ], | ||
68 | + ], | ||
69 | + ], | ||
70 | + ], | ||
71 | + ], | ||
72 | + ], | ||
73 | + ], | ||
74 | + ] | ||
75 | + ) ?> | ||
76 | + | ||
77 | + </section> | ||
78 | + | ||
79 | +</aside> |
1 | +++ a/backend/views/adminlte/layouts/main-login.php | ||
1 | +<?php | ||
2 | +use backend\assets\AppAsset; | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this \yii\web\View */ | ||
6 | +/* @var $content string */ | ||
7 | + | ||
8 | +dmstr\web\AdminLteAsset::register($this); | ||
9 | +?> | ||
10 | +<?php $this->beginPage() ?> | ||
11 | +<!DOCTYPE html> | ||
12 | +<html lang="<?= Yii::$app->language ?>"> | ||
13 | +<head> | ||
14 | + <meta charset="<?= Yii::$app->charset ?>"/> | ||
15 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
16 | + <?= Html::csrfMetaTags() ?> | ||
17 | + <title><?= Html::encode($this->title) ?></title> | ||
18 | + <?php $this->head() ?> | ||
19 | +</head> | ||
20 | +<body class="login-page"> | ||
21 | + | ||
22 | +<?php $this->beginBody() ?> | ||
23 | + | ||
24 | + <?= $content ?> | ||
25 | + | ||
26 | +<?php $this->endBody() ?> | ||
27 | +</body> | ||
28 | +</html> | ||
29 | +<?php $this->endPage() ?> |
1 | +++ a/backend/views/adminlte/layouts/main.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | + | ||
4 | +/* @var $this \yii\web\View */ | ||
5 | +/* @var $content string */ | ||
6 | + | ||
7 | + | ||
8 | +if (Yii::$app->controller->action->id === 'login') { | ||
9 | +/** | ||
10 | + * Do not use this code in your template. Remove it. | ||
11 | + * Instead, use the code $this->layout = '//main-login'; in your controller. | ||
12 | + */ | ||
13 | + echo $this->render( | ||
14 | + 'main-login', | ||
15 | + ['content' => $content] | ||
16 | + ); | ||
17 | +} else { | ||
18 | + | ||
19 | + if (class_exists('backend\assets\AppAsset')) { | ||
20 | + backend\assets\AppAsset::register($this); | ||
21 | + } else { | ||
22 | + app\assets\AppAsset::register($this); | ||
23 | + } | ||
24 | + | ||
25 | + dmstr\web\AdminLteAsset::register($this); | ||
26 | + | ||
27 | + $directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist'); | ||
28 | + ?> | ||
29 | + <?php $this->beginPage() ?> | ||
30 | + <!DOCTYPE html> | ||
31 | + <html lang="<?= Yii::$app->language ?>"> | ||
32 | + <head> | ||
33 | + <meta charset="<?= Yii::$app->charset ?>"/> | ||
34 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
35 | + <?= Html::csrfMetaTags() ?> | ||
36 | + <title><?= Html::encode($this->title) ?></title> | ||
37 | + <?php $this->head() ?> | ||
38 | + </head> | ||
39 | + <body class="skin-blue sidebar-mini"> | ||
40 | + <?php $this->beginBody() ?> | ||
41 | + <div class="wrapper"> | ||
42 | + | ||
43 | + <?= $this->render( | ||
44 | + 'header.php', | ||
45 | + ['directoryAsset' => $directoryAsset] | ||
46 | + ) ?> | ||
47 | + | ||
48 | + <?= $this->render( | ||
49 | + 'left.php', | ||
50 | + ['directoryAsset' => $directoryAsset] | ||
51 | + ) | ||
52 | + ?> | ||
53 | + | ||
54 | + <?= $this->render( | ||
55 | + 'content.php', | ||
56 | + ['content' => $content, 'directoryAsset' => $directoryAsset] | ||
57 | + ) ?> | ||
58 | + | ||
59 | + </div> | ||
60 | + | ||
61 | + <?php $this->endBody() ?> | ||
62 | + </body> | ||
63 | + </html> | ||
64 | + <?php $this->endPage() ?> | ||
65 | +<?php } ?> |
1 | +++ a/backend/views/adminlte/site/error.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $name string */ | ||
7 | +/* @var $message string */ | ||
8 | +/* @var $exception Exception */ | ||
9 | + | ||
10 | +$this->title = $name; | ||
11 | +?> | ||
12 | +<!-- Main content --> | ||
13 | +<section class="content"> | ||
14 | + | ||
15 | + <div class="error-page"> | ||
16 | + <h2 class="headline text-info"><i class="fa fa-warning text-yellow"></i></h2> | ||
17 | + | ||
18 | + <div class="error-content"> | ||
19 | + <h3><?= $name ?></h3> | ||
20 | + | ||
21 | + <p> | ||
22 | + <?= nl2br(Html::encode($message)) ?> | ||
23 | + </p> | ||
24 | + | ||
25 | + <p> | ||
26 | + The above error occurred while the Web server was processing your request. | ||
27 | + Please contact us if you think this is a server error. Thank you. | ||
28 | + Meanwhile, you may <a href='<?= Yii::$app->homeUrl ?>'>return to dashboard</a> or try using the search | ||
29 | + form. | ||
30 | + </p> | ||
31 | + | ||
32 | + <form class='search-form'> | ||
33 | + <div class='input-group'> | ||
34 | + <input type="text" name="search" class='form-control' placeholder="Search"/> | ||
35 | + | ||
36 | + <div class="input-group-btn"> | ||
37 | + <button type="submit" name="submit" class="btn btn-primary"><i class="fa fa-search"></i> | ||
38 | + </button> | ||
39 | + </div> | ||
40 | + </div> | ||
41 | + </form> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + | ||
45 | +</section> |
1 | +++ a/backend/views/adminlte/site/login.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | +use yii\bootstrap\ActiveForm; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
7 | +/* @var $model \common\models\LoginForm */ | ||
8 | + | ||
9 | +$this->title = 'Sign In'; | ||
10 | + | ||
11 | +$fieldOptions1 = [ | ||
12 | + 'options' => ['class' => 'form-group has-feedback'], | ||
13 | + 'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>" | ||
14 | +]; | ||
15 | + | ||
16 | +$fieldOptions2 = [ | ||
17 | + 'options' => ['class' => 'form-group has-feedback'], | ||
18 | + 'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>" | ||
19 | +]; | ||
20 | +?> | ||
21 | + | ||
22 | +<div class="login-box"> | ||
23 | + <div class="login-logo"> | ||
24 | + <a href="#"><b>Admin</b>LTE</a> | ||
25 | + </div> | ||
26 | + <!-- /.login-logo --> | ||
27 | + <div class="login-box-body"> | ||
28 | + <p class="login-box-msg">Sign in to start your session</p> | ||
29 | + | ||
30 | + <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?> | ||
31 | + | ||
32 | + <?= $form | ||
33 | + ->field($model, 'username', $fieldOptions1) | ||
34 | + ->label(false) | ||
35 | + ->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?> | ||
36 | + | ||
37 | + <?= $form | ||
38 | + ->field($model, 'password', $fieldOptions2) | ||
39 | + ->label(false) | ||
40 | + ->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?> | ||
41 | + | ||
42 | + <div class="row"> | ||
43 | + <div class="col-xs-8"> | ||
44 | + <?= $form->field($model, 'rememberMe')->checkbox() ?> | ||
45 | + </div> | ||
46 | + <!-- /.col --> | ||
47 | + <div class="col-xs-4"> | ||
48 | + <?= Html::submitButton('Sign in', ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?> | ||
49 | + </div> | ||
50 | + <!-- /.col --> | ||
51 | + </div> | ||
52 | + | ||
53 | + | ||
54 | + <?php ActiveForm::end(); ?> | ||
55 | + | ||
56 | + <div class="social-auth-links text-center"> | ||
57 | + <p>- OR -</p> | ||
58 | + <a href="#" class="btn btn-block btn-social btn-facebook btn-flat"><i class="fa fa-facebook"></i> Sign in | ||
59 | + using Facebook</a> | ||
60 | + <a href="#" class="btn btn-block btn-social btn-google-plus btn-flat"><i class="fa fa-google-plus"></i> Sign | ||
61 | + in using Google+</a> | ||
62 | + </div> | ||
63 | + <!-- /.social-auth-links --> | ||
64 | + | ||
65 | + <a href="#">I forgot my password</a><br> | ||
66 | + <a href="register.html" class="text-center">Register a new membership</a> | ||
67 | + | ||
68 | + </div> | ||
69 | + <!-- /.login-box-body --> | ||
70 | +</div><!-- /.login-box --> |
1 | +++ a/backend/views/clients/_form.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\ActiveForm; | ||
5 | +use mihaildev\ckeditor\CKEditor; | ||
6 | + | ||
7 | +/* @var $this yii\web\View */ | ||
8 | +/* @var $model backend\models\Clients */ | ||
9 | +/* @var $form yii\widgets\ActiveForm */ | ||
10 | +?> | ||
11 | + | ||
12 | +<div class="clients-form"> | ||
13 | + | ||
14 | + <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?> | ||
15 | + | ||
16 | + <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?> | ||
17 | + | ||
18 | + <?= $form->field($model, 'description')->widget(CKEditor::className(),[ | ||
19 | + 'editorOptions' => [ | ||
20 | + 'preset' => 'full', | ||
21 | + 'inline' => false, | ||
22 | + ], | ||
23 | + ]); ?> | ||
24 | + | ||
25 | + <?= $form->field($model, 'file')->fileInput() ?> | ||
26 | + | ||
27 | + <?= $form->field($model, 'link')->textInput(['maxlength' => true]) ?> | ||
28 | + | ||
29 | + <?= $form->field($model, 'visible')->dropDownList([1=>Yii::t('app', 'Active'),0=>Yii::t('app', 'Hidden')]) ?> | ||
30 | + | ||
31 | + <?= $form->field($model, 'position')->dropDownList(range(0, 50)) ?> | ||
32 | + | ||
33 | + <div class="form-group"> | ||
34 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | ||
35 | + </div> | ||
36 | + | ||
37 | + <?php ActiveForm::end(); ?> | ||
38 | + | ||
39 | +</div> |
1 | +++ a/backend/views/clients/_search.php | ||
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\ClientsSearch */ | ||
8 | +/* @var $form yii\widgets\ActiveForm */ | ||
9 | +?> | ||
10 | + | ||
11 | +<div class="clients-search"> | ||
12 | + | ||
13 | + <?php $form = ActiveForm::begin([ | ||
14 | + 'action' => ['index'], | ||
15 | + 'method' => 'get', | ||
16 | + ]); ?> | ||
17 | + | ||
18 | + <?= $form->field($model, 'id') ?> | ||
19 | + | ||
20 | + <?= $form->field($model, 'title') ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'description') ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'logo') ?> | ||
25 | + | ||
26 | + <?= $form->field($model, 'link') ?> | ||
27 | + | ||
28 | + <?php // echo $form->field($model, 'visible') ?> | ||
29 | + | ||
30 | + <?php // echo $form->field($model, 'position') ?> | ||
31 | + | ||
32 | + <div class="form-group"> | ||
33 | + <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?> | ||
34 | + <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?> | ||
35 | + </div> | ||
36 | + | ||
37 | + <?php ActiveForm::end(); ?> | ||
38 | + | ||
39 | +</div> |
1 | +++ a/backend/views/clients/create.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\Clients */ | ||
8 | + | ||
9 | +$this->title = Yii::t('app', 'Create Clients'); | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Clients'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="clients-create"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <?= $this->render('_form', [ | ||
18 | + 'model' => $model, | ||
19 | + ]) ?> | ||
20 | + | ||
21 | +</div> |
1 | +++ a/backend/views/clients/index.php | ||
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\ClientsSearch */ | ||
8 | +/* @var $dataProvider yii\data\ActiveDataProvider */ | ||
9 | + | ||
10 | +$this->title = Yii::t('app', 'Clients'); | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="clients-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('app', 'Create Clients'), ['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 | + 'id', | ||
29 | + 'title', | ||
30 | + 'description:ntext', | ||
31 | + 'logo', | ||
32 | + 'link', | ||
33 | + // 'visible', | ||
34 | + // 'position', | ||
35 | + | ||
36 | + ['class' => 'yii\grid\ActionColumn'], | ||
37 | + ], | ||
38 | + ]); ?> | ||
39 | + | ||
40 | +</div> |
1 | +++ a/backend/views/clients/update.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $model backend\models\Clients */ | ||
7 | + | ||
8 | +$this->title = Yii::t('app', 'Update {modelClass}: ', [ | ||
9 | + 'modelClass' => 'Clients', | ||
10 | +]) . ' ' . $model->title; | ||
11 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Clients'), 'url' => ['index']]; | ||
12 | +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]]; | ||
13 | +$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); | ||
14 | +?> | ||
15 | +<div class="clients-update"> | ||
16 | + | ||
17 | + <h1><?= Html::encode($this->title) ?></h1> | ||
18 | + | ||
19 | + <?= $this->render('_form', [ | ||
20 | + 'model' => $model, | ||
21 | + ]) ?> | ||
22 | + | ||
23 | +</div> |
1 | +++ a/backend/views/clients/view.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\DetailView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\Clients */ | ||
8 | + | ||
9 | +$this->title = $model->title; | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Clients'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="clients-view"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <p> | ||
18 | + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | ||
19 | + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | ||
20 | + 'class' => 'btn btn-danger', | ||
21 | + 'data' => [ | ||
22 | + 'confirm' => Yii::t('app', '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 | + 'id', | ||
32 | + 'title', | ||
33 | + 'description:ntext', | ||
34 | + 'logo', | ||
35 | + 'link', | ||
36 | + 'visible', | ||
37 | + 'position', | ||
38 | + ], | ||
39 | + ]) ?> | ||
40 | + | ||
41 | +</div> |
1 | +++ a/backend/views/departments/_form.php | ||
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\Departments */ | ||
8 | +/* @var $form yii\widgets\ActiveForm */ | ||
9 | +?> | ||
10 | + | ||
11 | +<div class="departments-form"> | ||
12 | + | ||
13 | + <?php $form = ActiveForm::begin(); ?> | ||
14 | + | ||
15 | + <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?> | ||
16 | + | ||
17 | + <?= $form->field($model, 'description')->textarea(['rows' => 6]) ?> | ||
18 | + | ||
19 | + <?= $form->field($model, 'visible')->textInput() ?> | ||
20 | + | ||
21 | + <div class="form-group"> | ||
22 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | ||
23 | + </div> | ||
24 | + | ||
25 | + <?php ActiveForm::end(); ?> | ||
26 | + | ||
27 | +</div> |
1 | +++ a/backend/views/departments/_search.php | ||
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\DepartmentsSearch */ | ||
8 | +/* @var $form yii\widgets\ActiveForm */ | ||
9 | +?> | ||
10 | + | ||
11 | +<div class="departments-search"> | ||
12 | + | ||
13 | + <?php $form = ActiveForm::begin([ | ||
14 | + 'action' => ['index'], | ||
15 | + 'method' => 'get', | ||
16 | + ]); ?> | ||
17 | + | ||
18 | + <?= $form->field($model, 'id') ?> | ||
19 | + | ||
20 | + <?= $form->field($model, 'title') ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'description') ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'visible') ?> | ||
25 | + | ||
26 | + <div class="form-group"> | ||
27 | + <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?> | ||
28 | + <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?> | ||
29 | + </div> | ||
30 | + | ||
31 | + <?php ActiveForm::end(); ?> | ||
32 | + | ||
33 | +</div> |
1 | +++ a/backend/views/departments/create.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\Departments */ | ||
8 | + | ||
9 | +$this->title = Yii::t('app', 'Create Departments'); | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Departments'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="departments-create"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <?= $this->render('_form', [ | ||
18 | + 'model' => $model, | ||
19 | + ]) ?> | ||
20 | + | ||
21 | +</div> |
1 | +++ a/backend/views/departments/index.php | ||
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\DepartmentsSearch */ | ||
8 | +/* @var $dataProvider yii\data\ActiveDataProvider */ | ||
9 | + | ||
10 | +$this->title = Yii::t('app', 'Departments'); | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="departments-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('app', 'Create Departments'), ['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 | + 'id', | ||
29 | + 'title', | ||
30 | + 'visible', | ||
31 | + | ||
32 | + ['class' => 'yii\grid\ActionColumn'], | ||
33 | + ], | ||
34 | + ]); ?> | ||
35 | + | ||
36 | +</div> |
1 | +++ a/backend/views/departments/update.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $model backend\models\Departments */ | ||
7 | + | ||
8 | +$this->title = Yii::t('app', 'Update {modelClass}: ', [ | ||
9 | + 'modelClass' => 'Departments', | ||
10 | +]) . ' ' . $model->title; | ||
11 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Departments'), 'url' => ['index']]; | ||
12 | +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]]; | ||
13 | +$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); | ||
14 | +?> | ||
15 | +<div class="departments-update"> | ||
16 | + | ||
17 | + <h1><?= Html::encode($this->title) ?></h1> | ||
18 | + | ||
19 | + <?= $this->render('_form', [ | ||
20 | + 'model' => $model, | ||
21 | + ]) ?> | ||
22 | + | ||
23 | +</div> |
1 | +++ a/backend/views/departments/view.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\DetailView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\Departments */ | ||
8 | + | ||
9 | +$this->title = $model->title; | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Departments'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="departments-view"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <p> | ||
18 | + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | ||
19 | + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | ||
20 | + 'class' => 'btn btn-danger', | ||
21 | + 'data' => [ | ||
22 | + 'confirm' => Yii::t('app', '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 | + 'id', | ||
32 | + 'title', | ||
33 | + 'description:ntext', | ||
34 | + 'visible', | ||
35 | + ], | ||
36 | + ]) ?> | ||
37 | + | ||
38 | +</div> |
1 | +++ a/backend/views/layouts/main.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this \yii\web\View */ | ||
4 | +/* @var $content string */ | ||
5 | + | ||
6 | +use backend\assets\AppAsset; | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\Nav; | ||
9 | +use yii\bootstrap\NavBar; | ||
10 | +use yii\widgets\Breadcrumbs; | ||
11 | +use common\widgets\Alert; | ||
12 | + | ||
13 | +AppAsset::register($this); | ||
14 | +?> | ||
15 | +<?php $this->beginPage() ?> | ||
16 | +<!DOCTYPE html> | ||
17 | +<html lang="<?= Yii::$app->language ?>"> | ||
18 | +<head> | ||
19 | + <meta charset="<?= Yii::$app->charset ?>"> | ||
20 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
21 | + <?= Html::csrfMetaTags() ?> | ||
22 | + <title><?= Html::encode($this->title) ?></title> | ||
23 | + <?php $this->head() ?> | ||
24 | +</head> | ||
25 | +<body> | ||
26 | +<?php $this->beginBody() ?> | ||
27 | + | ||
28 | +<div class="wrap"> | ||
29 | + <?php | ||
30 | + NavBar::begin([ | ||
31 | + 'brandLabel' => 'ArtWeb', | ||
32 | + 'brandUrl' => Yii::$app->homeUrl, | ||
33 | + 'options' => [ | ||
34 | + 'class' => 'navbar-inverse navbar-fixed-top', | ||
35 | + ], | ||
36 | + ]); | ||
37 | + $menuItems = | ||
38 | + [ | ||
39 | + [ | ||
40 | + 'label' => 'Компания', | ||
41 | + 'items' => [ | ||
42 | + [ | ||
43 | + 'label' => 'Команда', | ||
44 | + 'url' => ['/team'] | ||
45 | + ], | ||
46 | + [ | ||
47 | + 'label' => 'Отделы', | ||
48 | + 'url' => ['/departments'] | ||
49 | + ] | ||
50 | + ] | ||
51 | + ], | ||
52 | + [ | ||
53 | + 'label' => 'Клиенты', | ||
54 | + 'url' => ['/clients'] | ||
55 | + ], | ||
56 | + ]; | ||
57 | + if (Yii::$app->user->isGuest) { | ||
58 | + $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']]; | ||
59 | + } else { | ||
60 | + $menuItems[] = [ | ||
61 | + 'label' => 'Logout (' . Yii::$app->user->identity->username . ')', | ||
62 | + 'url' => ['/site/logout'], | ||
63 | + 'linkOptions' => ['data-method' => 'post'] | ||
64 | + ]; | ||
65 | + } | ||
66 | + echo Nav::widget([ | ||
67 | + 'options' => ['class' => 'navbar-nav navbar-right'], | ||
68 | + 'items' => $menuItems, | ||
69 | + ]); | ||
70 | + NavBar::end(); | ||
71 | + ?> | ||
72 | + | ||
73 | + <div class="container"> | ||
74 | + <?= Breadcrumbs::widget([ | ||
75 | + 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | ||
76 | + ]) ?> | ||
77 | + <?= Alert::widget() ?> | ||
78 | + <?= $content ?> | ||
79 | + </div> | ||
80 | +</div> | ||
81 | + | ||
82 | +<footer class="footer"> | ||
83 | + <div class="container"> | ||
84 | + <p class="pull-left">© My Company <?= date('Y') ?></p> | ||
85 | + | ||
86 | + <p class="pull-right"><?= Yii::powered() ?></p> | ||
87 | + </div> | ||
88 | +</footer> | ||
89 | + | ||
90 | +<?php $this->endBody() ?> | ||
91 | +</body> | ||
92 | +</html> | ||
93 | +<?php $this->endPage() ?> |
1 | +++ a/backend/views/site/error.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $name string */ | ||
5 | +/* @var $message string */ | ||
6 | +/* @var $exception Exception */ | ||
7 | + | ||
8 | +use yii\helpers\Html; | ||
9 | + | ||
10 | +$this->title = $name; | ||
11 | +?> | ||
12 | +<div class="site-error"> | ||
13 | + | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <div class="alert alert-danger"> | ||
17 | + <?= nl2br(Html::encode($message)) ?> | ||
18 | + </div> | ||
19 | + | ||
20 | + <p> | ||
21 | + The above error occurred while the Web server was processing your request. | ||
22 | + </p> | ||
23 | + <p> | ||
24 | + Please contact us if you think this is a server error. Thank you. | ||
25 | + </p> | ||
26 | + | ||
27 | +</div> |
1 | +++ a/backend/views/site/index.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | + | ||
5 | +$this->title = 'My Yii Application'; | ||
6 | +?> | ||
7 | +<div class="site-index"> | ||
8 | + | ||
9 | + <div class="jumbotron"> | ||
10 | + <h1>Congratulations!</h1> | ||
11 | + | ||
12 | + <p class="lead">You have successfully created your Yii-powered application.</p> | ||
13 | + | ||
14 | + <p><a class="btn btn-lg btn-success" href="http://www.yiiframework.com">Get started with Yii</a></p> | ||
15 | + </div> | ||
16 | + | ||
17 | + <div class="body-content"> | ||
18 | + | ||
19 | + <div class="row"> | ||
20 | + <div class="col-lg-4"> | ||
21 | + <h2>Heading</h2> | ||
22 | + | ||
23 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
24 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
25 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
26 | + fugiat nulla pariatur.</p> | ||
27 | + | ||
28 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/doc/">Yii Documentation »</a></p> | ||
29 | + </div> | ||
30 | + <div class="col-lg-4"> | ||
31 | + <h2>Heading</h2> | ||
32 | + | ||
33 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
34 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
35 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
36 | + fugiat nulla pariatur.</p> | ||
37 | + | ||
38 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum »</a></p> | ||
39 | + </div> | ||
40 | + <div class="col-lg-4"> | ||
41 | + <h2>Heading</h2> | ||
42 | + | ||
43 | + <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et | ||
44 | + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip | ||
45 | + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | ||
46 | + fugiat nulla pariatur.</p> | ||
47 | + | ||
48 | + <p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions »</a></p> | ||
49 | + </div> | ||
50 | + </div> | ||
51 | + | ||
52 | + </div> | ||
53 | +</div> |
1 | +++ a/backend/views/site/login.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $form yii\bootstrap\ActiveForm */ | ||
5 | +/* @var $model \common\models\LoginForm */ | ||
6 | + | ||
7 | +use yii\helpers\Html; | ||
8 | +use yii\bootstrap\ActiveForm; | ||
9 | + | ||
10 | +$this->title = 'Login'; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="site-login"> | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <p>Please fill out the following fields to login:</p> | ||
17 | + | ||
18 | + <div class="row"> | ||
19 | + <div class="col-lg-5"> | ||
20 | + <?php $form = ActiveForm::begin(['id' => 'login-form']); ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'username') ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'password')->passwordInput() ?> | ||
25 | + | ||
26 | + <?= $form->field($model, 'rememberMe')->checkbox() ?> | ||
27 | + | ||
28 | + <div class="form-group"> | ||
29 | + <?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?> | ||
30 | + </div> | ||
31 | + | ||
32 | + <?php ActiveForm::end(); ?> | ||
33 | + </div> | ||
34 | + </div> | ||
35 | +</div> |
1 | +++ a/backend/views/team/_form.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\helpers\Url; | ||
5 | +use yii\helpers\ArrayHelper; | ||
6 | +use yii\widgets\ActiveForm; | ||
7 | +use backend\models\Departments; | ||
8 | +use backend\models\User; | ||
9 | +use mihaildev\ckeditor\CKEditor; | ||
10 | +use pavlinter\multifields\MultiFields; | ||
11 | + | ||
12 | +/* @var $this yii\web\View */ | ||
13 | +/* @var $model backend\models\Team */ | ||
14 | +/* @var $form yii\widgets\ActiveForm */ | ||
15 | +?> | ||
16 | + | ||
17 | +<div class="team-form"> | ||
18 | + | ||
19 | + <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data', 'id' => 'team-form']]); ?> | ||
20 | + | ||
21 | + <?= $form->errorSummary([$model,reset($skills)],['class' => 'alert alert-danger']); ?> | ||
22 | + | ||
23 | + <?= $form->field($model, 'department_id')->dropDownList( | ||
24 | + ArrayHelper::map( | ||
25 | + Departments::find()->all(), | ||
26 | + 'id', | ||
27 | + 'title' | ||
28 | + ) | ||
29 | + ) ?> | ||
30 | + | ||
31 | + <?= $form->field($model, 'user_id')->dropDownList( | ||
32 | + ArrayHelper::map( | ||
33 | + User::find()->all(), | ||
34 | + 'id', | ||
35 | + 'username' | ||
36 | + ), ['prompt' => Yii::t('yii', '(not set)')] | ||
37 | + ) ?> | ||
38 | + | ||
39 | + <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> | ||
40 | + | ||
41 | + <?= $form->field($model, 'name2')->textInput(['maxlength' => true]) ?> | ||
42 | + | ||
43 | + <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?> | ||
44 | + | ||
45 | + <?= $form->field($model, 'job')->textInput(['maxlength' => true]) ?> | ||
46 | + | ||
47 | + <?= $form->field($model, 'zodiac')->dropDownList([ 'aries' => 'Aries', 'taurus' => 'Taurus', 'gemini' => 'Gemini', 'cancer' => 'Cancer', 'leo' => 'Leo', 'virgo' => 'Virgo', 'libra' => 'Libra', 'scorpio' => 'Scorpio', 'sagittarius' => 'Sagittarius', 'capricorn' => 'Capricorn', 'aquarius' => 'Aquarius', 'pisces' => 'Pisces'], ['prompt' => '']) ?> | ||
48 | + | ||
49 | + <?= $form->field($model, 'iq')->textInput() ?> | ||
50 | + | ||
51 | + <?= $form->field($model, 'soc_vk')->textInput(['maxlength' => true]) ?> | ||
52 | + | ||
53 | + <?= $form->field($model, 'soc_fb')->textInput(['maxlength' => true]) ?> | ||
54 | + | ||
55 | + <?= $form->field($model, 'soc_tw')->textInput(['maxlength' => true]) ?> | ||
56 | + | ||
57 | + <?= $form->field($model, 'soc_li')->textInput(['maxlength' => true]) ?> | ||
58 | + | ||
59 | + <?= $form->field($model, 'interests_caption')->widget(CKEditor::className(),[ | ||
60 | + 'editorOptions' => [ | ||
61 | + 'preset' => 'basic', | ||
62 | + 'inline' => false, | ||
63 | + ], | ||
64 | + ]); | ||
65 | + ?> | ||
66 | + | ||
67 | + <fieldset> | ||
68 | + <legend><?= Yii::t('app', 'Skils')?></legend> | ||
69 | + <?= $form->field($model, 'skils_caption')->widget(CKEditor::className(),[ | ||
70 | + 'editorOptions' => [ | ||
71 | + 'preset' => 'basic', | ||
72 | + 'inline' => false, | ||
73 | + ], | ||
74 | + ]); | ||
75 | + ?> | ||
76 | + <div class="form-group"> | ||
77 | + <?= MultiFields::widget([ | ||
78 | + 'models' => $skills, | ||
79 | + 'form' => $form, | ||
80 | + 'attributes' => [ | ||
81 | + [ | ||
82 | + 'attribute' => 'title', | ||
83 | + 'options'=> [], | ||
84 | + 'field' => function ($activeField, $skills, $parentClass, $closeButtonClass) { | ||
85 | + return $activeField->textInput($skills); | ||
86 | + }, | ||
87 | + ], | ||
88 | + [ | ||
89 | + 'attribute' => 'value', | ||
90 | + 'options'=> [], | ||
91 | + 'field' => function ($activeField, $skills, $parentClass, $closeButtonClass) { | ||
92 | + return $activeField->textInput($skills); | ||
93 | + }, | ||
94 | + ], | ||
95 | + ], | ||
96 | + //default | ||
97 | + 'parentClassPrefix' => '-mf-row', | ||
98 | + 'closeButtonClass' => 'mf-btn-close pull-right', | ||
99 | + 'clientOptions' => [ | ||
100 | + 'btn' => '.cloneBtn', | ||
101 | + 'appendTo' => '', | ||
102 | + 'confirmMessage' => Yii::t('yii' , 'Are you sure you want to delete this item?'), | ||
103 | + 'deleteRouter' => Url::to('deleteskill'), | ||
104 | + ], | ||
105 | + 'template' => function($parentOptions, $closeButtonClass, $templateFields){ //default | ||
106 | + $closeBtn = Html::tag('a', '×', ['class' => $closeButtonClass, 'href' => 'javascript:void(0)']); | ||
107 | + return Html::tag('div', $closeBtn . $templateFields, $parentOptions); | ||
108 | + }, | ||
109 | + ]);?> | ||
110 | + | ||
111 | + <?= \yii\bootstrap\Button::widget([ | ||
112 | + 'label' => 'Add skill', | ||
113 | + 'options' => [ | ||
114 | + 'class' => 'cloneBtn' | ||
115 | + ] | ||
116 | + ]);?> | ||
117 | + </div> | ||
118 | + </fieldset> | ||
119 | + | ||
120 | + <fieldset> | ||
121 | + <legend><?= Yii::t('app', 'Books')?></legend> | ||
122 | + <?= $form->field($model, 'films_caption')->widget(CKEditor::className(),[ | ||
123 | + 'editorOptions' => [ | ||
124 | + 'preset' => 'basic', | ||
125 | + 'inline' => false, | ||
126 | + ], | ||
127 | + ]); | ||
128 | + ?> | ||
129 | + <div class="form-group"> | ||
130 | + <?= MultiFields::widget([ | ||
131 | + 'models' => $books, | ||
132 | + 'form' => $form, | ||
133 | + 'attributes' => [ | ||
134 | + [ | ||
135 | + 'attribute' => 'title', | ||
136 | + 'options'=> [], | ||
137 | + 'field' => function ($activeField, $books, $parentClass, $closeButtonClass) { | ||
138 | + return $activeField->textInput($books); | ||
139 | + }, | ||
140 | + ], | ||
141 | + [ | ||
142 | + 'attribute' => 'cover', | ||
143 | + 'options'=> [], | ||
144 | + 'field' => function ($activeField, $books, $parentClass, $closeButtonClass) { | ||
145 | + return $activeField->fileInput(); | ||
146 | + }, | ||
147 | + ], | ||
148 | + ], | ||
149 | + //default | ||
150 | + 'parentClassPrefix' => '-mf-row', | ||
151 | + 'closeButtonClass' => 'mf-btn-close pull-right', | ||
152 | + 'clientOptions' => [ | ||
153 | + 'btn' => '.cloneBtn', | ||
154 | + 'appendTo' => '', | ||
155 | + 'confirmMessage' => Yii::t('yii' , 'Are you sure you want to delete this item?'), | ||
156 | + 'deleteRouter' => Url::to('deletebook'), | ||
157 | + ], | ||
158 | + 'template' => function($parentOptions, $closeButtonClass, $templateFields){ //default | ||
159 | + $closeBtn = Html::tag('a', '×', ['class' => $closeButtonClass, 'href' => 'javascript:void(0)']); | ||
160 | + return Html::tag('div', $closeBtn . $templateFields, $parentOptions); | ||
161 | + }, | ||
162 | + ]);?> | ||
163 | + | ||
164 | + <?= \yii\bootstrap\Button::widget([ | ||
165 | + 'label' => 'Add book', | ||
166 | + 'options' => [ | ||
167 | + 'class' => 'cloneBtn' | ||
168 | + ] | ||
169 | + ]);?> | ||
170 | + </div> | ||
171 | + </fieldset> | ||
172 | + | ||
173 | + <?= $form->field($model, 'description')->widget(CKEditor::className(),[ | ||
174 | + 'editorOptions' => [ | ||
175 | + 'preset' => 'basic', | ||
176 | + 'inline' => false, | ||
177 | + ], | ||
178 | + ]); | ||
179 | + ?> | ||
180 | + | ||
181 | + <?= $form->field($model, 'file')->fileInput() ?> | ||
182 | + <?php if (!empty($model->photo)) :?> | ||
183 | + <?= Html::img('/files/'. $model->photo, ['style' => 'max-width: 150px; max-height: 200px'])?> | ||
184 | + <br><br> | ||
185 | + <?php endif?> | ||
186 | + | ||
187 | + <?= $form->field($model, 'file2')->fileInput() ?> | ||
188 | + <?php if (!empty($model->photo_big)) :?> | ||
189 | + <?= Html::img('/files/'. $model->photo_big, ['style' => 'max-width: 150px; max-height: 200px'])?> | ||
190 | + <br><br> | ||
191 | + <?php endif?> | ||
192 | + | ||
193 | + <?= $form->field($model, 'visible')->dropDownList([1=>Yii::t('app', 'Active'),0=>Yii::t('app', 'Hidden')]) ?> | ||
194 | + | ||
195 | + <div class="form-group"> | ||
196 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | ||
197 | + </div> | ||
198 | + | ||
199 | + <?php ActiveForm::end(); ?> | ||
200 | + | ||
201 | +</div> |
1 | +++ a/backend/views/team/_search.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\ActiveForm; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model app\models\TeamSearch */ | ||
8 | +/* @var $form yii\widgets\ActiveForm */ | ||
9 | +?> | ||
10 | + | ||
11 | +<div class="team-search"> | ||
12 | + | ||
13 | + <?php $form = ActiveForm::begin([ | ||
14 | + 'action' => ['index'], | ||
15 | + 'method' => 'get', | ||
16 | + ]); ?> | ||
17 | + | ||
18 | + <?= $form->field($model, 'id') ?> | ||
19 | + | ||
20 | + <?= $form->field($model, 'department_id') ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'user_id') ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'name') ?> | ||
25 | + | ||
26 | + <?= $form->field($model, 'name2') ?> | ||
27 | + | ||
28 | + <?php // echo $form->field($model, 'email') ?> | ||
29 | + | ||
30 | + <?php // echo $form->field($model, 'job') ?> | ||
31 | + | ||
32 | + <?php // echo $form->field($model, 'zodiac') ?> | ||
33 | + | ||
34 | + <?php // echo $form->field($model, 'iq') ?> | ||
35 | + | ||
36 | + <?php // echo $form->field($model, 'soc_vk') ?> | ||
37 | + | ||
38 | + <?php // echo $form->field($model, 'soc_fb') ?> | ||
39 | + | ||
40 | + <?php // echo $form->field($model, 'soc_tw') ?> | ||
41 | + | ||
42 | + <?php // echo $form->field($model, 'soc_li') ?> | ||
43 | + | ||
44 | + <?php // echo $form->field($model, 'interests_caption') ?> | ||
45 | + | ||
46 | + <?php // echo $form->field($model, 'skils_caption') ?> | ||
47 | + | ||
48 | + <?php // echo $form->field($model, 'books_caption') ?> | ||
49 | + | ||
50 | + <?php // echo $form->field($model, 'films_caption') ?> | ||
51 | + | ||
52 | + <?php // echo $form->field($model, 'description') ?> | ||
53 | + | ||
54 | + <?php // echo $form->field($model, 'photo') ?> | ||
55 | + | ||
56 | + <?php // echo $form->field($model, 'photo_big') ?> | ||
57 | + | ||
58 | + <?php // echo $form->field($model, 'visible') ?> | ||
59 | + | ||
60 | + <div class="form-group"> | ||
61 | + <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?> | ||
62 | + <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?> | ||
63 | + </div> | ||
64 | + | ||
65 | + <?php ActiveForm::end(); ?> | ||
66 | + | ||
67 | +</div> |
1 | +++ a/backend/views/team/create.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model app\models\Team */ | ||
8 | + | ||
9 | +$this->title = Yii::t('app', 'Create Team'); | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Teams'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="team-create"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <?= $this->render('_form', [ | ||
18 | + 'model' => $model, | ||
19 | + ]) ?> | ||
20 | + | ||
21 | +</div> |
1 | +++ a/backend/views/team/index.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\grid\GridView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $searchModel app\models\TeamSearch */ | ||
8 | +/* @var $dataProvider yii\data\ActiveDataProvider */ | ||
9 | + | ||
10 | +$this->title = Yii::t('app', 'Teams'); | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="team-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('app', 'Create Team'), ['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 | +// 'id', | ||
29 | +// 'department_id', | ||
30 | + 'name', | ||
31 | + 'email:email', | ||
32 | + 'user_id', | ||
33 | + 'job', | ||
34 | +// 'name2', | ||
35 | + // 'zodiac', | ||
36 | + // 'iq', | ||
37 | + // 'soc_vk', | ||
38 | + // 'soc_fb', | ||
39 | + // 'soc_tw', | ||
40 | + // 'soc_li', | ||
41 | + // 'interests_caption:ntext', | ||
42 | + // 'skils_caption:ntext', | ||
43 | + // 'books_caption:ntext', | ||
44 | + // 'films_caption:ntext', | ||
45 | + // 'description:ntext', | ||
46 | + // 'photo', | ||
47 | + // 'photo_big', | ||
48 | + // 'visible', | ||
49 | + | ||
50 | + ['class' => 'yii\grid\ActionColumn'], | ||
51 | + ], | ||
52 | + ]); ?> | ||
53 | + | ||
54 | +</div> |
1 | +++ a/backend/views/team/skils/_form.php | ||
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\TeamSkils */ | ||
8 | +/* @var $form yii\widgets\ActiveForm */ | ||
9 | +?> | ||
10 | + | ||
11 | +<div class="team-skils-form"> | ||
12 | + | ||
13 | + <?php $form = ActiveForm::begin(); ?> | ||
14 | + | ||
15 | + <?= $form->field($model, 'team_id')->textInput() ?> | ||
16 | + | ||
17 | + <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?> | ||
18 | + | ||
19 | + <?= $form->field($model, 'value')->textInput() ?> | ||
20 | + | ||
21 | + <div class="form-group"> | ||
22 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | ||
23 | + </div> | ||
24 | + | ||
25 | + <?php ActiveForm::end(); ?> | ||
26 | + | ||
27 | +</div> |
1 | +++ a/backend/views/team/skils/create.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\TeamSkils */ | ||
8 | + | ||
9 | +$this->title = Yii::t('app', 'Create Team Skils'); | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Team Skils'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="team-skils-create"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <?= $this->render('_form', [ | ||
18 | + 'model' => $model, | ||
19 | + ]) ?> | ||
20 | + | ||
21 | +</div> |
1 | +++ a/backend/views/team/skils/index.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\grid\GridView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $dataProvider yii\data\ActiveDataProvider */ | ||
8 | + | ||
9 | +$this->title = Yii::t('app', 'Team Skils'); | ||
10 | +$this->params['breadcrumbs'][] = $this->title; | ||
11 | +?> | ||
12 | +<div class="team-skils-index"> | ||
13 | + | ||
14 | + <h1><?= Html::encode($this->title) ?></h1> | ||
15 | + | ||
16 | + <p> | ||
17 | + <?= Html::a(Yii::t('app', 'Create Team Skils'), ['create'], ['class' => 'btn btn-success']) ?> | ||
18 | + </p> | ||
19 | + | ||
20 | + <?= GridView::widget([ | ||
21 | + 'dataProvider' => $dataProvider, | ||
22 | + 'columns' => [ | ||
23 | + ['class' => 'yii\grid\SerialColumn'], | ||
24 | + | ||
25 | + 'id', | ||
26 | + 'team_id', | ||
27 | + 'title', | ||
28 | + 'value', | ||
29 | + | ||
30 | + ['class' => 'yii\grid\ActionColumn'], | ||
31 | + ], | ||
32 | + ]); ?> | ||
33 | + | ||
34 | +</div> |
1 | +++ a/backend/views/team/skils/update.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $model backend\models\TeamSkils */ | ||
7 | + | ||
8 | +$this->title = Yii::t('app', 'Update {modelClass}: ', [ | ||
9 | + 'modelClass' => 'Team Skils', | ||
10 | +]) . ' ' . $model->title; | ||
11 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Team Skils'), 'url' => ['index']]; | ||
12 | +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]]; | ||
13 | +$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); | ||
14 | +?> | ||
15 | +<div class="team-skils-update"> | ||
16 | + | ||
17 | + <h1><?= Html::encode($this->title) ?></h1> | ||
18 | + | ||
19 | + <?= $this->render('_form', [ | ||
20 | + 'model' => $model, | ||
21 | + ]) ?> | ||
22 | + | ||
23 | +</div> |
1 | +++ a/backend/views/team/skils/view.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\DetailView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\TeamSkils */ | ||
8 | + | ||
9 | +$this->title = $model->title; | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Team Skils'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="team-skils-view"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <p> | ||
18 | + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | ||
19 | + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | ||
20 | + 'class' => 'btn btn-danger', | ||
21 | + 'data' => [ | ||
22 | + 'confirm' => Yii::t('app', '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 | + 'id', | ||
32 | + 'team_id', | ||
33 | + 'title', | ||
34 | + 'value', | ||
35 | + ], | ||
36 | + ]) ?> | ||
37 | + | ||
38 | +</div> |
1 | +++ a/backend/views/team/update.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $model backend\models\Team */ | ||
7 | + | ||
8 | +$this->title = Yii::t('app', 'Update {modelClass}: ', [ | ||
9 | + 'modelClass' => 'Team', | ||
10 | +]) . ' ' . $model->name; | ||
11 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Teams'), 'url' => ['index']]; | ||
12 | +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; | ||
13 | +$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); | ||
14 | +?> | ||
15 | +<div class="team-update"> | ||
16 | + | ||
17 | + <h1><?= Html::encode($this->title) ?></h1> | ||
18 | + | ||
19 | + <?= $this->render('_form', [ | ||
20 | + 'model' => $model, | ||
21 | + 'skills' => $skills, | ||
22 | + 'books' => $books, | ||
23 | + ]) ?> | ||
24 | + | ||
25 | +</div> |
1 | +++ a/backend/views/team/view.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\DetailView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\Team */ | ||
8 | + | ||
9 | +$this->title = $model->name; | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Teams'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="team-view"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <p> | ||
18 | + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | ||
19 | + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | ||
20 | + 'class' => 'btn btn-danger', | ||
21 | + 'data' => [ | ||
22 | + 'confirm' => Yii::t('app', '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 | + 'id', | ||
32 | + 'department_id', | ||
33 | + 'user_id', | ||
34 | + 'name', | ||
35 | + 'name2', | ||
36 | + 'email:email', | ||
37 | + 'job', | ||
38 | + 'zodiac', | ||
39 | + 'iq', | ||
40 | + 'soc_vk', | ||
41 | + 'soc_fb', | ||
42 | + 'soc_tw', | ||
43 | + 'soc_li', | ||
44 | + 'interests_caption:ntext', | ||
45 | + 'skils_caption:ntext', | ||
46 | + 'books_caption:ntext', | ||
47 | + 'films_caption:ntext', | ||
48 | + 'description:ntext', | ||
49 | + 'photo', | ||
50 | + 'photo_big', | ||
51 | + 'visible', | ||
52 | + ], | ||
53 | + ]) ?> | ||
54 | + | ||
55 | +</div> |
1 | +++ a/backend/web/css/site.css | ||
1 | +html, | ||
2 | +body { | ||
3 | + height: 100%; | ||
4 | +} | ||
5 | + | ||
6 | +.wrap { | ||
7 | + min-height: 100%; | ||
8 | + height: auto; | ||
9 | + margin: 0 auto -60px; | ||
10 | + padding: 0 0 60px; | ||
11 | +} | ||
12 | + | ||
13 | +.wrap > .container { | ||
14 | + padding: 70px 15px 20px; | ||
15 | +} | ||
16 | + | ||
17 | +.footer { | ||
18 | + height: 60px; | ||
19 | + background-color: #f5f5f5; | ||
20 | + border-top: 1px solid #ddd; | ||
21 | + padding-top: 20px; | ||
22 | +} | ||
23 | + | ||
24 | +.jumbotron { | ||
25 | + text-align: center; | ||
26 | + background-color: transparent; | ||
27 | +} | ||
28 | + | ||
29 | +.jumbotron .btn { | ||
30 | + font-size: 21px; | ||
31 | + padding: 14px 24px; | ||
32 | +} | ||
33 | + | ||
34 | +.not-set { | ||
35 | + color: #c55; | ||
36 | + font-style: italic; | ||
37 | +} | ||
38 | + | ||
39 | +/* add sorting icons to gridview sort links */ | ||
40 | +a.asc:after, a.desc:after { | ||
41 | + position: relative; | ||
42 | + top: 1px; | ||
43 | + display: inline-block; | ||
44 | + font-family: 'Glyphicons Halflings'; | ||
45 | + font-style: normal; | ||
46 | + font-weight: normal; | ||
47 | + line-height: 1; | ||
48 | + padding-left: 5px; | ||
49 | +} | ||
50 | + | ||
51 | +a.asc:after { | ||
52 | + content: /*"\e113"*/ "\e151"; | ||
53 | +} | ||
54 | + | ||
55 | +a.desc:after { | ||
56 | + content: /*"\e114"*/ "\e152"; | ||
57 | +} | ||
58 | + | ||
59 | +.sort-numerical a.asc:after { | ||
60 | + content: "\e153"; | ||
61 | +} | ||
62 | + | ||
63 | +.sort-numerical a.desc:after { | ||
64 | + content: "\e154"; | ||
65 | +} | ||
66 | + | ||
67 | +.sort-ordinal a.asc:after { | ||
68 | + content: "\e155"; | ||
69 | +} | ||
70 | + | ||
71 | +.sort-ordinal a.desc:after { | ||
72 | + content: "\e156"; | ||
73 | +} | ||
74 | + | ||
75 | +.grid-view th { | ||
76 | + white-space: nowrap; | ||
77 | +} | ||
78 | + | ||
79 | +.hint-block { | ||
80 | + display: block; | ||
81 | + margin-top: 5px; | ||
82 | + color: #999; | ||
83 | +} | ||
84 | + | ||
85 | +.error-summary { | ||
86 | + color: #a94442; | ||
87 | + background: #fdf7f7; | ||
88 | + border-left: 3px solid #eed3d7; | ||
89 | + padding: 10px 20px; | ||
90 | + margin: 0 0 15px 0; | ||
91 | +} |
No preview for this file type
1 | +++ a/common/components/Request.php | ||
1 | +<?php | ||
2 | +namespace common\components; | ||
3 | + | ||
4 | +class Request extends \yii\web\Request | ||
5 | +{ | ||
6 | + public $web; | ||
7 | + public $adminUrl; | ||
8 | + | ||
9 | + public function getBaseUrl() | ||
10 | + { | ||
11 | + return str_replace($this->web, "", parent::getBaseUrl()) . $this->adminUrl; | ||
12 | + } | ||
13 | + | ||
14 | + public function resolvePathInfo() | ||
15 | + { | ||
16 | + if ($this->getUrl() === $this->adminUrl) { | ||
17 | + return ""; | ||
18 | + } else { | ||
19 | + return parent::resolvePathInfo(); | ||
20 | + } | ||
21 | + } | ||
22 | +} | ||
0 | \ No newline at end of file | 23 | \ No newline at end of file |
1 | +++ a/common/config/main.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', | ||
4 | + 'components' => [ | ||
5 | + 'cache' => [ | ||
6 | + 'class' => 'yii\caching\FileCache', | ||
7 | + ], | ||
8 | + 'urlManager' => [ | ||
9 | + 'enablePrettyUrl' => true, | ||
10 | + 'showScriptName' => false, | ||
11 | + 'rules' => [ | ||
12 | + 'module/<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>', | ||
13 | + ] | ||
14 | + ], | ||
15 | + ], | ||
16 | + 'language' => 'ru-RU', | ||
17 | +]; |
1 | +++ a/common/config/rules.php | ||
1 | +<?php | ||
2 | + | ||
3 | +return [ | ||
4 | + '<controller:\w+>' => '<controller>/index', | ||
5 | + '<controller:\w+>/<action:\w+>' => '<controller>/<action>', | ||
6 | + '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', | ||
7 | +]; | ||
0 | \ No newline at end of file | 8 | \ No newline at end of file |
1 | +++ a/common/mail/layouts/html.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | + | ||
4 | +/* @var $this \yii\web\View view component instance */ | ||
5 | +/* @var $message \yii\mail\MessageInterface the message being composed */ | ||
6 | +/* @var $content string main view render result */ | ||
7 | +?> | ||
8 | +<?php $this->beginPage() ?> | ||
9 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
10 | +<html xmlns="http://www.w3.org/1999/xhtml"> | ||
11 | +<head> | ||
12 | + <meta http-equiv="Content-Type" content="text/html; charset=<?= Yii::$app->charset ?>" /> | ||
13 | + <title><?= Html::encode($this->title) ?></title> | ||
14 | + <?php $this->head() ?> | ||
15 | +</head> | ||
16 | +<body> | ||
17 | + <?php $this->beginBody() ?> | ||
18 | + <?= $content ?> | ||
19 | + <?php $this->endBody() ?> | ||
20 | +</body> | ||
21 | +</html> | ||
22 | +<?php $this->endPage() ?> |
1 | +++ a/common/mail/layouts/text.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | + | ||
4 | +/* @var $this \yii\web\View view component instance */ | ||
5 | +/* @var $message \yii\mail\MessageInterface the message being composed */ | ||
6 | +/* @var $content string main view render result */ | ||
7 | +?> | ||
8 | +<?php $this->beginPage() ?> | ||
9 | +<?php $this->beginBody() ?> | ||
10 | +<?= $content ?> | ||
11 | +<?php $this->endBody() ?> | ||
12 | +<?php $this->endPage() ?> |
1 | +++ a/common/mail/passwordResetToken-html.php | ||
1 | +<?php | ||
2 | +use yii\helpers\Html; | ||
3 | + | ||
4 | +/* @var $this yii\web\View */ | ||
5 | +/* @var $user common\models\User */ | ||
6 | + | ||
7 | +$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]); | ||
8 | +?> | ||
9 | +<div class="password-reset"> | ||
10 | + <p>Hello <?= Html::encode($user->username) ?>,</p> | ||
11 | + | ||
12 | + <p>Follow the link below to reset your password:</p> | ||
13 | + | ||
14 | + <p><?= Html::a(Html::encode($resetLink), $resetLink) ?></p> | ||
15 | +</div> |
1 | +++ a/common/mail/passwordResetToken-text.php | ||
1 | +<?php | ||
2 | + | ||
3 | +/* @var $this yii\web\View */ | ||
4 | +/* @var $user common\models\User */ | ||
5 | + | ||
6 | +$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]); | ||
7 | +?> | ||
8 | +Hello <?= $user->username ?>, | ||
9 | + | ||
10 | +Follow the link below to reset your password: | ||
11 | + | ||
12 | +<?= $resetLink ?> |
1 | +++ a/common/models/LoginForm.php | ||
1 | +<?php | ||
2 | +namespace common\models; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\base\Model; | ||
6 | + | ||
7 | +/** | ||
8 | + * Login form | ||
9 | + */ | ||
10 | +class LoginForm extends Model | ||
11 | +{ | ||
12 | + public $username; | ||
13 | + public $password; | ||
14 | + public $rememberMe = true; | ||
15 | + | ||
16 | + private $_user; | ||
17 | + | ||
18 | + | ||
19 | + /** | ||
20 | + * @inheritdoc | ||
21 | + */ | ||
22 | + public function rules() | ||
23 | + { | ||
24 | + return [ | ||
25 | + // username and password are both required | ||
26 | + [['username', 'password'], 'required'], | ||
27 | + // rememberMe must be a boolean value | ||
28 | + ['rememberMe', 'boolean'], | ||
29 | + // password is validated by validatePassword() | ||
30 | + ['password', 'validatePassword'], | ||
31 | + ]; | ||
32 | + } | ||
33 | + | ||
34 | + /** | ||
35 | + * Validates the password. | ||
36 | + * This method serves as the inline validation for password. | ||
37 | + * | ||
38 | + * @param string $attribute the attribute currently being validated | ||
39 | + * @param array $params the additional name-value pairs given in the rule | ||
40 | + */ | ||
41 | + public function validatePassword($attribute, $params) | ||
42 | + { | ||
43 | + if (!$this->hasErrors()) { | ||
44 | + $user = $this->getUser(); | ||
45 | + if (!$user || !$user->validatePassword($this->password)) { | ||
46 | + $this->addError($attribute, 'Incorrect username or password.'); | ||
47 | + } | ||
48 | + } | ||
49 | + } | ||
50 | + | ||
51 | + /** | ||
52 | + * Logs in a user using the provided username and password. | ||
53 | + * | ||
54 | + * @return boolean whether the user is logged in successfully | ||
55 | + */ | ||
56 | + public function login() | ||
57 | + { | ||
58 | + if ($this->validate()) { | ||
59 | + return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0); | ||
60 | + } else { | ||
61 | + return false; | ||
62 | + } | ||
63 | + } | ||
64 | + | ||
65 | + /** | ||
66 | + * Finds user by [[username]] | ||
67 | + * | ||
68 | + * @return User|null | ||
69 | + */ | ||
70 | + protected function getUser() | ||
71 | + { | ||
72 | + if ($this->_user === null) { | ||
73 | + $this->_user = User::findByUsername($this->username); | ||
74 | + } | ||
75 | + | ||
76 | + return $this->_user; | ||
77 | + } | ||
78 | +} |
1 | +++ a/common/models/OrdersAudit.php | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace common\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "orders_audit". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property string $email | ||
12 | + * @property string $phone | ||
13 | + * @property string $comment | ||
14 | + * @property integer $created | ||
15 | + * @property string $ip | ||
16 | + */ | ||
17 | +class OrdersAudit extends \yii\db\ActiveRecord | ||
18 | +{ | ||
19 | + /** | ||
20 | + * @inheritdoc | ||
21 | + */ | ||
22 | + public static function tableName() | ||
23 | + { | ||
24 | + return 'orders_audit'; | ||
25 | + } | ||
26 | + | ||
27 | + /** | ||
28 | + * @inheritdoc | ||
29 | + */ | ||
30 | + public function rules() | ||
31 | + { | ||
32 | + return [ | ||
33 | + [['phone', 'comment'], 'required'], | ||
34 | + [['comment'], 'string'], | ||
35 | + [['created'], 'integer'], | ||
36 | + [['email', 'phone'], 'string', 'max' => 150], | ||
37 | + [['ip'], 'string', 'max' => 15] | ||
38 | + ]; | ||
39 | + } | ||
40 | + | ||
41 | + /** | ||
42 | + * @inheritdoc | ||
43 | + */ | ||
44 | + public function attributeLabels() | ||
45 | + { | ||
46 | + return [ | ||
47 | + 'id' => Yii::t('app', 'ID'), | ||
48 | + 'email' => Yii::t('app', 'Email'), | ||
49 | + 'phone' => Yii::t('app', 'Phone'), | ||
50 | + 'comment' => Yii::t('app', 'Comment'), | ||
51 | + 'created' => Yii::t('app', 'Created'), | ||
52 | + 'ip' => Yii::t('app', 'Ip'), | ||
53 | + ]; | ||
54 | + } | ||
55 | + | ||
56 | + public function setDefaults() { | ||
57 | + $this->ip = Yii::$app->request->getUserIP(); | ||
58 | + $this->created = time(); | ||
59 | + } | ||
60 | + | ||
61 | + public function sendEmail($to) { | ||
62 | + | ||
63 | + } | ||
64 | +} |
1 | +++ a/common/models/User.php | ||
1 | +<?php | ||
2 | +namespace common\models; | ||
3 | + | ||
4 | +use Yii; | ||
5 | +use yii\base\NotSupportedException; | ||
6 | +use yii\behaviors\TimestampBehavior; | ||
7 | +use yii\db\ActiveRecord; | ||
8 | +use yii\web\IdentityInterface; | ||
9 | + | ||
10 | +/** | ||
11 | + * User model | ||
12 | + * | ||
13 | + * @property integer $id | ||
14 | + * @property string $username | ||
15 | + * @property string $password_hash | ||
16 | + * @property string $password_reset_token | ||
17 | + * @property string $email | ||
18 | + * @property string $auth_key | ||
19 | + * @property integer $status | ||
20 | + * @property integer $created_at | ||
21 | + * @property integer $updated_at | ||
22 | + * @property string $password write-only password | ||
23 | + */ | ||
24 | +class User extends ActiveRecord implements IdentityInterface | ||
25 | +{ | ||
26 | + const STATUS_DELETED = 0; | ||
27 | + const STATUS_ACTIVE = 10; | ||
28 | + | ||
29 | + /** | ||
30 | + * @inheritdoc | ||
31 | + */ | ||
32 | + public static function tableName() | ||
33 | + { | ||
34 | + return '{{%user}}'; | ||
35 | + } | ||
36 | + | ||
37 | + /** | ||
38 | + * @inheritdoc | ||
39 | + */ | ||
40 | + public function behaviors() | ||
41 | + { | ||
42 | + return [ | ||
43 | + TimestampBehavior::className(), | ||
44 | + ]; | ||
45 | + } | ||
46 | + | ||
47 | + /** | ||
48 | + * @inheritdoc | ||
49 | + */ | ||
50 | + public function rules() | ||
51 | + { | ||
52 | + return [ | ||
53 | + ['status', 'default', 'value' => self::STATUS_ACTIVE], | ||
54 | + ['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]], | ||
55 | + ]; | ||
56 | + } | ||
57 | + | ||
58 | + /** | ||
59 | + * @inheritdoc | ||
60 | + */ | ||
61 | + public static function findIdentity($id) | ||
62 | + { | ||
63 | + return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]); | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * @inheritdoc | ||
68 | + */ | ||
69 | + public static function findIdentityByAccessToken($token, $type = null) | ||
70 | + { | ||
71 | + throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.'); | ||
72 | + } | ||
73 | + | ||
74 | + /** | ||
75 | + * Finds user by username | ||
76 | + * | ||
77 | + * @param string $username | ||
78 | + * @return static|null | ||
79 | + */ | ||
80 | + public static function findByUsername($username) | ||
81 | + { | ||
82 | + return static::findOne(['username' => $username, 'status' => self::STATUS_ACTIVE]); | ||
83 | + } | ||
84 | + | ||
85 | + /** | ||
86 | + * Finds user by password reset token | ||
87 | + * | ||
88 | + * @param string $token password reset token | ||
89 | + * @return static|null | ||
90 | + */ | ||
91 | + public static function findByPasswordResetToken($token) | ||
92 | + { | ||
93 | + if (!static::isPasswordResetTokenValid($token)) { | ||
94 | + return null; | ||
95 | + } | ||
96 | + | ||
97 | + return static::findOne([ | ||
98 | + 'password_reset_token' => $token, | ||
99 | + 'status' => self::STATUS_ACTIVE, | ||
100 | + ]); | ||
101 | + } | ||
102 | + | ||
103 | + /** | ||
104 | + * Finds out if password reset token is valid | ||
105 | + * | ||
106 | + * @param string $token password reset token | ||
107 | + * @return boolean | ||
108 | + */ | ||
109 | + public static function isPasswordResetTokenValid($token) | ||
110 | + { | ||
111 | + if (empty($token)) { | ||
112 | + return false; | ||
113 | + } | ||
114 | + | ||
115 | + $timestamp = (int) substr($token, strrpos($token, '_') + 1); | ||
116 | + $expire = Yii::$app->params['user.passwordResetTokenExpire']; | ||
117 | + return $timestamp + $expire >= time(); | ||
118 | + } | ||
119 | + | ||
120 | + /** | ||
121 | + * @inheritdoc | ||
122 | + */ | ||
123 | + public function getId() | ||
124 | + { | ||
125 | + return $this->getPrimaryKey(); | ||
126 | + } | ||
127 | + | ||
128 | + /** | ||
129 | + * @inheritdoc | ||
130 | + */ | ||
131 | + public function getAuthKey() | ||
132 | + { | ||
133 | + return $this->auth_key; | ||
134 | + } | ||
135 | + | ||
136 | + /** | ||
137 | + * @inheritdoc | ||
138 | + */ | ||
139 | + public function validateAuthKey($authKey) | ||
140 | + { | ||
141 | + return $this->getAuthKey() === $authKey; | ||
142 | + } | ||
143 | + | ||
144 | + /** | ||
145 | + * Validates password | ||
146 | + * | ||
147 | + * @param string $password password to validate | ||
148 | + * @return boolean if password provided is valid for current user | ||
149 | + */ | ||
150 | + public function validatePassword($password) | ||
151 | + { | ||
152 | + return Yii::$app->security->validatePassword($password, $this->password_hash); | ||
153 | + } | ||
154 | + | ||
155 | + /** | ||
156 | + * Generates password hash from password and sets it to the model | ||
157 | + * | ||
158 | + * @param string $password | ||
159 | + */ | ||
160 | + public function setPassword($password) | ||
161 | + { | ||
162 | + $this->password_hash = Yii::$app->security->generatePasswordHash($password); | ||
163 | + } | ||
164 | + | ||
165 | + /** | ||
166 | + * Generates "remember me" authentication key | ||
167 | + */ | ||
168 | + public function generateAuthKey() | ||
169 | + { | ||
170 | + $this->auth_key = Yii::$app->security->generateRandomString(); | ||
171 | + } | ||
172 | + | ||
173 | + /** | ||
174 | + * Generates new password reset token | ||
175 | + */ | ||
176 | + public function generatePasswordResetToken() | ||
177 | + { | ||
178 | + $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time(); | ||
179 | + } | ||
180 | + | ||
181 | + /** | ||
182 | + * Removes password reset token | ||
183 | + */ | ||
184 | + public function removePasswordResetToken() | ||
185 | + { | ||
186 | + $this->password_reset_token = null; | ||
187 | + } | ||
188 | +} |
1 | +++ a/common/widgets/Alert.php | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * @link http://www.yiiframework.com/ | ||
4 | + * @copyright Copyright (c) 2008 Yii Software LLC | ||
5 | + * @license http://www.yiiframework.com/license/ | ||
6 | + */ | ||
7 | + | ||
8 | +namespace common\widgets; | ||
9 | + | ||
10 | +/** | ||
11 | + * Alert widget renders a message from session flash. All flash messages are displayed | ||
12 | + * in the sequence they were assigned using setFlash. You can set message as following: | ||
13 | + * | ||
14 | + * ```php | ||
15 | + * \Yii::$app->session->setFlash('error', 'This is the message'); | ||
16 | + * \Yii::$app->session->setFlash('success', 'This is the message'); | ||
17 | + * \Yii::$app->session->setFlash('info', 'This is the message'); | ||
18 | + * ``` | ||
19 | + * | ||
20 | + * Multiple messages could be set as follows: | ||
21 | + * | ||
22 | + * ```php | ||
23 | + * \Yii::$app->session->setFlash('error', ['Error 1', 'Error 2']); | ||
24 | + * ``` | ||
25 | + * | ||
26 | + * @author Kartik Visweswaran <kartikv2@gmail.com> | ||
27 | + * @author Alexander Makarov <sam@rmcreative.ru> | ||
28 | + */ | ||
29 | +class Alert extends \yii\bootstrap\Widget | ||
30 | +{ | ||
31 | + /** | ||
32 | + * @var array the alert types configuration for the flash messages. | ||
33 | + * This array is setup as $key => $value, where: | ||
34 | + * - $key is the name of the session flash variable | ||
35 | + * - $value is the bootstrap alert type (i.e. danger, success, info, warning) | ||
36 | + */ | ||
37 | + public $alertTypes = [ | ||
38 | + 'error' => 'alert-danger', | ||
39 | + 'danger' => 'alert-danger', | ||
40 | + 'success' => 'alert-success', | ||
41 | + 'info' => 'alert-info', | ||
42 | + 'warning' => 'alert-warning' | ||
43 | + ]; | ||
44 | + | ||
45 | + /** | ||
46 | + * @var array the options for rendering the close button tag. | ||
47 | + */ | ||
48 | + public $closeButton = []; | ||
49 | + | ||
50 | + public function init() | ||
51 | + { | ||
52 | + parent::init(); | ||
53 | + | ||
54 | + $session = \Yii::$app->session; | ||
55 | + $flashes = $session->getAllFlashes(); | ||
56 | + $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : ''; | ||
57 | + | ||
58 | + foreach ($flashes as $type => $data) { | ||
59 | + if (isset($this->alertTypes[$type])) { | ||
60 | + $data = (array) $data; | ||
61 | + foreach ($data as $i => $message) { | ||
62 | + /* initialize css class for each alert box */ | ||
63 | + $this->options['class'] = $this->alertTypes[$type] . $appendCss; | ||
64 | + | ||
65 | + /* assign unique id to each alert box */ | ||
66 | + $this->options['id'] = $this->getId() . '-' . $type . '-' . $i; | ||
67 | + | ||
68 | + echo \yii\bootstrap\Alert::widget([ | ||
69 | + 'body' => $message, | ||
70 | + 'closeButton' => $this->closeButton, | ||
71 | + 'options' => $this->options, | ||
72 | + ]); | ||
73 | + } | ||
74 | + | ||
75 | + $session->removeFlash($type); | ||
76 | + } | ||
77 | + } | ||
78 | + } | ||
79 | +} |
1 | +++ a/composer.json | ||
1 | +{ | ||
2 | + "name": "yiisoft/yii2-app-advanced", | ||
3 | + "description": "Yii 2 Advanced Project Template", | ||
4 | + "keywords": ["yii2", "framework", "advanced", "project template"], | ||
5 | + "homepage": "http://www.yiiframework.com/", | ||
6 | + "type": "project", | ||
7 | + "license": "BSD-3-Clause", | ||
8 | + "support": { | ||
9 | + "issues": "https://github.com/yiisoft/yii2/issues?state=open", | ||
10 | + "forum": "http://www.yiiframework.com/forum/", | ||
11 | + "wiki": "http://www.yiiframework.com/wiki/", | ||
12 | + "irc": "irc://irc.freenode.net/yii", | ||
13 | + "source": "https://github.com/yiisoft/yii2" | ||
14 | + }, | ||
15 | + "minimum-stability": "stable", | ||
16 | + "require": { | ||
17 | + "php": ">=5.4.0", | ||
18 | + "yiisoft/yii2": ">=2.0.6", | ||
19 | + "yiisoft/yii2-bootstrap": "*", | ||
20 | + "yiisoft/yii2-swiftmailer": "*", | ||
21 | + "pavlinter/yii2-multifields": "*", | ||
22 | + "dmstr/yii2-adminlte-asset": "2.*" | ||
23 | + }, | ||
24 | + "require-dev": { | ||
25 | + "yiisoft/yii2-codeception": "*", | ||
26 | + "yiisoft/yii2-debug": "*", | ||
27 | + "yiisoft/yii2-gii": "*", | ||
28 | + "yiisoft/yii2-faker": "*" | ||
29 | + }, | ||
30 | + "config": { | ||
31 | + "process-timeout": 1800 | ||
32 | + }, | ||
33 | + "extra": { | ||
34 | + "asset-installer-paths": { | ||
35 | + "npm-asset-library": "vendor/npm", | ||
36 | + "bower-asset-library": "vendor/bower" | ||
37 | + } | ||
38 | + } | ||
39 | +} |
1 | +++ a/composer.lock | ||
1 | +{ | ||
2 | + "_readme": [ | ||
3 | + "This file locks the dependencies of your project to a known state", | ||
4 | + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | ||
5 | + "This file is @generated automatically" | ||
6 | + ], | ||
7 | + "hash": "e52c5edddf09bbaefeae553d396be73c", | ||
8 | + "content-hash": "f8b86b0265935903d07aa38f77e2aadb", | ||
9 | + "packages": [ | ||
10 | + { | ||
11 | + "name": "almasaeed2010/adminlte", | ||
12 | + "version": "v2.3.0", | ||
13 | + "source": { | ||
14 | + "type": "git", | ||
15 | + "url": "https://github.com/almasaeed2010/AdminLTE.git", | ||
16 | + "reference": "81aa879d3a4489213888e24975b073c7478f0447" | ||
17 | + }, | ||
18 | + "dist": { | ||
19 | + "type": "zip", | ||
20 | + "url": "https://api.github.com/repos/almasaeed2010/AdminLTE/zipball/81aa879d3a4489213888e24975b073c7478f0447", | ||
21 | + "reference": "81aa879d3a4489213888e24975b073c7478f0447", | ||
22 | + "shasum": "" | ||
23 | + }, | ||
24 | + "type": "library", | ||
25 | + "notification-url": "https://packagist.org/downloads/", | ||
26 | + "license": [ | ||
27 | + "MIT" | ||
28 | + ], | ||
29 | + "authors": [ | ||
30 | + { | ||
31 | + "name": "Abdullah Almsaeed", | ||
32 | + "email": "support@almsaeedstudio.com" | ||
33 | + } | ||
34 | + ], | ||
35 | + "description": "AdminLTE - admin control panel and dashboard that's based on Bootstrap 3", | ||
36 | + "homepage": "http://almsaeedstudio.com/", | ||
37 | + "keywords": [ | ||
38 | + "JS", | ||
39 | + "admin", | ||
40 | + "back-end", | ||
41 | + "css", | ||
42 | + "less", | ||
43 | + "responsive", | ||
44 | + "template", | ||
45 | + "theme", | ||
46 | + "web" | ||
47 | + ], | ||
48 | + "time": "2015-08-17 01:49:41" | ||
49 | + }, | ||
50 | + { | ||
51 | + "name": "bower-asset/bootstrap", | ||
52 | + "version": "v3.3.5", | ||
53 | + "source": { | ||
54 | + "type": "git", | ||
55 | + "url": "https://github.com/twbs/bootstrap.git", | ||
56 | + "reference": "16b48259a62f576e52c903c476bd42b90ab22482" | ||
57 | + }, | ||
58 | + "dist": { | ||
59 | + "type": "zip", | ||
60 | + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/16b48259a62f576e52c903c476bd42b90ab22482", | ||
61 | + "reference": "16b48259a62f576e52c903c476bd42b90ab22482", | ||
62 | + "shasum": "" | ||
63 | + }, | ||
64 | + "require": { | ||
65 | + "bower-asset/jquery": ">=1.9.1" | ||
66 | + }, | ||
67 | + "type": "bower-asset-library", | ||
68 | + "extra": { | ||
69 | + "bower-asset-main": [ | ||
70 | + "less/bootstrap.less", | ||
71 | + "dist/js/bootstrap.js" | ||
72 | + ], | ||
73 | + "bower-asset-ignore": [ | ||
74 | + "/.*", | ||
75 | + "_config.yml", | ||
76 | + "CNAME", | ||
77 | + "composer.json", | ||
78 | + "CONTRIBUTING.md", | ||
79 | + "docs", | ||
80 | + "js/tests", | ||
81 | + "test-infra" | ||
82 | + ] | ||
83 | + }, | ||
84 | + "license": [ | ||
85 | + "MIT" | ||
86 | + ], | ||
87 | + "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", | ||
88 | + "keywords": [ | ||
89 | + "css", | ||
90 | + "framework", | ||
91 | + "front-end", | ||
92 | + "js", | ||
93 | + "less", | ||
94 | + "mobile-first", | ||
95 | + "responsive", | ||
96 | + "web" | ||
97 | + ] | ||
98 | + }, | ||
99 | + { | ||
100 | + "name": "bower-asset/fontawesome", | ||
101 | + "version": "v4.4.0", | ||
102 | + "source": { | ||
103 | + "type": "git", | ||
104 | + "url": "https://github.com/FortAwesome/Font-Awesome.git", | ||
105 | + "reference": "e554555d73a44e0a7d11b0361ad7a5325a5f551c" | ||
106 | + }, | ||
107 | + "dist": { | ||
108 | + "type": "zip", | ||
109 | + "url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/e554555d73a44e0a7d11b0361ad7a5325a5f551c", | ||
110 | + "reference": "e554555d73a44e0a7d11b0361ad7a5325a5f551c", | ||
111 | + "shasum": "" | ||
112 | + }, | ||
113 | + "type": "bower-asset-library", | ||
114 | + "extra": { | ||
115 | + "bower-asset-main": [ | ||
116 | + "less/font-awesome.less", | ||
117 | + "scss/font-awesome.scss" | ||
118 | + ], | ||
119 | + "bower-asset-ignore": [ | ||
120 | + "*/.*", | ||
121 | + "*.json", | ||
122 | + "src", | ||
123 | + "*.yml", | ||
124 | + "Gemfile", | ||
125 | + "Gemfile.lock", | ||
126 | + "*.md" | ||
127 | + ] | ||
128 | + }, | ||
129 | + "license": [ | ||
130 | + "OFL-1.1", | ||
131 | + "MIT", | ||
132 | + "CC-BY-3.0" | ||
133 | + ], | ||
134 | + "description": "Font Awesome" | ||
135 | + }, | ||
136 | + { | ||
137 | + "name": "bower-asset/jquery", | ||
138 | + "version": "2.1.4", | ||
139 | + "source": { | ||
140 | + "type": "git", | ||
141 | + "url": "https://github.com/jquery/jquery.git", | ||
142 | + "reference": "7751e69b615c6eca6f783a81e292a55725af6b85" | ||
143 | + }, | ||
144 | + "dist": { | ||
145 | + "type": "zip", | ||
146 | + "url": "https://api.github.com/repos/jquery/jquery/zipball/7751e69b615c6eca6f783a81e292a55725af6b85", | ||
147 | + "reference": "7751e69b615c6eca6f783a81e292a55725af6b85", | ||
148 | + "shasum": "" | ||
149 | + }, | ||
150 | + "require-dev": { | ||
151 | + "bower-asset/qunit": "1.14.0", | ||
152 | + "bower-asset/requirejs": "2.1.10", | ||
153 | + "bower-asset/sinon": "1.8.1", | ||
154 | + "bower-asset/sizzle": "2.1.1-patch2" | ||
155 | + }, | ||
156 | + "type": "bower-asset-library", | ||
157 | + "extra": { | ||
158 | + "bower-asset-main": "dist/jquery.js", | ||
159 | + "bower-asset-ignore": [ | ||
160 | + "**/.*", | ||
161 | + "build", | ||
162 | + "dist/cdn", | ||
163 | + "speed", | ||
164 | + "test", | ||
165 | + "*.md", | ||
166 | + "AUTHORS.txt", | ||
167 | + "Gruntfile.js", | ||
168 | + "package.json" | ||
169 | + ] | ||
170 | + }, | ||
171 | + "license": [ | ||
172 | + "MIT" | ||
173 | + ], | ||
174 | + "keywords": [ | ||
175 | + "javascript", | ||
176 | + "jquery", | ||
177 | + "library" | ||
178 | + ] | ||
179 | + }, | ||
180 | + { | ||
181 | + "name": "bower-asset/jquery.inputmask", | ||
182 | + "version": "3.1.63", | ||
183 | + "source": { | ||
184 | + "type": "git", | ||
185 | + "url": "https://github.com/RobinHerbots/jquery.inputmask.git", | ||
186 | + "reference": "c40c7287eadc31e341ebbf0c02352eb55b9cbc48" | ||
187 | + }, | ||
188 | + "dist": { | ||
189 | + "type": "zip", | ||
190 | + "url": "https://api.github.com/repos/RobinHerbots/jquery.inputmask/zipball/c40c7287eadc31e341ebbf0c02352eb55b9cbc48", | ||
191 | + "reference": "c40c7287eadc31e341ebbf0c02352eb55b9cbc48", | ||
192 | + "shasum": "" | ||
193 | + }, | ||
194 | + "require": { | ||
195 | + "bower-asset/jquery": ">=1.7" | ||
196 | + }, | ||
197 | + "type": "bower-asset-library", | ||
198 | + "extra": { | ||
199 | + "bower-asset-main": [ | ||
200 | + "./dist/inputmask/jquery.inputmask.js", | ||
201 | + "./dist/inputmask/jquery.inputmask.extensions.js", | ||
202 | + "./dist/inputmask/jquery.inputmask.date.extensions.js", | ||
203 | + "./dist/inputmask/jquery.inputmask.numeric.extensions.js", | ||
204 | + "./dist/inputmask/jquery.inputmask.phone.extensions.js", | ||
205 | + "./dist/inputmask/jquery.inputmask.regex.extensions.js" | ||
206 | + ], | ||
207 | + "bower-asset-ignore": [ | ||
208 | + "**/.*", | ||
209 | + "qunit/", | ||
210 | + "nuget/", | ||
211 | + "tools/", | ||
212 | + "js/", | ||
213 | + "*.md", | ||
214 | + "build.properties", | ||
215 | + "build.xml", | ||
216 | + "jquery.inputmask.jquery.json" | ||
217 | + ] | ||
218 | + }, | ||
219 | + "license": [ | ||
220 | + "http://opensource.org/licenses/mit-license.php" | ||
221 | + ], | ||
222 | + "description": "jquery.inputmask is a jquery plugin which create an input mask.", | ||
223 | + "keywords": [ | ||
224 | + "form", | ||
225 | + "input", | ||
226 | + "inputmask", | ||
227 | + "jquery", | ||
228 | + "mask", | ||
229 | + "plugins" | ||
230 | + ] | ||
231 | + }, | ||
232 | + { | ||
233 | + "name": "bower-asset/punycode", | ||
234 | + "version": "v1.3.2", | ||
235 | + "source": { | ||
236 | + "type": "git", | ||
237 | + "url": "https://github.com/bestiejs/punycode.js.git", | ||
238 | + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" | ||
239 | + }, | ||
240 | + "dist": { | ||
241 | + "type": "zip", | ||
242 | + "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", | ||
243 | + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", | ||
244 | + "shasum": "" | ||
245 | + }, | ||
246 | + "type": "bower-asset-library", | ||
247 | + "extra": { | ||
248 | + "bower-asset-main": "punycode.js", | ||
249 | + "bower-asset-ignore": [ | ||
250 | + "coverage", | ||
251 | + "tests", | ||
252 | + ".*", | ||
253 | + "component.json", | ||
254 | + "Gruntfile.js", | ||
255 | + "node_modules", | ||
256 | + "package.json" | ||
257 | + ] | ||
258 | + } | ||
259 | + }, | ||
260 | + { | ||
261 | + "name": "bower-asset/yii2-pjax", | ||
262 | + "version": "v2.0.4", | ||
263 | + "source": { | ||
264 | + "type": "git", | ||
265 | + "url": "https://github.com/yiisoft/jquery-pjax.git", | ||
266 | + "reference": "3f20897307cca046fca5323b318475ae9dac0ca0" | ||
267 | + }, | ||
268 | + "dist": { | ||
269 | + "type": "zip", | ||
270 | + "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/3f20897307cca046fca5323b318475ae9dac0ca0", | ||
271 | + "reference": "3f20897307cca046fca5323b318475ae9dac0ca0", | ||
272 | + "shasum": "" | ||
273 | + }, | ||
274 | + "require": { | ||
275 | + "bower-asset/jquery": ">=1.8" | ||
276 | + }, | ||
277 | + "type": "bower-asset-library", | ||
278 | + "extra": { | ||
279 | + "bower-asset-main": "./jquery.pjax.js", | ||
280 | + "bower-asset-ignore": [ | ||
281 | + ".travis.yml", | ||
282 | + "Gemfile", | ||
283 | + "Gemfile.lock", | ||
284 | + "vendor/", | ||
285 | + "script/", | ||
286 | + "test/" | ||
287 | + ] | ||
288 | + }, | ||
289 | + "license": [ | ||
290 | + "MIT" | ||
291 | + ] | ||
292 | + }, | ||
293 | + { | ||
294 | + "name": "cebe/markdown", | ||
295 | + "version": "1.1.0", | ||
296 | + "source": { | ||
297 | + "type": "git", | ||
298 | + "url": "https://github.com/cebe/markdown.git", | ||
299 | + "reference": "54a2c49de31cc44e864ebf0500a35ef21d0010b2" | ||
300 | + }, | ||
301 | + "dist": { | ||
302 | + "type": "zip", | ||
303 | + "url": "https://api.github.com/repos/cebe/markdown/zipball/54a2c49de31cc44e864ebf0500a35ef21d0010b2", | ||
304 | + "reference": "54a2c49de31cc44e864ebf0500a35ef21d0010b2", | ||
305 | + "shasum": "" | ||
306 | + }, | ||
307 | + "require": { | ||
308 | + "lib-pcre": "*", | ||
309 | + "php": ">=5.4.0" | ||
310 | + }, | ||
311 | + "require-dev": { | ||
312 | + "cebe/indent": "*", | ||
313 | + "facebook/xhprof": "*@dev", | ||
314 | + "phpunit/phpunit": "4.1.*" | ||
315 | + }, | ||
316 | + "bin": [ | ||
317 | + "bin/markdown" | ||
318 | + ], | ||
319 | + "type": "library", | ||
320 | + "extra": { | ||
321 | + "branch-alias": { | ||
322 | + "dev-master": "1.1.x-dev" | ||
323 | + } | ||
324 | + }, | ||
325 | + "autoload": { | ||
326 | + "psr-4": { | ||
327 | + "cebe\\markdown\\": "" | ||
328 | + } | ||
329 | + }, | ||
330 | + "notification-url": "https://packagist.org/downloads/", | ||
331 | + "license": [ | ||
332 | + "MIT" | ||
333 | + ], | ||
334 | + "authors": [ | ||
335 | + { | ||
336 | + "name": "Carsten Brandt", | ||
337 | + "email": "mail@cebe.cc", | ||
338 | + "homepage": "http://cebe.cc/", | ||
339 | + "role": "Creator" | ||
340 | + } | ||
341 | + ], | ||
342 | + "description": "A super fast, highly extensible markdown parser for PHP", | ||
343 | + "homepage": "https://github.com/cebe/markdown#readme", | ||
344 | + "keywords": [ | ||
345 | + "extensible", | ||
346 | + "fast", | ||
347 | + "gfm", | ||
348 | + "markdown", | ||
349 | + "markdown-extra" | ||
350 | + ], | ||
351 | + "time": "2015-03-06 05:28:07" | ||
352 | + }, | ||
353 | + { | ||
354 | + "name": "cebe/yii2-gravatar", | ||
355 | + "version": "1.1", | ||
356 | + "target-dir": "cebe/gravatar", | ||
357 | + "source": { | ||
358 | + "type": "git", | ||
359 | + "url": "https://github.com/cebe/yii2-gravatar.git", | ||
360 | + "reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057" | ||
361 | + }, | ||
362 | + "dist": { | ||
363 | + "type": "zip", | ||
364 | + "url": "https://api.github.com/repos/cebe/yii2-gravatar/zipball/c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057", | ||
365 | + "reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057", | ||
366 | + "shasum": "" | ||
367 | + }, | ||
368 | + "require": { | ||
369 | + "yiisoft/yii2": "*" | ||
370 | + }, | ||
371 | + "type": "yii2-extension", | ||
372 | + "autoload": { | ||
373 | + "psr-0": { | ||
374 | + "cebe\\gravatar\\": "" | ||
375 | + } | ||
376 | + }, | ||
377 | + "notification-url": "https://packagist.org/downloads/", | ||
378 | + "license": [ | ||
379 | + "MIT" | ||
380 | + ], | ||
381 | + "authors": [ | ||
382 | + { | ||
383 | + "name": "Carsten Brandt", | ||
384 | + "email": "mail@cebe.cc", | ||
385 | + "homepage": "http://cebe.cc/", | ||
386 | + "role": "Core framework development" | ||
387 | + } | ||
388 | + ], | ||
389 | + "description": "Gravatar Widget for Yii 2", | ||
390 | + "keywords": [ | ||
391 | + "gravatar", | ||
392 | + "yii" | ||
393 | + ], | ||
394 | + "time": "2013-12-10 17:49:58" | ||
395 | + }, | ||
396 | + { | ||
397 | + "name": "dmstr/yii2-adminlte-asset", | ||
398 | + "version": "2.2.3", | ||
399 | + "source": { | ||
400 | + "type": "git", | ||
401 | + "url": "https://github.com/dmstr/yii2-adminlte-asset.git", | ||
402 | + "reference": "45cffbfe90d79f3c405b4cc98f7f318ae372bb10" | ||
403 | + }, | ||
404 | + "dist": { | ||
405 | + "type": "zip", | ||
406 | + "url": "https://api.github.com/repos/dmstr/yii2-adminlte-asset/zipball/45cffbfe90d79f3c405b4cc98f7f318ae372bb10", | ||
407 | + "reference": "45cffbfe90d79f3c405b4cc98f7f318ae372bb10", | ||
408 | + "shasum": "" | ||
409 | + }, | ||
410 | + "require": { | ||
411 | + "almasaeed2010/adminlte": "~2.0", | ||
412 | + "cebe/yii2-gravatar": "1.*", | ||
413 | + "rmrevin/yii2-fontawesome": "~2.9", | ||
414 | + "yiisoft/yii2": "2.*", | ||
415 | + "yiisoft/yii2-bootstrap": "2.*" | ||
416 | + }, | ||
417 | + "type": "yii2-extension", | ||
418 | + "extra": { | ||
419 | + "branch-alias": { | ||
420 | + "dev-master": "2.0.x-dev" | ||
421 | + } | ||
422 | + }, | ||
423 | + "autoload": { | ||
424 | + "psr-4": { | ||
425 | + "dmstr\\": "" | ||
426 | + } | ||
427 | + }, | ||
428 | + "notification-url": "https://packagist.org/downloads/", | ||
429 | + "license": [ | ||
430 | + "BSD-3-Clause" | ||
431 | + ], | ||
432 | + "authors": [ | ||
433 | + { | ||
434 | + "name": "Tobias Munk", | ||
435 | + "email": "tobias@diemeisterei.de" | ||
436 | + }, | ||
437 | + { | ||
438 | + "name": "Evgeniy Tkachenko", | ||
439 | + "email": "et.coder@gmail.com" | ||
440 | + } | ||
441 | + ], | ||
442 | + "description": "Backend theme for Yii2 Framework", | ||
443 | + "keywords": [ | ||
444 | + "AdminLTE", | ||
445 | + "extension", | ||
446 | + "yii2" | ||
447 | + ], | ||
448 | + "time": "2015-10-07 21:31:26" | ||
449 | + }, | ||
450 | + { | ||
451 | + "name": "ezyang/htmlpurifier", | ||
452 | + "version": "v4.6.0", | ||
453 | + "source": { | ||
454 | + "type": "git", | ||
455 | + "url": "https://github.com/ezyang/htmlpurifier.git", | ||
456 | + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd" | ||
457 | + }, | ||
458 | + "dist": { | ||
459 | + "type": "zip", | ||
460 | + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd", | ||
461 | + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd", | ||
462 | + "shasum": "" | ||
463 | + }, | ||
464 | + "require": { | ||
465 | + "php": ">=5.2" | ||
466 | + }, | ||
467 | + "type": "library", | ||
468 | + "autoload": { | ||
469 | + "psr-0": { | ||
470 | + "HTMLPurifier": "library/" | ||
471 | + }, | ||
472 | + "files": [ | ||
473 | + "library/HTMLPurifier.composer.php" | ||
474 | + ] | ||
475 | + }, | ||
476 | + "notification-url": "https://packagist.org/downloads/", | ||
477 | + "license": [ | ||
478 | + "LGPL" | ||
479 | + ], | ||
480 | + "authors": [ | ||
481 | + { | ||
482 | + "name": "Edward Z. Yang", | ||
483 | + "email": "admin@htmlpurifier.org", | ||
484 | + "homepage": "http://ezyang.com" | ||
485 | + } | ||
486 | + ], | ||
487 | + "description": "Standards compliant HTML filter written in PHP", | ||
488 | + "homepage": "http://htmlpurifier.org/", | ||
489 | + "keywords": [ | ||
490 | + "html" | ||
491 | + ], | ||
492 | + "time": "2013-11-30 08:25:19" | ||
493 | + }, | ||
494 | + { | ||
495 | + "name": "pavlinter/yii2-multifields", | ||
496 | + "version": "v1.0.2", | ||
497 | + "source": { | ||
498 | + "type": "git", | ||
499 | + "url": "https://github.com/pavlinter/yii2-multifields.git", | ||
500 | + "reference": "160f6928c702ace93f7c6873a69e00071cfcdaea" | ||
501 | + }, | ||
502 | + "dist": { | ||
503 | + "type": "zip", | ||
504 | + "url": "https://api.github.com/repos/pavlinter/yii2-multifields/zipball/160f6928c702ace93f7c6873a69e00071cfcdaea", | ||
505 | + "reference": "160f6928c702ace93f7c6873a69e00071cfcdaea", | ||
506 | + "shasum": "" | ||
507 | + }, | ||
508 | + "require": { | ||
509 | + "yiisoft/yii2": "*" | ||
510 | + }, | ||
511 | + "type": "yii2-extension", | ||
512 | + "autoload": { | ||
513 | + "psr-4": { | ||
514 | + "pavlinter\\": "" | ||
515 | + } | ||
516 | + }, | ||
517 | + "notification-url": "https://packagist.org/downloads/", | ||
518 | + "license": [ | ||
519 | + "BSD 3-Clause" | ||
520 | + ], | ||
521 | + "authors": [ | ||
522 | + { | ||
523 | + "name": "Pavels Radajevs", | ||
524 | + "email": "pavlinter@gmail.com" | ||
525 | + } | ||
526 | + ], | ||
527 | + "description": "Yii2: Multi dinamic fields", | ||
528 | + "keywords": [ | ||
529 | + "dinamic", | ||
530 | + "multi", | ||
531 | + "multifields", | ||
532 | + "multiinput", | ||
533 | + "yii2" | ||
534 | + ], | ||
535 | + "time": "2015-10-17 05:57:23" | ||
536 | + }, | ||
537 | + { | ||
538 | + "name": "rmrevin/yii2-fontawesome", | ||
539 | + "version": "2.12.0", | ||
540 | + "source": { | ||
541 | + "type": "git", | ||
542 | + "url": "https://github.com/rmrevin/yii2-fontawesome.git", | ||
543 | + "reference": "51d33ec9d1d7edab2166f1d42668c1bc8d28c068" | ||
544 | + }, | ||
545 | + "dist": { | ||
546 | + "type": "zip", | ||
547 | + "url": "https://api.github.com/repos/rmrevin/yii2-fontawesome/zipball/51d33ec9d1d7edab2166f1d42668c1bc8d28c068", | ||
548 | + "reference": "51d33ec9d1d7edab2166f1d42668c1bc8d28c068", | ||
549 | + "shasum": "" | ||
550 | + }, | ||
551 | + "require": { | ||
552 | + "bower-asset/fontawesome": "4.4.*", | ||
553 | + "php": ">=5.4.0", | ||
554 | + "yiisoft/yii2": "2.0.*" | ||
555 | + }, | ||
556 | + "type": "yii2-extension", | ||
557 | + "extra": { | ||
558 | + "asset-installer-paths": { | ||
559 | + "npm-asset-library": "vendor/npm", | ||
560 | + "bower-asset-library": "vendor/bower" | ||
561 | + } | ||
562 | + }, | ||
563 | + "autoload": { | ||
564 | + "psr-4": { | ||
565 | + "rmrevin\\yii\\fontawesome\\": "" | ||
566 | + } | ||
567 | + }, | ||
568 | + "notification-url": "https://packagist.org/downloads/", | ||
569 | + "license": [ | ||
570 | + "MIT" | ||
571 | + ], | ||
572 | + "authors": [ | ||
573 | + { | ||
574 | + "name": "Roman Revin", | ||
575 | + "email": "xgismox@gmail.com", | ||
576 | + "homepage": "http://rmrevin.ru/" | ||
577 | + } | ||
578 | + ], | ||
579 | + "description": "Asset Bundle for Yii2 with Font Awesome", | ||
580 | + "keywords": [ | ||
581 | + "asset", | ||
582 | + "awesome", | ||
583 | + "bundle", | ||
584 | + "font", | ||
585 | + "yii" | ||
586 | + ], | ||
587 | + "time": "2015-08-15 16:50:16" | ||
588 | + }, | ||
589 | + { | ||
590 | + "name": "swiftmailer/swiftmailer", | ||
591 | + "version": "v5.4.1", | ||
592 | + "source": { | ||
593 | + "type": "git", | ||
594 | + "url": "https://github.com/swiftmailer/swiftmailer.git", | ||
595 | + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" | ||
596 | + }, | ||
597 | + "dist": { | ||
598 | + "type": "zip", | ||
599 | + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", | ||
600 | + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", | ||
601 | + "shasum": "" | ||
602 | + }, | ||
603 | + "require": { | ||
604 | + "php": ">=5.3.3" | ||
605 | + }, | ||
606 | + "require-dev": { | ||
607 | + "mockery/mockery": "~0.9.1,<0.9.4" | ||
608 | + }, | ||
609 | + "type": "library", | ||
610 | + "extra": { | ||
611 | + "branch-alias": { | ||
612 | + "dev-master": "5.4-dev" | ||
613 | + } | ||
614 | + }, | ||
615 | + "autoload": { | ||
616 | + "files": [ | ||
617 | + "lib/swift_required.php" | ||
618 | + ] | ||
619 | + }, | ||
620 | + "notification-url": "https://packagist.org/downloads/", | ||
621 | + "license": [ | ||
622 | + "MIT" | ||
623 | + ], | ||
624 | + "authors": [ | ||
625 | + { | ||
626 | + "name": "Chris Corbyn" | ||
627 | + }, | ||
628 | + { | ||
629 | + "name": "Fabien Potencier", | ||
630 | + "email": "fabien@symfony.com" | ||
631 | + } | ||
632 | + ], | ||
633 | + "description": "Swiftmailer, free feature-rich PHP mailer", | ||
634 | + "homepage": "http://swiftmailer.org", | ||
635 | + "keywords": [ | ||
636 | + "email", | ||
637 | + "mail", | ||
638 | + "mailer" | ||
639 | + ], | ||
640 | + "time": "2015-06-06 14:19:39" | ||
641 | + }, | ||
642 | + { | ||
643 | + "name": "yiisoft/yii2", | ||
644 | + "version": "2.0.6", | ||
645 | + "source": { | ||
646 | + "type": "git", | ||
647 | + "url": "https://github.com/yiisoft/yii2-framework.git", | ||
648 | + "reference": "f42b2eb80f61992438661b01d0d74c6738e2ff38" | ||
649 | + }, | ||
650 | + "dist": { | ||
651 | + "type": "zip", | ||
652 | + "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/f42b2eb80f61992438661b01d0d74c6738e2ff38", | ||
653 | + "reference": "f42b2eb80f61992438661b01d0d74c6738e2ff38", | ||
654 | + "shasum": "" | ||
655 | + }, | ||
656 | + "require": { | ||
657 | + "bower-asset/jquery": "2.1.*@stable | 1.11.*@stable", | ||
658 | + "bower-asset/jquery.inputmask": "3.1.*", | ||
659 | + "bower-asset/punycode": "1.3.*", | ||
660 | + "bower-asset/yii2-pjax": ">=2.0.1", | ||
661 | + "cebe/markdown": "~1.0.0 | ~1.1.0", | ||
662 | + "ext-mbstring": "*", | ||
663 | + "ezyang/htmlpurifier": "4.6.*", | ||
664 | + "lib-pcre": "*", | ||
665 | + "php": ">=5.4.0", | ||
666 | + "yiisoft/yii2-composer": "*" | ||
667 | + }, | ||
668 | + "bin": [ | ||
669 | + "yii" | ||
670 | + ], | ||
671 | + "type": "library", | ||
672 | + "extra": { | ||
673 | + "branch-alias": { | ||
674 | + "dev-master": "2.0.x-dev" | ||
675 | + } | ||
676 | + }, | ||
677 | + "autoload": { | ||
678 | + "psr-4": { | ||
679 | + "yii\\": "" | ||
680 | + } | ||
681 | + }, | ||
682 | + "notification-url": "https://packagist.org/downloads/", | ||
683 | + "license": [ | ||
684 | + "BSD-3-Clause" | ||
685 | + ], | ||
686 | + "authors": [ | ||
687 | + { | ||
688 | + "name": "Qiang Xue", | ||
689 | + "email": "qiang.xue@gmail.com", | ||
690 | + "homepage": "http://www.yiiframework.com/", | ||
691 | + "role": "Founder and project lead" | ||
692 | + }, | ||
693 | + { | ||
694 | + "name": "Alexander Makarov", | ||
695 | + "email": "sam@rmcreative.ru", | ||
696 | + "homepage": "http://rmcreative.ru/", | ||
697 | + "role": "Core framework development" | ||
698 | + }, | ||
699 | + { | ||
700 | + "name": "Maurizio Domba", | ||
701 | + "homepage": "http://mdomba.info/", | ||
702 | + "role": "Core framework development" | ||
703 | + }, | ||
704 | + { | ||
705 | + "name": "Carsten Brandt", | ||
706 | + "email": "mail@cebe.cc", | ||
707 | + "homepage": "http://cebe.cc/", | ||
708 | + "role": "Core framework development" | ||
709 | + }, | ||
710 | + { | ||
711 | + "name": "Timur Ruziev", | ||
712 | + "email": "resurtm@gmail.com", | ||
713 | + "homepage": "http://resurtm.com/", | ||
714 | + "role": "Core framework development" | ||
715 | + }, | ||
716 | + { | ||
717 | + "name": "Paul Klimov", | ||
718 | + "email": "klimov.paul@gmail.com", | ||
719 | + "role": "Core framework development" | ||
720 | + } | ||
721 | + ], | ||
722 | + "description": "Yii PHP Framework Version 2", | ||
723 | + "homepage": "http://www.yiiframework.com/", | ||
724 | + "keywords": [ | ||
725 | + "framework", | ||
726 | + "yii2" | ||
727 | + ], | ||
728 | + "time": "2015-08-05 22:00:30" | ||
729 | + }, | ||
730 | + { | ||
731 | + "name": "yiisoft/yii2-bootstrap", | ||
732 | + "version": "2.0.4", | ||
733 | + "source": { | ||
734 | + "type": "git", | ||
735 | + "url": "https://github.com/yiisoft/yii2-bootstrap.git", | ||
736 | + "reference": "1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0" | ||
737 | + }, | ||
738 | + "dist": { | ||
739 | + "type": "zip", | ||
740 | + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0", | ||
741 | + "reference": "1b6b1e61cf91c3cdd517d6a7e71d30bb212e4af0", | ||
742 | + "shasum": "" | ||
743 | + }, | ||
744 | + "require": { | ||
745 | + "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", | ||
746 | + "yiisoft/yii2": ">=2.0.4" | ||
747 | + }, | ||
748 | + "type": "yii2-extension", | ||
749 | + "extra": { | ||
750 | + "branch-alias": { | ||
751 | + "dev-master": "2.0.x-dev" | ||
752 | + }, | ||
753 | + "asset-installer-paths": { | ||
754 | + "npm-asset-library": "vendor/npm", | ||
755 | + "bower-asset-library": "vendor/bower" | ||
756 | + } | ||
757 | + }, | ||
758 | + "autoload": { | ||
759 | + "psr-4": { | ||
760 | + "yii\\bootstrap\\": "" | ||
761 | + } | ||
762 | + }, | ||
763 | + "notification-url": "https://packagist.org/downloads/", | ||
764 | + "license": [ | ||
765 | + "BSD-3-Clause" | ||
766 | + ], | ||
767 | + "authors": [ | ||
768 | + { | ||
769 | + "name": "Qiang Xue", | ||
770 | + "email": "qiang.xue@gmail.com" | ||
771 | + } | ||
772 | + ], | ||
773 | + "description": "The Twitter Bootstrap extension for the Yii framework", | ||
774 | + "keywords": [ | ||
775 | + "bootstrap", | ||
776 | + "yii2" | ||
777 | + ], | ||
778 | + "time": "2015-05-10 22:08:17" | ||
779 | + }, | ||
780 | + { | ||
781 | + "name": "yiisoft/yii2-composer", | ||
782 | + "version": "2.0.3", | ||
783 | + "source": { | ||
784 | + "type": "git", | ||
785 | + "url": "https://github.com/yiisoft/yii2-composer.git", | ||
786 | + "reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be" | ||
787 | + }, | ||
788 | + "dist": { | ||
789 | + "type": "zip", | ||
790 | + "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/ca8d23707ae47d20b0454e4b135c156f6da6d7be", | ||
791 | + "reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be", | ||
792 | + "shasum": "" | ||
793 | + }, | ||
794 | + "require": { | ||
795 | + "composer-plugin-api": "1.0.0" | ||
796 | + }, | ||
797 | + "type": "composer-plugin", | ||
798 | + "extra": { | ||
799 | + "class": "yii\\composer\\Plugin", | ||
800 | + "branch-alias": { | ||
801 | + "dev-master": "2.0.x-dev" | ||
802 | + } | ||
803 | + }, | ||
804 | + "autoload": { | ||
805 | + "psr-4": { | ||
806 | + "yii\\composer\\": "" | ||
807 | + } | ||
808 | + }, | ||
809 | + "notification-url": "https://packagist.org/downloads/", | ||
810 | + "license": [ | ||
811 | + "BSD-3-Clause" | ||
812 | + ], | ||
813 | + "authors": [ | ||
814 | + { | ||
815 | + "name": "Qiang Xue", | ||
816 | + "email": "qiang.xue@gmail.com" | ||
817 | + } | ||
818 | + ], | ||
819 | + "description": "The composer plugin for Yii extension installer", | ||
820 | + "keywords": [ | ||
821 | + "composer", | ||
822 | + "extension installer", | ||
823 | + "yii2" | ||
824 | + ], | ||
825 | + "time": "2015-03-01 06:22:44" | ||
826 | + }, | ||
827 | + { | ||
828 | + "name": "yiisoft/yii2-swiftmailer", | ||
829 | + "version": "2.0.4", | ||
830 | + "source": { | ||
831 | + "type": "git", | ||
832 | + "url": "https://github.com/yiisoft/yii2-swiftmailer.git", | ||
833 | + "reference": "4ec435a89e30b203cea99770910fb5499cb3627a" | ||
834 | + }, | ||
835 | + "dist": { | ||
836 | + "type": "zip", | ||
837 | + "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/4ec435a89e30b203cea99770910fb5499cb3627a", | ||
838 | + "reference": "4ec435a89e30b203cea99770910fb5499cb3627a", | ||
839 | + "shasum": "" | ||
840 | + }, | ||
841 | + "require": { | ||
842 | + "swiftmailer/swiftmailer": "~5.0", | ||
843 | + "yiisoft/yii2": ">=2.0.4" | ||
844 | + }, | ||
845 | + "type": "yii2-extension", | ||
846 | + "extra": { | ||
847 | + "branch-alias": { | ||
848 | + "dev-master": "2.0.x-dev" | ||
849 | + } | ||
850 | + }, | ||
851 | + "autoload": { | ||
852 | + "psr-4": { | ||
853 | + "yii\\swiftmailer\\": "" | ||
854 | + } | ||
855 | + }, | ||
856 | + "notification-url": "https://packagist.org/downloads/", | ||
857 | + "license": [ | ||
858 | + "BSD-3-Clause" | ||
859 | + ], | ||
860 | + "authors": [ | ||
861 | + { | ||
862 | + "name": "Paul Klimov", | ||
863 | + "email": "klimov.paul@gmail.com" | ||
864 | + } | ||
865 | + ], | ||
866 | + "description": "The SwiftMailer integration for the Yii framework", | ||
867 | + "keywords": [ | ||
868 | + "email", | ||
869 | + "mail", | ||
870 | + "mailer", | ||
871 | + "swift", | ||
872 | + "swiftmailer", | ||
873 | + "yii2" | ||
874 | + ], | ||
875 | + "time": "2015-05-10 22:12:32" | ||
876 | + } | ||
877 | + ], | ||
878 | + "packages-dev": [ | ||
879 | + { | ||
880 | + "name": "bower-asset/typeahead.js", | ||
881 | + "version": "v0.10.5", | ||
882 | + "source": { | ||
883 | + "type": "git", | ||
884 | + "url": "https://github.com/twitter/typeahead.js.git", | ||
885 | + "reference": "5f198b87d1af845da502ea9df93a5e84801ce742" | ||
886 | + }, | ||
887 | + "dist": { | ||
888 | + "type": "zip", | ||
889 | + "url": "https://api.github.com/repos/twitter/typeahead.js/zipball/5f198b87d1af845da502ea9df93a5e84801ce742", | ||
890 | + "reference": "5f198b87d1af845da502ea9df93a5e84801ce742", | ||
891 | + "shasum": "" | ||
892 | + }, | ||
893 | + "require": { | ||
894 | + "bower-asset/jquery": ">=1.7" | ||
895 | + }, | ||
896 | + "require-dev": { | ||
897 | + "bower-asset/jasmine-ajax": "~1.3.1", | ||
898 | + "bower-asset/jasmine-jquery": "~1.5.2", | ||
899 | + "bower-asset/jquery": "~1.7" | ||
900 | + }, | ||
901 | + "type": "bower-asset-library", | ||
902 | + "extra": { | ||
903 | + "bower-asset-main": "dist/typeahead.bundle.js" | ||
904 | + } | ||
905 | + }, | ||
906 | + { | ||
907 | + "name": "fzaninotto/faker", | ||
908 | + "version": "v1.5.0", | ||
909 | + "source": { | ||
910 | + "type": "git", | ||
911 | + "url": "https://github.com/fzaninotto/Faker.git", | ||
912 | + "reference": "d0190b156bcca848d401fb80f31f504f37141c8d" | ||
913 | + }, | ||
914 | + "dist": { | ||
915 | + "type": "zip", | ||
916 | + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d0190b156bcca848d401fb80f31f504f37141c8d", | ||
917 | + "reference": "d0190b156bcca848d401fb80f31f504f37141c8d", | ||
918 | + "shasum": "" | ||
919 | + }, | ||
920 | + "require": { | ||
921 | + "php": ">=5.3.3" | ||
922 | + }, | ||
923 | + "require-dev": { | ||
924 | + "phpunit/phpunit": "~4.0", | ||
925 | + "squizlabs/php_codesniffer": "~1.5" | ||
926 | + }, | ||
927 | + "suggest": { | ||
928 | + "ext-intl": "*" | ||
929 | + }, | ||
930 | + "type": "library", | ||
931 | + "extra": { | ||
932 | + "branch-alias": { | ||
933 | + "dev-master": "1.5.x-dev" | ||
934 | + } | ||
935 | + }, | ||
936 | + "autoload": { | ||
937 | + "psr-4": { | ||
938 | + "Faker\\": "src/Faker/" | ||
939 | + } | ||
940 | + }, | ||
941 | + "notification-url": "https://packagist.org/downloads/", | ||
942 | + "license": [ | ||
943 | + "MIT" | ||
944 | + ], | ||
945 | + "authors": [ | ||
946 | + { | ||
947 | + "name": "François Zaninotto" | ||
948 | + } | ||
949 | + ], | ||
950 | + "description": "Faker is a PHP library that generates fake data for you.", | ||
951 | + "keywords": [ | ||
952 | + "data", | ||
953 | + "faker", | ||
954 | + "fixtures" | ||
955 | + ], | ||
956 | + "time": "2015-05-29 06:29:14" | ||
957 | + }, | ||
958 | + { | ||
959 | + "name": "phpspec/php-diff", | ||
960 | + "version": "v1.0.2", | ||
961 | + "source": { | ||
962 | + "type": "git", | ||
963 | + "url": "https://github.com/phpspec/php-diff.git", | ||
964 | + "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" | ||
965 | + }, | ||
966 | + "dist": { | ||
967 | + "type": "zip", | ||
968 | + "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", | ||
969 | + "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", | ||
970 | + "shasum": "" | ||
971 | + }, | ||
972 | + "type": "library", | ||
973 | + "autoload": { | ||
974 | + "psr-0": { | ||
975 | + "Diff": "lib/" | ||
976 | + } | ||
977 | + }, | ||
978 | + "notification-url": "https://packagist.org/downloads/", | ||
979 | + "license": [ | ||
980 | + "BSD-3-Clause" | ||
981 | + ], | ||
982 | + "authors": [ | ||
983 | + { | ||
984 | + "name": "Chris Boulton", | ||
985 | + "homepage": "http://github.com/chrisboulton", | ||
986 | + "role": "Original developer" | ||
987 | + } | ||
988 | + ], | ||
989 | + "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", | ||
990 | + "time": "2013-11-01 13:02:21" | ||
991 | + }, | ||
992 | + { | ||
993 | + "name": "yiisoft/yii2-codeception", | ||
994 | + "version": "2.0.4", | ||
995 | + "source": { | ||
996 | + "type": "git", | ||
997 | + "url": "https://github.com/yiisoft/yii2-codeception.git", | ||
998 | + "reference": "de5007e7a99359597abbfe1c88dca3ce620061c5" | ||
999 | + }, | ||
1000 | + "dist": { | ||
1001 | + "type": "zip", | ||
1002 | + "url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/de5007e7a99359597abbfe1c88dca3ce620061c5", | ||
1003 | + "reference": "de5007e7a99359597abbfe1c88dca3ce620061c5", | ||
1004 | + "shasum": "" | ||
1005 | + }, | ||
1006 | + "require": { | ||
1007 | + "yiisoft/yii2": ">=2.0.4" | ||
1008 | + }, | ||
1009 | + "type": "yii2-extension", | ||
1010 | + "extra": { | ||
1011 | + "branch-alias": { | ||
1012 | + "dev-master": "2.0.x-dev" | ||
1013 | + } | ||
1014 | + }, | ||
1015 | + "autoload": { | ||
1016 | + "psr-4": { | ||
1017 | + "yii\\codeception\\": "" | ||
1018 | + } | ||
1019 | + }, | ||
1020 | + "notification-url": "https://packagist.org/downloads/", | ||
1021 | + "license": [ | ||
1022 | + "BSD-3-Clause" | ||
1023 | + ], | ||
1024 | + "authors": [ | ||
1025 | + { | ||
1026 | + "name": "Mark Jebri", | ||
1027 | + "email": "mark.github@yandex.ru" | ||
1028 | + } | ||
1029 | + ], | ||
1030 | + "description": "The Codeception integration for the Yii framework", | ||
1031 | + "keywords": [ | ||
1032 | + "codeception", | ||
1033 | + "yii2" | ||
1034 | + ], | ||
1035 | + "time": "2015-05-10 22:08:30" | ||
1036 | + }, | ||
1037 | + { | ||
1038 | + "name": "yiisoft/yii2-debug", | ||
1039 | + "version": "2.0.4", | ||
1040 | + "source": { | ||
1041 | + "type": "git", | ||
1042 | + "url": "https://github.com/yiisoft/yii2-debug.git", | ||
1043 | + "reference": "5c7081b2be71c61d3a50d978b31edc3e0b6f2f97" | ||
1044 | + }, | ||
1045 | + "dist": { | ||
1046 | + "type": "zip", | ||
1047 | + "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/5c7081b2be71c61d3a50d978b31edc3e0b6f2f97", | ||
1048 | + "reference": "5c7081b2be71c61d3a50d978b31edc3e0b6f2f97", | ||
1049 | + "shasum": "" | ||
1050 | + }, | ||
1051 | + "require": { | ||
1052 | + "yiisoft/yii2": ">=2.0.4", | ||
1053 | + "yiisoft/yii2-bootstrap": "*" | ||
1054 | + }, | ||
1055 | + "type": "yii2-extension", | ||
1056 | + "extra": { | ||
1057 | + "branch-alias": { | ||
1058 | + "dev-master": "2.0.x-dev" | ||
1059 | + } | ||
1060 | + }, | ||
1061 | + "autoload": { | ||
1062 | + "psr-4": { | ||
1063 | + "yii\\debug\\": "" | ||
1064 | + } | ||
1065 | + }, | ||
1066 | + "notification-url": "https://packagist.org/downloads/", | ||
1067 | + "license": [ | ||
1068 | + "BSD-3-Clause" | ||
1069 | + ], | ||
1070 | + "authors": [ | ||
1071 | + { | ||
1072 | + "name": "Qiang Xue", | ||
1073 | + "email": "qiang.xue@gmail.com" | ||
1074 | + } | ||
1075 | + ], | ||
1076 | + "description": "The debugger extension for the Yii framework", | ||
1077 | + "keywords": [ | ||
1078 | + "debug", | ||
1079 | + "debugger", | ||
1080 | + "yii2" | ||
1081 | + ], | ||
1082 | + "time": "2015-05-10 22:08:56" | ||
1083 | + }, | ||
1084 | + { | ||
1085 | + "name": "yiisoft/yii2-faker", | ||
1086 | + "version": "2.0.3", | ||
1087 | + "source": { | ||
1088 | + "type": "git", | ||
1089 | + "url": "https://github.com/yiisoft/yii2-faker.git", | ||
1090 | + "reference": "b88ca69ee226a3610b2c26c026c3203d7ac50f6c" | ||
1091 | + }, | ||
1092 | + "dist": { | ||
1093 | + "type": "zip", | ||
1094 | + "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/b88ca69ee226a3610b2c26c026c3203d7ac50f6c", | ||
1095 | + "reference": "b88ca69ee226a3610b2c26c026c3203d7ac50f6c", | ||
1096 | + "shasum": "" | ||
1097 | + }, | ||
1098 | + "require": { | ||
1099 | + "fzaninotto/faker": "*", | ||
1100 | + "yiisoft/yii2": "*" | ||
1101 | + }, | ||
1102 | + "type": "yii2-extension", | ||
1103 | + "extra": { | ||
1104 | + "branch-alias": { | ||
1105 | + "dev-master": "2.0.x-dev" | ||
1106 | + } | ||
1107 | + }, | ||
1108 | + "autoload": { | ||
1109 | + "psr-4": { | ||
1110 | + "yii\\faker\\": "" | ||
1111 | + } | ||
1112 | + }, | ||
1113 | + "notification-url": "https://packagist.org/downloads/", | ||
1114 | + "license": [ | ||
1115 | + "BSD-3-Clause" | ||
1116 | + ], | ||
1117 | + "authors": [ | ||
1118 | + { | ||
1119 | + "name": "Mark Jebri", | ||
1120 | + "email": "mark.github@yandex.ru" | ||
1121 | + } | ||
1122 | + ], | ||
1123 | + "description": "Fixture generator. The Faker integration for the Yii framework.", | ||
1124 | + "keywords": [ | ||
1125 | + "Fixture", | ||
1126 | + "faker", | ||
1127 | + "yii2" | ||
1128 | + ], | ||
1129 | + "time": "2015-03-01 06:22:44" | ||
1130 | + }, | ||
1131 | + { | ||
1132 | + "name": "yiisoft/yii2-gii", | ||
1133 | + "version": "2.0.4", | ||
1134 | + "source": { | ||
1135 | + "type": "git", | ||
1136 | + "url": "https://github.com/yiisoft/yii2-gii.git", | ||
1137 | + "reference": "e5a023e8779bd774194842ec1b8fb4917cf04007" | ||
1138 | + }, | ||
1139 | + "dist": { | ||
1140 | + "type": "zip", | ||
1141 | + "url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/e5a023e8779bd774194842ec1b8fb4917cf04007", | ||
1142 | + "reference": "e5a023e8779bd774194842ec1b8fb4917cf04007", | ||
1143 | + "shasum": "" | ||
1144 | + }, | ||
1145 | + "require": { | ||
1146 | + "bower-asset/typeahead.js": "0.10.*", | ||
1147 | + "phpspec/php-diff": ">=1.0.2", | ||
1148 | + "yiisoft/yii2": ">=2.0.4", | ||
1149 | + "yiisoft/yii2-bootstrap": "~2.0" | ||
1150 | + }, | ||
1151 | + "type": "yii2-extension", | ||
1152 | + "extra": { | ||
1153 | + "branch-alias": { | ||
1154 | + "dev-master": "2.0.x-dev" | ||
1155 | + }, | ||
1156 | + "asset-installer-paths": { | ||
1157 | + "npm-asset-library": "vendor/npm", | ||
1158 | + "bower-asset-library": "vendor/bower" | ||
1159 | + } | ||
1160 | + }, | ||
1161 | + "autoload": { | ||
1162 | + "psr-4": { | ||
1163 | + "yii\\gii\\": "" | ||
1164 | + } | ||
1165 | + }, | ||
1166 | + "notification-url": "https://packagist.org/downloads/", | ||
1167 | + "license": [ | ||
1168 | + "BSD-3-Clause" | ||
1169 | + ], | ||
1170 | + "authors": [ | ||
1171 | + { | ||
1172 | + "name": "Qiang Xue", | ||
1173 | + "email": "qiang.xue@gmail.com" | ||
1174 | + } | ||
1175 | + ], | ||
1176 | + "description": "The Gii extension for the Yii framework", | ||
1177 | + "keywords": [ | ||
1178 | + "code generator", | ||
1179 | + "gii", | ||
1180 | + "yii2" | ||
1181 | + ], | ||
1182 | + "time": "2015-05-10 22:09:31" | ||
1183 | + } | ||
1184 | + ], | ||
1185 | + "aliases": [], | ||
1186 | + "minimum-stability": "stable", | ||
1187 | + "stability-flags": [], | ||
1188 | + "prefer-stable": false, | ||
1189 | + "prefer-lowest": false, | ||
1190 | + "platform": { | ||
1191 | + "php": ">=5.4.0" | ||
1192 | + }, | ||
1193 | + "platform-dev": [] | ||
1194 | +} |
1 | +++ a/console/config/main.php | ||
1 | +<?php | ||
2 | +$params = array_merge( | ||
3 | + require(__DIR__ . '/../../common/config/params.php'), | ||
4 | + require(__DIR__ . '/../../common/config/params-local.php'), | ||
5 | + require(__DIR__ . '/params.php'), | ||
6 | + require(__DIR__ . '/params-local.php') | ||
7 | +); | ||
8 | + | ||
9 | +return [ | ||
10 | + 'id' => 'app-console', | ||
11 | + 'basePath' => dirname(__DIR__), | ||
12 | + 'bootstrap' => ['log'], | ||
13 | + 'controllerNamespace' => 'console\controllers', | ||
14 | + 'components' => [ | ||
15 | + 'log' => [ | ||
16 | + 'targets' => [ | ||
17 | + [ | ||
18 | + 'class' => 'yii\log\FileTarget', | ||
19 | + 'levels' => ['error', 'warning'], | ||
20 | + ], | ||
21 | + ], | ||
22 | + ], | ||
23 | + ], | ||
24 | + 'params' => $params, | ||
25 | +]; |
1 | +++ a/console/controllers/.gitkeep |
1 | +++ a/console/migrations/m130524_201442_init.php | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\db\Schema; | ||
4 | +use yii\db\Migration; | ||
5 | + | ||
6 | +class m130524_201442_init extends Migration | ||
7 | +{ | ||
8 | + public function up() | ||
9 | + { | ||
10 | + $tableOptions = null; | ||
11 | + if ($this->db->driverName === 'mysql') { | ||
12 | + // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci | ||
13 | + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; | ||
14 | + } | ||
15 | + | ||
16 | + $this->createTable('{{%user}}', [ | ||
17 | + 'id' => $this->primaryKey(), | ||
18 | + 'username' => $this->string()->notNull()->unique(), | ||
19 | + 'auth_key' => $this->string(32)->notNull(), | ||
20 | + 'password_hash' => $this->string()->notNull(), | ||
21 | + 'password_reset_token' => $this->string()->unique(), | ||
22 | + 'email' => $this->string()->notNull()->unique(), | ||
23 | + | ||
24 | + 'status' => $this->smallInteger()->notNull()->defaultValue(10), | ||
25 | + 'created_at' => $this->integer()->notNull(), | ||
26 | + 'updated_at' => $this->integer()->notNull(), | ||
27 | + ], $tableOptions); | ||
28 | + } | ||
29 | + | ||
30 | + public function down() | ||
31 | + { | ||
32 | + $this->dropTable('{{%user}}'); | ||
33 | + } | ||
34 | +} |
1 | +++ a/environments/dev/backend/config/main-local.php | ||
1 | +<?php | ||
2 | + | ||
3 | +$config = [ | ||
4 | + 'components' => [ | ||
5 | + 'request' => [ | ||
6 | + // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation | ||
7 | + 'cookieValidationKey' => '', | ||
8 | + ], | ||
9 | + ], | ||
10 | +]; | ||
11 | + | ||
12 | +if (!YII_ENV_TEST) { | ||
13 | + // configuration adjustments for 'dev' environment | ||
14 | + $config['bootstrap'][] = 'debug'; | ||
15 | + $config['modules']['debug'] = [ | ||
16 | + 'class' => 'yii\debug\Module', | ||
17 | + ]; | ||
18 | + | ||
19 | + $config['bootstrap'][] = 'gii'; | ||
20 | + $config['modules']['gii'] = [ | ||
21 | + 'class' => 'yii\gii\Module', | ||
22 | + ]; | ||
23 | +} | ||
24 | + | ||
25 | +return $config; |
1 | +++ a/environments/dev/backend/web/index-test.php | ||
1 | +<?php | ||
2 | + | ||
3 | +// NOTE: Make sure this file is not accessible when deployed to production | ||
4 | +if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) { | ||
5 | + die('You are not allowed to access this file.'); | ||
6 | +} | ||
7 | + | ||
8 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
9 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
10 | + | ||
11 | +require(__DIR__ . '/../../vendor/autoload.php'); | ||
12 | +require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); | ||
13 | +require(__DIR__ . '/../../common/config/bootstrap.php'); | ||
14 | +require(__DIR__ . '/../config/bootstrap.php'); | ||
15 | + | ||
16 | + | ||
17 | +$config = require(__DIR__ . '/../../tests/codeception/config/backend/acceptance.php'); | ||
18 | + | ||
19 | +(new yii\web\Application($config))->run(); |
1 | +++ a/environments/dev/backend/web/index.php | ||
1 | +<?php | ||
2 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
3 | +defined('YII_ENV') or define('YII_ENV', 'dev'); | ||
4 | + | ||
5 | +require(__DIR__ . '/../../vendor/autoload.php'); | ||
6 | +require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); | ||
7 | +require(__DIR__ . '/../../common/config/bootstrap.php'); | ||
8 | +require(__DIR__ . '/../config/bootstrap.php'); | ||
9 | + | ||
10 | +$config = yii\helpers\ArrayHelper::merge( | ||
11 | + require(__DIR__ . '/../../common/config/main.php'), | ||
12 | + require(__DIR__ . '/../../common/config/main-local.php'), | ||
13 | + require(__DIR__ . '/../config/main.php'), | ||
14 | + require(__DIR__ . '/../config/main-local.php') | ||
15 | +); | ||
16 | + | ||
17 | +$application = new yii\web\Application($config); | ||
18 | +$application->run(); |
1 | +++ a/environments/dev/common/config/main-local.php | ||
1 | +<?php | ||
2 | +return [ | ||
3 | + 'components' => [ | ||
4 | + 'db' => [ | ||
5 | + 'class' => 'yii\db\Connection', | ||
6 | + 'dsn' => 'mysql:host=localhost;dbname=yii2advanced', | ||
7 | + 'username' => 'root', | ||
8 | + 'password' => '', | ||
9 | + 'charset' => 'utf8', | ||
10 | + ], | ||
11 | + 'mailer' => [ | ||
12 | + 'class' => 'yii\swiftmailer\Mailer', | ||
13 | + 'viewPath' => '@common/mail', | ||
14 | + // send all mails to a file by default. You have to set | ||
15 | + // 'useFileTransport' to false and configure a transport | ||
16 | + // for the mailer to send real emails. | ||
17 | + 'useFileTransport' => true, | ||
18 | + ], | ||
19 | + ], | ||
20 | +]; |
1 | +++ a/environments/dev/frontend/config/main-local.php | ||
1 | +<?php | ||
2 | + | ||
3 | +$config = [ | ||
4 | + 'components' => [ | ||
5 | + 'request' => [ | ||
6 | + // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation | ||
7 | + 'cookieValidationKey' => '', | ||
8 | + ], | ||
9 | + ], | ||
10 | +]; | ||
11 | + | ||
12 | +if (!YII_ENV_TEST) { | ||
13 | + // configuration adjustments for 'dev' environment | ||
14 | + $config['bootstrap'][] = 'debug'; | ||
15 | + $config['modules']['debug'] = 'yii\debug\Module'; | ||
16 | + | ||
17 | + $config['bootstrap'][] = 'gii'; | ||
18 | + $config['modules']['gii'] = 'yii\gii\Module'; | ||
19 | +} | ||
20 | + | ||
21 | +return $config; |
1 | +++ a/environments/dev/frontend/web/index-test.php | ||
1 | +<?php | ||
2 | + | ||
3 | +// NOTE: Make sure this file is not accessible when deployed to production | ||
4 | +if (!in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])) { | ||
5 | + die('You are not allowed to access this file.'); | ||
6 | +} | ||
7 | + | ||
8 | +defined('YII_DEBUG') or define('YII_DEBUG', true); | ||
9 | +defined('YII_ENV') or define('YII_ENV', 'test'); | ||
10 | + | ||
11 | +require(__DIR__ . '/../../vendor/autoload.php'); | ||
12 | +require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); | ||
13 | +require(__DIR__ . '/../../common/config/bootstrap.php'); | ||
14 | +require(__DIR__ . '/../config/bootstrap.php'); | ||
15 | + | ||
16 | +$config = require(__DIR__ . '/../../tests/codeception/config/frontend/acceptance.php'); | ||
17 | + | ||
18 | +(new yii\web\Application($config))->run(); |