1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Cjt Terabyte LLC [yii2-extension]. |
5
|
|
|
* |
6
|
|
|
* (c) Cjt Terabyte LLC [yii2-extension] <http://github.com/cjtterabytesoft>. |
7
|
|
|
* For the full copyright and license information, please view the LICENSE.md. |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
* |
10
|
|
|
* @link http://www.cjtterabyte.com. |
11
|
|
|
* @author Wilmer Arámbula <[email protected]>. |
12
|
|
|
* @copyright (c) 2015 Cjt Terabyte LLC. |
13
|
|
|
* @Extension: [yii2-adminlte-advanced]. |
14
|
|
|
* @Themes: AdminLTE - Views [Backend - layouts/main]. |
15
|
|
|
* @since 1.0 |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
use yii\helpers\Html; |
19
|
|
|
use yii\widgets\Breadcrumbs; |
20
|
|
|
use cjtterabytesoft\adminlte\advanced\widgets\Alert; |
21
|
|
|
use cjtterabytesoft\adminlte\advanced\assets\AdminLTE\AdminLTEAsset; |
22
|
|
|
use cjtterabytesoft\adminlte\advanced\assets\adminlte\AppAssetAdminLTE; |
23
|
|
|
|
24
|
|
|
/* @var $this \yii\web\View */ |
25
|
|
|
/* @var $content string */ |
26
|
|
|
|
27
|
|
|
AdminLTEAsset::register($this); |
28
|
|
|
AppAssetAdminLTE::register($this); |
29
|
|
|
|
30
|
|
|
?> |
31
|
|
|
|
32
|
|
|
<?php $this->beginPage() ?> |
33
|
|
|
<!DOCTYPE html> |
34
|
|
|
<?= Html::beginTag('html', ['lang' => Yii::$app->language]) ?> |
35
|
|
|
<?= Html::beginTag('head') ?> |
36
|
|
|
<?= Html::tag('meta', '', ['charset' => Yii::$app->charset]) ?> |
37
|
|
|
<?= Html::tag('meta', '', ['content' => 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no', 'name' => 'viewport']) ?> |
38
|
|
|
<?= Html::csrfMetaTags() ?> |
39
|
|
|
<?= Html::tag('title', Html::encode(Yii::t('adminlte',$this->title))) ?> |
40
|
|
|
<?php $this->head() ?> |
41
|
|
|
<!-- Theme style --> |
42
|
|
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
43
|
|
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
44
|
|
|
<!--[if lt IE 9]> |
45
|
|
|
<?= Html::tag('script', '', ['src' => 'https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js']) ?> |
46
|
|
|
<?= Html::tag('script', '', ['src' => 'https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js']) ?> |
47
|
|
|
<![endif]--> |
48
|
|
|
<?= Html::endTag('head') ?> |
49
|
|
|
<?php $this->beginBody() ?> |
50
|
|
|
<?= Html::begintag('body', ['class' => (!Yii::$app->user->isGuest) ? 'hold-transition ' .\yii::$app->params['AdminLTESkinBackend' |
51
|
|
|
] . ' sidebar-collapse sidebar-mini' : 'hold-transition layout-top-nav '. \yii::$app->params['AdminLTESkinBackend']]) ?> |
52
|
|
|
<?= Html::beginTag('div', ['class' => 'wrapper']) ?> |
53
|
|
|
<!-- header logo: style can be found in header.less --> |
54
|
|
|
<?= $this->render('_header') ?> |
55
|
|
|
<!-- Left side column. contains the logo and sidebar --> |
56
|
|
View Code Duplication |
<?php if (!Yii::$app->user->isGuest): ?> |
|
|
|
|
57
|
|
|
<?= Html::beginTag('aside', ['class' => 'main-sidebar']) ?> |
58
|
|
|
<!-- sidebar: style can be found in sidebar.less --> |
59
|
|
|
<?= Html::beginTag('section', ['class' => 'sidebar']) ?> |
60
|
|
|
<!-- Sidebar user panel --> |
61
|
|
|
<?= $this->render('_userpanel') ?> |
62
|
|
|
<!-- ./Sidebar user panel --> |
63
|
|
|
<?= $this->render('_sidebar') ?> |
64
|
|
|
<?= Html::endTag('section') ?> |
65
|
|
|
<!-- /.sidebar --> |
66
|
|
|
<?= Html::endTag('aside') ?> |
67
|
|
|
<!-- ./Left side column. --> |
68
|
|
|
<!-- Right side column. Contains the navbar and content of the page --> |
69
|
|
|
<!-- Navigation --> |
70
|
|
|
<?= Html::beginTag('div', ['class' => 'content-wrapper']) ?> |
71
|
|
|
<?= Html::beginTag('section', ['class' => 'content-header']) ?> |
72
|
|
|
<!-- Content Header (Page header) --> |
73
|
|
|
<?= Html::beginTag('div') ?> |
74
|
|
|
<?= Breadcrumbs::widget([ |
75
|
|
|
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], |
76
|
|
|
]) ?> |
77
|
|
|
<?= Html::endTag('div') ?> |
78
|
|
|
<?= Html::endTag('section') ?> |
79
|
|
|
<?= Html::beginTag('section', ['class' => 'content']) ?> |
80
|
|
|
<!-- Main content --> |
81
|
|
|
<?= $content ?> |
82
|
|
|
<?= Alert::widget() ?> |
83
|
|
|
<?= Html::endTag('section') ?> |
84
|
|
|
<!-- /.content --> |
85
|
|
|
<?= Html::endTag('div') ?> |
86
|
|
|
<!-- /.right-side --> |
87
|
|
|
<?php else: ?> |
88
|
|
|
<!-- ./Left side column. --> |
89
|
|
|
<!-- Right side column. Contains the navbar and content of the page --> |
90
|
|
|
<!-- Navigation --> |
91
|
|
|
<?= Html::beginTag('div', ['class' => 'content-wrapper']) ?> |
92
|
|
|
<?= Html::beginTag('section', ['class' => 'content-header']) ?> |
93
|
|
|
<?= Html::beginTag('div', ['class' => 'container']) ?> |
94
|
|
|
<?= Breadcrumbs::widget([ |
95
|
|
|
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], |
96
|
|
|
]) ?> |
97
|
|
|
<?= Html::endTag('div') ?> |
98
|
|
|
<?= Html::endTag('section') ?> |
99
|
|
|
<?= Html::beginTag('section', ['class' => 'content']) ?> |
100
|
|
|
<!-- Main content --> |
101
|
|
|
<?= Html::beginTag('div', ['class' => 'container']) ?> |
102
|
|
|
<?= $content ?> |
103
|
|
|
<?= Alert::widget() ?> |
104
|
|
|
<?= Html::endTag('div') ?> |
105
|
|
|
<?= Html::endTag('section') ?> |
106
|
|
|
<?= Html::endTag('div') ?> |
107
|
|
|
<?php endif; ?> |
108
|
|
|
<!-- ./Right side column. --> |
109
|
|
|
<?= $this->render('_footer') ?> |
110
|
|
|
<?= Html::endTag('div') ?> |
111
|
|
|
<?= Html::endTag('body') ?> |
112
|
|
|
<?php $this->endBody() ?> |
113
|
|
|
<?= Html::endTag('html') ?> |
114
|
|
|
<?php $this->endPage() ?> |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.