Drupal investigation

main.php 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $content string */
  4. use yii\helpers\Html;
  5. use yii\bootstrap\Nav;
  6. use yii\bootstrap\NavBar;
  7. use app\assets\AppAsset;
  8. use yii\helpers\Url;
  9. AppAsset::register($this);
  10. ?>
  11. <?php $this->beginPage() ?>
  12. <!DOCTYPE html>
  13. <html lang="<?= Yii::$app->language ?>">
  14. <head>
  15. <meta charset="<?= Yii::$app->charset ?>">
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  17. <meta name="viewport" content="width=device-width, initial-scale=1">
  18. <?= Html::csrfMetaTags() ?>
  19. <title><?= Html::encode($this->title) ?></title>
  20. <?php $this->head() ?>
  21. <style>
  22. body{
  23. padding-top: 80px; }
  24. .footer-custom{}
  25. .img-responsive{
  26. max-width: 200px;
  27. height: auto;
  28. }
  29. .custom-block{
  30. margin-top: 10px;
  31. }
  32. .hamburger{
  33. background-color: #2b542c;
  34. }
  35. .nav-menu{
  36. margin-top: 15px !important;
  37. }
  38. .navbar-custom{
  39. background-color: rgba(254,254,254,254);
  40. }
  41. .container{
  42. width: 80%;
  43. }
  44. .custom{
  45. padding-top: 40px !important;
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <?php $this->beginBody() ?>
  51. <div class="wrap">
  52. <?php
  53. /*<?= Yii::t('app', 'Welcome!')?>*/
  54. NavBar::begin([
  55. 'innerContainerOptions' => ['class' => 'container'],
  56. 'brandLabel' => '<img src="'.Yii::getAlias('@web').'/images/imws_logo.gif" class="img-responsive"/>',
  57. 'brandUrl' => Yii::$app->homeUrl,
  58. 'options' => [
  59. 'class' => 'navbar-fixed-top navbar-custom',//navbar-inverse
  60. ],
  61. ]);
  62. $adminToolsDropdown = [
  63. ['label' => Yii::t('app', 'Roles and Permissions'), 'url' => ['/admin-tools/index'], 'visible' => !Yii::$app->user->isGuest],
  64. ['label' => Yii::t('app', 'User Import'), 'url' => ['/admin-tools/userimport'], 'visible' => !Yii::$app->user->isGuest],
  65. ['label' => Yii::t('app', 'Gii'), 'url' => ['/gii'], 'visible' => !Yii::$app->user->isGuest],
  66. ];
  67. $hrToolsDropdown = [
  68. ['label' => Yii::t('app', 'Groups Editor'), 'url' => ['/hr-tools/groups'], 'visible' => !Yii::$app->user->isGuest],
  69. ['label' => Yii::t('app', 'Workflow Configuration'), 'url' => ['/hr-tools/workflow'], 'visible' => !Yii::$app->user->isGuest],
  70. ['label' => Yii::t('app', 'Tasks Editor'), 'url' => ['/hr-tools/tasks'], 'visible' => !Yii::$app->user->isGuest],
  71. ];
  72. $userDropdown = [
  73. ['label' => Yii::t('app', 'My profile'), 'url' => ['/site/account'], 'visible' => !Yii::$app->user->isGuest],
  74. ['label' => Yii::t('app', 'Settings'), 'url' => ['/site/settings'], 'visible' => !Yii::$app->user->isGuest]
  75. ];
  76. echo Nav::widget([
  77. 'options' => ['class' => 'navbar-nav navbar-right nav-menu'],
  78. 'items' => [
  79. ['label' => Yii::t('app', 'My tasks'), 'url' => ['/site/index'], 'visible' => !Yii::$app->user->isGuest],
  80. ['label' => Yii::t('app', 'Workflow'), 'url' => ['/site/workflow'], 'visible' => !Yii::$app->user->isGuest],
  81. ['label' => Yii::t('app', 'Organigram'), 'url' => ['/site/organigram'], 'visible' => !Yii::$app->user->isGuest],
  82. (Yii::$app->user->can('permission_hr') or Yii::$app->user->can('permission_admin'))?['label' => Yii::t('app', 'HR Tools'), 'url' => ['#'], 'visible' => !Yii::$app->user->isGuest, 'items' => $hrToolsDropdown]: '',
  83. (Yii::$app->user->can('permission_admin'))?['label' => Yii::t('app', 'Admin Tools'), 'url' => ['#'], 'visible' => !Yii::$app->user->isGuest, 'items' => $adminToolsDropdown]: '',
  84. ['label' => Yii::t('app', 'Profile') /*Yii::$app->user->identity->username*/, 'url' => ['#'], 'visible' => !Yii::$app->user->isGuest, 'items' => $userDropdown],
  85. Yii::$app->user->isGuest ? (
  86. ['label' => 'Login', 'url' => ['/site/login'], 'visible' => false]
  87. ) : (
  88. '<li>'
  89. . Html::beginForm(['/site/logout'], 'post')
  90. . Html::submitButton(
  91. Yii::t('app', 'Logout').' (' . Yii::$app->user->identity->username . ')',
  92. ['class' => 'btn btn-link logout']
  93. )
  94. . Html::endForm()
  95. . '</li>'
  96. ),
  97. ],
  98. ]);
  99. NavBar::end();
  100. ?>
  101. <div class="container custom">
  102. <?= $content ?>
  103. </div>
  104. </div>
  105. <footer class="footer-custom">
  106. <div class="container">
  107. <p class="pull-left"><!--<?= Yii::powered() ?>--></p>
  108. <p class="pull-right"> &copy; Fraunhofer IMWS <?= date('Y') ?></p>
  109. </div>
  110. </footer>
  111. <?php $this->endBody() ?>
  112. </body>
  113. </html>
  114. <?php $this->endPage() ?>