From 739605384248f4998f51d0aca0305b16bcc073e8 Mon Sep 17 00:00:00 2001 From: gtraxx Date: Mon, 18 Feb 2019 12:35:20 +0100 Subject: [PATCH] Fix bug news pagination (frontend) * Update global function for stricte mode --- .../widget/function.autoload_i18n.php | 4 +- app/backend/controller/plugins.php | 3 +- app/backend/model/plugins.php | 4 +- app/frontend/db/news.php | 6 +- .../component/helpers/headLink.php | 61 +++++++++++-------- 5 files changed, 44 insertions(+), 34 deletions(-) diff --git a/admin/template/widget/function.autoload_i18n.php b/admin/template/widget/function.autoload_i18n.php index 65387d88..e83820f8 100644 --- a/admin/template/widget/function.autoload_i18n.php +++ b/admin/template/widget/function.autoload_i18n.php @@ -17,8 +17,8 @@ * @return string */ function smarty_function_autoload_i18n($params, $template){ - backend_model_template::configLoad( + $coreTemplate = new backend_model_template(); + return $coreTemplate->configLoad( 'local_fr.conf' ); - //backend_model_language::current_Language() } \ No newline at end of file diff --git a/app/backend/controller/plugins.php b/app/backend/controller/plugins.php index d302b429..6c4dfe77 100644 --- a/app/backend/controller/plugins.php +++ b/app/backend/controller/plugins.php @@ -84,7 +84,8 @@ private function setNotRegisterItems(){ $newsItems[]=$plugin; } } - component_format_array::array_sortBy('title', $newsItems); + $coreComponent = new component_format_array(); + $coreComponent->array_sortBy('title', $newsItems); return $newsItems; } diff --git a/app/backend/model/plugins.php b/app/backend/model/plugins.php index e13df7af..9dbbc663 100644 --- a/app/backend/model/plugins.php +++ b/app/backend/model/plugins.php @@ -88,8 +88,8 @@ private function setItems($config){ break; } } - - component_format_array::array_sortBy('title', $newsItems); + $coreComponent = new component_format_array(); + $coreComponent->array_sortBy('title', $newsItems); return $newsItems; } diff --git a/app/frontend/db/news.php b/app/frontend/db/news.php index 69f45d07..b6809086 100644 --- a/app/frontend/db/news.php +++ b/app/frontend/db/news.php @@ -151,7 +151,8 @@ public function fetchData($config, $params = false) WHERE tag.id_lang = :id_lang AND tag.name_tag LIKE :name_tag'; break; case 'prev_page': - $sql = "SELECT c.name_news, + $sql = "SELECT c.id_news, + c.name_news, c.url_news, c.resume_news, c.content_news, @@ -171,7 +172,8 @@ public function fetchData($config, $params = false) ORDER BY c.date_publish DESC LIMIT 1"; break; case 'next_page': - $sql = "SELECT c.name_news, + $sql = "SELECT c.id_news, + c.name_news, c.url_news, c.resume_news, c.content_news, diff --git a/lib/magepattern/component/helpers/headLink.php b/lib/magepattern/component/helpers/headLink.php index 15023965..d476f499 100755 --- a/lib/magepattern/component/helpers/headLink.php +++ b/lib/magepattern/component/helpers/headLink.php @@ -89,26 +89,30 @@ private function endLink(){ return ' />'.PHP_EOL; } } - /** - * - * helpers_headLink::linkStyleSheet() - * - * - * @param string $href - * @param string media - */ + + /** + * + * helpers_headLink::linkStyleSheet() + * + * + * @param string $href + * @param string media + * @return string + */ public static function linkStyleSheet($href,$media='screen'){ if(self::getInstance()){ return self::getInstance()->startLink().link_rel::stylesheet($href,$media).self::getInstance()->endLink(); } } - /** - * - * helpers_headLink::linkRss() - * - * - * @param string $href - */ + + /** + * + * helpers_headLink::linkRss() + * + * + * @param string $href + * @return string + */ public static function linkRss($href){ if(self::getInstance()){ return self::getInstance()->startLink().link_rel::alternate(self::application.self::rss,$href).' title="RSS"'.self::getInstance()->endLink(); @@ -116,20 +120,23 @@ public static function linkRss($href){ } } abstract class link_rel{ - /** - * Protected define alternate params - * @param string $type - * @param string $href - */ - protected function alternate($type,$href){ + /** + * Protected define alternate params + * @param string $type + * @param string $href + * @return string + */ + protected static function alternate($type,$href){ return 'rel="alternate" type="'.$type.'" href="'.$href.'"'; } - /** - * Protected define alternate params - * @param string $type - * @param string $media - */ - protected function stylesheet($href,$media){ + + /** + * Protected define alternate params + * @param string $type + * @param string $media + * @return string + */ + protected static function stylesheet($href,$media){ return 'rel="stylesheet" type="text/css" href="'.$href.'" media="'.$media.'"'; } } \ No newline at end of file