PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.1.9
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.1.9
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / inc / modules / utilities / icons-extended / icons-extended.php

icons-extended.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.1.9, at inc/modules/utilities/icons-extended/icons-extended.php

145 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MasterAddons\Modules\Utilities;
4
5 use \Elementor\Controls_Manager;
6 use \MasterAddons\Inc\Classes\Helper;
7
8 /**
9 * Author Name: Liton Arefin
10 * Author URL: https://jeweltheme.com
11 * Date: 6/5/2021
12 */
13
14 if (!defined('ABSPATH')) {
15 exit;
16 } // Exit if accessed directly.
17
18 if (!class_exists('MasterAddons\Modules\Utilities\IconsExtended')) {
19 class IconsExtended
20 {
21
22 /*
23 * Instance of this class
24 */
25 private static $instance = null;
26
27 public function __construct()
28 {
29 // Add new Icons to Icons Manager
30 add_filter('elementor/icons_manager/additional_tabs', [$this, 'jltma_add_icons_manager_tab'], 100, 3);
31 }
32
33 // Add Section Controls
34 public function jltma_add_icons_manager_tab($tabs)
35 {
36 // Adds Icons Library options
37 // Ensure proper URL formatting with trailing slash
38 $assets_url = trailingslashit(JLTMA_URL) . 'assets/';
39
40 $tabs['elementor-icons'] = [
41 'name' => 'elementor-icons',
42 'label' => __('Elementor Icons', 'master-addons' ),
43 'prefix' => 'eicon-',
44 'displayPrefix' => 'elementor-icons',
45 'labelIcon' => 'jltma-icon jltma-icon-ma elementor-icons eicon eicon-elementor-circle jltma-font-manager',
46 'ver' => JLTMA_VER,
47 'fetchJson' => $assets_url . 'fonts/elementor-icon/elementor-icons.js?v=' . JLTMA_VER,
48 'native' => true,
49 ];
50
51 $tabs['simple-line-icons'] = [
52 'name' => 'simple-line-icons',
53 'label' => __('Simple Line Icons', 'master-addons' ),
54 'url' => $assets_url . 'fonts/simple-line-icons/simple-line-icons.css',
55 'enqueue' => [$assets_url . 'fonts/simple-line-icons/simple-line-icons.css'],
56 'prefix' => 'icon-',
57 'displayPrefix' => 'simple-line-icons',
58 'labelIcon' => 'jltma-icon jltma-icon-ma simple-line-icons icon-heart jltma-font-manager',
59 'ver' => JLTMA_VER,
60 'fetchJson' => $assets_url . 'fonts/simple-line-icons/simple-line-icons.js?v=' . JLTMA_VER,
61 'native' => false,
62 ];
63
64 $tabs['iconic-fonts'] = [
65 'name' => 'iconic-fonts',
66 'label' => __('Iconic Font Icons', 'master-addons' ),
67 'url' => $assets_url . 'fonts/iconic-fonts/iconic-font.min.css',
68 'enqueue' => [$assets_url . 'fonts/iconic-fonts/iconic-font.min.css'],
69 'prefix' => 'im-',
70 'displayPrefix' => 'im',
71 'labelIcon' => 'jltma-icon jltma-icon-ma iconic-fonts im im-flag jltma-font-manager',
72 'ver' => JLTMA_VER,
73 'fetchJson' => $assets_url . 'fonts/iconic-fonts/iconic-fonts.js?v=' . JLTMA_VER,
74 'native' => false,
75 ];
76
77 $tabs['linear-icons'] = [
78 'name' => 'linear-icons',
79 'label' => __('Linear Icons', 'master-addons' ),
80 'url' => $assets_url . 'fonts/linear-icons/linear-icons.css',
81 'enqueue' => [$assets_url . 'fonts/linear-icons/linear-icons.css'],
82 'prefix' => 'lnr-',
83 'displayPrefix' => 'lnr',
84 'labelIcon' => 'jltma-icon jltma-icon-ma linear-icons lnr lnr-flag jltma-font-manager',
85 'ver' => JLTMA_VER,
86 'fetchJson' => $assets_url . 'fonts/linear-icons/linear-icons.js?v=' . JLTMA_VER,
87 'native' => false,
88 ];
89
90 $tabs['material-icons'] = [
91 'name' => 'material-icons',
92 'label' => __('Material Icons', 'master-addons' ),
93 'url' => $assets_url . 'fonts/material-icons/material-icons.css',
94 'enqueue' => [$assets_url . 'fonts/material-icons/material-icons.css'],
95 'prefix' => 'jltma-material-icon-',
96 'displayPrefix' => 'jltma-material-icon',
97 'labelIcon' => 'jltma-icon jltma-icon-ma material-icons jltma-material-icon-flag jltma-font-manager',
98 'ver' => JLTMA_VER,
99 'fetchJson' => $assets_url . 'fonts/material-icons/material-icons.js?v=' . JLTMA_VER,
100 'native' => false,
101 ];
102
103
104 // Pro Icon Libraries - filtered through Pro_Modules.php
105 $pro_icons = apply_filters('master_addons/modules/icons_extended/pro_icons', [], $assets_url);
106 foreach ($pro_icons as $key => $icon_config) {
107 $tabs[$key] = $icon_config;
108 }
109
110 // Check Enabled Icons Libraries - only filter MA's own icon tabs
111 $jltma_get_icons_library_settings = \MasterAddons\Inc\Admin\Settings\Settings::get_icons() ?: [];
112 $jltma_icon_keys = [
113 'elementor-icons', 'simple-line-icons', 'iconic-fonts',
114 'linear-icons', 'material-icons',
115 ];
116 // Include pro icon keys if any
117 foreach ($pro_icons as $key => $icon_config) {
118 $jltma_icon_keys[] = $key;
119 }
120
121 // Remove disabled MA icon libraries, but keep all other tabs intact
122 foreach ($jltma_icon_keys as $key) {
123 if (!isset($jltma_get_icons_library_settings[$key]) || $jltma_get_icons_library_settings[$key] != 1) {
124 unset($tabs[$key]);
125 }
126 }
127
128 return $tabs;
129 }
130
131
132 public static function get_instance()
133 {
134 if (!self::$instance) {
135 self::$instance = new self;
136 }
137 return self::$instance;
138 }
139 }
140 }
141
142 if (class_exists('MasterAddons\Modules\Utilities\IconsExtended')) {
143 IconsExtended::get_instance();
144 }
145