1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 12:11:55 +02:00

Fix cognitive complexity warning in news_shortcodes::sc_newsnavlink()

This commit is contained in:
Nick Liu 2020-11-28 12:09:21 +01:00
parent ef06f382cb
commit c0db7909ed
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637

View File

@ -202,7 +202,8 @@ class news_shortcodes extends e_shortcode
*/
function sc_newsnavlink($parm=null) //TODO add more options.
{
$url = e107::getUrl()->create('news/list/items'); // default for now.
if(varset($parm['list']) == 'all') // A list of all items - usually headings and thumbnails
{
$url = e107::getUrl()->create('news/list/all');
@ -215,12 +216,7 @@ class news_shortcodes extends e_shortcode
{
$url = e107::getUrl()->create('news/list/category', $this->news_item);
}
else
{
$url = e107::getUrl()->create('news/list/items'); // default for now.
}
$caption = vartrue($parm['text'],LAN_BACK);
$text = '<ul class="pager hidden-print">