1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Bootstrap 4 toBadge() fix.

This commit is contained in:
Cameron
2019-06-20 11:33:05 -07:00
parent 5a1a1def12
commit 6eb730ff69
2 changed files with 8 additions and 4 deletions

View File

@@ -4213,16 +4213,20 @@ class e_parser
/** /**
* Return a Bootstrap Badge tag
* @param $text * @param $text
* @return string * @return string
*/ */
public function toBadge($text) public function toBadge($text, $parm=null)
{ {
return "<span class='badge'>".$text."</span>"; $class = !empty($parm['class']) ? " ".$parm['class'] : ' badge-secondary';
return "<span class='badge".$class."'>".$text."</span>";
} }
/** /**
* Return a Bootstrap Label tag
* @param $text * @param $text
* @return string * @return string
*/ */

View File

@@ -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')) 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) $this->cat('news_count');
} }
return (string) e107::getParser()->toBadge( $this->cat('news_count')); return (string) e107::getParser()->toBadge( $this->cat('news_count'), $parm);
} }
} }