From 6eb730ff69588ca4e7363fa0fd3944704d090124 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 20 Jun 2019 11:33:05 -0700 Subject: [PATCH] Bootstrap 4 toBadge() fix. --- e107_handlers/e_parse_class.php | 8 ++++++-- e107_handlers/news_class.php | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 6b9c0ae04..d9386649c 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -4213,16 +4213,20 @@ class e_parser /** + * Return a Bootstrap Badge tag * @param $text * @return string */ - public function toBadge($text) + public function toBadge($text, $parm=null) { - return "".$text.""; + $class = !empty($parm['class']) ? " ".$parm['class'] : ' badge-secondary'; + + return "".$text.""; } /** + * Return a Bootstrap Label tag * @param $text * @return string */ diff --git a/e107_handlers/news_class.php b/e107_handlers/news_class.php index 38c84960c..71aed0111 100644 --- a/e107_handlers/news_class.php +++ b/e107_handlers/news_class.php @@ -1000,7 +1000,7 @@ class e_news_category_item extends e_front_model } } - public function sc_news_category_news_count($parm = '') + public function sc_news_category_news_count($parm = null) { if(!$this->is('category_news_count')) { @@ -1012,7 +1012,7 @@ class e_news_category_item extends e_front_model return (string) $this->cat('news_count'); } - return (string) e107::getParser()->toBadge( $this->cat('news_count')); + return (string) e107::getParser()->toBadge( $this->cat('news_count'), $parm); } }