PATH:
home
/
letacommog
/
lesfinessaveurs
/
wp-content
/
themes
/
Avada
/
includes
<?php /** * Single social-icon handler. * * @author ThemeFusion * @copyright (c) Copyright by ThemeFusion * @link http://theme-fusion.com * @package Avada * @subpackage Core * @since 4.0.0 */ // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } /** * Single social-icon handler. * * @since 4.0.0 */ class Avada_Social_Icon { /** * Array of our arguments for this icon. * * @static * @access public * @var array */ public static $args = array(); /** * The prefix that we'll be using for all our icon classes. * * @static * @access public * @var string */ public static $iconfont_prefix = 'fusion-icon-'; /** * Creates the markup for a single icon. * * @static * @access public * @param array $args The arguments array. * @return string */ public static function get_markup( $args ) { $icon_options = array( 'class' => '', 'style' => '', ); if ( isset( $args['social_network'] ) ) { $icon_options['social_network'] = $args['social_network']; } elseif ( isset( $args['icon'] ) ) { $icon_options['social_network'] = $args['icon']; } $icon_options['social_link'] = ''; if ( isset( $args['social_link'] ) ) { $icon_options['social_link'] = $args['social_link']; } elseif ( isset( $args['url'] ) ) { $icon_options['social_link'] = $args['url']; } if ( isset( $args['icon_color'] ) ) { $icon_options['icon_color'] = $args['icon_color']; } if ( isset( $args['box_color'] ) ) { $icon_options['box_color'] = $args['box_color']; } $icon_options['last'] = ( isset( $args['last'] ) ) ? $args['last'] : false; $icon_padding = Fusion_Sanitize::size( Avada()->settings->get( 'header_social_links_boxed_padding' ) ); $custom = ''; $is_custom_icon = ( isset( $args['custom_source'] ) && isset( $args['custom_title'] ) ) ? true : false; // This is a custom icon. if ( $is_custom_icon ) { // Get the position. $position = ( isset( self::$args['position'] ) && 'footer' === self::$args['position'] ) ? 'footer' : 'header'; // Get the line-height. $line_height_option = ( 'header' == $position ) ? 'header_social_links_font_size' : 'footer_social_links_font_size'; $line_height = Fusion_Sanitize::size( Avada()->settings->get( $line_height_option ) ); // Get the padding. $padding_option = ( 'header' === $position ) ? 'header_social_links_boxed_padding' : 'footer_social_links_boxed_padding'; $icon_padding = Fusion_Sanitize::size( Avada()->settings->get( $padding_option ) ); // Calculate the max-height for the custom icon. $max_height = ( self::$args['icon_boxed'] ) ? 'calc(' . $line_height . ' + (2 * ' . $icon_padding . ') + 2px)' : $line_height; $custom = '<img src="' . $args['custom_source'] . '" style="width:auto;max-height:' . $max_height . ';" alt="' . $args['custom_title'] . '" />'; } if ( 'custom' === substr( $icon_options['social_network'], 0, 7 ) ) { $icon_options['class'] .= 'custom '; $tooltip = 'Custom'; if ( isset( $args['custom_title'] ) ) { $tooltip = str_replace( 'custom', '', $args['custom_title'] ); } } else { $tooltip = ucfirst( $icon_options['social_network'] ); } $icon_options['social_network'] = ( 'email' == $icon_options['social_network'] ) ? 'mail' : $icon_options['social_network']; $icon_options['class'] .= 'fusion-social-network-icon fusion-tooltip fusion-' . $icon_options['social_network'] . ' ' . self::$iconfont_prefix . $icon_options['social_network']; $icon_options['class'] .= ( $args['last'] ) ? ' fusion-last-social-icon' : ''; $icon_options['href'] = $icon_options['social_link']; if ( 'googleplus' == $icon_options['social_network'] && false !== strpos( $icon_options['social_link'], 'share?' ) ) { $icon_options['onclick'] = 'javascript:window.open(this.href,\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;'; } if ( self::$args['linktarget'] ) { $icon_options['target'] = '_blank'; if ( 'facebook' !== $icon_options['social_network'] || isset( $args['icon'] ) ) { $icon_options['rel'] = 'noopener noreferrer'; } } if ( 'mail' == $icon_options['social_network'] ) { if ( 'http' === substr( $icon_options['social_link'], 0, 4 ) ) { $icon_options['href'] = $icon_options['social_link']; } else { if ( false !== strpos( $icon_options['social_link'], 'body=' ) ) { $icon_options['href'] = 'mailto:' . str_replace( 'mailto:', '', $icon_options['social_link'] ); } else { $icon_options['href'] = 'mailto:' . antispambot( str_replace( 'mailto:', '', $icon_options['social_link'] ) ); } } $icon_options['target'] = '_self'; } if ( Avada()->settings->get( 'nofollow_social_links' ) ) { $icon_options['rel'] = 'nofollow'; } if ( $args['icon_color'] ) { $icon_options['style'] .= 'color:' . $args['icon_color'] . ';'; } if ( $is_custom_icon ) { // We need a top offset for boxed mode, based on the padding. $top_offset = ( self::$args['icon_boxed'] ) ? 'top:-' . $icon_padding . ';' : ''; $icon_options['style'] .= 'position:relative;' . $top_offset; } if ( ! $is_custom_icon && self::$args['icon_boxed'] && $args['box_color'] && ! is_array( $args['box_color'] ) ) { $icon_options['style'] .= 'background-color:' . $args['box_color'] . ';border-color:' . $args['box_color'] . ';'; } if ( ! $is_custom_icon && self::$args['icon_boxed'] && ( self::$args['icon_boxed_radius'] || '0' === self::$args['icon_boxed_radius'] ) ) { self::$args['icon_boxed_radius'] = ( 'round' == self::$args['icon_boxed_radius'] ) ? '50%' : self::$args['icon_boxed_radius']; $icon_options['style'] .= 'border-radius:' . self::$args['icon_boxed_radius'] . ';'; } if ( 'none' !== strtolower( self::$args['tooltip_placement'] ) ) { $icon_options['data-placement'] = strtolower( self::$args['tooltip_placement'] ); if ( 'Googleplus' == $tooltip ) { $tooltip = 'Google+'; } elseif ( 'Youtube' === $tooltip ) { $tooltip = 'YouTube'; } elseif ( 'Linkedin' === $tooltip ) { $tooltip = 'LinkedIn'; } $icon_options['data-title'] = $tooltip; $icon_options['data-toggle'] = 'tooltip'; } $icon_options['title'] = $tooltip; $icon_options = apply_filters( 'fusion_attr_social-icons-class-icon', $icon_options ); $properties = ''; $not_allowed_attributes = array( 'last', 'box_color', 'icon_color', 'social_link', 'social_network' ); foreach ( $icon_options as $name => $value ) { if ( ! in_array( $name, $not_allowed_attributes ) ) { $properties .= ! empty( $value ) ? ' ' . esc_html( $name ) . '="' . esc_attr( $value ) . '"' : esc_html( " {$name}" ); } } return '<a ' . $properties . '><span class="screen-reader-text">' . $tooltip . '</span>' . $custom . '</a>'; } }
[+]
..
[-] class-avada-scripts.php
[edit]
[-] class-avada-layout-bbpress.php
[edit]
[-] class-avada-social-icon.php
[edit]
[-] class-avada-multiple-featured-images.php
[edit]
[-] class-fusion-builder-filters.php
[edit]
[-] class-avada-woocommerce.php
[edit]
[-] custom_functions.php
[edit]
[-] class-avada-gravity-forms-tags-merger.php
[edit]
[-] class-avada-avadaredux-migration.php
[edit]
[-] class-avada-portfolio.php
[edit]
[-] class-avada-images.php
[edit]
[-] class-fusion-builder-migrate.php
[edit]
[-] class-avada-upgrade.php
[edit]
[-] dynamic_css_helpers.php
[edit]
[-] class-avada-head.php
[edit]
[-] class-fusion-image-resizer.php
[edit]
[-] class-avada-blog.php
[edit]
[+]
widget
[-] class-avada-megamenu-framework.php
[edit]
[+]
recaptcha
[-] fusion-functions.php
[edit]
[-] class-avada-fonts.php
[edit]
[-] class-avada-remote-installer.php
[edit]
[-] class-avada-layout.php
[edit]
[-] avada-tgm.php
[edit]
[-] class-avada-page-options.php
[edit]
[+]
plugins
[-] wc-functions.php
[edit]
[-] class-fusion-builder-redux-options.php
[edit]
[-] class-avada-helper.php
[edit]
[-] class-avada-eventscalendar.php
[edit]
[-] class-fusion-builder-demos-importer.php
[edit]
[-] class-avada-template.php
[edit]
[-] deprecated.php
[edit]
[-] class-fusion-gfonts-downloader.php
[edit]
[-] class-avada-megamenu.php
[edit]
[-] dynamic_css.php
[edit]
[-] avada-functions.php
[edit]
[-] class-avada-googlemap.php
[edit]
[+]
upgrade
[-] class-avada-migrate.php
[edit]
[+]
importer
[-] fusion-shared-options.php
[edit]
[-] class-avada-social-sharing.php
[edit]
[-] class-avada-settings.php
[edit]
[-] class-avada-init.php
[edit]
[+]
lib
[-] class-avada-social-icons.php
[edit]
[+]
ls-skins
[+]
typography
[-] class-avada-contact.php
[edit]
[-] class-avada-breadcrumbs.php
[edit]
[-] class-avada-tgm-plugin-activation.php
[edit]
[-] class-avada-system-status.php
[edit]
[-] class-avada-options-conditionals.php
[edit]
[-] class-avada-nav-walker-megamenu.php
[edit]
[-] class-avada-admin.php
[edit]
[-] class-avada-widget-style.php
[edit]
[-] class-avada.php
[edit]
[+]
options
[-] class-avada-nav-walker.php
[edit]
[-] class-avada-dynamic-css.php
[edit]
[+]
admin-screens
[-] class-avada-avadaredux.php
[edit]
[-] class-avada-autoload.php
[edit]
[-] class-avada-sermon-manager.php
[edit]
[-] class-avada-options.php
[edit]
[-] class-avada-maintenance.php
[edit]
[-] class-avada-taxonomy-meta.php
[edit]
[-] class-avada-sidebars.php
[edit]
[+]
metaboxes
[-] class-avada-google-fonts.php
[edit]
[-] class-avada-admin-notices.php
[edit]
[-] class-avada-privacy-embeds.php
[edit]