<?php
class Petcare_Draggable_Slider_Widget extends WP_Widget{
    public function __construct(){
        global $petcare_plugin_name;
        parent::__construct($petcare_plugin_name.'-slider-widget',
            __('Petcare -  Draggable Slider',$petcare_plugin_name),
            array('description' => __('Displays portfolio and kaya slider items as draggable slider',$petcare_plugin_name), 'class' => 'draggable_widget')
        );
    }    
     public function widget( $args, $instance ) {
      echo $args['before_widget'];
      global $petcare_plugin_name;
          global $post;
      $instance=wp_parse_args($instance, array(
        'title' => '',
        'description' => '',
        'description_color' => '#787878',
        'readmore_text' => __('Read More',$petcare_plugin_name),
        'text_align'   => 'left',
        'title_color' => '#333333',
        'draggable_img_height' => '',
        'draggable_project_link' => '#',
        'draggable_project_title' => '',
        'hide_slide_content' => '',
        'Popular_post_display' => '',
        'draggable_display_orderby' => 'date',
        'draggable_display_order' => 'DESC',
        'draggable_slide_items' => '4',
        'draggable_auto_play' => 'true',
        'select_cat_type' => '',
        'kaya_slider_cat' => '',
        'pf_slider_cat' => '',
        'draggable_title_color' => '#323232',
        'draggable_content_bg_color' => '#f5f5f5',
        'hide_lightbox_icon' => '',
        'hide_post_link_icon' => '',
        'enable_image_link'    => '',
        'heading_styles' => '3',
        'animation_names' => '',
        'price_color' => '#000000',
        'hide_price' => '',
        'hover_icon_bg_color' =>'',
      ));
       $rand = rand(1,50);
        ?>
     <style type="text/css">
       #mid_container_wrapper .kaya_portfolio_widget_sliders<?php echo $rand; ?> .portfolio-container{
            background-color: <?php echo $instance['draggable_content_bg_color']; ?>!important;
            color: <?php echo $instance['draggable_title_color']; ?>!important;
        }
      
        #mid_container_wrapper .kaya_portfolio_widget_sliders<?php echo $rand; ?> .portfolio-container:hover h4{
               color: <?php echo $instance['draggable_title_hover_hover_color']; ?>!important;
        }

        <?php if( $instance['hide_slide_content'] != 'on' ): ?>
     #mid_container_wrapper .kaya_portfolio_widget_sliders<?php echo $rand ?> .strip {
          border-bottom: 11px solid <?php echo $instance['draggable_content_bg_color']; ?>!important;
          display: block;
        }
         <?php endif; ?>

     </style>
        <?php $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%'; ?>
      <script type="text/javascript">
      (function($) {
        "use strict";
        $(function() {
           // Hover Effects
     $('.draggable_slider .portfolio_img_container').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>
    <?php   
      switch ($instance['draggable_slide_items']) {
      case '5':
       $img_width = '350';
        break;
      case '4':
        $img_width = '400';
        break;
      case '3':
        $img_width = '400';
        break;
      case '2':
        $img_width = '600';
        break;
      case '1':
        $img_width = '1100';
        break;  
      default:
        $img_width = '400';
        break;
      }    ?>
    <div class="Portfolio_gallery portfolio_draggable_slider $petcare_plugin_name_portfolio_gallery wow <?php echo $instance['animation_names']; ?>">
     <?php 
      $post_type = ( $instance['select_cat_type'] == 'portfolio_category' ) ? 'portfolio' : 'slider';
      $post_terms = ( $instance['select_cat_type'] == 'portfolio_category' ) ? $instance['pf_slider_cat'] : $instance['kaya_slider_cat'];
      echo '<span class="slider_bg_loading_img container" style="height:150px; background:url('.constant(strtoupper($petcare_plugin_name).'_PLUGIN_URL').'images/bx_loader.GIF)"></span>';
      ?>
    <div id="kaya_portfolio_widget_slider" class="kaya_portfolio_widget_sliders<?php echo $rand; ?>" data-columns="<?php echo $instance['draggable_slide_items']; ?>" data-autoplay="<?php echo $instance['draggable_auto_play']; ?>">
    <?php
    if( $instance['select_cat_type'] == 'portfolio_category'){
      $array_val = ( !empty($instance['pf_slider_cat']) ) ? explode(',', $instance['pf_slider_cat'])  :  '';
    }
    elseif( $instance['select_cat_type'] == 'slider_category'){
     $array_val = ( !empty($instance['kaya_slider_cat']) ) ? explode(',', $instance['kaya_slider_cat'])  :  '';
    } else{ $array_val = '';   } 

    if( ( $instance["Popular_post_display"] == '1') && ($instance["Popular_post_display"] == 'on') ){
      $loop = new WP_Query(array('post_type' => $post_type , 'showposts' => -1, 'meta_key' => 'post_views_count', 'orderby' => 'meta_value_num', 'field' => 'id', 'order' => $instance['draggable_display_order'], 'taxonomy' => $instance['select_cat_type'] ));

    }else{
         if( is_array($array_val ) ){
          $loop = new WP_Query(array( 'post_type' => $post_type,  'orderby' => $instance['draggable_display_orderby'], 'posts_per_page' =>-1,'order' => $instance['draggable_display_order'],  'tax_query' => array('relation' => 'AND', array( 'taxonomy' => $instance['select_cat_type'],   'field' => 'id', 'terms' => $array_val  ) )));
          }else{
                 $loop = new WP_Query(array('post_type' => $post_type, 'taxonomy' => $instance['select_cat_type'],'term' => '', 'orderby' => $instance['draggable_display_orderby'], 'posts_per_page' =>-1,'order' => $instance['draggable_display_order']));
          }
        }

    if( $loop->have_posts() ) : while( $loop->have_posts() ) : $loop->the_post();  
        $title=get_the_title($post->Id);
        global $post;
        $img_url=wp_get_attachment_url( get_post_thumbnail_id() );
        $draggable_link_new_window=get_post_meta(get_the_ID(),'pf_link_new_window' ,true);
        if($draggable_link_new_window == '1') { $draggable_target_link ="_blank"; }else{ $draggable_target_link ='_self'; }
        $permalink = get_permalink();
        $Porfolio_customlink=get_post_meta($post->ID,'Porfolio_customlink',true);
        $pf_customlink = $Porfolio_customlink ? $Porfolio_customlink : $permalink;
        $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';
        $height = $instance['draggable_img_height'] ? $instance['draggable_img_height'] : '300';
       echo '<div class="draggable_slider">';
       echo '<div class="portfolio-container">'; ?>
         <?php if( $instance['enable_image_link'] == 'on' ): ?>
            <a href="<?php echo $pf_customlink; ?>" target="<?php echo $pf_target_link; ?>">
          <?php endif; ?>
          <?php
          $default_img_url = constant(strtoupper($petcare_plugin_name).'_PLUGIN_URL').'images/draggable_slider.jpg';
           echo '<div class="portfolio_img_container">';
                if( $img_url ):
                  echo '<img src="'.kaya_image_resize( $img_url, $img_width , $height, true ).'" class=""  alt="'.$title.'"  />';
                else:
                if (is_multisite()){
                     $img_url = $default_img_url;
                  }else{                  
                    $img_url = kaya_image_resize( $default_img_url,$img_width , $height, true );
                  }
                  echo '<img src="'.$img_url.'" class=""  alt="'.$title.'"  />';
                endif; ?>
                 <?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']" 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']; ?>" href="<?php echo $pf_customlink; ?>" target="<?php echo $draggable_target_link; ?>" >&nbsp; </a> 
              <?php endif; ?>
         </div>
        </a>
            <?php if( $instance['hide_slide_content'] != '1' && $instance['hide_slide_content'] != 'on' ): ?>
           <?php echo '<div class="portfolio_item_text" style="background-color:'.$instance['draggable_content_bg_color'].';">';
                 echo '<h4 style="color:'.$instance['draggable_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;?>
             </div>
                 <?php endif; ?> 
               </div>
      </div>

    <?php endwhile; endif; ?>
    </div>
    <?php wp_reset_query(); ?>
    </div>
    <?php
    echo $args['after_widget'];
    }

    public function form($instance){
      global $petcare_plugin_name;
      $portfolio_terms=  get_terms('portfolio_category','');
    if( $portfolio_terms ){
      foreach ($portfolio_terms as $portfolio_term) { 
         $pf_cats_name[] = $portfolio_term->name.' - '.$portfolio_term->term_id;
         $pf_cats_id[] = $portfolio_term->term_id;
      }
    }else{
      $pf_cats_name[] = '';
      $pf_cats_id[] = '';
    }
     $kayaslider_array =get_terms('slider_category','hide_empty=1');
    if( $kayaslider_array ){
        foreach ($kayaslider_array as $sliders) {
               $kaya_cat_name[] = $sliders->name.' - '.$sliders->term_id;
                $kaya_cat_id[] =$sliders->term_id;
      } } else{
          $kaya_cat_name[] = '';
           $kaya_cat_id[] ='';
      }
      $instance=wp_parse_args($instance, array(
        'title' => '',
        'heading_styles' => '3',
        'description' => '',
        'readmore_text' => __('Read More',$petcare_plugin_name),
        'text_align'   => 'left',
        'title_color' => '#333333',
        'description_color' => '#787878',
        'draggable_img_height' => '',
        'draggable_project_link' => '#',
        'draggable_project_title' => '',
        'hide_slide_content' => '',
        'Popular_post_display' => '',
        'draggable_display_orderby' => 'date',
        'draggable_display_order' => 'DESC',
        'draggable_slide_items' => '4',
        'draggable_auto_play' => 'true',
        'select_cat_type' => '',
        'kaya_slider_cat' => implode(',', $kaya_cat_id),
        'pf_slider_cat' =>  implode(',', $pf_cats_id),
        'draggable_title_color' => '#323232',
        'draggable_content_bg_color' => '#f5f5f5',
        'hide_lightbox_icon' => '',
        'hide_post_link_icon' => '',
        'animation_names' => '',
        'enable_image_link'    => '',
        'hover_icon_bg_color' =>'',
        'price_color' => '#000000',
        'hide_price' => '',
              ));
           ?>
       <script type="text/javascript">
      (function($) {
      "use strict";
      $(function() {

      $("#<?php echo $this->get_field_id('select_cat_type') ?>").change(function () {
      $("#<?php echo $this->get_field_id('kaya_slider_cat') ?>").parent().hide();
      $("#<?php echo $this->get_field_id('pf_slider_cat') ?>").parent().hide();
      var selectlayout = $("#<?php echo $this->get_field_id('select_cat_type') ?> option:selected").val(); 
      switch(selectlayout)
        {
          case 'portfolio_category':
           $("#<?php echo $this->get_field_id('pf_slider_cat') ?>").parent().show();
          break;
          case 'slider_category':
           $("#<?php echo $this->get_field_id('kaya_slider_cat') ?>").parent().show();
          break;


        }
      }).change();
     });
  })(jQuery);
    </script>
    <script type='text/javascript'>
    jQuery(document).ready(function($) {
      jQuery('.draggable_slider_color_pickr').each(function(){
      jQuery(this).wpColorPicker();
      }); 
    });
  </script>
      <p>
      <label for="<?php echo $this->get_field_id('select_cat_type') ?>"> <?php _e('Select Slider Category : ',$petcare_plugin_name); ?></label>
      <select id="<?php echo $this->get_field_id('select_cat_type') ?>" name="<?php echo $this->get_field_name('select_cat_type') ?>">
       <option value="portfolio_category" <?php selected('portfolio_category', $instance['select_cat_type']) ?>> <?php _e('Portfolio Category',$petcare_plugin_name) ?> </option> 
       <option value="slider_category" <?php selected('slider_category',$instance['select_cat_type']) ?>><?php _e('Kaya Slider Category',$petcare_plugin_name) ?></option>
       </select>
      </p>
      <p>
         <p>
      <label for="<?php echo $this->get_field_id('pf_slider_cat') ?>">  <?php _e('Enter Portfolio Category IDs : ',$petcare_plugin_name) ?>  </label>
          <input type="text" name="<?php echo $this->get_field_name('pf_slider_cat') ?>" id="<?php echo $this->get_field_id('pf_slider_cat') ?>" class="widefat" value="<?php echo $instance['pf_slider_cat'] ?>" />
     <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>
   <p>
      <label for="<?php echo $this->get_field_id('kaya_slider_cat') ?>">   <?php _e('Enter Kaya Slider Category IDs : ',$petcare_plugin_name) ?>  </label>
          <input type="text" name="<?php echo $this->get_field_name('kaya_slider_cat') ?>" id="<?php echo $this->get_field_id('kaya_slider_cat') ?>" class="widefat" value="<?php echo $instance['kaya_slider_cat'] ?>" />
      <em><strong style="color:green;"><?php _e('Available Categories and IDs : ',$petcare_plugin_name); ?> </strong><?php echo implode(',', $kaya_cat_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">
      <p class="one_fourth">
        <label for="<?php echo $this->get_field_id('draggable_slide_items') ?>">
        <?php _e('Portfolio Slide Items',$petcare_plugin_name); ?>
        </label>
        <select id="<?php echo $this->get_field_id('draggable_slide_items') ?>" name="<?php echo $this->get_field_name('draggable_slide_items') ?>">
          <option value="1" <?php selected('1', $instance['draggable_slide_items']) ?>>
          <?php esc_html_e('1 Item', '') ?>
          </option>
          <option value="2" <?php selected('2', $instance['draggable_slide_items']) ?>>
          <?php esc_html_e('2 Items', '') ?>
          </option>
          <option value="3" <?php selected('3', $instance['draggable_slide_items']) ?>>
          <?php esc_html_e('3 Items', '') ?>
          </option>
          <option value="4" <?php selected('4', $instance['draggable_slide_items']) ?>>
          <?php esc_html_e('4 Items', '') ?>
          </option>
          <option value="5" <?php selected('5', $instance['draggable_slide_items']) ?>>
          <?php esc_html_e('5 Items', '') ?>
          </option>
        </select>
      </p>
      <p class="one_fourth">
        <label for="<?php echo $this->get_field_id('draggable_auto_play') ?>">
        <?php _e('Auto Play',$petcare_plugin_name)?>
        </label>
        <select id="<?php echo $this->get_field_id('draggable_auto_play') ?>" name="<?php echo $this->get_field_name('draggable_auto_play') ?>">
          <option value="true" <?php selected('true', $instance['draggable_auto_play']) ?>>
          <?php esc_html_e('True', '') ?>
          </option>
          <option value="false" <?php selected('false', $instance['draggable_auto_play']) ?>>
          <?php esc_html_e('False', '') ?>
          </option>
        </select>
      </p>
      <p class="one_fourth">
        <label for="<?php echo $this->get_field_id('draggable_display_orderby') ?>">
        <?php _e('Orderby',$petcare_plugin_name)?>
        </label>
        <select id="<?php echo $this->get_field_id('draggable_display_orderby') ?>" name="<?php echo $this->get_field_name('draggable_display_orderby') ?>">
          <option value="date" <?php selected('date', $instance['draggable_display_orderby']) ?>>
          <?php esc_html_e('Date', '') ?>
          </option>
          <option value="menu_order" <?php selected('menu_order', $instance['draggable_display_orderby']) ?>>
          <?php esc_html_e('Menu Order', '') ?>
          </option>
          <option value="title" <?php selected('title', $instance['draggable_display_orderby']) ?>>
          <?php esc_html_e('Title', '') ?>
          </option>
          <option value="rand" <?php selected('rand', $instance['draggable_display_orderby']) ?>>
          <?php esc_html_e('Random', '') ?>
          </option>
          <option value="author" <?php selected('author', $instance['draggable_display_orderby']) ?>>
          <?php esc_html_e('Author', '') ?>
          </option>
        </select>
      </p>
      <p class="one_fourth_last">
        <label for="<?php echo $this->get_field_id('draggable_display_order') ?>">
        <?php _e('Order',$petcare_plugin_name)?>
        </label>
        <select id="<?php echo $this->get_field_id('draggable_display_order') ?>" name="<?php echo $this->get_field_name('draggable_display_order') ?>">
          <option value="ASC" <?php selected('ASC', $instance['draggable_display_order']) ?>>
          <?php esc_html_e('Ascending', '') ?>
          </option>
          <option value="DESC" <?php selected('DESC', $instance['draggable_display_order']) ?>>
          <?php esc_html_e('Descending', '') ?>
          </option>
        </select>
      </p>
    </div>
      <div class="input-elements-wrapper">
      <p class="one_fourth">
            <label for="<?php echo $this->get_field_id('draggable_title_color'); ?>"><?php _e('Post Slide Title Color',$petcare_plugin_name) ?></label>
            <input type="text" name="<?php echo $this->get_field_name('draggable_title_color') ?>" id="<?php echo $this->get_field_id('draggable_title_color') ?>" class="draggable_slider_color_pickr" value="<?php echo $instance['draggable_title_color'] ?>" />
        </p>
      <p class="one_fourth">
            <label for="<?php echo $this->get_field_id('draggable_content_bg_color'); ?>"><?php _e('Post Slide Content BG Color',$petcare_plugin_name) ?></label>
            <input type="text" name="<?php echo $this->get_field_name('draggable_content_bg_color') ?>" id="<?php echo $this->get_field_id('draggable_content_bg_color') ?>" class="draggable_slider_color_pickr" value="<?php echo $instance['draggable_content_bg_color'] ?>" />
        </p>
        <p class="one_fourth">
        <label for="<?php echo $this->get_field_id('draggable_img_height'); ?>">
        <?php _e('Image Height(px)',$petcare_plugin_name) ?>
        </label>
        <input type="text" name="<?php echo $this->get_field_name('draggable_img_height') ?>" id="<?php echo $this->get_field_id('draggable_img_height') ?>" class="widefat" value="<?php echo $instance['draggable_img_height'] ?>" />
      </p>
       <p class="one_fourth_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('enable_image_link') ?>"><?php _e('Enable Image Link',$petcare_plugin_name)?></label>&nbsp;
         <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("enable_image_link"); ?>" name="<?php echo $this->get_field_name("enable_image_link"); ?>"<?php checked( (bool) $instance["enable_image_link"], true ); ?> />
       </p>
       <p class="one_fourth_last">
        <label for="<?php echo $this->get_field_id('hide_slide_content') ?>"><?php _e('Disable Post Title',$petcare_plugin_name)?></label>&nbsp;
       <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("hide_slide_content"); ?>" name="<?php echo $this->get_field_name("hide_slide_content"); ?>"<?php checked( (bool) $instance["hide_slide_content"], 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="draggable_slider_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="draggable_slider_color_pickr" value="<?php echo $instance['price_color'] ?>" />
      </p>
    </div>
       <p>
   <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>
<?php  }
 }
 petcare_kaya_register_widgets('draggable-slider', __FILE__);
?>