main.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. use common\modules\rbac\components\MenuHelper;
  3. use common\modules\rbac\models\Menu;
  4. use yii\helpers\Html;
  5. /* @var $this \yii\web\View */
  6. /* @var $content string */
  7. /* @var $context \yii\web\Controller */
  8. backend\assets\AppAsset::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="hold-transition <?= Yii::$app->config->get('backend_skin', 'skin-green') ?> ">
  21. <?php $this->beginBody() ?>
  22. <style>
  23. .content-wrapper, .right-side, .main-footer {margin-left:0!important;}
  24. .btn-refresh {
  25. position: fixed;
  26. bottom: 100px;
  27. right: 2px;
  28. padding: 3px 8px;
  29. font-size: 24px;
  30. border:1px solid #ccc;
  31. border-radius:4px;
  32. cursor: pointer;
  33. background-color: #009688;
  34. border-color: #009688;
  35. }
  36. .btn-refresh:hover{
  37. background: #009688 !important;
  38. border-color: #009688 !important;
  39. opacity: 0.8;
  40. }
  41. </style>
  42. <div class="content-wrapper">
  43. <section class="content-header">
  44. <?php if (isset($this->blocks['content-header'])) { ?>
  45. <h1><?= $this->blocks['content-header'] ?></h1>
  46. <?php } else { ?>
  47. <h1>
  48. <?php
  49. if ($this->title !== null) {
  50. echo \yii\helpers\Html::encode($this->title);
  51. } else {
  52. echo \yii\helpers\Inflector::camel2words(
  53. \yii\helpers\Inflector::id2camel($this->context->module->id)
  54. );
  55. echo ($this->context->module->id !== \Yii::$app->id) ? '<small>Module</small>' : '';
  56. } ?>
  57. </h1>
  58. <?php } ?>
  59. <?= \yii\widgets\Breadcrumbs::widget([
  60. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  61. 'homeLink' => false
  62. ]) ?>
  63. </section>
  64. <section class="content">
  65. <?= \common\widgets\Alert::widget()?>
  66. <?= $content ?>
  67. </section>
  68. </div>
  69. <?php
  70. $js = <<<JS
  71. //layer相册
  72. layer.ready(function () {
  73. layer.photos({
  74. photos: '.media-content',
  75. shift: 5
  76. });
  77. });
  78. JS;
  79. $this->registerJs($js);
  80. ?>
  81. <?= Html::a(Html::icon('refresh'), 'javascript:;', ['class' => 'btn btn-success btn-refresh', 'onclick' => 'location.reload()']) ?>
  82. <?php $this->endBody() ?>
  83. <?php if (isset($this->blocks['js'])): ?>
  84. <?= $this->blocks['js'] ?>
  85. <?php endif; ?>
  86. </body>
  87. </html>
  88. <?php $this->endPage() ?>