'', 'library' => '', ]; } /** * Render Icons control output in the editor. * * Used to generate the control HTML in the editor using Underscore JS * template. The variables for the class are available using `data` JS * object. * * @since 2.6.0 * @access public */ public function content_template() { ?> <# if ( 'inline' === data.skin ) { #> render_inline_skin(); ?> <# } else { #> render_media_skin(); ?> <# } #>
<# if ( data.description ) { #>
{{{ data.description }}}
<# } #>
<# const defaultSkinSettings = { none: { label: '', icon: 'eicon-ban', }, svg: { label: '', icon: 'eicon-upload', }, icon: { label: '', icon: 'eicon-circle', } }; const skinSettings = data.skin_settings.inline; const get = ( type, key ) => { if ( skinSettings[ type ] ) { return skinSettings[ type ]?.[ key ] || defaultSkinSettings[ type ][ key ]; } return defaultSkinSettings[ type ][ key ]; } #>
<# if ( ! data.exclude_inline_options.includes( 'none' ) ) { #> <# } if ( ! data.exclude_inline_options.includes( 'svg' ) ) { #> <# } if ( ! data.exclude_inline_options.includes( 'icon' ) ) { #> <# } #>
<# if ( data.description ) { #>
{{{ data.description }}}
<# } #> true, 'dynamic' => [ 'categories' => [ TagsModule::IMAGE_CATEGORY ], 'returnType' => 'object', ], 'search_bar' => true, 'recommended' => false, 'skin' => 'media', 'exclude_inline_options' => [], 'disable_initial_active_state' => false, 'skin_settings' => [ 'inline' => [ 'none' => [ 'label' => esc_html__( 'None', 'elementor' ), 'icon' => 'eicon-ban', ], 'svg' => [ 'label' => esc_html__( 'Upload SVG', 'elementor' ), 'icon' => 'eicon-upload', ], 'icon' => [ 'label' => esc_html__( 'Icon Library', 'elementor' ), 'icon' => 'eicon-circle', ], ], ], ]; } /** * Support SVG Import * * @deprecated 3.5.0 * * @param $mimes * @return mixed */ public function support_svg_import( $mimes ) { Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.5.0' ); $mimes['svg'] = 'image/svg+xml'; return $mimes; } public function on_import( $settings ) { if ( empty( $settings['library'] ) || 'svg' !== $settings['library'] || empty( $settings['value']['url'] ) ) { return $settings; } $imported = Plugin::$instance->templates_manager->get_import_images_instance()->import( $settings['value'] ); if ( ! $imported ) { $settings['value'] = ''; $settings['library'] = ''; } else { $settings['value'] = $imported; } return $settings; } }