Commit 19a587356412029c6bb91260a47c55a0efa991de
Merge remote-tracking branch 'origin/master'
Showing
3 changed files
with
43 additions
and
2 deletions
Show diff stats
frontend/config/main.php
@@ -130,6 +130,8 @@ | @@ -130,6 +130,8 @@ | ||
130 | setTimeout(function(){$(".success_").animate({opacity: 0, top: \'0\'}, 200,function(){ | 130 | setTimeout(function(){$(".success_").animate({opacity: 0, top: \'0\'}, 200,function(){ |
131 | $(this).removeClass("done_"); | 131 | $(this).removeClass("done_"); |
132 | })}, 4000); | 132 | })}, 4000); |
133 | + var data = $("#feedback-form").data(\'yiiActiveForm\'); | ||
134 | + data.validated = false; | ||
133 | } | 135 | } |
134 | 136 | ||
135 | }', | 137 | }', |
1 | +<?php | ||
2 | + | ||
3 | + namespace frontend\helpers; | ||
4 | + | ||
5 | + | ||
6 | + class Url extends \artbox\core\helpers\Url | ||
7 | + { | ||
8 | + /** | ||
9 | + * @param bool $scheme | ||
10 | + * @param string $languagesClass | ||
11 | + * | ||
12 | + * @return string | ||
13 | + * @throws \yii\base\InvalidConfigException | ||
14 | + * @throws \yii\di\NotInstantiableException | ||
15 | + */ | ||
16 | + public static function home($scheme = false, $languagesClass = 'artbox\core\services\Languages') | ||
17 | + { | ||
18 | + /** | ||
19 | + * @var \artbox\core\services\Languages $languages | ||
20 | + * @var \artbox\core\seo\UrlManager $urlManager | ||
21 | + */ | ||
22 | + $languages = \Yii::$container->get($languagesClass); | ||
23 | + | ||
24 | + $url = '/' . $languages->getCurrent()->url; | ||
25 | + | ||
26 | + $urlManager = \Yii::$app->urlManager; | ||
27 | + | ||
28 | + if (( $languages->getCurrent()->id === $languages->getDefault( | ||
29 | + )->id ) && $urlManager->hideDefaultLanguagePrefix) { | ||
30 | + $url = '/'; | ||
31 | + } | ||
32 | + | ||
33 | + if ($scheme !== false) { | ||
34 | + $url = $urlManager->getHostInfo() . $url; | ||
35 | + } | ||
36 | + | ||
37 | + return $url; | ||
38 | + } | ||
39 | + } | ||
0 | \ No newline at end of file | 40 | \ No newline at end of file |
frontend/views/layouts/main.php
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | use yii\bootstrap\Nav; | 23 | use yii\bootstrap\Nav; |
24 | use yii\bootstrap\Html; | 24 | use yii\bootstrap\Html; |
25 | use yii\db\ActiveQuery; | 25 | use yii\db\ActiveQuery; |
26 | - use artbox\core\helpers\Url; | 26 | + use frontend\helpers\Url; |
27 | use yii\web\View; | 27 | use yii\web\View; |
28 | use yii\widgets\Breadcrumbs; | 28 | use yii\widgets\Breadcrumbs; |
29 | 29 | ||
@@ -422,7 +422,7 @@ _________________________________________________________ --> | @@ -422,7 +422,7 @@ _________________________________________________________ --> | ||
422 | 'homeLink'=> | 422 | 'homeLink'=> |
423 | [ | 423 | [ |
424 | 'label'=>\Yii::t('app','Home'), | 424 | 'label'=>\Yii::t('app','Home'), |
425 | - 'url'=>\Yii::$app->homeUrl | 425 | + 'url'=> Url::home() |
426 | ] | 426 | ] |
427 | ] | 427 | ] |
428 | ) ?> | 428 | ) ?> |