Skip to content

Commit

Permalink
fix duplicate function declaration and made new function default to o…
Browse files Browse the repository at this point in the history
…ld behavior
  • Loading branch information
nkissebe committed May 8, 2024
1 parent 86cb2cb commit 386f22f
Showing 1 changed file with 17 additions and 32 deletions.
49 changes: 17 additions & 32 deletions core/components/com_resources/helpers/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,46 +413,31 @@ public function getTagUsage($tag, $rtrn='id')
return $this->_db->loadColumn();
}

/**
* Get a tag cloud for an object
*
* @param integer $limit
* @param string $tagstring
* @param integer $maxTagCount -- max count of tags that can be searched
* @return string
*/
public function getTopTagCloud($limit, $tagstring='', $maxTagCount=5)
{
$tagArray = explode(",", $tagstring);

// check that we haven't been handed too many tags to search:
if (count($tagArray) > $maxTagCount)
{
// nope, too many, don't search:
$retval = null;
}
else
// ok, search for the tags:
{
$tags = $this->getTopTags($limit);
$retval = $this->buildTopCloud($tags, 'alpha', 0, $tagstring);
}
return $retval;
}


/**
* Get a tag cloud for an object
*
*
* @param integer $limit
* @param string $tagstring
* @param integer $maxTagCount -- max count of tags that can be searched
* @return string
*/
public function getTopTagCloud($limit, $tagstring='')
public function getTopTagCloud($limit, $tagstring='', $maxTagCount=null)
{
$tags = $this->getTopTags($limit);
$tagArray = explode(",", $tagstring);

return $this->buildTopCloud($tags, 'alpha', 0, $tagstring);
// check that we haven't been handed too many tags to search:
if ( ($maxTagCount != null) && (count($tagArray) > $maxTagCount))
{
// nope, too many, don't search:
$retval = null;
}
else
// ok, search for the tags:
{
$tags = $this->getTopTags($limit);
$retval = $this->buildTopCloud($tags, 'alpha', 0, $tagstring);
}
return $retval;
}

/**
Expand Down

0 comments on commit 386f22f

Please sign in to comment.