Blame view

frontend/config/main.php 12.8 KB
c420c609   alex   first commit
1
2
  <?php
      use artbox\core\components\SeoComponent;
b2e6e4cc   alex   Добавил возможнос...
3
      #use common\components\SeoComponent;
c420c609   alex   first commit
4
      use frontend\components\UrlManager;
b2e6e4cc   alex   Добавил возможнос...
5
      use common\models\Alias;
c420c609   alex   first commit
6
7
8
9
10
11
12
      
      $params = array_merge(
          require( __DIR__ . '/../../common/config/params.php' ),
          require( __DIR__ . '/../../common/config/params-local.php' ),
          require( __DIR__ . '/params.php' ),
          require( __DIR__ . '/params-local.php' )
      );
aa6e6170   alex   Доделал мелкие пр...
13
14
  
      $send="Отправить";
e095876b   alex   правки по формам
15
      $request1='Ваша заявка';
d23c67c0   alex   правки по формам
16
  
aa6e6170   alex   Доделал мелкие пр...
17
18
      if(strpos($_SERVER['REQUEST_URI'],"/ua")!==false) {
  	    $send = "Вiдправити";
e095876b   alex   правки по формам
19
  
aa6e6170   alex   Доделал мелкие пр...
20
21
22
      }
  
  
c420c609   alex   first commit
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
      
      return [
          'id'                  => 'app-frontend',
          'homeUrl'             => '/',
          'basePath'            => dirname(__DIR__),
          'bootstrap'           => [ 'log' ],
          'controllerNamespace' => 'frontend\controllers',
          'container' => [
              'singletons' => [
                  'artbox\core\services\Languages' =>'artbox\core\services\Languages',
              ]
          ],
          'modules'             => [
              'feedback' => [
                  'class'      => 'artbox\core\forms\Module',
                  'activeRecord' => "artbox\core\models\Feedback",
                  'attributes' => [
                      'name',
                      'email',
                      'message',
                  ],
                  'rules'           => [
                      [
                          [ 'email' ],
                          'email',
                      ],
                      [
                          [
                              'email',
                              'name',
                              'message',
                          ],
                          'required',
                      ],
                  ],
                  'labels'          => [
                      'email'   => 'Email',
                      'name'    => 'Name',
                      'message' => 'You question',
                  ],
                  'inputOptions'    => [
                      'message' => [
                          'type'    => 'textarea',
                          'options' => [],
                      ],
                  ],
                  'scenario'        => 'feedback',
                  'sendEmail'       => false,
                  'formId'          => 'feedback-form',
                  'ajax'            => true,
                  'successCallback' => 'function (data) {
                   document.getElementById("feedback-form").reset();
                                $(".close").click();
                                if (data.status == "success"){
                                document.getElementById("feedback-form").reset();
                                $(".success_").animate({opacity: 1, top: \'40\'}, 200).addClass("done_");
                                setTimeout(function(){$(".success_").animate({opacity: 0, top: \'0\'}, 200,function(){
                                    $(this).removeClass("done_");
                                })}, 4000);
                                 var data = $("#feedback-form").data(\'yiiActiveForm\');
                                data.validated = false;
                                }
                      }',
              ],
  
              'contact' => [
                  'class'      => 'artbox\core\forms\Module',
1a059019   alex   Доделал мелкие пр...
90
                  'activeRecord' => "common\models\Feedback",
c420c609   alex   first commit
91
92
93
                  'templateForm' => '<div class="row">{form}</div>',
                  'attributes' => [
                      'name',
c420c609   alex   first commit
94
                      'phone',
be2b3be7   alex   правки по формам
95
  	                'email',
e095876b   alex   правки по формам
96
                      'message',
c420c609   alex   first commit
97
  
be2b3be7   alex   правки по формам
98
  
c420c609   alex   first commit
99
100
                  ],
                  'rules'      => [
be2b3be7   alex   правки по формам
101
102
103
104
                  	[
                  		['email'],
  		                'email'
  	                ],
c420c609   alex   first commit
105
                      [
e095876b   alex   правки по формам
106
107
                          [ 'message' ],
                          'text',
c420c609   alex   first commit
108
109
110
                      ],
                      [
                          [
be2b3be7   alex   правки по формам
111
  							'email',
c420c609   alex   first commit
112
113
114
115
                              'name',
                              'phone',
                          ],
                          'required',
e095876b   alex   правки по формам
116
117
  
                      ],
df90a7cb   alex   правки по формам
118
119
120
121
  	                [
  	                	['name','phone'],
  		                'string'
  	                ],
e095876b   alex   правки по формам
122
  
c420c609   alex   first commit
123
124
                  ],
                  'labels'     => [
be2b3be7   alex   правки по формам
125
126
127
128
                      'message'           => 'Message',
                      'name'              => 'Name',
                      'phone'             => 'Phone',
  	                'email'             => 'Email'
c420c609   alex   first commit
129
130
131
132
133
134
                  ],
  
                  'inputOptions'    => [
                      'name'   => [
                        'template' => '<div class="col-sm-12">{input}</div>'
                      ],
be2b3be7   alex   правки по формам
135
136
137
138
139
  	                'email'   => [
  
  		                'template'          =>'<div class="col-sm-12">{input}</div>',
  
  		            ],
e095876b   alex   правки по формам
140
141
142
143
144
  	                'message' => [
  		                'type'    => 'textarea',
  		                'options' => [],
  		                'template' => '<div class="input-wr">{input}</div>'
  	                ],
c420c609   alex   first commit
145
146
147
148
149
                      'phone'   => [
                          'template' => '<div class="col-sm-12">{input}</div>'
                      ],
  
                  ],
1a059019   alex   Доделал мелкие пр...
150
151
                  'buttonTemplate'  => '<div class="button-wr">{button}</div>',
  
be2b3be7   alex   правки по формам
152
                  'buttonContent'   => $send,
c420c609   alex   first commit
153
                  'sendEmail'       => true,
69768df7   alex   правки по формам
154
  	            'email'           => 'buh.artplast@gmail.com',
4ab98ba2   alex   правки по формам
155
  	            'subject'         => 'Новая заявка',
c420c609   alex   first commit
156
157
                  'ajax'            => true,
                  'formId'          => 'contact-form',
be2b3be7   alex   правки по формам
158
                  'scenario'        => 'default',
c420c609   alex   first commit
159
160
161
162
163
164
165
166
167
168
                  'successCallback' => 'function (data) {
                               document.getElementById("contact-form").reset();
                               
                                  var pos = ($(window).scrollTop()) + 30;
                                  
                                 $(".forms_").animate({opacity: 0, top: "0"}, 200,function(){
              $(this).css("display", "none");
          });
          setTimeout(function () {
              $("#overlay").fadeIn(400);
df90a7cb   alex   правки по формам
169
170
171
172
173
174
175
176
177
178
179
180
181
            
                     if(data.status=="success"){
               $("#success_form").css("display", "block").animate({opacity: 1, top: pos}, 700);
              }
              else{
               $("#success_form.error_form").css("display", "block").animate({opacity: 1, top: pos}, 700);
              }
          
          
          
          
          
          
c420c609   alex   first commit
182
183
184
          },400)}',
  
              ],
e095876b   alex   правки по формам
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
  	        'request_1' => [
  		        'class'      => 'artbox\core\forms\Module',
  		        'activeRecord' => "common\models\Feedback",
  		        'templateForm' => '<div class="row">{form}</div>',
  		        'attributes' => [
  			        'name',
  			        'phone',
  			        'message',
  
  		        ],
  		        'rules'      => [
  			        [
  				        [ 'message' ],
  				        'text',
  			        ],
  			        [
  				        [
e095876b   alex   правки по формам
202
203
204
205
206
  					        'name',
  					        'phone',
  				        ],
  				        'required',
  
df90a7cb   alex   правки по формам
207
208
209
210
  			        ],
  			        [['name','phone'],
  				        'string'
  				        ],
e095876b   alex   правки по формам
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
  		        ],
  		        'labels'     => [
  			        'message'   => 'Message',
  			        'name'    => 'Name',
  			        'phone'   => 'Phone'
  		        ],
  
  		        'inputOptions'    => [
  			        'name'   => [
  				        'template' => '<div class="col-sm-12">{input}</div>'
  			        ],
  			        'message' => [
  				        'type'    => 'textarea',
  				        'options' => [],
  				        'template' => '<div class="input-wr">{input}</div>'
  			        ],
  			        'phone'   => [
  				        'template' => '<div class="col-sm-12">{input}</div>'
  			        ],
  
  		        ],
  		        'buttonTemplate'  => '<div class="button-wr">{button}</div>',
df90a7cb   alex   правки по формам
233
  		        'buttonContent'   => $send,
be2b3be7   alex   правки по формам
234
  		        'sendEmail'       => true,
69768df7   alex   правки по формам
235
  		        'email'           => 'buh.artplast@gmail.com',
4ab98ba2   alex   правки по формам
236
  		        'subject'         => 'Новая заявка',
be2b3be7   alex   правки по формам
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
  		        'ajax'            => true,
  		        'formId'          => 'contact-form',
  		        'scenario'        => 'callback',
  		        'successCallback' => 'function (data) {
                               document.getElementById("contact-form").reset();
                                 
                                
                                  var pos = ($(window).scrollTop()) + 30;
                                  
                                 $(".forms_").animate({opacity: 0, top: "0"}, 200,function(){
              $(this).css("display", "none");
          });
          setTimeout(function () {
              $("#overlay").fadeIn(400);
              
              if(data.status=="success"){
               $("#success_form").css("display", "block").animate({opacity: 1, top: pos}, 700);
              }
              else{
               $("#success_form.error_form").css("display", "block").animate({opacity: 1, top: pos}, 700);
              }
              
             
         
         
          },400)}',
  
  	        ],
  	        'request_2' => [
  		        'class'      => 'artbox\core\forms\Module',
  		        'activeRecord' => "common\models\Feedback",
  		        'templateForm' => '<div class="row">{form}</div>',
  		        'attributes' => [
  			        'name',
  			        'phone',
  			        'message',
  
  		        ],
  		        'rules'      => [
  			        [
  				        [ 'message' ],
  				        'text',
  			        ],
  			        [
  				        [
  
  					        'name',
  					        'phone',
  				        ],
  				        'required',
  
df90a7cb   alex   правки по формам
288
289
290
291
292
  			        ],
  			        [
  			        	['name','phone'],
  				        'string'
  			        ],
be2b3be7   alex   правки по формам
293
294
295
296
297
298
299
300
301
302
  		        ],
  		        'labels'     => [
  			        'message'   => 'Message',
  			        'name'    => 'Name',
  			        'phone'   => 'Phone'
  		        ],
  
  		        'inputOptions'    => [
  			        'name'   => [
  				        'template' => '<div class="col-sm-12">{input}</div>',
df90a7cb   alex   правки по формам
303
304
305
  				        'labelOptions' => [ 'class' => 'callback_text_input_label'],
  
  
be2b3be7   alex   правки по формам
306
307
308
309
310
311
312
313
314
315
316
317
318
  			        ],
  			        'message' => [
  				        'type'    => 'textarea',
  				        'options' => [],
  				        'template' => '<div class="input-wr">{input}</div>'
  			        ],
  			        'phone'   => [
  				        'template' => '<div class="col-sm-12">{input}</div>',
  				        'labelOptions' => [ 'class' => 'callback_text_input_label' ]
  			        ],
  
  		        ],
  		        'buttonTemplate'  => '<div class="button-wr">{button}</div>',
e095876b   alex   правки по формам
319
  
d23c67c0   alex   правки по формам
320
  		        'buttonContent'   => $send,
e095876b   alex   правки по формам
321
  		        'sendEmail'       => true,
69768df7   alex   правки по формам
322
  		        'email'           => 'buh.artplast@gmail.com',
4ab98ba2   alex   правки по формам
323
  		        'subject'         => 'Новая заявка',
e095876b   alex   правки по формам
324
325
326
327
328
329
  		        'ajax'            => true,
  		        'formId'          => 'contact-form',
  		        'scenario'        => 'callback',
  		        'successCallback' => 'function (data) {
                               document.getElementById("contact-form").reset();
                                 
69768df7   alex   правки по формам
330
                      
e095876b   alex   правки по формам
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
                                  var pos = ($(window).scrollTop()) + 30;
                                  
                                 $(".forms_").animate({opacity: 0, top: "0"}, 200,function(){
              $(this).css("display", "none");
          });
          setTimeout(function () {
              $("#overlay").fadeIn(400);
              
              if(data.status=="success"){
               $("#success_form").css("display", "block").animate({opacity: 1, top: pos}, 700);
              }
              else{
               $("#success_form.error_form").css("display", "block").animate({opacity: 1, top: pos}, 700);
              }
              
             
         
         
          },400)}',
c420c609   alex   first commit
350
  
e095876b   alex   правки по формам
351
  	        ],
c420c609   alex   first commit
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
  
  
  
          ],
          'components'          => [
              'request'      => [
                  'csrfParam' => '_csrf-frontend',
                  'baseUrl'   => '',
              ],
              'user'         => [
                  'identityClass'   => 'common\models\User',
                  'enableAutoLogin' => true,
                  'identityCookie'  => [
                      'name'     => '_identity-frontend',
                      'httpOnly' => true,
                  ],
              ],
              'session'      => [
                  // this is the name of the session cookie used for login on the frontend
                  'name' => 'advanced-frontend',
              ],
              'log'          => [
                  'traceLevel' => YII_DEBUG ? 3 : 0,
                  'targets'    => [
                      [
                          'class'  => 'yii\log\FileTarget',
                          'levels' => [
                              'error',
                              'warning',
                          ],
                      ],
                  ],
              ],
              'seo'                => [
b2e6e4cc   alex   Добавил возможнос...
386
387
388
                  'class'      => SeoComponent::className(),
  
  
c420c609   alex   first commit
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
              ],
              'errorHandler' => [
                  'errorAction' => 'site/error',
              ],
              'urlManager'   => [
                  'class'           => UrlManager::className(),
                  'baseUrl'         => '/',
                  'enablePrettyUrl' => true,
                  'showScriptName'  => false,
                  'rules'           => [],
                  'hideDefaultLanguagePrefix' => true,
              ],
          ],
          
          'params'              => $params,
      ];