PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.6
Elementor Website Builder – more than just a page builder v3.0.6
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/controls/icons.php +28 -79 4.1.23.0.6 View file →
@@ -72,24 +72,22 @@
72 72 public function render_media_skin() {
73 73 ?>
74 74 <div class="elementor-control-field elementor-control-media">
75 75 <label class="elementor-control-title">{{{ data.label }}}</label>
76 - <div class="elementor-control-input-wrapper">
77 - <div class="elementor-control-media__content elementor-control-tag-area elementor-control-preview-area">
78 - <div class="elementor-control-media-upload-button elementor-control-media__content__upload-button">
76 + <div class="elementor-control-input-wrapper elementor-aspect-ratio-219">
77 + <div class="elementor-control-media__content elementor-control-tag-area elementor-control-preview-area elementor-fit-aspect-ratio">
78 + <div class="elementor-control-media-upload-button elementor-control-media__content__upload-button elementor-fit-aspect-ratio">
79 79 <i class="eicon-plus-circle" aria-hidden="true"></i>
80 - <span class="elementor-screen-only"><?php echo esc_html__( 'Add', 'elementor' ); ?></span>
81 80 </div>
82 - <div class="elementor-control-media-area">
83 - <div class="elementor-control-media__remove elementor-control-media__content__remove" data-tooltip="<?php echo esc_attr__( 'Remove', 'elementor' ); ?>">
84 - <i class="eicon-trash-o" aria-hidden="true"></i>
85 - <span class="elementor-screen-only"><?php echo esc_html__( 'Remove', 'elementor' ); ?></span>
81 + <div class="elementor-control-media-area elementor-fit-aspect-ratio">
82 + <div class="elementor-control-media__remove elementor-control-media__content__remove" title="<?php echo __( 'Remove', 'elementor' ); ?>">
83 + <i class="eicon-trash-o"></i>
86 84 </div>
87 - <div class="elementor-control-media__preview"></div>
85 + <div class="elementor-control-media__preview elementor-fit-aspect-ratio"></div>
88 86 </div>
89 87 <div class="elementor-control-media__tools elementor-control-dynamic-switcher-wrapper">
90 - <div class="elementor-control-icon-picker elementor-control-media__tool"><?php echo esc_html__( 'Icon Library', 'elementor' ); ?></div>
91 - <div class="elementor-control-svg-uploader elementor-control-media__tool"><?php echo esc_html__( 'Upload SVG', 'elementor' ); ?></div>
88 + <div class="elementor-control-icon-picker elementor-control-media__tool"><?php echo __( 'Icon Library', 'elementor' ); ?></div>
89 + <div class="elementor-control-svg-uploader elementor-control-media__tool"><?php echo __( 'Upload SVG', 'elementor' ); ?></div>
92 90 </div>
93 91 </div>
94 92 </div>
95 93 <# if ( data.description ) { #>
@@ -100,60 +98,33 @@
100 98 <?php
101 99 }
102 100
103 101 public function render_inline_skin() {
102 + $control_uid = $this->get_control_uid();
104 103 ?>
105 - <#
106 - const defaultSkinSettings = {
107 - none: {
108 - label: '<?php echo esc_html__( 'None', 'elementor' ); ?>',
109 - icon: 'eicon-ban',
110 - },
111 - svg: {
112 - label: '<?php echo esc_html__( 'Upload SVG', 'elementor' ); ?>',
113 - icon: 'eicon-upload',
114 - },
115 - icon: {
116 - label: '<?php echo esc_html__( 'Icon Library', 'elementor' ); ?>',
117 - icon: 'eicon-circle',
118 - }
119 - };
120 -
121 - const skinSettings = data.skin_settings.inline;
122 -
123 - const get = ( type, key ) => {
124 - if ( skinSettings[ type ] ) {
125 - return skinSettings[ type ]?.[ key ] || defaultSkinSettings[ type ][ key ];
126 - }
127 -
128 - return defaultSkinSettings[ type ][ key ];
129 - }
130 - #>
131 104 <div class="elementor-control-field elementor-control-inline-icon">
132 105 <label class="elementor-control-title">{{{ data.label }}}</label>
133 106 <div class="elementor-control-input-wrapper">
134 107 <div class="elementor-choices">
135 - <# if ( ! data.exclude_inline_options.includes( 'none' ) ) { #>
136 - <input id="<?php $this->print_control_uid(); ?>-none" type="radio" value="none">
137 - <label class="elementor-choices-label elementor-control-unit-1 tooltip-target elementor-control-icons--inline__none" for="<?php $this->print_control_uid(); ?>-none" data-tooltip="{{ get( 'none', 'label' ) }}">
138 - <i class="{{ get( 'none', 'icon' ) }}" aria-hidden="true"></i>
139 - <span class="elementor-screen-only">{{ get( 'none', 'label' ) }}</span>
108 + <input id="<?php echo $control_uid; ?>-none" type="radio" value="none">
109 + <label class="elementor-choices-label elementor-control-unit-1 tooltip-target elementor-control-icons--inline__none" for="<?php echo $control_uid; ?>-none" data-tooltip="<?php echo __( 'None', 'elementor' ); ?>" title="<?php echo __( 'None', 'elementor' ); ?>">
110 + <i class="eicon-ban" aria-hidden="true"></i>
111 + <span class="elementor-screen-only"><?php echo __( 'None', 'elementor' ); ?></span>
112 + </label>
113 + <# if ( ! data.exclude_inline_options.includes( 'svg' ) ) { #>
114 + <input id="<?php echo $control_uid; ?>-svg" type="radio" value="svg">
115 + <label class="elementor-choices-label elementor-control-unit-1 tooltip-target elementor-control-icons--inline__svg" for="<?php echo $control_uid; ?>-svg" data-tooltip="<?php echo __( 'Upload SVG', 'elementor' ); ?>" title="<?php echo __( 'Upload SVG', 'elementor' ); ?>">
116 + <i class="eicon-upload" aria-hidden="true"></i>
117 + <span class="elementor-screen-only"><?php echo __( 'Upload SVG', 'elementor' ); ?></span>
140 118 </label>
141 119 <# }
142 - if ( ! data.exclude_inline_options.includes( 'svg' ) ) { #>
143 - <input id="<?php $this->print_control_uid(); ?>-svg" type="radio" value="svg">
144 - <label class="elementor-choices-label elementor-control-unit-1 tooltip-target elementor-control-icons--inline__svg" for="<?php $this->print_control_uid(); ?>-svg" data-tooltip="{{ get( 'svg', 'label' ) }}">
145 - <i class="{{ get( 'svg', 'icon' ) }}" aria-hidden="true"></i>
146 - <span class="elementor-screen-only">{{ get( 'svg', 'label' ) }}</span>
147 - </label>
148 - <# }
149 120 if ( ! data.exclude_inline_options.includes( 'icon' ) ) { #>
150 - <input id="<?php $this->print_control_uid(); ?>-icon" type="radio" value="icon">
151 - <label class="elementor-choices-label elementor-control-unit-1 tooltip-target elementor-control-icons--inline__icon" for="<?php $this->print_control_uid(); ?>-icon" data-tooltip="{{ get( 'icon', 'label' ) }}">
121 + <input id="<?php echo $control_uid; ?>-icon" type="radio" value="icon">
122 + <label class="elementor-choices-label elementor-control-unit-1 tooltip-target elementor-control-icons--inline__icon" for="<?php echo $control_uid; ?>-icon" data-tooltip="<?php echo __( 'Icon Library', 'elementor' ); ?>" title="<?php echo __( 'Icon Library', 'elementor' ); ?>">
152 123 <span class="elementor-control-icons--inline__displayed-icon">
153 - <i class="{{ get( 'icon', 'icon' ) }}" aria-hidden="true"></i>
124 + <i class="eicon-circle" aria-hidden="true"></i>
154 125 </span>
155 - <span class="elementor-screen-only">{{ get( 'icon', 'label' ) }}</span>
126 + <span class="elementor-screen-only"><?php echo __( 'Icon Library', 'elementor' ); ?></span>
156 127 </label>
157 128 <# } #>
158 129 </div>
159 130 </div>
@@ -186,38 +157,12 @@
186 157 'search_bar' => true,
187 158 'recommended' => false,
188 159 'skin' => 'media',
189 160 'exclude_inline_options' => [],
190 - 'disable_initial_active_state' => false,
191 - 'skin_settings' => [
192 - 'inline' => [
193 - 'none' => [
194 - 'label' => esc_html__( 'None', 'elementor' ),
195 - 'icon' => 'eicon-ban',
196 - ],
197 - 'svg' => [
198 - 'label' => esc_html__( 'Upload SVG', 'elementor' ),
199 - 'icon' => 'eicon-upload',
200 - ],
201 - 'icon' => [
202 - 'label' => esc_html__( 'Icon Library', 'elementor' ),
203 - 'icon' => 'eicon-circle',
204 - ],
205 - ],
206 - ],
207 161 ];
208 162 }
209 163
210 - /**
211 - * Support SVG Import
212 - *
213 - * @param array $mimes
214 - * @return array
215 - * @deprecated 3.5.0
216 - */
217 164 public function support_svg_import( $mimes ) {
218 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.5.0' );
219 -
220 165 $mimes['svg'] = 'image/svg+xml';
221 166 return $mimes;
222 167 }
223 168
@@ -225,9 +170,13 @@
225 170 if ( empty( $settings['library'] ) || 'svg' !== $settings['library'] || empty( $settings['value']['url'] ) ) {
226 171 return $settings;
227 172 }
228 173
174 + add_filter( 'upload_mimes', [ $this, 'support_svg_import' ], 100 );
175 +
229 176 $imported = Plugin::$instance->templates_manager->get_import_images_instance()->import( $settings['value'] );
177 +
178 + remove_filter( 'upload_mimes', [ $this, 'support_svg_import' ], 100 );
230 179
231 180 if ( ! $imported ) {
232 181 $settings['value'] = '';
233 182 $settings['library'] = '';