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