From 5b77976b870aa6d4e72c6f13d0971d58acfca8e0 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 31 Oct 2016 19:27:56 +0200 Subject: [PATCH] 14.09.16 --- frontend/widgets/Seo.php | 46 +++++++++------------------------------------- 1 file changed, 9 insertions(+), 37 deletions(-) diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php index 64b42ec..b590b41 100755 --- a/frontend/widgets/Seo.php +++ b/frontend/widgets/Seo.php @@ -101,49 +101,21 @@ class Seo extends Widget $filter = \Yii::$app->request->get('filters', []); + $default = $this->selectSeoData(self::H1); + if ($default != $this->{self::H1}) { - if (isset($filter['brands']) && count($filter['brands']) == 1) { + return $default; - $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); - if(!$model instanceof Brand){ - - \Yii::$app->response->redirect(['/site/error'],404); - } else { - if($this->selectSeoData(self::H1) == $this->category_name) { - - return $this->selectSeoData(self::H1) . ' ' . $model->name ; - }else { - - return $this->selectSeoData(self::H1); - - } - } - - - - } else if (isset($filter["naznacenie"]) && count($filter["naznacenie"]) == 1) { - - $model = TaxOption::find()->where(['alias' => $filter["naznacenie"]])->one(); - if(!$model instanceof TaxOption){ - - \Yii::$app->response->redirect(['/site/error'],404); - } else { - if($this->selectSeoData(self::H1) == $this->category_name) { - - return $this->selectSeoData(self::H1) . ' ' . $model->value->value; - }else { - - return $this->selectSeoData(self::H1); - - } - - } + } else if(!empty($filter) && !$this->checkFilter($filter)){ + $array = $this->arrayBuilder($filter); + return $this->getNameString($array); + } + else { - } else { - return $this->selectSeoData(self::H1); + return $default; } break; case self::TITLE: -- libgit2 0.21.4