From db6035f8445001bd89ddcaf8b3b3f7bbc0930fb6 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 15 Nov 2021 13:51:01 -0800 Subject: [PATCH] Experimental embedding of FA svg. --- e107_core/shortcodes/single/glyph.php | 2 +- e107_handlers/e_parse_class.php | 21 +++++++++++++++++++++ e107_plugins/social/e_shortcode.php | 18 ++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/e107_core/shortcodes/single/glyph.php b/e107_core/shortcodes/single/glyph.php index 9455288c9..1a1cdbef4 100644 --- a/e107_core/shortcodes/single/glyph.php +++ b/e107_core/shortcodes/single/glyph.php @@ -1,7 +1,7 @@ '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('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)