/**
  * Renders all soical icons not belonging to shortcodes
  *
  * @since 3.5.0
  * @param  array   $args Holding all necessarry data for social icons
  * @return string  The HTML mark up for social icons, incl. wrapping container
  */
 public function render_social_icons($args)
 {
     parent::$args = $args;
     // Get a list of all the available social networks
     $social_networks_full_array = Avada_Data::fusion_social_icons(true, true);
     if (isset(parent::$args['authorpage']) && parent::$args['authorpage'] == 'yes') {
         $social_networks = $this->get_authorpage_social_links_array(parent::$args);
     } else {
         $social_networks = $this->get_sharingbox_social_links_array(parent::$args);
     }
     $html = $icons = '';
     $i = 0;
     $per_icon_colors = 'brand' == Avada()->settings->get('sharing_social_links_color_type') ? true : false;
     $number_of_social_networks = count($social_networks);
     foreach ($social_networks as $network => $icon_args) {
         $icon_options = array('social_network' => $network, 'social_link' => $icon_args['url']);
         if ($per_icon_colors) {
             $network_for_colors = str_replace('sharing_', '', $network);
             $network_for_colors = in_array($network_for_colors, array('google', 'googleplus')) ? 'gplus' : $network_for_colors;
             if (parent::$args['icon_boxed']) {
                 $icon_options['icon_color'] = '#ffffff';
                 $icon_options['box_color'] = $social_networks_full_array[$network_for_colors]['color'];
             } else {
                 $icon_options['icon_color'] = $social_networks_full_array[$network_for_colors]['color'];
                 $icon_options['box_color'] = '#ffffff';
             }
         } else {
             $icon_options['icon_color'] = Avada()->settings->get('sharing_social_links_icon_color');
             $icon_options['box_color'] = Avada()->settings->get('sharing_social_links_box_color');
         }
         // Check if are on the last social icon;
         // $i needs to be incremented first to make it match the count() value
         $i++;
         $icon_options['last'] = $i == $number_of_social_networks ? true : false;
         $icons .= parent::get_markup($icon_options);
     }
     if (!empty($icons)) {
         $attr = array('class' => 'fusion-social-networks');
         if (parent::$args['icon_boxed']) {
             $attr['class'] .= ' boxed-icons';
         }
         $html = '<div ' . fusion_attr('social-icons-class-social-networks', $attr) . '><div ' . fusion_attr('fusion-social-networks-wrapper') . '>' . $icons;
         if (isset(parent::$args['position']) && ('header' == parent::$args['position'] || 'footer' == parent::$args['position'])) {
             $html .= '</div></div>';
         } else {
             $html .= '<div class="fusion-clearfix"></div></div></div>';
         }
     }
     return $html;
 }
Exemple #2
0
/**
 * Social Media
 *
 * @var  array  	any existing settings
 * @return array 	existing sections + social_media
 *
 */
function avada_options_section_social_media($sections)
{
    $sections['social_media'] = array('label' => esc_html__('Social Media', 'Avada'), 'id' => 'heading_social_media', 'priority' => 18, 'icon' => 'el-icon-share-alt', 'fields' => array('social_media_icons_section' => array('label' => esc_html__('Social Media Icons', 'Avada'), 'id' => 'social_media_icons_section', 'icon' => true, 'type' => 'sub-section', 'fields' => array('social_media_icons_important_note_info' => array('label' => '', 'description' => '<div class="avada-avadaredux-important-notice">' . __('<strong>IMPORTANT NOTE:</strong> This tab controls the social networks that display in the header and footer. Add the network of your choice along with your unique URL. Each network you wish to display must be added here to show up in the header and footer. These settings do not control the avada social widget, social link shortcode or person shortcode.', 'Avada') . '</div>', 'id' => 'social_media_icons_important_note_info', 'type' => 'custom'), 'social_media_icons' => array('label' => esc_html__('Social Media Links', 'Avada'), 'description' => esc_html__('Social media links use a repeater field and allow one network per field. Click the "Add" button to add additional fields.', 'Avada'), 'id' => 'social_media_icons', 'default' => array(), 'type' => 'repeater', 'bind_title' => 'icon', 'fields' => array('icon' => array('type' => 'select', 'description' => esc_html__('Select a social network to automatically add its icon', 'Avada'), 'default' => 'none', 'choices' => Avada_Data::fusion_social_icons(true, false)), 'url' => array('type' => 'text', 'label' => esc_html__('Link (URL)', 'Avada'), 'description' => esc_html__('Insert your custom link here', 'Avada'), 'default' => ''), 'custom_title' => array('type' => 'text', 'label' => esc_html__('Custom Icon Title', 'Avada'), 'description' => esc_html__('Insert your custom link here', 'Avada'), 'default' => ''), 'custom_source' => array('type' => 'media', 'label' => esc_html__('Link (URL) of the image you want to use as the icon', 'Avada'), 'description' => esc_html__('Upload your custom icon', 'Avada'), 'default' => ''))))), 'header_social_icons_options' => array('label' => esc_html__('Header Social Icons', 'Avada'), 'description' => '', 'id' => 'header_social_icons_options', 'default' => '', 'icon' => true, 'type' => 'sub-section', 'fields' => array('header_social_links_font_size' => array('label' => esc_html__('Header Social Icon Font Size', 'Avada'), 'description' => esc_html__('Controls the font size of the header social icons.', 'Avada'), 'id' => 'header_social_links_font_size', 'default' => '16px', 'type' => 'dimension'), 'header_social_links_tooltip_placement' => array('label' => esc_html__('Header Social Icon Tooltip Position', 'Avada'), 'description' => esc_html__('Controls the tooltip position of the header social icons.', 'Avada'), 'id' => 'header_social_links_tooltip_placement', 'default' => 'Bottom', 'type' => 'radio-buttonset', 'choices' => array('Top' => esc_html__('Top', 'Avada'), 'Right' => esc_html__('Right', 'Avada'), 'Bottom' => esc_html__('Bottom', 'Avada'), 'Left' => esc_html__('Left', 'Avada'), 'None' => esc_html__('None', 'Avada'))), 'header_social_links_color_type' => array('label' => esc_html__('Header Social Icon Color Type', 'Avada'), 'description' => esc_html__('Custom colors allow you to choose a color for icons and boxes. Brand colors will use the exact brand color of each network for the icons or boxes.', 'Avada'), 'id' => 'header_social_links_color_type', 'default' => 'custom', 'type' => 'radio-buttonset', 'choices' => array('custom' => esc_html__('Custom Colors', 'Avada'), 'brand' => esc_html__('Brand Colors', 'Avada'))), 'header_social_links_icon_color' => array('label' => esc_html__('Header Social Icon Color', 'Avada'), 'description' => esc_html__('Controls the color of the header social icons. This color will be used for all social icons in the header.', 'Avada'), 'id' => 'header_social_links_icon_color', 'default' => '#bebdbd', 'type' => 'color-alpha', 'required' => array(array('setting' => 'header_social_links_color_type', 'operator' => '==', 'value' => 'custom'))), 'header_social_links_boxed' => array('label' => esc_html__('Header Social Icons Boxed', 'Avada'), 'description' => esc_html__('Controls if each icon is displayed in a small box.', 'Avada'), 'id' => 'header_social_links_boxed', 'default' => '0', 'type' => 'switch'), 'header_social_links_box_color' => array('label' => esc_html__('Header Social Icon Box Color', 'Avada'), 'description' => esc_html__('Controls the color of the social icon box.', 'Avada'), 'id' => 'header_social_links_box_color', 'default' => '#e8e8e8', 'type' => 'color-alpha', 'required' => array(array('setting' => 'header_social_links_boxed', 'operator' => '==', 'value' => '1'), array('setting' => 'header_social_links_color_type', 'operator' => '==', 'value' => 'custom'))), 'header_social_links_boxed_radius' => array('label' => esc_html__('Header Social Icon Boxed Radius', 'Avada'), 'description' => esc_html__('Controls the box radius', 'Avada'), 'id' => 'header_social_links_boxed_radius', 'default' => '4px', 'type' => 'dimension', 'required' => array(array('setting' => 'header_social_links_boxed', 'operator' => '==', 'value' => '1'))), 'header_social_links_boxed_padding' => array('label' => esc_html__('Header Social Icon Boxed Padding', 'Avada'), 'description' => esc_html__('Controls the interior padding of the box.', 'Avada'), 'id' => 'header_social_links_boxed_padding', 'default' => '8px', 'type' => 'dimension', 'required' => array(array('setting' => 'header_social_links_boxed', 'operator' => '==', 'value' => '1'))))), 'footer_social_icons_options' => array('label' => esc_html__('Footer Social Icons', 'Avada'), 'description' => '', 'id' => 'footer_social_icons_options', 'default' => '', 'icon' => true, 'type' => 'sub-section', 'fields' => array('icons_footer' => array('label' => esc_html__('Display Social Icons In The Footer', 'Avada'), 'description' => esc_html__('Turn on to display social icons in the footer copyright bar.', 'Avada'), 'id' => 'icons_footer', 'default' => '1', 'type' => 'switch'), 'footer_social_links_font_size' => array('label' => esc_html__('Footer Social Icon Font Size', 'Avada'), 'description' => esc_html__('Controls the font size of the footer social icons.', 'Avada'), 'id' => 'footer_social_links_font_size', 'default' => '16px', 'type' => 'dimension', 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'))), 'footer_social_links_tooltip_placement' => array('label' => esc_html__('Footer Social Icon Tooltip Position', 'Avada'), 'description' => esc_html__('Controls the tooltip position of the footer social icons.', 'Avada'), 'id' => 'footer_social_links_tooltip_placement', 'default' => 'Top', 'type' => 'radio-buttonset', 'choices' => array('Top' => esc_html__('Top', 'Avada'), 'Right' => esc_html__('Right', 'Avada'), 'Bottom' => esc_html__('Bottom', 'Avada'), 'Left' => esc_html__('Left', 'Avada'), 'None' => esc_html__('None', 'Avada')), 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'))), 'footer_social_links_color_type' => array('label' => esc_html__('Footer Social Icon Color Type', 'Avada'), 'description' => esc_html__('Custom colors allow you to choose a color for icons and boxes. Brand colors will use the exact brand color of each network for the icons or boxes.', 'Avada'), 'id' => 'footer_social_links_color_type', 'default' => 'custom', 'type' => 'radio-buttonset', 'choices' => array('custom' => esc_html__('Custom Colors', 'Avada'), 'brand' => esc_html__('Brand Colors', 'Avada')), 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'))), 'footer_social_links_icon_color' => array('label' => esc_html__('Footer Social Icon Color', 'Avada'), 'description' => esc_html__('Controls the color of the footer social icons. This color will be used for all social icons in the footer.', 'Avada'), 'id' => 'footer_social_links_icon_color', 'type' => 'color-alpha', 'default' => '#46494a', 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'), array('setting' => 'footer_social_links_color_type', 'operator' => '==', 'value' => 'custom'))), 'footer_social_links_boxed' => array('label' => esc_html__('Footer Social Icons Boxed', 'Avada'), 'description' => esc_html__('Controls if each icon is displayed in a small box.', 'Avada'), 'id' => 'footer_social_links_boxed', 'default' => '0', 'type' => 'switch', 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'))), 'footer_social_links_box_color' => array('label' => esc_html__('Footer Social Icon Box Color', 'Avada'), 'description' => esc_html__('Controls the color of the social icon box.', 'Avada'), 'id' => 'footer_social_links_box_color', 'default' => '#222222', 'type' => 'color-alpha', 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'), array('setting' => 'footer_social_links_boxed', 'operator' => '==', 'value' => '1'), array('setting' => 'footer_social_links_color_type', 'operator' => '==', 'value' => 'custom'))), 'footer_social_links_boxed_radius' => array('label' => esc_html__('Footer Social Icon Boxed Radius', 'Avada'), 'description' => esc_html__('Controls the box radius.', 'Avada'), 'id' => 'footer_social_links_boxed_radius', 'default' => '4px', 'type' => 'dimension', 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'), array('setting' => 'footer_social_links_boxed', 'operator' => '==', 'value' => '1'))), 'footer_social_links_boxed_padding' => array('label' => esc_html__('Footer Social Icon Boxed Padding', 'Avada'), 'description' => esc_html__('Controls the interior padding of the box.', 'Avada'), 'id' => 'footer_social_links_boxed_padding', 'default' => '8px', 'type' => 'dimension', 'required' => array(array('setting' => 'icons_footer', 'operator' => '==', 'value' => '1'), array('setting' => 'footer_social_links_boxed', 'operator' => '==', 'value' => '1'))))), 'heading_social_sharing_box' => array('label' => esc_html__('Social Sharing Box', 'Avada'), 'id' => 'heading_social_sharing_box', 'icon' => true, 'type' => 'sub-section', 'fields' => array('sharing_social_tagline' => array('label' => esc_html__('Sharing Box Tagline', 'Avada'), 'description' => esc_html__('Insert a tagline for the social sharing boxes.', 'Avada'), 'id' => 'sharing_social_tagline', 'default' => esc_html__('Share This Story, Choose Your Platform!', 'Avada'), 'type' => 'text'), 'sharing_box_tagline_text_color' => array('label' => esc_html__('Sharing Box Tagline Text Color', 'Avada'), 'description' => esc_html__('Controls the color of the tagline text in the social sharing boxes.', 'Avada'), 'id' => 'sharing_box_tagline_text_color', 'default' => '#333333', 'type' => 'color'), 'social_bg_color' => array('label' => esc_html__('Sharing Box Background Color', 'Avada'), 'description' => esc_html__('Controls the background color of the social sharing boxes.', 'Avada'), 'id' => 'social_bg_color', 'default' => '#f6f6f6', 'type' => 'color-alpha'), 'social_share_box_icon_info' => array('label' => esc_html__('Social Sharing Box Icons', 'Avada'), 'description' => '', 'id' => 'social_share_box_icon_info', 'icon' => true, 'type' => 'info'), 'sharing_social_links_font_size' => array('label' => esc_html__('Sharing Box Icon Font Size', 'Avada'), 'description' => esc_html__('Controls the font size of the social icons in the social sharing boxes.', 'Avada'), 'id' => 'sharing_social_links_font_size', 'default' => '16px', 'type' => 'dimension'), 'sharing_social_links_tooltip_placement' => array('label' => esc_html__('Sharing Box Icons Tooltip Position', 'Avada'), 'description' => esc_html__('Controls the tooltip position of the social icons in the social sharing boxes.', 'Avada'), 'id' => 'sharing_social_links_tooltip_placement', 'default' => 'Top', 'type' => 'radio-buttonset', 'choices' => array('Top' => esc_html__('Top', 'Avada'), 'Right' => esc_html__('Right', 'Avada'), 'Bottom' => esc_html__('Bottom', 'Avada'), 'Left' => esc_html__('Left', 'Avada'), 'None' => esc_html__('None', 'Avada'))), 'sharing_social_links_color_type' => array('label' => esc_html__('Sharing Box Icon Color Type', 'Avada'), 'description' => esc_html__('Custom colors allow you to choose a color for icons and boxes. Brand colors will use the exact brand color of each network for the icons or boxes.', 'Avada'), 'id' => 'sharing_social_links_color_type', 'default' => 'custom', 'type' => 'radio-buttonset', 'choices' => array('custom' => esc_html__('Custom Colors', 'Avada'), 'brand' => esc_html__('Brand Colors', 'Avada'))), 'sharing_social_links_icon_color' => array('label' => esc_html__('Sharing Box Icon Color', 'Avada'), 'description' => esc_html__('Controls the color of the social icons in the social sharing boxes. This color will be used for all social icons.', 'Avada'), 'id' => 'sharing_social_links_icon_color', 'default' => '#bebdbd', 'type' => 'color', 'required' => array(array('setting' => 'sharing_social_links_color_type', 'operator' => '==', 'value' => 'custom'))), 'sharing_social_links_boxed' => array('label' => esc_html__('Sharing Box Icons Boxed', 'Avada'), 'description' => esc_html__('Controls if each social icon is displayed in a small box.', 'Avada'), 'id' => 'sharing_social_links_boxed', 'default' => '0', 'type' => 'switch'), 'sharing_social_links_box_color' => array('label' => esc_html__('Sharing Box Icon Box Color', 'Avada'), 'description' => esc_html__('Controls the color of the social icon box.', 'Avada'), 'id' => 'sharing_social_links_box_color', 'default' => '#e8e8e8', 'type' => 'color-alpha', 'required' => array(array('setting' => 'sharing_social_links_boxed', 'operator' => '==', 'value' => '1'), array('setting' => 'sharing_social_links_color_type', 'operator' => '==', 'value' => 'custom'))), 'sharing_social_links_boxed_radius' => array('label' => esc_html__('Sharing Box Icon Boxed Radius', 'Avada'), 'description' => esc_html__('Controls the box radius of the social icon box.', 'Avada'), 'id' => 'sharing_social_links_boxed_radius', 'default' => '4px', 'type' => 'dimension', 'required' => array(array('setting' => 'sharing_social_links_boxed', 'operator' => '==', 'value' => '1'))), 'sharing_social_links_boxed_padding' => array('label' => esc_html__('Sharing Box Icons Boxed Padding', 'Avada'), 'description' => esc_html__('Controls the interior padding of the social icon box.', 'Avada'), 'id' => 'sharing_social_links_boxed_padding', 'default' => '8px', 'type' => 'dimension', 'required' => array(array('setting' => 'sharing_social_links_boxed', 'operator' => '==', 'value' => '1'))), 'social_share_box_links_title' => array('label' => esc_html__('Sharing Box Links', 'Avada'), 'description' => '', 'id' => 'social_share_box_links_title', 'icon' => true, 'type' => 'info'), 'sharing_facebook' => array('label' => esc_html__('Facebook', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('Facebook', 'Avada')), 'id' => 'sharing_facebook', 'default' => '1', 'type' => 'toggle'), 'sharing_twitter' => array('label' => esc_html__('Twitter', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('Twitter', 'Avada')), 'id' => 'sharing_twitter', 'default' => '1', 'type' => 'toggle'), 'sharing_reddit' => array('label' => esc_html__('Reddit', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('Reddit', 'Avada')), 'id' => 'sharing_reddit', 'default' => '1', 'type' => 'toggle'), 'sharing_linkedin' => array('label' => esc_html__('LinkedIn', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('LinkedIn', 'Avada')), 'id' => 'sharing_linkedin', 'default' => '1', 'type' => 'toggle'), 'sharing_google' => array('label' => esc_html__('Google+', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('Google+', 'Avada')), 'id' => 'sharing_google', 'default' => '1', 'type' => 'toggle'), 'sharing_tumblr' => array('label' => esc_html__('Tumblr', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('Tumblr', 'Avada')), 'id' => 'sharing_tumblr', 'default' => '1', 'type' => 'toggle'), 'sharing_pinterest' => array('label' => esc_html__('Pinterest', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('Pinterest', 'Avada')), 'id' => 'sharing_pinterest', 'default' => '1', 'type' => 'toggle'), 'sharing_vk' => array('label' => esc_html__('VK', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('VK', 'Avada')), 'id' => 'sharing_vk', 'default' => '1', 'type' => 'toggle'), 'sharing_email' => array('label' => esc_html__('Email', 'Avada'), 'description' => sprintf(esc_html__('Turn on to display %s in the social share box.', 'Avada'), esc_html__('Email', 'Avada')), 'id' => 'sharing_email', 'default' => '1', 'type' => 'toggle')))));
    return $sections;
}
 /**
  * Renders all soical icons not belonging to shortcodes
  *
  * @since 3.5.0
  * @param  array   $args Holding all necessarry data for social icons
  * @return string  The HTML mark up for social icons, incl. wrapping container
  */
 public function render_social_icons($args)
 {
     parent::$args = $args;
     $html = '';
     $icons = '';
     // Get the social networks setting
     $social_networks = Avada()->settings->get('social_media_icons');
     // Get a list of all the available social networks
     $social_networks_full_array = Avada_Data::fusion_social_icons(true, true);
     // Count how many social icons we have
     $count = count($social_networks);
     // Get the default color values for social media depending on their location
     $footer_social_links_icon_color = Avada()->settings->get('footer_social_links_icon_color');
     $footer_social_links_box_color = Avada()->settings->get('footer_social_links_box_color');
     $header_social_links_icon_color = Avada()->settings->get('header_social_links_icon_color');
     $header_social_links_box_color = Avada()->settings->get('header_social_links_box_color');
     $use_brand_colors = false;
     if (isset(parent::$args['position'])) {
         if ('footer' == parent::$args['position']) {
             if ('brand' == Avada()->settings->get('footer_social_links_color_type')) {
                 $use_brand_colors = true;
             }
         } else {
             if ('brand' == Avada()->settings->get('header_social_links_color_type')) {
                 $use_brand_colors = true;
             }
         }
     }
     // Check that we have social networks defined before proceeding
     if (!empty($social_networks) && isset($social_networks['url']) && !empty($social_networks['url'])) {
         for ($i = 0; $i <= count($social_networks['url']) - 1; $i++) {
             // Get the icon's arguments
             $icon = isset($social_networks['icon'][$i]) ? str_replace('_link', '', $social_networks['icon'][$i]) : false;
             $url = isset($social_networks['url'][$i]) && !empty($social_networks['url'][$i]) ? $social_networks['url'][$i] : false;
             $header_box_color = isset($social_networks['header_box_color'][$i]) && !empty($social_networks['header_box_color'][$i]) ? $social_networks['header_box_color'][$i] : false;
             $footer_box_color = isset($social_networks['footer_box_color'][$i]) && !empty($social_networks['footer_box_color'][$i]) ? $social_networks['footer_box_color'][$i] : false;
             $custom_title = isset($social_networks['custom_title'][$i]) && !empty($social_networks['custom_title'][$i]) ? $social_networks['custom_title'][$i] : '';
             $custom_source = isset($social_networks['custom_source'][$i]) && isset($social_networks['custom_source'][$i]['url']) && !empty($social_networks['custom_source'][$i]['url']) ? $social_networks['custom_source'][$i]['url'] : '';
             $custom_source_height = isset($social_networks['custom_source'][$i]) && isset($social_networks['custom_source'][$i]['height']) && !empty($social_networks['custom_source'][$i]['height']) ? $social_networks['custom_source'][$i]['height'] : '';
             $custom_source_width = isset($social_networks['custom_source'][$i]) && isset($social_networks['custom_source'][$i]['width']) && !empty($social_networks['custom_source'][$i]['width']) ? $social_networks['custom_source'][$i]['width'] : '';
             // Hack for Google+
             if (in_array($icon, array('google', 'gplus'))) {
                 $icon = 'googleplus';
             }
             // Make sure we have a URL & an icon defined
             if ($icon && $url) {
                 $icon_args = array('icon' => $icon, 'url' => $url);
                 $icon_args['icon_color'] = Avada()->settings->get('header_social_links_icon_color');
                 $icon_args['box_color'] = Avada()->settings->get('header_social_links_box_color');
                 // Use footer args when appropriate
                 if (isset(parent::$args['position']) && 'footer' == parent::$args['position']) {
                     $icon_args['icon_color'] = Avada()->settings->get('footer_social_links_icon_color');
                     $icon_args['box_color'] = Avada()->settings->get('footer_social_links_box_color');
                 }
                 if ($use_brand_colors) {
                     $brand_icon = 'googleplus' == $icon ? 'gplus' : $icon;
                     $brand_color = $social_networks_full_array[$brand_icon]['color'];
                     $icon_args['icon_color'] = parent::$args['icon_boxed'] ? '#ffffff' : $social_networks_full_array[$brand_icon]['color'];
                     $icon_args['box_color'] = parent::$args['icon_boxed'] ? $social_networks_full_array[$brand_icon]['color'] : 'transparent';
                 }
                 // Check if are on the last social icon
                 $icon_args['last'] = $count == $i ? true : false;
                 // Custom icons
                 if ('custom' == $icon && !empty($custom_source)) {
                     $icon_args['custom_source'] = $custom_source;
                     $icon_args['custom_source_height'] = $custom_source_height;
                     $icon_args['custom_source_width'] = $custom_source_width;
                     $icon_args['custom_title'] = $custom_title;
                 }
                 $icons .= parent::get_markup($icon_args);
             }
         }
     }
     if (!empty($icons)) {
         $attr = array('class' => 'fusion-social-networks');
         if (parent::$args['icon_boxed']) {
             $attr['class'] .= ' boxed-icons';
         }
         $html = '<div ' . fusion_attr('social-icons-class-social-networks', $attr) . '><div ' . fusion_attr('fusion-social-networks-wrapper') . '>' . $icons;
         if (isset(parent::$args['position']) && ('header' == parent::$args['position'] || 'footer' == parent::$args['position'])) {
             $html .= '</div></div>';
         } else {
             $html .= '<div class="fusion-clearfix"></div></div></div>';
         }
     }
     return $html;
 }
    public function form($instance)
    {
        $defaults = array('title' => __('Get Social', 'Avada'), 'linktarget' => '', 'icons_font_size' => '16px', 'icon_color' => '', 'boxed_icon' => 'No', 'boxed_color' => '', 'color_type' => 'custom', 'boxed_icon_radius' => '4px', 'boxed_icon_padding' => '8px', 'tooltip_pos' => 'top', 'rss_link' => '', 'fb_link' => '', 'twitter_link' => '', 'dribbble_link' => '', 'google_link' => '', 'linkedin_link' => '', 'blogger_link' => '', 'tumblr_link' => '', 'reddit_link' => '', 'yahoo_link' => '', 'deviantart_link' => '', 'vimeo_link' => '', 'youtube_link' => '', 'pinterest_link' => '', 'digg_link' => '', 'flickr_link' => '', 'forrst_link' => '', 'myspace_link' => '', 'skype_link' => '', 'instagram_link' => '', 'vk_link' => '', 'xing_link' => '', 'dropbox_link' => '', 'soundcloud_link' => '', 'paypal_link' => '', 'email_link' => '', 'show_custom' => 'No');
        $instance = wp_parse_args((array) $instance, $defaults);
        ?>

		<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:', 'Avada');
        ?>
</label>
			<input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo $instance['title'];
        ?>
" />
		</p>

		<p>
			<label for="<?php 
        echo $this->get_field_id('linktarget');
        ?>
"><?php 
        _e('Link Target:', 'Avada');
        ?>
</label>
			<input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('linktarget');
        ?>
" name="<?php 
        echo $this->get_field_name('linktarget');
        ?>
" value="<?php 
        echo $instance['linktarget'];
        ?>
" />
		</p>

		<p>
			<label for="<?php 
        echo $this->get_field_id('icons_font_size');
        ?>
"><?php 
        _e('Icons Font Size:', 'Avada');
        ?>
</label>
			<input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('icons_font_size');
        ?>
" name="<?php 
        echo $this->get_field_name('icons_font_size');
        ?>
" value="<?php 
        echo $instance['icons_font_size'];
        ?>
" />
		</p>

		<p>
			<label for="<?php 
        echo $this->get_field_id('color_type');
        ?>
"><?php 
        _e('Icons Color Type:', 'Avada');
        ?>
</label>
			<select id="<?php 
        echo $this->get_field_id('color_type');
        ?>
" name="<?php 
        echo $this->get_field_name('color_type');
        ?>
" class="widefat" style="width:100%;">
				<option value="custom" <?php 
        echo 'custom' == $instance['color_type'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Custom Color', 'Avada');
        ?>
</option>
				<option value="brand" <?php 
        echo 'brand' == $instance['color_type'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Brand Colors', 'Avada');
        ?>
</option>
			</select>
		</p>

		<p class="avada-widget-color-type-option-child">
			<label for="<?php 
        echo $this->get_field_id('icon_color');
        ?>
"><?php 
        _e('Icons Color Hex Code:', 'Avada');
        ?>
</label>
			<input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('icon_color');
        ?>
" name="<?php 
        echo $this->get_field_name('icon_color');
        ?>
" value="<?php 
        echo $instance['icon_color'];
        ?>
" />
		</p>

		<p>
			<label for="<?php 
        echo $this->get_field_id('boxed_icon');
        ?>
"><?php 
        _e('Icons Boxed:', 'Avada');
        ?>
</label>
			<select id="<?php 
        echo $this->get_field_id('boxed_icon');
        ?>
" name="<?php 
        echo $this->get_field_name('boxed_icon');
        ?>
" class="widefat" style="width:100%;">
				<option value="No" <?php 
        echo 'No' == $instance['boxed_icon'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('No', 'Avada');
        ?>
</option>
				<option value="Yes" <?php 
        echo 'Yes' == $instance['boxed_icon'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Yes', 'Avada');
        ?>
</option>
			</select>
		</p>

		<p class="avada-widget-color-type-option-child avada-widget-boxed-icon-background">
			<label for="<?php 
        echo $this->get_field_id('boxed_color');
        ?>
"><?php 
        _e('Boxed Icons Background Color Hex Code:', 'Avada');
        ?>
</label>
			<input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('boxed_color');
        ?>
" name="<?php 
        echo $this->get_field_name('boxed_color');
        ?>
" value="<?php 
        echo $instance['boxed_color'];
        ?>
" />
		</p>

		<p class="avada-widget-boxed-icon-option-child">
			<label for="<?php 
        echo $this->get_field_id('boxed_icon_radius');
        ?>
"><?php 
        _e('Boxed Icons Radius:', 'Avada');
        ?>
</label>
			<input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('boxed_icon_radius');
        ?>
" name="<?php 
        echo $this->get_field_name('boxed_icon_radius');
        ?>
" value="<?php 
        echo $instance['boxed_icon_radius'];
        ?>
" />
		</p>

		<p class="avada-widget-boxed-icon-option-child">
			<label for="<?php 
        echo $this->get_field_id('boxed_icon_padding');
        ?>
"><?php 
        _e('Boxed Icons Padding:', 'Avada');
        ?>
</label>
			<input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('boxed_icon_padding');
        ?>
" name="<?php 
        echo $this->get_field_name('boxed_icon_padding');
        ?>
" value="<?php 
        echo $instance['boxed_icon_padding'];
        ?>
" />
		</p>

		<p>
			<label for="<?php 
        echo $this->get_field_id('tooltip_pos');
        ?>
"><?php 
        _e('Tooltip Position:', 'Avada');
        ?>
</label>
			<select id="<?php 
        echo $this->get_field_id('tooltip_pos');
        ?>
" name="<?php 
        echo $this->get_field_name('tooltip_pos');
        ?>
" class="widefat" style="width:100%;">
				<option value="Top" <?php 
        echo 'Top' == $instance['tooltip_pos'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Top', 'Avada');
        ?>
</option>
				<option value="Right" <?php 
        echo 'Right' == $instance['tooltip_pos'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Right', 'Avada');
        ?>
</option>
				<option value="Bottom" <?php 
        echo 'Bottom' == $instance['tooltip_pos'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Bottom', 'Avada');
        ?>
</option>
				<option value="Left" <?php 
        echo 'Left' == $instance['tooltip_pos'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Left', 'Avada');
        ?>
</option>
				<option value="None" <?php 
        echo 'None' == $instance['tooltip_pos'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('None', 'Avada');
        ?>
</option>
			</select>
		</p>

		<p>
			<label for="<?php 
        echo $this->get_field_id('show_custom');
        ?>
"><?php 
        _e('Show Custom Icons:', 'Avada');
        ?>
</label>
			<select id="<?php 
        echo $this->get_field_id('show_custom');
        ?>
" name="<?php 
        echo $this->get_field_name('show_custom');
        ?>
" class="widefat" style="width:100%;">
				<option value="No" <?php 
        echo 'No' == $instance['show_custom'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('No', 'Avada');
        ?>
</option>
				<option value="Yes" <?php 
        echo 'Yes' == $instance['show_custom'] ? 'selected="selected"' : '';
        ?>
><?php 
        _e('Yes', 'Avada');
        ?>
</option>
			</select>
		</p>

		<?php 
        // Create social network fields
        $social_networks_full_array = Avada_Data::fusion_social_icons(false, true);
        foreach ($social_networks_full_array as $key => $value) {
            if ('facebook' == $key) {
                $key = 'fb';
            } elseif ('gplus' == $key) {
                $key = 'google';
            }
            echo '<p>';
            echo '<label for="' . $this->get_field_id($key . '_link') . '">' . sprintf(__('%s Link:', 'Avada'), $value['label']) . '</label>';
            echo '<input class="widefat" type="text" id="' . $this->get_field_id($key . '_link') . '" name="' . $this->get_field_name($key . '_link') . '" value="' . $instance[$key . '_link'] . '" />';
            echo '</p>';
        }
        $color_type_id = $this->get_field_id('color_type');
        $boxed_icon_id = $this->get_field_id('boxed_icon');
        ?>
		<script type="text/javascript">
			jQuery(document).ready(function($){
				var $color_type_field = $("#<?php 
        echo $color_type_id;
        ?>
");
				var $boxed_icon_field = $("#<?php 
        echo $boxed_icon_id;
        ?>
");

				function checkBoxedIcons() {
					var color_type = $color_type_field.val();
					var boxed_icon = $boxed_icon_field.val();

					if ( boxed_icon === 'No' ) {
						$boxed_icon_field.parent().parent().find('.avada-widget-boxed-icon-option-child').hide();
						$boxed_icon_field.parent().parent().find('.avada-widget-boxed-icon-background').hide();
					} else {
						$boxed_icon_field.parent().parent().find('.avada-widget-boxed-icon-option-child').show();

						if ( color_type === 'custom' ) {
							$boxed_icon_field.parent().parent().find('.avada-widget-boxed-icon-background').show();
						}
					}
				}

				function checkColorType() {
					var color_type = $color_type_field.val();
					var boxed_icon = $boxed_icon_field.val();

					if ( color_type === 'brand' ) {
						$color_type_field.parent().parent().find('.avada-widget-color-type-option-child').hide();
					} else {
						$color_type_field.parent().parent().find('.avada-widget-color-type-option-child').show();

						if ( boxed_icon === 'No' ) {
							$boxed_icon_field.parent().parent().find('.avada-widget-boxed-icon-background').hide();
						}
					}
				}

				checkColorType();
				checkBoxedIcons();

				$color_type_field.on('change', function() {
					checkColorType();
				});
				$boxed_icon_field.on('change', function() {
					checkBoxedIcons();
				});

			});
		</script>
		<?php 
    }