Commit 54330e07a522bb927b6c22b722be68523ffaea68

Authored by Administrator
1 parent d3b9384a

29.06.16

Showing 1 changed file with 35 additions and 1 deletions   Show diff stats
frontend/widgets/Seo.php
... ... @@ -51,7 +51,41 @@ class Seo extends Widget
51 51  
52 52 switch ($this->row) {
53 53 case self::SEO_TEXT:
54   - return $this->selectSeoData(self::SEO_TEXT);
  54 +
  55 +
  56 + $filter = \Yii::$app->request->get('filter', []);
  57 + $sort = \Yii::$app->request->get('sort', []);
  58 + $paginate = \Yii::$app->request->get('page', []);
  59 +
  60 + if(empty($filter) && empty($sort) && empty($paginate) ){
  61 +
  62 + return $this->selectSeoData(self::SEO_TEXT);
  63 +
  64 + } else {
  65 +
  66 + $widgetData = $this->findSeoByUrl();
  67 +
  68 + $result = '';
  69 +
  70 + if ($widgetData instanceof \common\models\Seo) {
  71 +
  72 + $result = $widgetData->{self::SEO_TEXT};
  73 +
  74 + } else {
  75 +
  76 + $widgetData = $this->findSeoByDynamic();
  77 +
  78 + if ($widgetData instanceof SeoDynamic) {
  79 +
  80 + $result = $widgetData->{self::SEO_TEXT};
  81 +
  82 + }
  83 +
  84 + }
  85 +
  86 + return $this->replaceData($result);
  87 + }
  88 +
55 89  
56 90 break;
57 91 case self::H1:
... ...