mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Experimental embedding of FA svg.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
function glyph_shortcode($parm = '')
|
||||
function glyph_shortcode($parm = null)
|
||||
{
|
||||
if(!is_array($parm))
|
||||
{
|
||||
|
@@ -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":
|
||||
|
@@ -160,6 +160,24 @@ class social_shortcodes extends e_shortcode
|
||||
return $this->var['class'];
|
||||
}
|
||||
|
||||
/** @experimental inline svg - subject to removal at any time */
|
||||
public function sc_xurl_icons_svg($parm=null)
|
||||
{
|
||||
$path = e_WEB.'lib/font-awesome/5/svgs/brands/';
|
||||
$path .= $this->var['id'].".svg";
|
||||
|
||||
if(!file_exists($path))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if($ret = file_get_contents($path))
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
function sc_social_login($parm=null)
|
||||
|
Reference in New Issue
Block a user