1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 00:54:49 +02:00

Experimental embedding of FA svg.

This commit is contained in:
Cameron
2021-11-15 13:51:01 -08:00
parent 20631296c5
commit db6035f844
3 changed files with 40 additions and 1 deletions

View File

@@ -3783,6 +3783,27 @@ class e_parse
case "fas":
$prefix = $cat.' ';
$id = str_replace($cat.'-', 'fa-', $id);
/** @experimental - subject to removal at any time. */
if(!empty($parm['embed']))
{
$dirs = ['far'=>'regular', 'fab'=>'brands', 'fas'=>'solid'];
$path = e_WEB.'lib/font-awesome/5/svgs/';
$path .= $dirs[$cat].'/';
$path .= str_replace('fa-','',$id).".svg";
if($ret = file_get_contents($path))
{
$class = 'svg-inline--fa ';
$class .= $id;
$class .= ' fa-w-16';
$class .= !empty($parm['fw']) ? ' fa-fw' : '';
return str_replace('<svg', '<svg class="'.$class.'" role="img" ', $ret);
}
}
break;
case "fa":