@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | if ($this->translateModel && defined('LANG')) { |
41 | 41 | // Если есть массив переводов и установлена константа активного языка или другого языка |
42 | - if(self::$custom_lang){ |
|
42 | + if (self::$custom_lang) { |
|
43 | 43 | self::setLang(self::$custom_lang); |
44 | 44 | } else { |
45 | 45 | self::setLang(LANG); // Устанавливаем текущий язык |
@@ -53,7 +53,7 @@ |
||
53 | 53 | { |
54 | 54 | $save = []; |
55 | 55 | $languages = Language::find(); |
56 | - foreach($languages as $lang) { |
|
56 | + foreach ($languages as $lang) { |
|
57 | 57 | $save[$lang->getIso()] = [""=>""]; |
58 | 58 | } |
59 | 59 |
@@ -15,23 +15,23 @@ discard block |
||
15 | 15 | |
16 | 16 | public function initialize() |
17 | 17 | { |
18 | - $this->cacheViewKey = HOST_HASH . md5('Sitemap\Model\Sitemap'); |
|
18 | + $this->cacheViewKey = HOST_HASH . md5('Sitemap\Model\Sitemap'); |
|
19 | 19 | |
20 | 20 | $this->models = [ |
21 | 21 | [ |
22 | 22 | 'class' => 'Publication', |
23 | 23 | 'model' => 'Publication', |
24 | 24 | 'where' => "", // preview_inner='0' , etc. |
25 | - 'getLink' => function($model, $lang){ |
|
25 | + 'getLink' => function ($model, $lang) { |
|
26 | 26 | return $this->langUrlCustom([ |
27 | 27 | 'for' => 'publication', |
28 | 28 | 'type' => $model->getTypeSlug(), |
29 | 29 | 'slug' => $model->getSlug()], $lang); |
30 | 30 | } |
31 | - ],[ |
|
31 | + ], [ |
|
32 | 32 | 'class' => 'Page', |
33 | 33 | 'model' => 'Page', |
34 | - 'getLink' => function($model, $lang){ |
|
34 | + 'getLink' => function ($model, $lang) { |
|
35 | 35 | return $this->langUrlCustom([ |
36 | 36 | 'for' => 'page', |
37 | 37 | 'slug' => $model->getSlug()], $lang); |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | |
44 | 44 | public function indexAction() |
45 | 45 | { |
46 | - $this->view->setRenderLevel( \Phalcon\Mvc\View::LEVEL_NO_RENDER ); |
|
46 | + $this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_NO_RENDER); |
|
47 | 47 | $cache = $this->getDi()->get('cache'); |
48 | 48 | $sitemap_xml = $cache->get($this->cacheViewKey); |
49 | 49 | |
50 | - if(!$sitemap_xml){ |
|
50 | + if (!$sitemap_xml) { |
|
51 | 51 | $langs = Language::find(['columns' => 'iso,primary']); |
52 | 52 | |
53 | 53 | //link(s) for main-page(s) |
54 | - foreach ($langs as $lang){ |
|
54 | + foreach ($langs as $lang) { |
|
55 | 55 | $suffix = !$lang['primary'] ? $lang['iso'] . '/' : ''; |
56 | 56 | $this->links[] = [ |
57 | - 'url' => 'http://' . $_SERVER['HTTP_HOST'] . '/' . $suffix, |
|
58 | - 'updated_at' => date('c',time()), |
|
57 | + 'url' => 'http://' . $_SERVER['HTTP_HOST'] . '/' . $suffix, |
|
58 | + 'updated_at' => date('c', time()), |
|
59 | 59 | ]; |
60 | 60 | } |
61 | 61 | |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | foreach ($langs as $lang) { |
69 | 69 | foreach ($rows as $row) { |
70 | 70 | $row::setCustomLang($lang->iso); |
71 | - if($row->getSlug() !== 'index' && $row->getTitle()){ |
|
71 | + if ($row->getSlug() !== 'index' && $row->getTitle()) { |
|
72 | 72 | $this->links[] = [ |
73 | - 'url' => 'http://' . $_SERVER['HTTP_HOST'] . $m['getLink']($row, $lang->iso), |
|
73 | + 'url' => 'http://' . $_SERVER['HTTP_HOST'] . $m['getLink']($row, $lang->iso), |
|
74 | 74 | 'updated_at' => date('c', strtotime($row->getUpdatedAt())), |
75 | 75 | ]; |
76 | 76 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | private function getRawXml() |
99 | 99 | { |
100 | - $this->view->setRenderLevel( \Phalcon\Mvc\View::LEVEL_ACTION_VIEW ); |
|
100 | + $this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_ACTION_VIEW); |
|
101 | 101 | $this->view->links = $this->links; |
102 | 102 | $this->view->start(); |
103 | 103 | $this->view->setLayoutsDir('../views/'); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $typeLimit = ($typeModel->getLimit()) ? $typeModel->getLimit() : 10; |
23 | 23 | $limit = $this->request->getQuery('limit', 'string', $typeLimit); |
24 | 24 | if ($limit != 'all') { |
25 | - $paginatorLimit = (int)$limit; |
|
25 | + $paginatorLimit = (int) $limit; |
|
26 | 26 | } else { |
27 | 27 | $paginatorLimit = 9999; |
28 | 28 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $slug, |
21 | 21 | $lang |
22 | 22 | |
23 | - ], function() use ($slug, $lang, $lifeTime) { |
|
23 | + ], function () use ($slug, $lang, $lifeTime) { |
|
24 | 24 | $columns = [ |
25 | 25 | 'p.*', |
26 | 26 | 't_slug' => 't.slug' |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $lang = ($lang) ? $lang : LANG; |
48 | 48 | |
49 | 49 | $fields = []; |
50 | - foreach($this->translateFields as $field) { |
|
50 | + foreach ($this->translateFields as $field) { |
|
51 | 51 | $fields[] = "(SELECT tr.value FROM [$this->translateModel] AS tr WHERE tr.foreign_id = p.id AND tr.lang = '$lang' AND tr.key = '$field') AS $field"; |
52 | 52 | } |
53 | 53 | return $fields; |
@@ -20,9 +20,9 @@ |
||
20 | 20 | $slug, |
21 | 21 | $lang |
22 | 22 | |
23 | - ], function() use ($slug, $lang, $lifeTime) { |
|
23 | + ], function () use ($slug, $lang, $lifeTime) { |
|
24 | 24 | $columns = ['p.*']; |
25 | - foreach($this->translateFields as $field) { |
|
25 | + foreach ($this->translateFields as $field) { |
|
26 | 26 | $columns[] = "(SELECT t.value FROM [$this->translateModel] AS t WHERE t.foreign_id = p.id AND t.lang = '$lang' AND t.key = '$field') AS $field"; |
27 | 27 | } |
28 | 28 |
@@ -109,8 +109,7 @@ discard block |
||
109 | 109 | $this->changeAttributesInAccordanceWithStretch(); |
110 | 110 | } |
111 | 111 | $this->attributes['alt'] = (isset($this->attributes['alt'])) ? |
112 | - htmlspecialchars($this->attributes['alt'], ENT_QUOTES) : |
|
113 | - ''; |
|
112 | + htmlspecialchars($this->attributes['alt'], ENT_QUOTES) : ''; |
|
114 | 113 | } |
115 | 114 | |
116 | 115 | private function changeAttributesInAccordanceWithStretch() |
@@ -239,7 +238,7 @@ discard block |
||
239 | 238 | */ |
240 | 239 | public function isExists() |
241 | 240 | { |
242 | - return (file_exists($this->getAbsPath(true))) ? true : false ; |
|
241 | + return (file_exists($this->getAbsPath(true))) ? true : false; |
|
243 | 242 | } |
244 | 243 | |
245 | 244 | /** |