mirror of
https://github.com/e107inc/e107.git
synced 2025-08-18 12:21:45 +02:00
Merge pull request #449 from Axeia/master
Added alt text to news category icons and fixed double ID bug (so at least that part is valid HTML)
This commit is contained in:
@@ -406,8 +406,7 @@ class news_shortcodes extends e_shortcode
|
||||
$src = (is_readable(e_IMAGE_ABS."newspost_images/".$category_icon)) ? e_IMAGE_ABS."newspost_images/".$category_icon : e_IMAGE_ABS."icons/".$category_icon;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$alt_text = e107::getParser()->toHTML($this->news_item['category_name'], FALSE ,'defs');
|
||||
//TODO - remove inline styles
|
||||
if($this->param['caticon'] == ''){$this->param['caticon'] = 'border:0px';}
|
||||
|
||||
@@ -418,12 +417,12 @@ class news_shortcodes extends e_shortcode
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return "<img class='news_image' src='{$src}' alt='' style='".$this->param['caticon']."' />";
|
||||
return "<img class='news_image' src='{$src}' alt='$alt_text' style='".$this->param['caticon']."' />";
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
default:
|
||||
return "<a href='".e107::getUrl()->create('news/list/category', $this->news_item)."'><img class='img-rounded' style='".$this->param['caticon']."' src='".$src."' alt='' /></a>";
|
||||
return "<a href='".e107::getUrl()->create('news/list/category', $this->news_item)."'><img class='img-rounded' style='".$this->param['caticon']."' src='".$src."' alt='$alt_text' /></a>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -488,4 +487,4 @@ class news_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user