Skip to content

Commit

Permalink
Fix bug news pagination (frontend)
Browse files Browse the repository at this point in the history
* Update global function for stricte mode
  • Loading branch information
gtraxx committed Feb 18, 2019
1 parent d480ec9 commit 7396053
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 34 deletions.
4 changes: 2 additions & 2 deletions admin/template/widget/function.autoload_i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
3 changes: 2 additions & 1 deletion app/backend/controller/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions app/backend/model/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions app/frontend/db/news.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
61 changes: 34 additions & 27 deletions lib/magepattern/component/helpers/headLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,47 +89,54 @@ private function endLink(){
return ' />'.PHP_EOL;
}
}
/**
*
* helpers_headLink::linkStyleSheet()
* <link rel="stylesheet" type="text/css" href="http://mydomaine.com/styles.css" media="screen" />
*
* @param string $href
* @param string media
*/

/**
*
* helpers_headLink::linkStyleSheet()
* <link rel="stylesheet" type="text/css" href="http://mydomaine.com/styles.css" media="screen" />
*
* @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()
* <link rel="alternate" type="application/rss+xml" href="http://mydomaine.com/rss.xml" />
*
* @param string $href
*/

/**
*
* helpers_headLink::linkRss()
* <link rel="alternate" type="application/rss+xml" href="http://mydomaine.com/rss.xml" />
*
* @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();
}
}
}
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.'"';
}
}

0 comments on commit 7396053

Please sign in to comment.