Blame view

frontend/config/main.php 12.8 KB
c420c609   alex   first commit
1
2
  <?php
      use artbox\core\components\SeoComponent;
c420c609   alex   first commit
3
      use frontend\components\UrlManager;
b2e6e4cc   alex   Добавил возможнос...
4
      use common\models\Alias;
c420c609   alex   first commit
5
6
7
8
9
10
11
      
      $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   Доделал мелкие пр...
12
13
  
      $send="Отправить";
e095876b   alex   правки по формам
14
      $request1='Ваша заявка';
d23c67c0   alex   правки по формам
15
  
aa6e6170   alex   Доделал мелкие пр...
16
17
      if(strpos($_SERVER['REQUEST_URI'],"/ua")!==false) {
  	    $send = "Вiдправити";
e095876b   alex   правки по формам
18
  
aa6e6170   alex   Доделал мелкие пр...
19
20
21
      }
  
  
c420c609   alex   first commit
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
      
      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   Доделал мелкие пр...
89
                  'activeRecord' => "common\models\Feedback",
c420c609   alex   first commit
90
91
92
                  'templateForm' => '<div class="row">{form}</div>',
                  'attributes' => [
                      'name',
c420c609   alex   first commit
93
                      'phone',
be2b3be7   alex   правки по формам
94
  	                'email',
e095876b   alex   правки по формам
95
                      'message',
c420c609   alex   first commit
96
  
be2b3be7   alex   правки по формам
97
  
c420c609   alex   first commit
98
99
                  ],
                  'rules'      => [
be2b3be7   alex   правки по формам
100
101
102
103
                  	[
                  		['email'],
  		                'email'
  	                ],
c420c609   alex   first commit
104
                      [
e095876b   alex   правки по формам
105
106
                          [ 'message' ],
                          'text',
c420c609   alex   first commit
107
108
109
                      ],
                      [
                          [
be2b3be7   alex   правки по формам
110
  							'email',
c420c609   alex   first commit
111
112
113
114
                              'name',
                              'phone',
                          ],
                          'required',
e095876b   alex   правки по формам
115
116
  
                      ],
df90a7cb   alex   правки по формам
117
118
119
120
  	                [
  	                	['name','phone'],
  		                'string'
  	                ],
e095876b   alex   правки по формам
121
  
c420c609   alex   first commit
122
123
                  ],
                  'labels'     => [
be2b3be7   alex   правки по формам
124
125
126
127
                      'message'           => 'Message',
                      'name'              => 'Name',
                      'phone'             => 'Phone',
  	                'email'             => 'Email'
c420c609   alex   first commit
128
129
130
131
132
133
                  ],
  
                  'inputOptions'    => [
                      'name'   => [
                        'template' => '<div class="col-sm-12">{input}</div>'
                      ],
be2b3be7   alex   правки по формам
134
135
136
137
138
  	                'email'   => [
  
  		                'template'          =>'<div class="col-sm-12">{input}</div>',
  
  		            ],
e095876b   alex   правки по формам
139
140
141
142
143
  	                'message' => [
  		                'type'    => 'textarea',
  		                'options' => [],
  		                'template' => '<div class="input-wr">{input}</div>'
  	                ],
c420c609   alex   first commit
144
145
146
147
148
                      'phone'   => [
                          'template' => '<div class="col-sm-12">{input}</div>'
                      ],
  
                  ],
1a059019   alex   Доделал мелкие пр...
149
150
                  'buttonTemplate'  => '<div class="button-wr">{button}</div>',
  
be2b3be7   alex   правки по формам
151
                  'buttonContent'   => $send,
c420c609   alex   first commit
152
                  'sendEmail'       => true,
69768df7   alex   правки по формам
153
  	            'email'           => 'buh.artplast@gmail.com',
4ab98ba2   alex   правки по формам
154
  	            'subject'         => 'Новая заявка',
c420c609   alex   first commit
155
156
                  'ajax'            => true,
                  'formId'          => 'contact-form',
be2b3be7   alex   правки по формам
157
                  'scenario'        => 'default',
c420c609   alex   first commit
158
159
160
161
162
163
164
165
166
167
                  '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   правки по формам
168
169
170
171
172
173
174
175
176
177
178
179
180
            
                     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
181
182
183
          },400)}',
  
              ],
e095876b   alex   правки по формам
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
  	        '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   правки по формам
201
202
203
204
205
  					        'name',
  					        'phone',
  				        ],
  				        'required',
  
df90a7cb   alex   правки по формам
206
207
208
209
  			        ],
  			        [['name','phone'],
  				        'string'
  				        ],
e095876b   alex   правки по формам
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
  		        ],
  		        '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   правки по формам
232
  		        'buttonContent'   => $send,
be2b3be7   alex   правки по формам
233
  		        'sendEmail'       => true,
69768df7   alex   правки по формам
234
  		        'email'           => 'buh.artplast@gmail.com',
4ab98ba2   alex   правки по формам
235
  		        'subject'         => 'Новая заявка',
be2b3be7   alex   правки по формам
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
  		        '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   правки по формам
287
288
289
290
291
  			        ],
  			        [
  			        	['name','phone'],
  				        'string'
  			        ],
be2b3be7   alex   правки по формам
292
293
294
295
296
297
298
299
300
301
  		        ],
  		        'labels'     => [
  			        'message'   => 'Message',
  			        'name'    => 'Name',
  			        'phone'   => 'Phone'
  		        ],
  
  		        'inputOptions'    => [
  			        'name'   => [
  				        'template' => '<div class="col-sm-12">{input}</div>',
df90a7cb   alex   правки по формам
302
303
304
  				        'labelOptions' => [ 'class' => 'callback_text_input_label'],
  
  
be2b3be7   alex   правки по формам
305
306
307
308
309
310
311
312
313
314
315
316
317
  			        ],
  			        '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   правки по формам
318
  
d23c67c0   alex   правки по формам
319
  		        'buttonContent'   => $send,
e095876b   alex   правки по формам
320
  		        'sendEmail'       => true,
69768df7   alex   правки по формам
321
  		        'email'           => 'buh.artplast@gmail.com',
4ab98ba2   alex   правки по формам
322
  		        'subject'         => 'Новая заявка',
e095876b   alex   правки по формам
323
324
325
326
327
328
  		        'ajax'            => true,
  		        'formId'          => 'contact-form',
  		        'scenario'        => 'callback',
  		        'successCallback' => 'function (data) {
                               document.getElementById("contact-form").reset();
                                 
69768df7   alex   правки по формам
329
                      
e095876b   alex   правки по формам
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
                                  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
349
  
e095876b   alex   правки по формам
350
  	        ],
c420c609   alex   first commit
351
352
353
354
355
  
  
  
          ],
          'components'          => [
701eaaed   alex   add Cookie modal ...
356
  
c420c609   alex   first commit
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
              '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,
      ];