1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 03:10:50 +02:00

Fix for news params in news shortcodes.

This commit is contained in:
Cameron
2016-04-28 18:13:41 -07:00
parent b9ef70678a
commit c40c909293
2 changed files with 10 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ class news_shortcodes extends e_shortcode
private $imageItem;
public $param = array();
// protected $param; // do not enable - erases param. .
function __construct($eVars = null)
@@ -381,11 +381,16 @@ class news_shortcodes extends e_shortcode
if($this->commentsDisabled || ($this->commentsEngine != 'e107'))
{
return;
return null;
}
$class = varset($parm['class']) ? " ".$parm['class'] : "";
if(empty($this->param['commentlink']))
{
$this->param['commentlink'] = e107::getParser()->toGlyph('fa-comment');
}
// When news_allow_comments = 1 then it is disabled. Backward, but that's how it is in v1.x
$text = ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "<a title='".$this->sc_newscommentcount()." comments' class='e-tip".$class."' href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$this->param['commentlink'].'</a>');
return $text;
@@ -398,7 +403,7 @@ class news_shortcodes extends e_shortcode
{
if($this->commentsDisabled || ($this->commentsEngine != 'e107'))
{
return;
return null;
}
$text = varset($parm['glyph']) ? e107::getParser()->toGlyph($parm['glyph']) : "";

View File

@@ -1357,9 +1357,9 @@ class e_shortcode
/**
* e_shortcode constructor.
*/
public function __construct()
public function __construct($eVars = null)
{
$this->scVars = new e_vars();
$this->scVars = !empty($eVars) ? $eVars : new e_vars();
}
/**