From e0414c83dc286c8465f1b0f9d8ee6903f4c1ccc8 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 30 Aug 2022 20:29:50 +0200 Subject: [PATCH] nettoyage module search --- module/search/search.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/module/search/search.php b/module/search/search.php index 36d6862e..b0b6c1c7 100644 --- a/module/search/search.php +++ b/module/search/search.php @@ -217,7 +217,7 @@ class search extends common { } // Articles d'une sous-page blog ou de news - if ( $this->getData([ 'module', $childId, 'posts']) + if ( $this->getData([ 'module', $childId, 'posts']) ) { foreach($this->getData(['module',$childId,'posts']) as $articleId => $article) { if($this->getData(['module',$childId,'posts',$articleId,'state']) === true) { @@ -235,8 +235,8 @@ class search extends common { } // Articles d'un blog ou de news - if ( $this->getData([ 'module', $parentId, 'posts']) - ) { + if ( $this->getData([ 'module', $parentId, 'posts']) + ) { foreach($this->getData(['module',$parentId,'posts']) as $articleId => $article) { if($this->getData(['module',$parentId,'posts',$articleId,'state']) === true) @@ -273,8 +273,8 @@ class search extends common { 'view' => 'index', 'showBarEditButton' => true, 'showPageContent' => !$this->getData(['module', $this->getUrl(0), 'config', 'resultHideContent']), - 'style' => file_exists($this->getData(['module', $this->getUrl(0), 'theme', 'style'])) - ? $this->getData(['module', $this->getUrl(0), 'theme', 'style']) + 'style' => file_exists($this->getData(['module', $this->getUrl(0), 'theme', 'style'])) + ? $this->getData(['module', $this->getUrl(0), 'theme', 'style']) : '' ]); } else { @@ -337,9 +337,4 @@ class search extends common { } } - // RequĂȘte de traduction avec le script Google - private function translate($from_lan, $to_lan, $text) { - $arrayjson = json_decode(file_get_contents('https://translate.googleapis.com/translate_a/single?client=gtx&sl='.$from_lan.'&tl=fr&dt=t&q='.$text),true); - return $arrayjson[0][0][0]; - } }