public function frontend_enqueue_scripts()
 {
     parent::frontend_enqueue_scripts();
     if (!is_admin()) {
         wp_enqueue_script('wplb-gmap-api', 'http://maps.google.com/maps/api/js?sensor=false&language=en', array('jquery'), '1.0', true);
         wp_enqueue_script('wplb-gmap3-js', WPLB_WIDGETS_JS_URL . 'gmap3.js', array('jquery', 'wplb-gmap-api'), '6.0.0', true);
     }
 }
 public function __construct()
 {
     $widgets_init = array('id_base' => 'wplb-socials-widget', 'name' => $this->plugin_name . __(' Socials Link', 'wplb'), 'options' => array('classname' => 'wplb-socials-widget', 'description' => __('Display Socials Link', 'wplb')));
     $defaults = array('title' => array('label' => __('Title', 'wplb'), 'std' => __('Socials', 'wplb'), 'type' => 'text'), 'fb_url' => array('label' => __('Facebook url', 'wplb'), 'type' => 'text', 'std' => 'http://facebook.com'), 'google_url' => array('label' => __('Youtube url', 'wplb'), 'std' => 'http://youtube.com', 'type' => 'text'), 'tw_url' => array('label' => __('Twitter url', 'wplb'), 'std' => 'http://twitter.com', 'type' => 'text'), 'pinterest_url' => array('label' => __('Pinterest', 'wplb'), 'type' => 'text', 'std' => 'http://pinterest.com'), 'size' => array('label' => __('Size', 'wplb'), 'type' => 'select', 'options' => array('32' => '32px', '16' => '16px'), 'std' => '32'), 'target' => array('label' => __('Target', 'wplb'), 'type' => 'select', 'options' => array('_blank' => '_blank', '_self' => '_self', '_parent' => '_parent', '_top' => '_top'), 'std' => '_parent'), 'class' => array('label' => __('Class', 'wplb'), 'type' => 'text'));
     $widgets_init = apply_filters('wplb_widgets_socials_init', $widgets_init);
     $defaults = apply_filters('wplb_widgets_socials_default', $defaults);
     parent::__construct($widgets_init, $defaults);
 }
 public function __construct()
 {
     $widgets_init = array('id_base' => 'wplb-image-widget', 'name' => $this->plugin_name . __(' Image Upload', 'wplb'), 'options' => array('classname' => 'wplb-image-widget', 'description' => __('Display image with a title, url, caption ...', 'wplb')));
     $defaults = array('title' => array('label' => __('Title', 'wplb'), 'std' => __('Image Widget', 'wplb'), 'type' => 'text'), 'src' => array('label' => __('Image', 'wplb'), 'type' => 'image'), 'link' => array('label' => __('Link', 'wplb'), 'type' => 'text'), 'fill' => array('label' => __('Fill Width', 'wplb'), 'type' => 'checkbox'), 'target' => array('label' => __('Target', 'wplb'), 'type' => 'select', 'options' => array('_blank' => '_blank', '_self' => '_self', '_parent' => '_parent', '_top' => '_top'), 'std' => '_parent'), 'align' => array('label' => __('Align', 'wplb'), 'type' => 'select', 'options' => array('none' => 'None', 'left' => 'Left', 'center' => 'Center', 'right' => 'Right'), 'std' => 'center'), 'alt' => array('label' => __('Alternate text', 'wplb'), 'type' => 'text'), 'caption' => array('label' => __('Caption', 'wplb'), 'type' => 'textarea'), 'class' => array('label' => __('Class', 'wplb'), 'type' => 'text'));
     $widgets_init = apply_filters('wplb_widgets_image_init', $widgets_init);
     $defaults = apply_filters('wplb_widgets_image_default', $defaults);
     parent::__construct($widgets_init, $defaults);
 }
 public function __construct()
 {
     $widgets_init = array('id_base' => 'wplb-video-widget', 'name' => $this->plugin_name . __(' Video', 'wplb'), 'options' => array('classname' => 'wplb-video-widget', 'description' => __('Displays Vimeo or Youtobe Video by ID or Embed Code ', 'wplb')));
     // Defaults
     $defaults = array('title' => array('label' => __('Title', 'wplb'), 'std' => __('Find Us On Facebook', 'wplb'), 'type' => 'text'), 'embed_code' => array('label' => __('Embed Code', 'wplb'), 'type' => 'textarea', 'desc' => ''), 'youtobe_id' => array('label' => __('Youtobe ID', 'wplb'), 'type' => 'text', 'std' => '_F9qn54SHW4', 'desc' => __('if video url : http://www.youtube.com/watch?v=_F9qn54SHW4  Enter above <strong>_F9qn54SHW4</strong>', 'wplb')), 'vimeo_id' => array('label' => __('Vimeo ID', 'wplb'), 'type' => 'text', 'desc' => __('if video url :https://vimeo.com/113525882  Enter above <strong>113525882</strong>', 'wplb')), 'class' => array('label' => __('Class', 'wplb'), 'type' => 'text'));
     $widgets_init = apply_filters('wplb_widgets_video_init', $widgets_init);
     $defaults = apply_filters('wplb_widgets_video_default', $defaults);
     parent::__construct($widgets_init, $defaults);
 }
 public function __construct()
 {
     $widgets_init = array('id_base' => 'wplb-list-posts-widget', 'name' => $this->plugin_name . __('Custom post list', 'wplb'), 'options' => array('classname' => 'wplb-list-posts-widget', 'description' => __('Display ultimate display custom post', 'wplb')));
     // Defaults
     $defaults = array('title' => array('label' => __('Title', 'wplb'), 'std' => __('List Custom Post', 'wplb'), 'type' => 'text'), 'post_and_term' => array('type' => 'post_to_term'), 'posts_num' => array('label' => __('Number to show', 'wplb'), 'type' => 'text', 'std' => '3', 'class' => 'float-left'), 'posts_offset' => array('label' => __('Offset', 'wplb'), 'type' => 'text', 'std' => '0', 'class' => 'float-left'), 'orderby' => array('label' => __('Order by', 'wplb'), 'type' => 'select', 'options' => array('date' => __('Date', 'wplb'), 'ID' => __('ID', 'wplb'), 'title' => __('Title', 'wplb'), 'parent' => __('Parent', 'wplb'), 'rand' => __('Random', 'wplb'), 'comment_count' => __('Comment Count', 'wplb')), 'std' => 'date'), 'order' => array('label' => __('Order by', 'wplb'), 'type' => 'select', 'options' => array('DESC' => __('Descending (3, 2, 1)', 'wplb'), 'ASC' => __('Ascending (1, 2, 3)', 'wplb')), 'std' => 'DESC'), 'exclude' => array('label' => __('Exlude ', 'wplb'), 'type' => 'text', 'class' => 'float-left', 'desc' => __('These post (separated by commas)', 'wplb')), 'show_title' => array('label' => __('Show Title?', 'wplb'), 'type' => 'checkbox'), 'show_image' => array('label' => __('Show Image?', 'wplb'), 'type' => 'checkbox', 'std' => true), 'show_meta_date' => array('label' => __('Show meta date ?', 'wplb'), 'type' => 'checkbox', 'std' => false), 'show_meta_cat' => array('label' => __('Show meta category ?', 'wplb'), 'type' => 'checkbox', 'std' => false), 'image_size' => array('label' => __('Thumbnail Size', 'wplb'), 'type' => 'select', 'options' => wplb_get_image_sizes(), 'std' => 'thumbnail'), 'show_content' => array('label' => __('Content', 'wplb'), 'type' => 'select', 'options' => array('' => __('None', 'wplb'), 'content' => __('Full Content', 'wplb'), 'excerpt' => __('Expert', 'wplb'), 'content-limit' => __('Content limit', 'wplb'))), 'content_limit' => array('label' => __('Content Limit', 'wplb'), 'type' => 'text'), 'more_text' => array('label' => __('More text', 'wplb'), 'type' => 'text', 'std' => __('More', 'wplb')), 'show_gravatar' => array('label' => __('Show Gravata?', 'wplb'), 'type' => 'checkbox'), 'gravatar_size' => array('label' => __('Gravata Size', 'wplb'), 'type' => 'select', 'options' => array('26' => 'Small (26px)', '65' => 'Medium (65px)', '85' => 'Lage (85px)', '125' => 'Extra lage (125px)'), 'std' => '26'), 'class' => array('label' => __('Class', 'wplb'), 'type' => 'text'));
     $widgets_init = apply_filters('wplb_widgets_list_posts_init', $widgets_init);
     $defaults = apply_filters('wplb_widgets_list_posts_default', $defaults);
     parent::__construct($widgets_init, $defaults);
 }
 public function __construct()
 {
     $widgets_init = array('id_base' => 'wplb-fb-box-widget', 'name' => $this->plugin_name . __('Facebook Like Box', 'wplb'), 'options' => array('classname' => 'wplb-fb-box-widget', 'description' => __('Displays Facebook Page owners to attract and gain Likes from their own website', 'wplb')));
     // Defaults
     $defaults = array('title' => array('label' => __('Title', 'wplb'), 'std' => __('Find us on Facebook', 'wplb'), 'type' => 'text', 'desc' => __('If an item is left blank it will not be output.', 'wplb')), 'fb_url' => array('label' => __('Page Url', 'wplb'), 'type' => 'text', 'std' => 'https://www.facebook.com/RureShopping'), 'width' => array('label' => __('Width: ', 'wplb'), 'type' => 'text', 'std' => '340', 'class' => 'float-left', 'desc' => __('Only input number', 'wplb')), 'height' => array('label' => __('Height: ', 'wplb'), 'type' => 'text', 'std' => '500', 'class' => 'float-left', 'desc' => __('Only input number', 'wplb')), 'adapt_container_width' => array('label' => __('Adapt to plugin container width', 'wplb'), 'type' => 'checkbox', 'std' => true, 'desc' => __('Try to fit inside the container width', 'wplb')), 'small_header' => array('label' => __('Use Small Header', 'wplb'), 'type' => 'checkbox', 'std' => false), 'hide_cover' => array('label' => __('Hide Cover Photo', 'wplb'), 'type' => 'checkbox', 'std' => false), 'show_friends' => array('label' => __('Show Friend`s Faces', 'wplb'), 'type' => 'checkbox', 'std' => true), 'show_posts' => array('label' => __('Show posts from the Page`s timeline', 'wplb'), 'type' => 'checkbox', 'std' => true), 'class' => array('label' => __('Class', 'wplb'), 'type' => 'text'));
     $widgets_init = apply_filters('wplb_widgets_video_init', $widgets_init);
     $defaults = apply_filters('wplb_widgets_video_default', $defaults);
     parent::__construct($widgets_init, $defaults);
 }
 /**
  * The constructor for this widget.
  *
  * @return void
  * @author Huu Ha
  */
 public function __construct()
 {
     $widgets_init = array('id_base' => 'wplb-custom-taxonomy-widget', 'name' => $this->plugin_name . __(' Custom Taxonomy', 'wplb'), 'options' => array('classname' => 'wplb-widgets-total wplb-custom-taxonomy-widget', 'description' => __('Display list term or custom post of custom taxonomy', 'wplb')));
     $levels = array();
     for ($i = 0; $i <= 10; $i++) {
         $levels[$i] = $i;
     }
     $defaults = array('title' => array('label' => __('Title', 'wplb'), 'std' => __('Custom Taxonomy', 'wplb'), 'type' => 'text'), 'post_and_term' => array('type' => 'post_to_term'), 'hide_empty' => array('label' => __('Hide empty?'), 'type' => 'checkbox', 'std' => false), 'show_count' => array('label' => __('Show Count ?'), 'type' => 'checkbox', 'std' => false), 'hierarchical' => array('label' => __('Hierarchical ?'), 'type' => 'checkbox', 'std' => true), 'level' => array('label' => __('Level', 'wplb'), 'type' => 'select', 'options' => $levels, 'std' => '0', 'desc' => __('0 - to show all levels, 1 - Show only top level (hierarchical must enabled)', 'wplb')), 'sortby' => array('label' => __('Sort by', 'wplb'), 'type' => 'select', 'options' => array('date' => __('Date', 'wplb'), 'ID' => __('ID', 'wplb'), 'title' => __('Title', 'wplb')), 'std' => 'date'), 'order' => array('label' => __('Order', 'wplb'), 'type' => 'select', 'options' => array('DESC' => __('Descending (3, 2, 1)', 'wplb'), 'ASC' => __('Ascending (1, 2, 3)', 'wplb')), 'std' => 'DESC'), 'exclude_cat' => array('type' => 'text', 'label' => __('Exlude Categories ids: ', 'wplb'), 'desc' => __('These categories (separated by commas), include must be empty', 'wplb'), 'class' => 'float-left'), 'include_cat' => array('type' => 'text', 'label' => __('Include Categories ids: ', 'wplb'), 'desc' => __('These categories (separated by commas)', 'wplb'), 'class' => 'float-left'), 'display' => array('label' => __('Display', 'wplb'), 'type' => 'select', 'options' => array('list' => __('Display as list', 'wplb'), 'drop' => __('Display as dropdown', 'wplb'), 'checklist' => __('Display as check list', 'wplb')), 'std' => 'list'), 'class' => array('label' => __('Class: ', 'wplb'), 'type' => 'text'));
     $widgets_init = apply_filters('wplb_widgets_category_init', $widgets_init);
     $defaults = apply_filters('wplb_widgets_category_default', $defaults);
     parent::__construct($widgets_init, $defaults);
     add_action('wp_ajax_wplb_widget_get_term_action', array($this, 'do_wplb_widget_get_term_action'));
 }
 /**
  * Hook the update process.
  *
  * @return array
  * @author Huu Ha <*****@*****.**>
  */
 public function update($new_instance, $old_instance)
 {
     // echo '<pre>';
     // print_r($new_instance);
     // print_r($old_instance);
     // print_r($this->fields);
     // echo '</pre>';
     // die;
     return WPLB_Widgets::update_instance($new_instance, $old_instance, $this->fields);
 }