Blame view

backend/views/sitemap/index.php 2.78 KB
a0e8d4e0   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
  <?php
      use common\components\Sitemap;
      use yii\bootstrap\Html;
      use yii\web\View;
      use yiister\gentelella\widgets\Panel;
      
      /**
       * @var View $this
       */
e600c706   Eugeny Galkovskiy   Записаться на приём
10
      $this->title = \Yii::t('core', 'Карта сайта');
a0e8d4e0   Alexey Boroda   first commit
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
      $this->params[ 'breadcrumbs' ][] = $this->title;
      /**
       * @var Sitemap $sitemap
       */
      $sitemap = \Yii::$app->get('sitemap');
  ?>
  <div class="sitemap-main">
      <?php
          $xPanel = Panel::begin(
              [
                  'header'  => $this->title,
                  'options' => [
                      'class' => 'x_panel sitemap-buttons',
                  ],
              ]
          );
      ?>
      <div class="row">
          <div class="col-xs-12 col-sm-6 text-center">
              <?php
                  echo Html::a(
                      Html::icon(
                          'edit',
                          [
                              'prefix' => 'fa fa-',
                          ]
809b0ee3   Eugeny Galkovskiy   Переводы 1
37
                      ) . \Yii::t('core', 'Редактировать'),
a0e8d4e0   Alexey Boroda   first commit
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
                      [ 'update' ],
                      [
                          'class' => 'btn btn-app',
                      ]
                  );
              ?>
          </div>
          <div class="col-xs-12 col-sm-6 text-center">
              <?php
                  echo Html::a(
                      Html::icon(
                          'cogs',
                          [
                              'prefix' => 'fa fa-',
                              'class'  => 'indexed',
                          ]
                      ) . Html::tag(
                          'span',
809b0ee3   Eugeny Galkovskiy   Переводы 1
56
                          \Yii::t('core', 'Сгенерировать'),
a0e8d4e0   Alexey Boroda   first commit
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
                          [
                              'class' => 'indexed',
                          ]
                      ) . Html::tag(
                          'div',
                          ' ',
                          [
                              'class' => 'spinner',
                          ]
                      ),
                      [ 'generate' ],
                      [
                          'class' => 'btn btn-app ajax',
                          'data'  => [
                              'need-reload' => !$sitemap->checkFileExist(),
                          ],
                      ]
                  );
              ?>
          </div>
      </div>
      <?php
          if ($sitemap->checkFileExist()) {
              echo Html::tag(
                  'div',
                  Html::a(
809b0ee3   Eugeny Galkovskiy   Переводы 1
83
                      \Yii::t('core', 'Посмотреть сгенерированный sitemap.xml'),
a0e8d4e0   Alexey Boroda   first commit
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
                      $sitemap->getUrl(),
                      [
                          'target' => '_blank',
                      ]
                  ),
                  [
                      'class' => 'row text-right',
                  ]
              );
          }
      ?>
      <?php
          $xPanel::end();
      ?>
  </div>