| 1 |
<?php |
| 2 |
namespace Elementor\Core\Page_Assets\Data_Managers\Font_Icon_Svg; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly. |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* E-Icons Svg. |
| 10 |
* |
| 11 |
* @since 3.5.0 |
| 12 |
*/ |
| 13 |
class E_Icons extends Base { |
| 14 |
const LIBRARY_CURRENT_VERSION = '5.13.0'; |
| 15 |
|
| 16 |
protected function get_config( $icon ) { |
| 17 |
return [ |
| 18 |
'key' => $icon['value'], |
| 19 |
'version' => self::LIBRARY_CURRENT_VERSION, |
| 20 |
'file_path' => ELEMENTOR_ASSETS_PATH . 'lib/eicons/eicons.json', |
| 21 |
'data' => [ |
| 22 |
'icon_data' => [ |
| 23 |
'name' => $icon['value'], |
| 24 |
'library' => $icon['library'], |
| 25 |
], |
| 26 |
], |
| 27 |
]; |
| 28 |
} |
| 29 |
|
| 30 |
protected function get_asset_content() { |
| 31 |
$icon_data = $this->get_config_data( 'icon_data' ); |
| 32 |
|
| 33 |
$file_data = json_decode( $this->get_file_data( 'content', $icon_data['library'] ), true ); |
| 34 |
|
| 35 |
$icon_name = str_replace( 'eicon-', '', $icon_data['name'] ); |
| 36 |
|
| 37 |
$svg_data = $file_data[ $icon_name ]; |
| 38 |
|
| 39 |
return [ |
| 40 |
'width' => $svg_data['width'], |
| 41 |
'height' => $svg_data['height'], |
| 42 |
'path' => $svg_data['path'], |
| 43 |
'key' => $this->get_key(), |
| 44 |
]; |
| 45 |
} |
| 46 |
} |
| 47 |
|