function form($instance) { global $icons_name; $defaults = array('title' => '', 'phone' => '', 'icon_type' => 'icon', 'text' => '', 'class' => ''); $icon_list = YIT_Plugin_Common::get_icon_list(); $instance = wp_parse_args((array) $instance, $defaults); $current_icon = isset($instance['icon']) ? YIT_Icon()->get_icon_data($instance['icon']) : ''; ?> <p> <label for="<?php esc_attr($this->get_field_id('title')); ?> "><?php _e('Title', 'yit'); ?> </label> <input class="widefat" type="text" id="<?php echo esc_attr($this->get_field_id('title')); ?> " name="<?php echo esc_attr($this->get_field_name('title')); ?> " value="<?php echo esc_attr($instance['title']); ?> " /> </p> <p> <label for="<?php esc_attr($this->get_field_id('phone')); ?> "><?php _e('Phone', 'yit'); ?> </label> <input class="widefat" type="text" id="<?php echo esc_attr($this->get_field_id('phone')); ?> " name="<?php echo esc_attr($this->get_field_name('phone')); ?> " value="<?php echo esc_attr($instance['phone']); ?> " /> </p> <p> <label for="<?php esc_attr($this->get_field_id('class')); ?> "><?php _e('Extra Class', 'yit'); ?> </label> <input class="widefat" type="text" id="<?php echo esc_attr($this->get_field_id('class')); ?> " name="<?php echo esc_attr($this->get_field_name('class')); ?> " value="<?php echo esc_attr($instance['class']); ?> " /> </p> <div class="widget-icon-manager"> <div class="icon-manager-wrapper"> <label for="<?php echo esc_attr($this->get_field_id('icon')); ?> "><?php _e('Icon', 'yit'); ?> </label> <div class="icon-manager-text"> <div class="icon-preview" <?php echo $current_icon; ?> ></div> <input type="text" id="<?php echo esc_attr($this->get_field_id('icon')); ?> " class="icon-text" name="<?php echo esc_attr($this->get_field_name('icon')); ?> " value="<?php echo esc_attr($instance['icon']); ?> " /> </div> <div class="icon-manager"> <ul class="icon-list-wrapper"> <?php foreach ($icon_list as $font => $icons) { foreach ($icons as $key => $icon) { ?> <li data-font="<?php echo $font; ?> " data-icon="<?php echo strpos($key, '\\') === 0 ? '&#x' . substr($key, 1) . ';' : $key; ?> " data-key="<?php echo $key; ?> " data-name="<?php echo $icon; ?> "></li> <?php } } ?> </ul> </div> </div> </div> <p> <label for="<?php echo esc_attr($this->get_field_id('text')); ?> "><?php _e('Text ( you can use html )', 'yit'); ?> </label> <textarea class="widefat" id="<?php echo esc_attr($this->get_field_id('text')); ?> " name="<?php echo esc_attr($this->get_field_name('text')); ?> " cols="20" rows="16"><?php echo esc_attr($instance['text']); ?> </textarea> </p> <?php }
} $show = yit_get_post_meta($post->ID, '_modal_window'); $img = yit_get_post_meta($post->ID, '_modal_window_img'); $title = yit_get_post_meta($post->ID, '_modal_window_title'); $text = yit_get_post_meta($post->ID, '_modal_window_text'); $icon = yit_get_post_meta($post->ID, '_modal_window_icon'); $img_html = '<img src="' . $img . '">'; if ($show == 'yes') { ?> <div id="modal-window"> <?php if ($icon['select'] != 'none') { if ($icon['select'] == 'icon') { ?> <span class="icon-form" <?php echo YIT_Icon()->get_icon_data($icon['icon']); ?> ></span> <?php } else { ?> <span class="custom-icon"><img src="<?php echo esc_url($icon['custom']); ?> "></span> <?php } } ?> <?php echo do_shortcode('[modal title="' . $title . '" link_text_opener="' . $text . '" link_text_size="13" opener="text"]' . $img_html . '[/modal]');
*/ /** * Awesome Icon Admin View * * @package Yithemes * @author Emanuela Castorina <*****@*****.**> * @since 1.0.0 */ extract($args); if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $current_options = wp_parse_args($args['value'], $args['std']); $current_icon = YIT_Icon()->get_icon_data($current_options['icon']); $current_icon = YIT_Icon()->get_icon_data($std['icon']); $options['icon'] = YIT_Plugin_Common::get_icon_list(); ?> <div id="<?php echo $id; ?> -container" <?php if (isset($deps)) { ?> data-field="<?php echo $id; ?> " data-dep="<?php
<div class="clearfix box-sections <?php echo esc_attr($class . $last_class . $animate); ?> <?php echo $layout; ?> " <?php echo $delay; ?> > <?php echo $a_before; echo '<div class="box-icon">'; if ($icon_type == 'theme-icon') { $icon_data = YIT_Icon()->get_icon_data($icon_theme); $margin_left = $circle_size != 0 && $layout == 'horizontal' ? $circle_size + 30 : $margin_left; echo '<span class="icon-circle" style="border-width:' . $border_size . 'px;width:' . $circle_size . 'px; height:' . $circle_size . 'px;border-color: ' . $color_circle . ';">'; $color = $color == '' ? '' : 'color:' . $color; $icon_size = $icon_size == '' ? '14' : $icon_size; echo '<span class="icon"><i ' . $icon_data . '" style="' . $color . '; font-size:' . $icon_size . 'px"></i></span>'; echo '</span>'; } elseif (strcmp($icon_custom, '') != 0) { $image = yit_image("echo=no&src=" . $icon_custom . "&getimagesize=1"); echo '<span class="icon">' . $image . '</span>'; } echo '</div><div class="box-content" style="margin-left:' . $margin_left . 'px">'; if ($title != '') { echo '<' . $title_size . '>' . $title . '</' . $title_size . '>'; } echo $a_after;
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); if (strpos($before_widget, 'widget-wrap') === false) { if ($title != '') { $before_widget .= '<div class="clearfix widget-wrap">'; } else { $before_widget .= '<div class="clearfix widget-wrap" style="margin-bottom: 20px;">'; } $after_widget .= '</div>'; } echo $before_widget; // if ( $title ) { // echo $before_title . $title . $after_title; // } echo '<div>'; if ($instance['autop']) { $instance['text'] = wpautop(apply_filters('widget_text', $instance['text'])); } $text = '<div class="clearfix widget_image ' . $instance['align'] . '">'; if (isset($instance['link']) && $instance['link'] != '') { $text .= '<a href ="' . esc_url($instance['link']) . '">'; } if (isset($instance['icon_type'])) { switch ($instance['icon_type']) { case 'icon': if (isset($instance['icon'])) { $current_icon = YIT_Icon()->get_icon_data($instance['icon']); $text .= '<i ' . $current_icon . ' ></i>'; } break; case 'custom': if (isset($instance['image']) && $instance['image'] != '') { $text .= yit_image("echo=no&src=" . $instance['image'] . "&getimagesize=1&alt=" . $instance['title']); } break; default: } } if (isset($instance['link']) && $instance['link'] != '') { $text .= '</a>'; } $localized_text = function_exists('icl_translate') ? icl_translate('Widgets', 'widget_text_yit_text_image' . sanitize_title($instance['text']), $instance['text']) : $instance['text']; $text .= '</div><div class="widget_text left">'; if ($title) { $text .= $before_title . $title . $after_title; } $text .= $localized_text; // $text .= '</div><div class="widget_text left">' . $localized_text; // echo do_shortcode($text); echo '</div></div>'; echo $after_widget; }