Пример #1
0
 /**
  * 
  *
  * @package Kopa
  * @subpackage Core
  * @author thethangtran <*****@*****.**>
  * @since 1.0.0
  *      
  */
 public function __construct($id_base, $name, $widget_options = array(), $control_options = array())
 {
     parent::__construct($id_base, $name, $widget_options, $control_options);
     $g_style = array('size' => 4, 'fields' => array());
     $g_style['fields']['title'] = array('type' => 'text', 'id' => 'title', 'name' => 'title', 'default' => '', 'classes' => array(), 'label' => __('Title', kopa_get_domain()), 'help' => NULL);
     $g_style['fields']['posts_per_page'] = array('type' => 'number', 'id' => 'posts_per_page', 'name' => 'posts_per_page', 'default' => 4, 'classes' => array(), 'label' => __('Number of posts', kopa_get_domain()), 'help' => NULL);
     $g_style['fields']['excerpt_character_limit'] = array('type' => 'number', 'id' => 'excerpt_character_limit', 'name' => 'excerpt_character_limit', 'default' => 100, 'classes' => array(), 'label' => __('Excerpt character limit', kopa_get_domain()), 'help' => NULL);
     $g_style['fields']['is_hide_title'] = array('type' => 'checkbox', 'id' => 'is_hide_title', 'name' => 'is_hide_title', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide title', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_style['fields']['is_hide_excerpt'] = array('type' => 'checkbox', 'id' => 'is_hide_excerpt', 'name' => 'is_hide_excerpt', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide excerpt', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_style['fields']['is_hide_created_date'] = array('type' => 'checkbox', 'id' => 'is_hide_created_date', 'name' => 'is_hide_created_date', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide created date', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_style['fields']['is_hide_comments'] = array('type' => 'checkbox', 'id' => 'is_hide_comments', 'name' => 'is_hide_comments', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide comments', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_style['fields']['is_hide_views'] = array('type' => 'checkbox', 'id' => 'is_hide_views', 'name' => 'is_hide_views', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide views', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_style['fields']['is_hide_likes'] = array('type' => 'checkbox', 'id' => 'is_hide_likes', 'name' => 'is_hide_likes', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide likes', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_style['fields']['is_hide_readmore'] = array('type' => 'checkbox', 'id' => 'is_hide_readmore', 'name' => 'is_hide_readmore', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide readmore', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_query = array('size' => 8, 'fields' => array());
     $g_query['fields']['category'] = array('type' => 'taxonomy', 'id' => 'category', 'name' => 'category', 'default' => '', 'classes' => array(), 'label' => __('Categories', kopa_get_domain()), 'help' => NULL, 'taxonomy' => 'category', 'attributes' => array('multiple' => 'multiple'));
     $g_query['fields']['post_tag'] = array('type' => 'taxonomy', 'id' => 'post_tag', 'name' => 'post_tag', 'default' => '', 'classes' => array(), 'label' => __('Tags', kopa_get_domain()), 'help' => NULL, 'taxonomy' => 'post_tag', 'attributes' => array('multiple' => 'multiple'));
     $g_query['fields']['post_tag'] = array('type' => 'taxonomy', 'id' => 'post_tag', 'name' => 'post_tag', 'default' => '', 'classes' => array(), 'label' => __('Tags', kopa_get_domain()), 'help' => NULL, 'taxonomy' => 'post_tag', 'attributes' => array('multiple' => 'multiple'));
     $g_query['fields']['post_format'] = array('type' => 'taxonomy', 'id' => 'post_format', 'name' => 'post_format', 'default' => '', 'classes' => array(), 'label' => __('Post Format', kopa_get_domain()), 'help' => NULL, 'taxonomy' => 'post_format', 'attributes' => array('multiple' => 'multiple'));
     $g_query['fields']['orderby'] = array('type' => 'select', 'id' => 'orderby', 'name' => 'orderby', 'default' => 'date', 'classes' => array(), 'label' => __('Order by', kopa_get_domain()), 'help' => NULL, 'options' => array('date' => __('Latest news', kopa_get_domain()), 'popular' => __('Popular by view count', kopa_get_domain()), 'comment_count' => __('Most comments', kopa_get_domain()), 'rand' => __('Random', kopa_get_domain())));
     $g_query['fields']['relation'] = array('type' => 'checkbox', 'id' => 'relation', 'name' => 'relation', 'default' => 'false', 'classes' => array(), 'label' => __('Is combine condition by <i>Tags</i>, <i>Categories</i>, <i>Format</i>', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $g_query['fields']['timestamp'] = array('type' => 'select', 'id' => 'timestamp', 'name' => 'timestamp', 'default' => '', 'classes' => array(), 'label' => __('Timestamp (ago)', kopa_get_domain()), 'help' => NULL, 'options' => array('' => __('-- Select --', kopa_get_domain()), '-1 week' => __('1 week', kopa_get_domain()), '-2 week' => __('2 weeks', kopa_get_domain()), '-3 week' => __('3 weeks', kopa_get_domain()), '-1 month' => __('1 months', kopa_get_domain()), '-2 month' => __('2 months', kopa_get_domain()), '-3 month' => __('3 months', kopa_get_domain()), '-4 month' => __('4 months', kopa_get_domain()), '-5 month' => __('5 months', kopa_get_domain()), '-6 month' => __('6 months', kopa_get_domain()), '-7 month' => __('7 months', kopa_get_domain()), '-8 month' => __('8 months', kopa_get_domain()), '-9 month' => __('9 months', kopa_get_domain()), '-10 month' => __('10 months', kopa_get_domain()), '-11 month' => __('11 months', kopa_get_domain()), '-1 year' => __('1 year', kopa_get_domain()), '-2 year' => __('2 years', kopa_get_domain()), '-3 year' => __('3 years', kopa_get_domain()), '-4 year' => __('4 years', kopa_get_domain()), '-5 year' => __('5 years', kopa_get_domain()), '-6 year' => __('6 years', kopa_get_domain()), '-7 year' => __('7 years', kopa_get_domain()), '-8 year' => __('8 years', kopa_get_domain()), '-9 year' => __('9 years', kopa_get_domain()), '-10 year' => __('10 years', kopa_get_domain())));
     $this->groups['col-1'] = $g_style;
     $this->groups['col-2'] = $g_query;
 }
Пример #2
0
 public function __construct($id_base = '', $name = '', $widget_options = array(), $control_options = array())
 {
     $id_base = 'kopa-contact-information';
     $name = __('Kopa Contact Information', kopa_get_domain());
     $widget_options = array('classname' => 'kopa-contact-information widget_text', 'description' => __('Display your contact information', kopa_get_domain()));
     $control_options = array('width' => 'auto', 'height' => 'auto');
     parent::__construct($id_base, $name, $widget_options, $control_options);
     $col_1 = array('size' => 12, 'fields' => array());
     $col_1['fields']['title'] = array('type' => 'text', 'id' => 'title', 'name' => 'title', 'default' => '', 'classes' => array(), 'label' => __('Title', kopa_get_domain()), 'help' => NULL);
     $col_1['fields']['description'] = array('type' => 'textarea', 'id' => 'description', 'name' => 'description', 'default' => '', 'classes' => array(), 'label' => __('Description', kopa_get_domain()), 'help' => NULL);
     $this->groups['col-1'] = $col_1;
 }
Пример #3
0
 public function __construct($id_base = '', $name = '', $widget_options = array(), $control_options = array())
 {
     $id_base = 'kopa_newsletter';
     $name = __('Kopa Newsletter', kopa_get_domain());
     $widget_options = array('classname' => 'widget-newsletter', 'description' => __('Display email subscriptions form (by http://feedburner.google.com)', kopa_get_domain()));
     $control_options = array('width' => 'auto', 'height' => 'auto');
     parent::__construct($id_base, $name, $widget_options, $control_options);
     $col = array('size' => 12, 'fields' => array());
     $col['fields']['title'] = array('type' => 'text', 'id' => 'title', 'name' => 'title', 'default' => '', 'classes' => array(), 'label' => __('Title', kopa_get_domain()), 'help' => NULL);
     $col['fields']['uri'] = array('type' => 'text', 'id' => 'uri', 'name' => 'uri', 'default' => 'KopaTheme', 'classes' => array(), 'label' => __('URI', kopa_get_domain()));
     $col['fields']['description'] = array('type' => 'textarea', 'id' => 'description', 'name' => 'description', 'default' => '', 'classes' => array(), 'label' => __('Description', kopa_get_domain()));
     $this->groups['col'] = $col;
 }
Пример #4
0
 public function __construct($id_base = '', $name = '', $widget_options = array(), $control_options = array())
 {
     $id_base = 'kopa_flickr';
     $name = __('Kopa Flickr', kopa_get_domain());
     $widget_options = array('classname' => 'widget-flickr', 'description' => __('Display list photo from flickr', kopa_get_domain()));
     $control_options = array('width' => 'auto', 'height' => 'auto');
     parent::__construct($id_base, $name, $widget_options, $control_options);
     $col_1 = array('size' => 12, 'fields' => array());
     $col_1['fields']['title'] = array('type' => 'text', 'id' => 'title', 'name' => 'title', 'default' => '', 'classes' => array(), 'label' => __('Title', kopa_get_domain()), 'help' => NULL);
     $col_1['fields']['id'] = array('type' => 'text', 'id' => 'id', 'name' => 'id', 'default' => '71865026@N00', 'classes' => array(), 'label' => __('ID', kopa_get_domain()), 'help' => sprintf(__('Get your flickr ID. Click <a href="%s" target="_blank">here</a>', kopa_get_domain()), 'http://idgettr.com/'));
     $col_1['fields']['limit'] = array('type' => 'number', 'id' => 'limit', 'name' => 'limit', 'default' => '12', 'classes' => array(), 'label' => __('Number of photos', kopa_get_domain()), 'help' => NULL);
     $this->groups['col-1'] = $col_1;
 }
Пример #5
0
 public function __construct($id_base = '', $name = '', $widget_options = array(), $control_options = array())
 {
     $id_base = 'kopa_advertisement';
     $name = __('Kopa Advertisement', kopa_get_domain());
     $widget_options = array('classname' => 'kopa_advertisement widget-adv', 'description' => __('Display banner image', kopa_get_domain()));
     $control_options = array('width' => 'auto', 'height' => 'auto');
     parent::__construct($id_base, $name, $widget_options, $control_options);
     $col = array('size' => 12, 'fields' => array());
     $col['fields']['title'] = array('type' => 'text', 'id' => 'title', 'name' => 'title', 'default' => '', 'classes' => array(), 'label' => __('Title', kopa_get_domain()), 'help' => NULL);
     $col['fields']['image'] = array('type' => 'media', 'id' => 'image', 'name' => 'image', 'default' => '', 'classes' => array(), 'label' => __('Upload Image', kopa_get_domain()), 'help' => NULL);
     $col['fields']['size'] = array('type' => 'select', 'id' => 'size', 'name' => 'size', 'default' => '000x000', 'classes' => array(), 'label' => NULl, 'help' => NULL, 'options' => array('000x000' => __('Select size of image', kopa_get_domain()), '120x240' => __('120 x 240', kopa_get_domain()), '120x600' => __('120 x 600', kopa_get_domain()), '125x125' => __('125 x 125', kopa_get_domain()), '160x600' => __('160 x 600', kopa_get_domain()), '180x150' => __('180 x 150', kopa_get_domain()), '200x200' => __('200 x 200', kopa_get_domain()), '234x60' => __('234 x 60', kopa_get_domain()), '250x250' => __('250 x 250', kopa_get_domain()), '300x250' => __('300 x 250', kopa_get_domain()), '336x280' => __('336 x 280', kopa_get_domain()), '468x60' => __('468 x 60', kopa_get_domain()), '728x90' => __('728 x 90', kopa_get_domain())));
     $col['fields']['href'] = array('type' => 'url', 'id' => 'href', 'name' => 'href', 'default' => '', 'classes' => array(), 'label' => __('Link to', kopa_get_domain()), 'help' => NULL);
     $col['fields']['target'] = array('type' => 'checkbox', 'id' => 'target', 'name' => 'target', 'default' => 'false', 'classes' => array(), 'label' => __('Open link in new tab', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $this->groups['col'] = $col;
 }
Пример #6
0
 public function __construct($id_base = '', $name = '', $widget_options = array(), $control_options = array())
 {
     $id_base = 'kopa_recent_comments';
     $name = __('Kopa Recent Comments', kopa_get_domain());
     $widget_options = array('classname' => 'kopa_recent_comments widget-recent-comment', 'description' => __("Your site's most recent Posts", kopa_get_domain()));
     $control_options = array('width' => 'auto', 'height' => 'auto');
     parent::__construct($id_base, $name, $widget_options, $control_options);
     $col = array('size' => 12, 'fields' => array());
     $col['fields']['title'] = array('type' => 'text', 'id' => 'title', 'name' => 'title', 'default' => '', 'classes' => array(), 'label' => __('Title', kopa_get_domain()), 'help' => NULL);
     $col['fields']['limit'] = array('type' => 'number', 'id' => 'limit', 'name' => 'limit', 'default' => 4, 'classes' => array(), 'label' => __('Number of comments', kopa_get_domain()));
     $col['fields']['comment_character_limit'] = array('type' => 'number', 'id' => 'comment_character_limit', 'name' => 'comment_character_limit', 'default' => 60, 'classes' => array(), 'label' => __('Comment character limit', kopa_get_domain()), 'help' => NULL);
     $col['fields']['is_hide_author'] = array('type' => 'checkbox', 'id' => 'is_hide_author', 'name' => 'is_hide_author', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide author name', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $col['fields']['is_hide_gravatar'] = array('type' => 'checkbox', 'id' => 'is_hide_gravatar', 'name' => 'is_hide_gravatar', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide gravatar', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $col['fields']['is_hide_created_date'] = array('type' => 'checkbox', 'id' => 'is_hide_created_date', 'name' => 'is_hide_created_date', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide created date', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $col['fields']['is_hide_comment'] = array('type' => 'checkbox', 'id' => 'is_hide_comment', 'name' => 'is_hide_comment', 'default' => 'false', 'classes' => array(), 'label' => __('Is hide comment content', kopa_get_domain()), 'help' => NULL, 'is_append_label_before_control' => false);
     $this->groups['col'] = $col;
 }
Пример #7
0
 public function __construct($id_base = '', $name = '', $widget_options = array(), $control_options = array())
 {
     $id_base = 'kopa_twitter';
     $name = __('Kopa Twitter', kopa_get_domain());
     $widget_options = array('classname' => 'widget-twitters', 'description' => __('Display list tweets from twitter.com', kopa_get_domain()));
     $control_options = array('width' => 500, 'height' => 'auto');
     parent::__construct($id_base, $name, $widget_options, $control_options);
     $col_1 = array('size' => 4, 'fields' => array());
     $col_2 = array('size' => 8, 'fields' => array());
     $col_1['fields']['title'] = array('type' => 'text', 'id' => 'title', 'name' => 'title', 'default' => '', 'classes' => array(), 'label' => __('Title', kopa_get_domain()), 'help' => NULL);
     $col_1['fields']['id'] = array('type' => 'text', 'id' => 'id', 'name' => 'id', 'default' => 'YOUR-NAME', 'label' => __('Username', kopa_get_domain()), 'classes' => array(), 'help' => NULL);
     $col_1['fields']['limit'] = array('type' => 'number', 'id' => 'limit', 'name' => 'limit', 'default' => '2', 'classes' => array(), 'label' => __('Number of tweets', kopa_get_domain()), 'help' => NULL);
     //consumer_key
     $col_2['fields']['consumer_key'] = array('type' => 'text', 'id' => 'consumer_key', 'name' => 'consumer_key', 'default' => '', 'label' => __('API key', kopa_get_domain()), 'classes' => array(), 'help' => NULL);
     //consumer_secret
     $col_2['fields']['consumer_secret'] = array('type' => 'text', 'id' => 'consumer_secret', 'name' => 'consumer_secret', 'default' => '', 'label' => __('API secret', kopa_get_domain()), 'classes' => array(), 'help' => NULL);
     //oauth_access_token
     $col_2['fields']['oauth_access_token'] = array('type' => 'text', 'id' => 'oauth_access_token', 'name' => 'oauth_access_token', 'default' => '', 'label' => __('Access token', kopa_get_domain()), 'classes' => array(), 'help' => NULL);
     //oauth_access_token_secret
     $col_2['fields']['oauth_access_token_secret'] = array('type' => 'text', 'id' => 'oauth_access_token_secret', 'name' => 'oauth_access_token_secret', 'default' => '', 'label' => __('Access token secret', kopa_get_domain()), 'classes' => array(), 'help' => NULL);
     $this->groups['col-1'] = $col_1;
     $this->groups['col-2'] = $col_2;
 }
Пример #8
0
 public function form($instance)
 {
     $this->update_fields($instance);
     parent::form($instance);
 }