step1.php 11.5 KB
Newer Older
Vladimir Kharinenkov's avatar
Release  
Vladimir Kharinenkov committed
1
2
3
4
5
6
7
8
9
10
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<?php

  use \Bitrix\Main\Localization\Loc;
  use \Epublish\Magicsite\Integration;

  Loc::loadMessages(__FILE__);

  $warnings = array();
?>
<form action="<?php echo $APPLICATION->GetCurPage(); ?>" name="blog_install">
<?php echo bitrix_sessid_post(); ?>
  <input type="hidden" name="lang" value="<?php echo LANG ?>">
  <input type="hidden" name="id" value="epublish.magicsite">
  <input type="hidden" name="install" value="Y">
  <input type="hidden" id="error-main" name="error[main]" value="Y">
  <input type="hidden" id="error-curl" name="error[curl]" value="Y">
  <input type="hidden" id="error-dom" name="error[dom]" value="Y">
  <input type="hidden" name="step" value="2">

  <script language="JavaScript">
    document.addEventListener('DOMContentLoaded', function(){
      ChangeInstallPublic();
    });

    function ChangeInstallPublic() {
      var disabled = false;
      if (document.getElementById('error-main').value == "Y") {
        disabled = true;
      } else if (document.getElementById('error-curl').value == "Y") {
        disabled = true;
      } else if (document.getElementById('error-dom').value == "Y") {
        disabled = true;
      } else if (typeof(document.getElementById('overwrite-sections')) != 'undefined' && document.getElementById('overwrite-sections') != null){
        if (document.getElementById('overwrite-sections').checked == false) {
          disabled = true;
        }
      }
      document.getElementById('inst').disabled = disabled;
    }
  </script>

  <div class="inst-cont-title-wrap">
    <div class="inst-cont-title"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_TITLE'); ?></div>

  </div>
  <div class="step-content">
    <?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_DESC'); ?><br>
    <table border="0" class="data-table data-table-multiple-column">
      <tr>
        <td class="header"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_HEADER_PARAM'); ?></td>
        <td class="header"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_HEADER_NEED'); ?></td>
        <td class="header"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_HEADER_CURRENT'); ?></td>
      </tr>
      <tr>
        <td valign="top"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_MAIN_MODULE_VERSION_TITLE'); ?></td>
        <td valign="top"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_MAIN_MODULE_VERSION_NEED'); ?></td>
        <td valign="top">
          <?php if (CheckVersion(\Bitrix\Main\ModuleManager::getVersion('main'), '14.00.00')) : ?>
            <script language="JavaScript">document.getElementById('error-main').value = "N"</script>
            <b><span style="color:green"><?php echo \Bitrix\Main\ModuleManager::getVersion('main'); ?></span></b>
          <?php else : ?>
            <b><span style="color:red"><?php echo \Bitrix\Main\ModuleManager::getVersion('main'); ?></span></b>
          <?php endif; ?>
        </td>
      </tr>
      <tr>
        <td colspan="3"><b><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_PHP_EXTENSION_TITLE'); ?>:</b></td>
      </tr>
      <tr>
        <td valign="top"><a href="https://www.php.net/manual/en/book.curl.php" target="_blank"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_PHP_EXTENSION_CURL_TITLE'); ?></a></td>
        <td valign="top">Установлен</td>
        <td valign="top">
          <?php if (extension_loaded('curl')) : ?>
            <script language="JavaScript">document.getElementById('error-curl').value = "N"</script>
            <b><span style="color:green"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_PHP_EXTENSION_LOADED'); ?></span></b>
          <?php else : ?>
            <b><span style="color:green"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_PHP_EXTENSION_UNLOADED'); ?></span></b>
          <?php endif; ?>
        </td>
      </tr>
      <tr>
        <td valign="top">
          <a href="https://www.php.net/manual/ru/book.dom.php" target="_blank"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_PHP_EXTENSION_DOM_TITLE'); ?></a>
        </td>
        <td valign="top">Установлен</td>
        <td valign="top">
          <?php if (extension_loaded('dom')) : ?>
            <script language="JavaScript">document.getElementById('error-dom').value = "N"</script>
            <b><span style="color:green"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_PHP_EXTENSION_LOADED'); ?></span></b>
          <?php else : ?>
            <b><span style="color:green"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_PHP_EXTENSION_UNLOADED'); ?></span></b>
          <?php endif; ?>
        </td>
      </tr>
      <tr>
        <td colspan="3"><b>Разделы сайта:</b></td>
      </tr>
      <?php $sections = epublish_magicsite::getSections(); ?>
      <?php foreach ($sections as $section ) : ?>
        <tr>
          <td valign="top"><?php echo $section['title']; ?> (<b>/<?php echo $section['path']; ?>/</b>)</td>
          <td valign="top"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_SESCTION_NOT_EXISTS'); ?></td>
          <td valign="top">
          <?php if (file_exists($_SERVER["DOCUMENT_ROOT"].'/'.$section['path'].'/index.php')) :
            $warnings['sections'][] = $section['path']; ?>
            <b><span style="color:brown"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_SESCTION_EXISTS'); ?></span></b>
          <?php else : ?>
            <b><span style="color:green"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_SESCTION_NOT_EXISTS'); ?></span></b>
          <?php endif; ?>
          </td>
        </tr>
        <?php if (isset($section['below'])) : ?>
          <?php foreach ($section['below'] as $subsection ) : ?>
            <tr>
              <td valign="top"><span><?php echo $subsection['title']; ?> (<b>/<?php echo $subsection['path']; ?>/</b>)</span></td>
              <td valign="top"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_SESCTION_NOT_EXISTS'); ?></td>
              <td valign="top">
              <?php if (file_exists($_SERVER["DOCUMENT_ROOT"].'/'.$subsection['path'].'/index.php')) :
                $warnings['sections'][] = $section['path']; ?>
                <b><span style="color:brown"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_SESCTION_EXISTS'); ?></span></b>
              <?php else : ?>
                <b><span style="color:green"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_CHECK_SESCTION_NOT_EXISTS'); ?></span></b>
              <?php endif; ?>
              </td>
            </tr>
          <?php endforeach; ?>
        <?php endif; ?>
      <?php endforeach; ?>
    </table>
    <?php if (count($warnings)) : ?>
      <p>
        <input type="checkbox" name="overwrite_sections" value="Y" id="overwrite-sections" onclick="ChangeInstallPublic();">&nbsp;<label for="overwrite-sections"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_OVERWRITE_SESCTION'); ?></label><br />
      </p>
      <br>
    <?php endif; ?>

    <table class="data-table">
      <tr>
        <td width="0%">
          <font color="green"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_LEGEND_GREEN'); ?><br></font>
          <font color="red"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_LEGEND_RED'); ?><br></font>
          <font color="brown"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_LEGEND_BROWN'); ?></font>
        </td>
      </tr>
    </table>
    <p>
      <input type="checkbox" name="top_menu" value="Y" id="top-menu" checked>&nbsp;<label for="top-menu"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_TOP_MENU'); ?></label><br />
      <sub><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_TOP_MENU_DESC'); ?></sub>
    </p>
    <p>
      <input type="checkbox" name="left_menu" value="Y" id="left-menu" checked>&nbsp;<label for="left-menu"><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_LEFT_MENU'); ?></label><br />
      <sub><?php echo Loc::getMessage('EPUBLISH_MAGICSITE_INSTALL_LEFT_MENU_DESC'); ?></sub>
    </p>
    <br>

    <input type="submit" name="inst" id="inst" value="<?= GetMessage("MOD_INSTALL")?>">
  </div>
</form>
<style>
.inst-cont-title {
    background: #e7efc2;
    border: 1px solid;
    border-color: #d3e1c1 #cbdab4 #c5d4a7;
    border-radius: 3px;
    -webkit-box-shadow: 0 1px 0 #fff;
    box-shadow: inset 0 1px 0 #fff;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    line-height: 37px;
    height: 37px;
    padding: 0 17px;
    text-shadow: 0 1px rgb(255 255 255 / 90%);
}

.inst-cont-title {
    background: #e7efc2;
    border: 1px solid;
    border-color: #d3e1c1 #cbdab4 #c5d4a7;
    border-radius: 3px;
    -webkit-box-shadow: 0 1px 0 #fff;
    box-shadow: inset 0 1px 0 #fff;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    line-height: 37px;
    height: 37px;
    padding: 0 17px;
    text-shadow: 0 1px rgb(255 255 255 / 90%);
}

.step-content {
  background-color: #ffffff;
  color: #737373;
  text-align: left;
  vertical-align: top;
  padding: 25px 35px 25px 25px;
}

.data-table{
  border:1px solid #e7eff2;
  border-bottom:none;
  border-radius:5px;
  border-spacing:0;
  margin-bottom:20px;
  width: 100%;
}
.data-table th,
.data-table thead tr td,
.data-table td.header{
  background: #e3ebee;
  background:-webkit-linear-gradient(top, #e0eaec, #e5ecef);
  background:-moz-linear-gradient(top, #e0eaec, #e5ecef);
  background:-ms-linear-gradient(top, #e0eaec, #e5ecef);
  background:-o-linear-gradient(top, #e0eaec, #e5ecef);
  background:linear-gradient(to bottom, #e0eaec, #e5ecef);
  border-color: #f1f1f1 #e5e5e5 #bac0c3;
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255,255,255,.3), 0 1px 0 #eaeded;
  color: #000;
  font-size: 14px;
  font-weight: bold;
  line-height: 39px;
  margin: 0 -1px 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 17px;
  white-space: nowrap;
}
.data-table td{
  background:#fafcfd;
  border-bottom:1px solid #e6eaeb;
  color: #000;
  text-shadow:0 1px 1px #fff;
  font-size:14px;
  padding:10px 10px 10px 17px;
}

.data-table td span{
  padding-left: 40px;
}

.data-table-multiple-column th td,
.data-table-multiple-column thead tr td,
.data-table-multiple-column td.header {border-left: 1px solid #d3dddf;}

.data-table-multiple-column td {border-left: 1px solid #e6eaeb;}
.data-table-multiple-column td:first-child {border-left: none;}

.data-table td small {display: inline-block; padding-top: 5px;}

.data-table tr:last-child td:first-child{border-bottom-left-radius:5px;}

.data-table tr:last-child td:last-child{border-bottom-right-radius:5px;}

.data-table tr:first-child td:first-child{border-top-left-radius:5px; margin-top: -1px;}

.data-table tr:first-child td:last-child{border-top-right-radius:5px; margin-top: -1px;}

.data-table input[type="text"],
.data-table input[type="password"] {
  background: #fff;
  border: 1px solid;
  border-color: #c8ced3 #ccd2d7 #d2d8dc;
  border-radius: 3px;
  -webkit-box-shadow: inset 0 1px 0 #edf0f1, inset 0 2px 0 #f9fafb;
  box-shadow: inset 0 1px 0 #edf0f1, inset 0 2px 0 #f9fafb;
  font-size: 14px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  height: 29px;
  outline: none;
  padding: 0 5px;
  width: 290px;
}

.data-table select {
  font-size: 14px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  height: 29px;
  outline: none;
  padding: 5px 3px;
  width: 290px;
}


.data-table input[type="radio"]{
  margin-left: 0;
}
.data-table input[type="checkbox"]{
  margin-right: 8px;
}

.data-table input[type="checkbox"]+label {
  display: inline-block;
  padding-top: 1px;
  vertical-align: top;
}
</style>