예제 #1
0
 public function __construct($name, $default, $properties = array())
 {
     parent::__construct($name, $default, $properties);
     $this->icon->options = function () {
         $icons = array_intersect_key(\Drone\Options\Option\ImageSelect::cssToOptions('data/img/icons/icons.css'), array_flip(array('mail', 'aim', 'amazon', 'app-store', 'apple', 'arto', 'aws', 'baidu', 'basecamp', 'bebo', 'behance', 'bing', 'blip', 'blogger', 'bnter', 'brightkite', 'cloudapp', 'dailybooth', 'delicious', 'designfloat', 'designmoo', 'deviantart', 'digg', 'diigo', 'dribbble', 'dropbox', 'drupal', 'dzone', 'ebay', 'ember', 'etsy', 'evernote', 'facebook', 'facebook-alt', 'facebook-places', 'feedburner', 'flickr', 'folkd', 'forrst', 'foursquare', 'friendfeed', 'friendster', 'gdgt', 'github', 'goodreads', 'googleplus', 'gowalla', 'gowalla-alt', 'grooveshark', 'hacker-news', 'hi5', 'hype-machine', 'hyves', 'icq', 'instapaper', 'itunes', 'kik', 'krop', 'last', 'linkedin', 'linkedin-alt', 'livejournal', 'lovedsgn', 'meetup', 'metacafe', 'mister-wong', 'mobileme', 'msn-messenger', 'myspace', 'newsvine', 'official', 'openid', 'orkut', 'pandora', 'path', 'paypal', 'photobucket', 'picasa', 'pinboard', 'ping', 'pingchat', 'pinterest', 'playstation', 'plixi', 'plurk', 'podcast', 'posterous', 'qik', 'quora', 'rdio', 'readernaut', 'reddit', 'retweet', 'rss', 'scribd', 'sharethis', 'simplenote', 'skype', 'slashdot', 'slideshare', 'smugmug', 'soundcloud', 'spotify', 'squarespace', 'squidoo', 'steam', 'stumbleupon', 'technorati', 'tribe', 'tripit', 'tumblr', 'twitter', 'viddler', 'vimeo', 'virb', 'vk', 'w3', 'whatsapp', 'wikipedia', 'windows', 'wists', 'wordpress', 'wordpress-alt', 'xbox360', 'xing', 'yahoo', 'yahoo-buzz', 'yahoo-messenger', 'yelp', 'youtube', 'youtube-alt', 'zerply', 'zynga', 'instagram')));
         ksort($icons);
         return apply_filters('everything_social_media_icons', $icons);
     };
     $this->icon->required = false;
     $this->icon->font_path = \Everything::ICON_FONT_PATH;
     $this->icon->on_html = function ($option, &$html) {
         $html->style('float: left; margin-top: 6px;');
     };
 }
예제 #2
0
$product = $woocommerce->addGroup('product', __('Product', 'everything'));
$product->addOption('group', 'image_size', '12_12', __('Image & gallery width', 'everything'), '', array('options' => array('14_34' => '25%', '13_23' => '33%', '12_12' => '50%')));
$product->addOption('number', 'thumbnails_columns', 3, __('Gallery thumbnails columns', 'everything'), '', array('min' => 1, 'max' => 6));
$product->addOption('group', 'captions', 'title', __('Gallery captions', 'everything'), '', array('options' => array('' => __('None', 'everything'), 'title' => __('Image title', 'everything'), 'caption' => __('Image caption', 'everything'), 'caption_title' => __('Image caption or title', 'everything'))));
$product->addOption('boolean', 'brands', Everything::isPluginActive('woocommerce-brands'), __('Brand', 'everything'), '', array('caption' => __('Show brand description', 'everything'), 'disabled' => !Everything::isPluginActive('woocommerce-brands')));
$meta = $product->addGroup('meta', __('Meta', 'everything'));
$visible = $meta->addOption('boolean', 'visible', true, '', '', array('caption' => __('Visible', 'everything')));
$meta->addOption('group', 'items', Everything::isPluginActive('woocommerce-brands') ? array('sku', 'categories', 'tags', 'brands') : array('sku', 'categories', 'tags'), '', '', array('options' => array('sku' => __('SKU', 'everything'), 'categories' => __('Categories', 'everything'), 'tags' => __('Tags', 'everything'), 'brands' => __('Brands', 'everything')), 'disabled' => Everything::isPluginActive('woocommerce-brands') ? array() : array('brands'), 'indent' => true, 'multiple' => true, 'sortable' => true, 'owner' => $visible));
$related_products = $woocommerce->addGroup('related_products', __('Related products', 'everything'));
$related_products->addOption('number', 'total', 4, __('Products', 'everything'), '', array('min' => 0));
$related_products->addOption('number', 'columns', 4, __('Columns', 'everything'), '', array('min' => 1, 'max' => 8));
$cross_sells = $woocommerce->addGroup('cross_sells', __('Cross sells', 'everything'));
$cross_sells->addOption('number', 'total', 4, __('Products', 'everything'), '', array('min' => 0));
$cross_sells->addOption('number', 'columns', 4, __('Columns', 'everything'), '', array('min' => 1, 'max' => 8));
$cart = $woocommerce->addGroup('cart', __('Cart icon', 'everything'));
$cart->addOption('image_select', 'icon', 'cart-1', __('Image', 'everything'), '', array('options' => array_intersect_key(\Drone\Options\Option\ImageSelect::cssToOptions('data/img/icons/icons.css'), array_flip(array('cart-1', 'cart-2', 'cart-3', 'bag', 'bag-1', 'bag-2', 'bag-3', 'bag-4', 'basket'))), 'font_path' => Everything::ICON_FONT_PATH));
$cart->addOption('color', 'color', '', __('Color', 'everything'), '', array('required' => false, 'placeholder' => __('default', 'everything')));
$onsale = $woocommerce->addGroup('onsale', __('Sale label style', 'everything'));
$custom = $onsale->addOption('boolean', 'custom', false, '', '', array('caption' => __('Custom', 'everything')));
$onsale->addOption('color', 'background', '#2d4b7e', __('Background', 'everything'), '', array('owner' => $custom, 'indent' => true));
$onsale->addOption('color', 'color', '#ffffff', __('Color', 'everything'), '', array('owner' => $custom, 'indent' => true));
$rating = $woocommerce->addGroup('rating', __('Ratings style', 'everything'));
$rating->included = \Drone\Func::stringToBool(get_option('woocommerce_enable_review_rating'));
$custom = $rating->addOption('boolean', 'custom', false, '', '', array('caption' => __('Custom', 'everything')));
$rating->addOption('color', 'color', '#ffba00', __('Color', 'everything'), '', array('owner' => $custom, 'indent' => true));
// -----------------------------------------------------------------------------
// Not found
$not_found = $theme_options->addGroup('not_found', __('404 page', 'everything'));
$default = sprintf("<h2>%s</h2>\n%s\n\n[search]", __('Are you lost?', 'everything'), sprintf(__('This is 404 page - it seems you\'ve encountered a dead link or missing page. You can use search form below to find what you\'re lookig for or go to a <a href="%s">homepage</a>.', 'everything'), esc_url(home_url('/'))));
$not_found->addOption('editor', 'content', $default, __('Content', 'everything'));
// -----------------------------------------------------------------------------
예제 #3
0
 protected function onSetupOptions(\Drone\Options\Group\Shortcode $options)
 {
     $options->addOption('image_select', 'icon', 'right-open', __('Icon', 'everything'), '', array('font_path' => \Everything::ICON_FONT_PATH, 'options' => function () {
         return \Drone\Options\Option\ImageSelect::cssToOptions('data/img/icons/icons.css');
     }));
     $options->addOption('color', 'color', '', __('Color', 'everything'), __('If empty, leading color will be used.', 'everything'), array('required' => false));
 }