<?php
 class  Petcare_Portfolio_Widget extends WP_Widget{
    public function __construct(){
      global $petcare_plugin_name;
        parent::__construct('kaya-portfolio-widget',
            __('Petcare -  Portfolio (PB)',$petcare_plugin_name),
            array('description' => __('Displays all portfolio items in grid style',$petcare_plugin_name), 'class' => 'portfolio_widget')
        );
    }
    public function widget( $args, $instance ) {
      echo $args['before_widget']; 
      global $petcare_plugin_name;                    
          global $post;
           wp_enqueue_script('jquery.isotope');
      wp_enqueue_style('css_Isotope', constant(strtoupper($petcare_plugin_name).'_PLUGIN_URL').'/css/Isotope.css',false, '', 'all');
      $instance=wp_parse_args($instance, array(
          'description' => '',
          'columns' => '4',
          'readmore_text' => __('Read More',$petcare_plugin_name),
          'text_align'   => __('left',$petcare_plugin_name),
          'pf_img_height' => '400',
          'portfolio_limit' => '',
          'kaya_portfolio_filter' => __('false',$petcare_plugin_name),
          'portfolio_widget_category' => '',
          'disable_title' => '',
          'Popular_post_display' => '',
          'pf_display_orderby' => __('date',$petcare_plugin_name),
          'pf_display_order' => __('DESC',$petcare_plugin_name),
          'hide_post_link_icon' => '',
          'hide_lightbox_icon' => '',
          'hide_post_title' => '',
          'post_title_bg_color' => '#f5f5f5',
          'post_title_color' => '#333',
          'hide_price' => '',
          'animation_names' => '',
          'filter_tab_bg_color' => '#333',
          'filter_tab_text_color' => '#ffffff',
          'filter_tab_active_bg_color' => '#ff6c00',
          'filter_tab_active_text_color' => '#ffffff',
          'disable_pagination' => '',
          'price_color' => '#000000',
          'hover_icon_bg_color' =>'',
          'hover_icon_hover_bg_color' =>'#3c8a9a',
      )); ?>
<?php   $effects = rand(1,200);
        $rand = rand(1,200);
        $post_icon = ( $instance['hide_lightbox_icon'] == 'on' ) ? "50%" : '30%'; ?>
        <?php $post_class = ( $instance['hide_lightbox_icon'] == 'on' ) ? "left" : 'right'; ?>
        <?php $lightbox_icon = ( $instance['hide_post_link_icon'] == 'on' ) ? "50%" : '30%'; ?>
    <?php  switch( $instance['columns'] ){
         case 5:
            $width = "480";
            $height = $instance['pf_img_height'] ? $instance['pf_img_height'] : '400';
            break;
        case 4:
            $width = "500";
            $height = $instance['pf_img_height'] ? $instance['pf_img_height'] : '400';
            break;
        case 3:
            $width =  "650";
            $height = $instance['pf_img_height'] ? $instance['pf_img_height'] : '400';
            break;
         case 2:
             $width =  "920";
            $height = $instance['pf_img_height'] ? $instance['pf_img_height'] : '400';
      } 
    ?>
    <script type="text/javascript">
      (function($) {
        "use strict";
        $(function() {
        // Hover Effects
        $('.widget_kaya-portfolio-widget .Portfolio_gallery-<?php echo $effects; ?> li').hover(function(){
          $(this).find('img').fadeTo(500,0.6);
          $(this).find('.link_to_image, .link_to_video').css({'left':'-100px','display':'block'}).stop().animate({'left':'<?php echo $lightbox_icon; ?>', opacity:1},600);
          $(this).find('.link_to_post').css({'<?php echo $post_class; ?>':'-100px','display':'block'}).stop().animate({'<?php echo $post_class; ?>':'<?php echo $post_icon; ?>',opacity:1},600);
        },function(){
          $(this).find('img').fadeTo(500,1);
          $(this).find('.link_to_image, .link_to_video').css({'left':'100','display':'block'}).stop().animate({'left':'-<?php echo $lightbox_icon; ?>',opacity:0},600);
          $(this).find('.link_to_post').css({'<?php echo $post_class; ?>':'100px','display':'block'}).stop().animate({'<?php echo $post_class; ?>':'-<?php echo $post_icon; ?>',opacity:0},600);
       }); 
         });
        
      })(jQuery);
     </script>
     </script>
          <style type="text/css">
      #mid_container_wrapper .widget_kaya-portfolio-widget .filter-<?php echo $rand; ?> a:hover, .filter-<?php echo $rand; ?> .active{
        background-color: <?php echo $instance['filter_tab_active_bg_color']; ?>!important;
        color: <?php echo $instance['filter_tab_active_text_color']; ?>!important;
      }
      .link_to_post:hover,.link_to_image:hover,.link_to_video:hover{
        background-color: <?php echo $instance['hover_icon_hover_bg_color']; ?>!important;
      }
     </style>
    <?php 
    $pf_animation_effcect = $instance['animation_names'] ?  'wow '.$instance['animation_names'].'' : '';
    echo '<div class="'.$pf_animation_effcect.'">';
        // $title = apply_filters('widget_title' ,$title);
     $array_val = ( !empty( $instance['portfolio_widget_category'] )) ? explode(',',  $instance['portfolio_widget_category']) : '';
 
              if ($instance['kaya_portfolio_filter'] == 'true'){ // open filter settings
            echo '<div class="filter_portfolio">';
              echo '<div class="filter filter-'.$rand.'" id="filter">';
                echo '<ul style="text-align:'.$instance['text_align'].';">';
                  echo '<li class="all" ><a class="" href="#" style="color:'.$instance['filter_tab_text_color'].'; background:'.$instance['filter_tab_bg_color'].';" data-category="all">'.__( 'All', $petcare_plugin_name ).'</a></li>';
                  $category = trim( $instance['portfolio_widget_category']);
                  if( $category ){
                    $pf_categories = @explode(',', $category);
                     for($i=0;$i<count($pf_categories);$i++){
                      $terms[] = get_term_by('id', $pf_categories[$i], 'portfolio_category');
                    } } else {
                      $terms = get_terms('portfolio_category');
                    }
                    foreach($terms as $term) {
                    echo '<li  class="cat-'.$term->term_id .'" >';
                    echo '<a href="" style="color:'.$instance['filter_tab_text_color'].'; background:'.$instance['filter_tab_bg_color'].';" data-category="cat-' . $term->term_id . '">' . $term->name . ' </a></li>';
                    }
                    //print_r($terms);
                echo '</ul>';
             echo '</div>';
           echo '</div>'; 
      } // end filter ?>
    <div class="Portfolio_gallery $petcare_plugin_name_portfolio_gallery Portfolio_gallery-<?php echo $effects; ?> <?php echo $fluid_gallery_width; ?>">
      <ul  id="list"  class="isotope-container portfolio<?php echo $instance['columns'] ?> porfolio_items portfolio_extra clearfix">
        <?php
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; 
   if( $instance["Popular_post_display"] == '1' || $instance["Popular_post_display"] == 'on' ){
           $args = array('paged' => $paged, 'post_type' => 'portfolio', 'showposts' => $instance['portfolio_limit'], 'meta_key' => 'post_views_count', 'orderby' => 'meta_value_num', 'field' => 'id', 'order' => $instance['pf_display_order'], 'taxonomy' => 'portfolio_category');
        }else{
         if( $array_val ) {
          $args = array( 'paged' => $paged, 'post_type' => 'portfolio',  'orderby' => $instance['pf_display_orderby'], 'posts_per_page' =>$instance['portfolio_limit'],'order' => $instance['pf_display_order'],  'tax_query' => array('relation' => 'AND', array( 'taxonomy' => 'portfolio_category',   'field' => 'id', 'terms' => $array_val  ), ));
          }else{
             $args = array( 'paged' => $paged, 'post_type' => 'portfolio', 'taxonomy' => 'portfolio_category','term' => $instance['portfolio_widget_category'], 'orderby' => $instance['pf_display_orderby'], 'posts_per_page' =>$instance['portfolio_limit'],'order' => $instance['pf_display_order']);
          }
        }
      query_posts($args);
      if( have_posts() ) : while( have_posts() ) : the_post();
      $terms = get_the_terms(get_the_ID(), 'portfolio_category');
      $pf_link_new_window=get_post_meta(get_the_ID(),'pf_link_new_window' ,true);
            if($pf_link_new_window == '1') { $pf_target_link ="_blank"; }else{ $pf_target_link ='_self'; }
            $permalink = get_permalink();
            $Porfolio_customlink=get_post_meta($post->ID,'Porfolio_customlink',true);
            $pf_customlink = $Porfolio_customlink ? $Porfolio_customlink : $permalink;
        $terms_id = array();
        $terms_name = array();
        if($terms ){
        foreach ($terms as $term) {
          $terms_id[] = 'cat-'.$term->term_id;
          $terms_name[] = $term ->name;
        }
      }else{
        $terms_name[] = 'Uncategorized';
      }
        echo '<li class="isotope-item all '.implode(' ', $terms_id).'">';   ?>
        <div class="item_container">
      <?php $default_img_url = constant(strtoupper($petcare_plugin_name).'_PLUGIN_URL').'images/portfolio.jpg';
      $img_url = wp_get_attachment_url( get_post_thumbnail_id() );
        global $post;
         $lightbox_url =  get_template_directory_uri().'/images/defult_featured_img.png';
         $featured_img = $img_url ? $img_url : $lightbox_url;
          $video_url= get_post_meta($post->ID,'video_url',true);
           $lightbox_type = $video_url ? trim($video_url) : $featured_img;
           $class = $video_url ? 'link_to_video' : 'link_to_image';
            if( $img_url ) {
                $lightbox_url =  $img_url;
              echo '<img src="'.kaya_image_resize( $img_url, $width, $height, 't' ).'" alt="'.get_the_title().'" />';
              }else{
                if (is_multisite()){
                     $img_url = $default_img_url;
                  }else{                  
                    $img_url = kaya_image_resize( $default_img_url,$width, $height, 't' );
                  }
                  echo '<img src="'.$img_url.'" alt="'.get_the_title().'"  />';
              } 
 ?>
        <?php if( $instance['hide_lightbox_icon'] != '1' && $instance['hide_lightbox_icon'] != 'on' ): ?>
                <a class="<?php echo $class; ?> pf_images" style="background-color:<?php echo $instance['hover_icon_bg_color']; ?>"rel="prettyPhoto['gallery']" title="<?php echo the_title();?>" href="<?php echo $lightbox_type; ?>" >&nbsp;</a>
        <?php endif; ?>
        <?php if( $instance['hide_post_link_icon'] != '1' && $instance['hide_post_link_icon'] != 'on' ): ?>
                <a class="link_to_post" style="background-color:<?php echo $instance['hover_icon_bg_color']; ?>" target = "<?php echo $pf_target_link; ?>" href="<?php echo $pf_customlink; ?>">&nbsp; </a>
        <?php endif; ?>
       </div> 
               <?php if( $instance['hide_post_title'] != 'on' ): ?>    
             <div class="portfolio_post_content" style="background-color:<?php echo $instance['post_title_bg_color']; ?>">
             <?php echo '<h4 style="color:'.$instance['post_title_color'].';">'.get_the_title().'</h4>'; ?>
            
            <?php
              $price = get_post_meta(get_the_ID(),'fooditem_price',true);
              if( $price &&  $instance['hide_price'] != 'on' ): echo '<span style="color:'.$instance['price_color'].';"class="item_price">'.$price.'</span>'; endif;
              echo '</div>';  ?>
            <?php endif; ?>
       </li>
       <?php endwhile; endif; ?>
    </ul> <?php
      if( $instance['disable_pagination'] != 'on'){
          echo kaya_pagination();    
       } 
      wp_reset_query(); ?>
    </div>
    <?php echo '</div>'; ?>
     <?php echo '</div>'; ?>
    <?php 
    }
    public function form($instance){
global $petcare_plugin_name;
      $portfolio_terms=  get_terms('portfolio_category','');
          $portfolio_terms=  get_terms('portfolio_category','');
        if( $portfolio_terms ){
          foreach ($portfolio_terms as $portfolio_term) { 
            $pf_cat_ids[] = $portfolio_term->term_id;
             $pf_cats_name[] = $portfolio_term->name.' - '.$portfolio_term->term_id;
          }
        }else{ $pf_cats_name[] = ''; $pf_cat_ids[] =''; }

         $instance = wp_parse_args($instance, array(
          'description' => '',
          'columns' => '4',
          'readmore_text' => __('Read More',$petcare_plugin_name),
          'text_align'   => __('left',$petcare_plugin_name),
          'pf_img_height' => '400',
          'portfolio_limit' => '',
          'kaya_portfolio_filter' => __('false',$petcare_plugin_name),
          'portfolio_widget_category' => implode(',', $pf_cat_ids),
          'disable_title' => '',
          'Popular_post_display' => '',
          'pf_display_orderby' => __('date',$petcare_plugin_name),
          'pf_display_order' => __('DESC',$petcare_plugin_name),
          'hide_post_link_icon' => '',
          'hide_lightbox_icon' => '',
          'hide_post_title' => '',
          'animation_names' => '',
          'post_title_bg_color' => '#f5f5f5',
          'post_title_color' => '#333',
          'hide_price' => '',
          'filter_tab_bg_color' => '#333',
          'filter_tab_text_color' => '#ffffff',
          'filter_tab_active_bg_color' => '#ff6c00',
          'filter_tab_active_text_color' => '#ffffff',
          'disable_pagination' => '',
          'price_color' => '#000000',
          'hover_icon_bg_color' =>'',
          'hover_icon_hover_bg_color' =>'#3c8a9a',
      )); ?>

         <script type="text/javascript">
      (function($) {
        "use strict";
        $(function() {
        $("#<?php echo $this->get_field_id('kaya_portfolio_filter') ?>").change(function () {
          $(".<?php echo $this->get_field_id('kaya_portfolio_filter'); ?>").find('.filter_tab_enable').hide();
          var selectlayout = $("#<?php echo $this->get_field_id('kaya_portfolio_filter') ?> option:selected").val();
        switch(selectlayout)
          {
            case 'true':
              $(".<?php echo $this->get_field_id('kaya_portfolio_filter'); ?>").find('.filter_tab_enable').show();
            break;
            case 'false':
            break;      
          }
        }).change();
      // Color picker
        $('.pf_color_pickr').each(function(){
          $(this).wpColorPicker();
        });
        });
      })(jQuery);
      </script>
 <div class="input-elements-wrapper">
<p>
  <label for="<?php echo $this->get_field_id('text_align') ?>">
  <?php _e('Filters Tabs Position',$petcare_plugin_name)?>
  </label>
  <select id="<?php echo $this->get_field_id('text_align') ?>" name="<?php echo $this->get_field_name('text_align') ?>">
    <option value="left" <?php selected('left', $instance['text_align']) ?>>
    <?php esc_html(_e(' Left', $petcare_plugin_name) );?>
    </option>
    <option value="right" <?php selected('right', $instance['text_align']) ?>>
    <?php esc_html(_e(' Right', $petcare_plugin_name) );?>
    </option>
    <option value="center" <?php selected('center', $instance['text_align']) ?>>
    <?php esc_html(_e(' Center', $petcare_plugin_name) );?>
    </option>
  </select>
</p>
</div>
<p>
  <label for="<?php echo $this->get_field_id('portfolio_widget_category') ?>"> <?php _e('Enter Portfolio Category IDs : ',$petcare_plugin_name) ?> </label>
 <input type="text" name="<?php echo $this->get_field_name('portfolio_widget_category') ?>" id="<?php echo $this->get_field_id('portfolio_widget_category') ?>" class="widefat" value="<?php echo $instance['portfolio_widget_category'] ?>" />
  <em><strong style="color:green;"><?php _e('Available Categories and IDs : ',$petcare_plugin_name); ?> </strong><?php echo implode(',', $pf_cats_name); ?></em><br />
   <stong><?php _e('Note:',$petcare_plugin_name); ?></strong><?php _e('Separate IDs with commas only',$petcare_plugin_name); ?>
</p>
<div class="input-elements-wrapper <?php echo $this->get_field_id('kaya_portfolio_filter') ?>">
<p class="one_fifth">
  <label for="<?php echo $this->get_field_id('kaya_portfolio_filter') ?>">
  <?php _e('Portfolio Filter Tabs',$petcare_plugin_name)?>
  </label>
  <select id="<?php echo $this->get_field_id('kaya_portfolio_filter') ?>" name="<?php echo $this->get_field_name('kaya_portfolio_filter') ?>">
    <option value="false" <?php selected('false', $instance['kaya_portfolio_filter']) ?>>
    <?php esc_html(_e('False', $petcare_plugin_name )); ?>
    </option>
    <option value="true" <?php selected('true', $instance['kaya_portfolio_filter']) ?>>
    <?php esc_html(_e('True', $petcare_plugin_name) );?>
    </option>
  </select>
</p>
<p class=" one_fifth filter_tab_enable">
  <label for="<?php echo $this->get_field_id('filter_tab_bg_color'); ?>"><?php _e('Filter Tab BG Color',$petcare_plugin_name) ?></label>
  <input type="text" name="<?php echo $this->get_field_name('filter_tab_bg_color') ?>" id="<?php echo $this->get_field_id('filter_tab_bg_color') ?>" class="pf_color_pickr" value="<?php echo $instance['filter_tab_bg_color'] ?>" />
</p>
<p class=" one_fifth filter_tab_enable">
  <label for="<?php echo $this->get_field_id('filter_tab_text_color'); ?>"><?php _e('Filter Tab Text Color',$petcare_plugin_name) ?></label>
  <input type="text" name="<?php echo $this->get_field_name('filter_tab_text_color') ?>" id="<?php echo $this->get_field_id('filter_tab_text_color') ?>" class="pf_color_pickr" value="<?php echo $instance['filter_tab_text_color'] ?>" />
</p>
<p class="one_fifth filter_tab_enable">
  <label for="<?php echo $this->get_field_id('filter_tab_active_bg_color'); ?>"><?php _e('Filter Tab Acive BG Color',$petcare_plugin_name) ?></label>
  <input type="text" name="<?php echo $this->get_field_name('filter_tab_active_bg_color') ?>" id="<?php echo $this->get_field_id('filter_tab_active_bg_color') ?>" class="pf_color_pickr" value="<?php echo $instance['filter_tab_active_bg_color'] ?>" />
</p>
<p class=" one_fifth_last filter_tab_enable">
  <label for="<?php echo $this->get_field_id('filter_tab_active_text_color'); ?>"><?php _e('Filter Tab Active Text Color',$petcare_plugin_name) ?></label>
  <input type="text" name="<?php echo $this->get_field_name('filter_tab_active_text_color') ?>" id="<?php echo $this->get_field_id('filter_tab_active_text_color') ?>" class="pf_color_pickr" value="<?php echo $instance['filter_tab_active_text_color'] ?>" />
</p>
</div>
<div class="input-elements-wrapper">
<p class="one_fourth">
  <label for="<?php echo $this->get_field_id('columns') ?>">
  <?php _e('Select Columns',$petcare_plugin_name)?>
  </label>
  <select id="<?php echo $this->get_field_id('columns') ?>" name="<?php echo $this->get_field_name('columns') ?>">
    <option value="5" <?php selected('5', $instance['columns']) ?>>
    <?php esc_html(_e('Column5', $petcare_plugin_name)); ?>
    </option>
    <option value="4" <?php selected('4', $instance['columns']) ?>>
    <?php esc_html(_e('Column4', $petcare_plugin_name) );?>
    </option>
    <option value="3" <?php selected('3', $instance['columns']) ?>>
    <?php esc_html(_e('Column3', $petcare_plugin_name)); ?>
    </option>
    <option value="2" <?php selected('2', $instance['columns']) ?>>
    <?php esc_html(_e('Column2', $petcare_plugin_name)); ?>
    </option>
  </select>
</p>
<p class="one_fourth">
  <label for="<?php echo $this->get_field_id('pf_display_orderby') ?>">
  <?php _e('Orderby',$petcare_plugin_name)?>
  </label>
  <select id="<?php echo $this->get_field_id('pf_display_orderby') ?>" name="<?php echo $this->get_field_name('pf_display_orderby') ?>">
    <option value="date" <?php selected('date', $instance['pf_display_orderby']) ?>>
    <?php esc_html(_e('Date', $petcare_plugin_name)); ?>
    </option>
    <option value="menu_order" <?php selected('menu_order', $instance['pf_display_orderby']) ?>>
    <?php esc_html(_e('Menu Order', $petcare_plugin_name)); ?>
    </option>
    <option value="title" <?php selected('title', $instance['pf_display_orderby']) ?>>
    <?php esc_html(_e('Title', $petcare_plugin_name)); ?>
    </option>
    <option value="rand" <?php selected('rand', $instance['pf_display_orderby']) ?>>
    <?php esc_html(_e('Random', $petcare_plugin_name) );?>
    </option>
    <option value="author" <?php selected('author', $instance['pf_display_orderby']) ?>>
    <?php esc_html(_e('Author', $petcare_plugin_name)); ?>
    </option>
  </select>
</p>
<p class="one_fourth">
  <label for="<?php echo $this->get_field_id('pf_display_order') ?>">
  <?php _e('Order',$petcare_plugin_name)?>
  </label>
  <select id="<?php echo $this->get_field_id('pf_display_order') ?>" name="<?php echo $this->get_field_name('pf_display_order') ?>">
    <option value="ASC" <?php selected('ASC', $instance['pf_display_order']) ?>>
    <?php esc_html(_e('Ascending', $petcare_plugin_name) );?>
    </option>
    <option value="DESC" <?php selected('DESC', $instance['pf_display_order']) ?>>
    <?php esc_html(_e('Descending', $petcare_plugin_name) );?>
    </option>
  </select>
</p>
</div>
<div class="input-elements-wrapper">
<p class="one_fifth">
  <label for="<?php echo $this->get_field_id('pf_img_height') ?>">
  <?php _e('Image Height(px)',$petcare_plugin_name)?>
  </label>
  <input type="text" class="widefat" id="<?php echo $this->get_field_id('pf_img_height') ?>" value="<?php echo esc_attr($instance['pf_img_height']) ?>" name="<?php echo $this->get_field_name('pf_img_height') ?>" />
</p>
<p class="one_fifth">
  <label for="<?php echo $this->get_field_id('portfolio_limit') ?>">
  <?php _e('Display Number of Images',$petcare_plugin_name)?>
  </label>
  <input type="text" class="widefat" id="<?php echo $this->get_field_id('portfolio_limit') ?>" value="<?php echo esc_attr($instance['portfolio_limit']) ?>" name="<?php echo $this->get_field_name('portfolio_limit') ?>" />
</p>
<p class="one_fifth">
  <label for="<?php echo $this->get_field_id('post_title_bg_color'); ?>"><?php _e('Post Title BG Color',$petcare_plugin_name) ?></label>
  <input type="text" name="<?php echo $this->get_field_name('post_title_bg_color') ?>" id="<?php echo $this->get_field_id('post_title_bg_color') ?>" class="pf_color_pickr" value="<?php echo $instance['post_title_bg_color'] ?>" />
</p>
<p class="one_fifth">
  <label for="<?php echo $this->get_field_id('post_title_color'); ?>"><?php _e('Post Title Color',$petcare_plugin_name) ?></label>
  <input type="text" name="<?php echo $this->get_field_name('post_title_color') ?>" id="<?php echo $this->get_field_id('post_title_color') ?>" class="pf_color_pickr" value="<?php echo $instance['post_title_color'] ?>" />
</p>
<p class="one_fifth_last">
  <label for="<?php echo $this->get_field_id('Popular_post_display') ?>">
  <?php _e('Popular Posts',$petcare_plugin_name)?>
  </label>
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("Popular_post_display"); ?>" name="<?php echo $this->get_field_name("Popular_post_display"); ?>"<?php checked( (bool) $instance["Popular_post_display"], true ); ?> />
</p>
</div>
<div class="input-elements-wrapper">
  <p class="one_fourth">
  <label for="<?php echo $this->get_field_id('hide_lightbox_icon') ?>"><?php _e('Disable Lightbox icon',$petcare_plugin_name)?></label>&nbsp;
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("hide_lightbox_icon"); ?>" name="<?php echo $this->get_field_name("hide_lightbox_icon"); ?>"<?php checked( (bool) $instance["hide_lightbox_icon"], true ); ?> />
  </p>
  <p class="one_fourth">
  <label for="<?php echo $this->get_field_id('hide_post_link_icon') ?>"><?php _e('Disable Post Link icon',$petcare_plugin_name)?></label>&nbsp;
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("hide_post_link_icon"); ?>" name="<?php echo $this->get_field_name("hide_post_link_icon"); ?>"<?php checked( (bool) $instance["hide_post_link_icon"], true ); ?> />
  </p>
  <p class="one_fourth">
        <label for="<?php echo $this->get_field_id('hide_post_title') ?>"><?php _e('Disable Post Title',$petcare_plugin_name)?></label>&nbsp;
       <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("hide_post_title"); ?>" name="<?php echo $this->get_field_name("hide_post_title"); ?>"<?php checked( (bool) $instance["hide_post_title"], true ); ?> />
</p>
<p class="one_fourth_last">
  <label for="<?php echo $this->get_field_id('disable_pagination') ?>">
  <?php _e('Disable Pagination',$petcare_plugin_name)?>
  </label>
  <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("disable_pagination"); ?>" name="<?php echo $this->get_field_name("disable_pagination"); ?>"<?php checked( (bool) $instance["disable_pagination"], true ); ?> />
</p>
</div>
<div class="input-elements-wrapper">
<p class="one_fourth">
  <label for="<?php echo $this->get_field_id('price_color'); ?>"><?php _e('Price Color',$petcare_plugin_name) ?></label>
  <input type="text" name="<?php echo $this->get_field_name('price_color') ?>" id="<?php echo $this->get_field_id('price_color') ?>" class="pf_color_pickr" value="<?php echo $instance['price_color'] ?>" />
</p>
<p class="one_fourth">
   <label for="<?php echo $this->get_field_id('hide_price') ?>"><?php _e('Disable Price',$petcare_plugin_name)?></label>&nbsp;
       <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("hide_price"); ?>" name="<?php echo $this->get_field_name("hide_price"); ?>"<?php checked( (bool) $instance["hide_price"], true ); ?> />
</p>
 <p class="one_fourth">
    <label for="<?php echo $this->get_field_id('hover_icon_bg_color'); ?>"><?php _e('Icon Background Color',$petcare_plugin_name) ?></label>
    <input type="text" name="<?php echo $this->get_field_name('hover_icon_bg_color') ?>" id="<?php echo $this->get_field_id('hover_icon_bg_color') ?>" class="pf_color_pickr" value="<?php echo $instance['hover_icon_bg_color'] ?>" />
      </p>
 <p class="one_fourth_last">
    <label for="<?php echo $this->get_field_id('hover_icon_hover_bg_color'); ?>"><?php _e('Icon Background Hover Color',$petcare_plugin_name) ?></label>
    <input type="text" name="<?php echo $this->get_field_name('hover_icon_hover_bg_color') ?>" id="<?php echo $this->get_field_id('hover_icon_hover_bg_color') ?>" class="pf_color_pickr" value="<?php echo $instance['hover_icon_hover_bg_color'] ?>" />
      </p>
</div>
<div class="input-elements-wrapper">
    <label for="<?php echo $this->get_field_id('animation_names') ?>">  <?php _e('Select Animation Effect',
    $petcare_plugin_name) ?>  </label>
      <?php animation_effects($this->get_field_name('animation_names'), $instance['animation_names'] ); ?>
</p> 
</div>
<?php
}
 }
 petcare_kaya_register_widgets('portfolio', __FILE__);
 ?>