コード例 #1
1
 /**
  * Renders a layout with the provided post ID and enqueues the 
  * necessary styles and scripts.
  *
  * @since 1.7
  * @param array $attrs The shortcode attributes.
  * @return string
  */
 public static function insert_layout($attrs)
 {
     $builder_active = in_the_loop() && FLBuilderModel::is_builder_active();
     $post_type = isset($attrs['type']) ? $attrs['type'] : get_post_types();
     $args = array('post_type' => $post_type, 'posts_per_page' => -1);
     // Build the args array.
     if (isset($attrs['id'])) {
         $args['orderby'] = 'post__in';
         if (is_numeric($attrs['id'])) {
             $args['post__in'] = array($attrs['id']);
         } else {
             $args['post__in'] = explode(',', $attrs['id']);
         }
     } else {
         if (isset($attrs['slug'])) {
             $args['orderby'] = 'name';
             $args['name'] = $attrs['slug'];
         } else {
             return;
         }
     }
     // Render and return the layout.
     ob_start();
     if ($builder_active) {
         echo '<div class="fl-builder-shortcode-mask-wrap"><div class="fl-builder-shortcode-mask"></div>';
     }
     FLBuilder::render_query($args);
     if ($builder_active) {
         echo '</div>';
     }
     return ob_get_clean();
 }
コード例 #2
1
 /**
  * Render markup for the list field. 
  *
  * @since 1.5.4
  * @param array $lists List data from the API.
  * @param object $settings Saved module settings.
  * @return string The markup for the list field.
  * @access private
  */
 private function render_list_field($lists, $settings)
 {
     ob_start();
     $options = array('' => __('Choose...', 'fl-builder'));
     foreach ($lists as $list) {
         $options[$list['list_id']] = $list['name'];
     }
     FLBuilder::render_settings_field('list_id', array('row_class' => 'fl-builder-service-field-row', 'class' => 'fl-builder-service-list-select', 'type' => 'select', 'label' => _x('List', 'An email list from a third party provider.', 'fl-builder'), 'options' => $options, 'preview' => array('type' => 'none')), $settings);
     return ob_get_clean();
 }
コード例 #3
0
 /**
  * Render thumbnail image for mobile.
  *
  * Get's the post ID and renders the html markup for the featured image
  * in the desired cropped size.
  * 
  * @param  int $id    The post ID.
  * @since  1.5.9
  * @return void
  */
 public function render_img($id = null)
 {
     // check if image_type is set
     if (isset($this->settings->show_image) && $this->settings->show_image == 1) {
         // get image source and data
         $src = $this->_get_uncropped_url($id);
         $photo_data = $this->_get_img_data($id);
         // set params
         $photo_settings = array('align' => 'center', 'link_type' => 'url', 'crop' => $this->settings->crop, 'photo' => $photo_data, 'photo_src' => $src, 'photo_source' => 'library', 'attributes' => array('data-no-lazy' => 1));
         // if link id is provided, set link_url param
         if ($id) {
             $photo_settings['link_url'] = get_the_permalink($id);
         }
         // render image
         FLBuilder::render_module_html('photo', $photo_settings);
     }
 }
コード例 #4
0
<?php

/**
 * @class FLRichTextModule
 */
class FLPricingTableModule extends FLBuilderModule
{
    /**
     * @method __construct
     */
    public function __construct()
    {
        parent::__construct(array('name' => __('Pricing Table', 'fl-builder'), 'description' => __('A simple pricing table generator.', 'fl-builder'), 'category' => __('Advanced Modules', 'fl-builder')));
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLPricingTableModule', array('columns' => array('title' => __('Pricing Boxes', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('pricing_columns' => array('type' => 'form', 'label' => __('Pricing Box', 'fl-builder'), 'form' => 'pricing_column_form', 'preview_text' => 'title', 'multiple' => true))))), 'style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('spacing' => array('type' => 'select', 'label' => __('Box Spacing', 'fl-builder'), 'default' => 'wide', 'options' => array('wide' => __('Wide', 'fl-builder'), 'tight' => __('Tight', 'fl-builder'))), 'min_height' => array('type' => 'text', 'label' => __('Features Min Height', 'fl-builder'), 'default' => '0', 'size' => '5', 'description' => 'px', 'help' => __('Use this to normalize the height of your boxes when they have different numbers of features.', 'fl-builder')), 'border_size' => array('type' => 'select', 'label' => __('Border Size', 'fl-builder'), 'default' => 'wide', 'options' => array('wide' => _x('Wide', 'Border size.', 'fl-builder'), 'tight' => _x('Tight', 'Border size.', 'fl-builder')))))))));
/**
 * Register a settings form to use in the "form" field type above.
 */
FLBuilder::register_settings_form('pricing_column_form', array('title' => __('Add Pricing Box', 'fl-builder'), 'tabs' => array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('title' => array('title' => __('Title', 'fl-builder'), 'fields' => array('title' => array('type' => 'text', 'label' => __('Title', 'fl-builder')), 'title_size' => array('type' => 'text', 'label' => __('Title Size', 'fl-builder'), 'default' => '24', 'maxlength' => '3', 'size' => '4', 'description' => 'px'))), 'price-box' => array('title' => __('Price Box', 'fl-builder'), 'fields' => array('price' => array('type' => 'text', 'label' => __('Price', 'fl-builder')), 'duration' => array('type' => 'text', 'label' => __('Duration', 'fl-builder'), 'placeholder' => __('per Year', 'fl-builder')), 'price_size' => array('type' => 'text', 'label' => __('Price Size', 'fl-builder'), 'default' => '31', 'maxlength' => '3', 'size' => '4', 'description' => 'px'))), 'button' => array('title' => __('Button', 'fl-builder'), 'fields' => array('button_text' => array('type' => 'text', 'label' => __('Button Text', 'fl-builder')), 'button_url' => array('type' => 'link', 'label' => __('Button URL', 'fl-builder')))), 'features' => array('title' => _x('Features', 'Price features displayed in pricing box.', 'fl-builder'), 'fields' => array('features' => array('type' => 'text', 'label' => '', 'placeholder' => __('One feature per line. HTML is okay.', 'fl-builder'), 'multiple' => true))))), 'style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('style' => array('title' => 'Style', 'fields' => array('background' => array('type' => 'color', 'label' => __('Box Background', 'fl-builder'), 'default' => 'F2F2F2'), 'foreground' => array('type' => 'color', 'label' => __('Box Foreground', 'fl-builder'), 'default' => 'ffffff'), 'column_background' => array('type' => 'color', 'default' => '66686b', 'label' => __('Accent Color', 'fl-builder')), 'column_color' => array('type' => 'color', 'default' => 'ffffff', 'label' => __('Accent Text Color', 'fl-builder')), 'margin' => array('type' => 'text', 'label' => __('Box Top Margin', 'fl-builder'), 'default' => '0', 'maxlength' => '3', 'size' => '3', 'description' => 'px'))))))));
コード例 #5
0
<?php

FLBuilder::register_settings_form('col', array('title' => __('Column Settings', 'fl-builder'), 'tabs' => array('style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('size' => array('type' => 'text', 'label' => __('Column Width', 'fl-builder'), 'default' => '', 'description' => '%', 'maxlength' => '5', 'size' => '6', 'preview' => array('type' => 'none')))), 'text' => array('title' => __('Text', 'fl-builder'), 'fields' => array('text_color' => array('type' => 'color', 'label' => __('Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'link_color' => array('type' => 'color', 'label' => __('Link Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'hover_color' => array('type' => 'color', 'label' => __('Link Hover Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'heading_color' => array('type' => 'color', 'label' => __('Heading Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')))), 'background' => array('title' => __('Background', 'fl-builder'), 'fields' => array('bg_type' => array('type' => 'select', 'label' => __('Type', 'fl-builder'), 'default' => 'color', 'options' => array('none' => _x('None', 'Background type.', 'fl-builder'), 'color' => _x('Color', 'Background type.', 'fl-builder'), 'photo' => _x('Photo', 'Background type.', 'fl-builder')), 'toggle' => array('color' => array('sections' => array('bg_color')), 'photo' => array('sections' => array('bg_photo', 'bg_overlay'))), 'preview' => array('type' => 'none')))), 'bg_color' => array('title' => __('Background Color', 'fl-builder'), 'fields' => array('bg_color' => array('type' => 'color', 'label' => __('Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'bg_opacity' => array('type' => 'text', 'label' => __('Opacity', 'fl-builder'), 'default' => '100', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'preview' => array('type' => 'none')))), 'bg_photo' => array('title' => __('Background Photo', 'fl-builder'), 'fields' => array('bg_image' => array('type' => 'photo', 'label' => __('Photo', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_repeat' => array('type' => 'select', 'label' => __('Repeat', 'fl-builder'), 'default' => 'none', 'options' => array('no-repeat' => _x('None', 'Background repeat.', 'fl-builder'), 'repeat' => _x('Tile', 'Background repeat.', 'fl-builder'), 'repeat-x' => _x('Horizontal', 'Background repeat.', 'fl-builder'), 'repeat-y' => _x('Vertical', 'Background repeat.', 'fl-builder')), 'help' => __('Repeat applies to how the image should display in the background. Choosing none will display the image as uploaded. Tile will repeat the image as many times as needed to fill the background horizontally and vertically. You can also specify the image to only repeat horizontally or vertically.', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_position' => array('type' => 'select', 'label' => __('Position', 'fl-builder'), 'default' => 'center center', 'options' => array('left top' => __('Left Top', 'fl-builder'), 'left center' => __('Left Center', 'fl-builder'), 'left bottom' => __('Left Bottom', 'fl-builder'), 'right top' => __('Right Top', 'fl-builder'), 'right center' => __('Right Center', 'fl-builder'), 'right bottom' => __('Right Bottom', 'fl-builder'), 'center top' => __('Center Top', 'fl-builder'), 'center center' => __('Center', 'fl-builder'), 'center bottom' => __('Center Bottom', 'fl-builder')), 'help' => __('Position will tell the image where it should sit in the background.', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_attachment' => array('type' => 'select', 'label' => __('Attachment', 'fl-builder'), 'default' => 'scroll', 'options' => array('scroll' => __('Scroll', 'fl-builder'), 'fixed' => __('Fixed', 'fl-builder')), 'help' => __('Attachment will specify how the image reacts when scrolling a page. When scrolling is selected, the image will scroll with page scrolling. This is the default setting. Fixed will allow the image to scroll within the background if fill is selected in the scale setting.', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_size' => array('type' => 'select', 'label' => __('Scale', 'fl-builder'), 'default' => 'cover', 'options' => array('' => _x('None', 'Background scale.', 'fl-builder'), 'contain' => __('Fit', 'fl-builder'), 'cover' => __('Fill', 'fl-builder')), 'help' => __('Scale applies to how the image should display in the background. You can select either fill or fit to the background.', 'fl-builder'), 'preview' => array('type' => 'none')))), 'bg_overlay' => array('title' => __('Background Overlay', 'fl-builder'), 'fields' => array('bg_overlay_color' => array('type' => 'color', 'label' => __('Overlay Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'bg_overlay_opacity' => array('type' => 'text', 'label' => __('Overlay Opacity', 'fl-builder'), 'default' => '50', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'preview' => array('type' => 'none')))), 'border' => array('title' => __('Border', 'fl-builder'), 'fields' => array('border_type' => array('type' => 'select', 'label' => __('Type', 'fl-builder'), 'default' => '', 'help' => __('The type of border to use. Double borders must have a width of at least 3px to render properly.', 'fl-builder'), 'options' => array('' => _x('None', 'Border type.', 'fl-builder'), 'solid' => _x('Solid', 'Border type.', 'fl-builder'), 'dashed' => _x('Dashed', 'Border type.', 'fl-builder'), 'dotted' => _x('Dotted', 'Border type.', 'fl-builder'), 'double' => _x('Double', 'Border type.', 'fl-builder')), 'toggle' => array('' => array('fields' => array()), 'solid' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right')), 'dashed' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right')), 'dotted' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right')), 'double' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right'))), 'preview' => array('type' => 'none')), 'border_color' => array('type' => 'color', 'label' => __('Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'border_opacity' => array('type' => 'text', 'label' => __('Opacity', 'fl-builder'), 'default' => '100', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'preview' => array('type' => 'none')), 'border_top' => array('type' => 'text', 'label' => __('Top Width', 'fl-builder'), 'default' => '1', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'border_bottom' => array('type' => 'text', 'label' => __('Bottom Width', 'fl-builder'), 'default' => '1', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'border_left' => array('type' => 'text', 'label' => __('Left Width', 'fl-builder'), 'default' => '1', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'border_right' => array('type' => 'text', 'label' => __('Right Width', 'fl-builder'), 'default' => '1', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')))))), 'advanced' => array('title' => __('Advanced', 'fl-builder'), 'sections' => array('margins' => array('title' => __('Margins', 'fl-builder'), 'fields' => array('margin_top' => array('type' => 'text', 'label' => __('Top', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'margin_bottom' => array('type' => 'text', 'label' => __('Bottom', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'margin_left' => array('type' => 'text', 'label' => __('Left', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'margin_right' => array('type' => 'text', 'label' => __('Right', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')))), 'padding' => array('title' => __('Padding', 'fl-builder'), 'fields' => array('padding_top' => array('type' => 'text', 'label' => __('Top', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'padding_bottom' => array('type' => 'text', 'label' => __('Bottom', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'padding_left' => array('type' => 'text', 'label' => __('Left', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'padding_right' => array('type' => 'text', 'label' => __('Right', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')))), 'responsive' => array('title' => __('Responsive Layout', 'fl-builder'), 'fields' => array('responsive_display' => array('type' => 'select', 'label' => __('Display', 'fl-builder'), 'options' => array('' => __('Always', 'fl-builder'), 'desktop' => __('Large Devices Only', 'fl-builder'), 'desktop-medium' => __('Large &amp; Medium Devices Only', 'fl-builder'), 'medium' => __('Medium Devices Only', 'fl-builder'), 'medium-mobile' => __('Medium &amp; Small Devices Only', 'fl-builder'), 'mobile' => __('Small Devices Only', 'fl-builder')), 'help' => __('Choose whether to show or hide this column at different device sizes.', 'fl-builder'), 'preview' => array('type' => 'none')), 'medium_size' => array('type' => 'select', 'label' => __('Medium Device Width', 'fl-builder'), 'help' => __('The width of this column on medium devices such as tablets.', 'fl-builder'), 'options' => array('default' => __('Default', 'fl-builder'), 'custom' => __('Custom', 'fl-builder')), 'toggle' => array('custom' => array('fields' => array('custom_medium_size'))), 'preview' => array('type' => 'none')), 'custom_medium_size' => array('type' => 'text', 'label' => __('Custom Medium Device Width', 'fl-builder'), 'default' => '100', 'description' => '%', 'maxlength' => '5', 'size' => '6', 'preview' => array('type' => 'none')), 'responsive_size' => array('type' => 'select', 'label' => __('Small Device Width', 'fl-builder'), 'help' => __('The width of this column on small devices such as phones.', 'fl-builder'), 'options' => array('default' => __('Default', 'fl-builder'), 'custom' => __('Custom', 'fl-builder')), 'toggle' => array('custom' => array('fields' => array('custom_responsive_size'))), 'preview' => array('type' => 'none')), 'custom_responsive_size' => array('type' => 'text', 'label' => __('Custom Small Device Width', 'fl-builder'), 'default' => '100', 'description' => '%', 'maxlength' => '5', 'size' => '6', 'preview' => array('type' => 'none')))), 'css_selectors' => array('title' => __('CSS Selectors', 'fl-builder'), 'fields' => array('id' => array('type' => 'text', 'label' => __('ID', 'fl-builder'), 'help' => __("A unique ID that will be applied to this column's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. No spaces.", 'fl-builder'), 'preview' => array('type' => 'none')), 'class' => array('type' => 'text', 'label' => __('CSS Class', 'fl-builder'), 'help' => __("A class that will be applied to this column's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. Separate multiple classes with spaces.", 'fl-builder'), 'preview' => array('type' => 'none')))))))));
コード例 #6
0
<?php

$global_settings = FLBuilderModel::get_global_settings();
FLBuilder::register_settings_form('module_advanced', array('title' => __('Advanced', 'fl-builder'), 'sections' => array('margins' => array('title' => __('Margins', 'fl-builder'), 'fields' => array('margin_top' => array('type' => 'text', 'label' => __('Top', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->module_margins, 'preview' => array('type' => 'none')), 'margin_bottom' => array('type' => 'text', 'label' => __('Bottom', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->module_margins, 'preview' => array('type' => 'none')), 'margin_left' => array('type' => 'text', 'label' => __('Left', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->module_margins, 'preview' => array('type' => 'none')), 'margin_right' => array('type' => 'text', 'label' => __('Right', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->module_margins, 'preview' => array('type' => 'none')))), 'responsive' => array('title' => __('Responsive Layout', 'fl-builder'), 'fields' => array('responsive_display' => array('type' => 'select', 'label' => __('Display', 'fl-builder'), 'options' => array('' => __('Always', 'fl-builder'), 'desktop' => __('Large Devices Only', 'fl-builder'), 'desktop-medium' => __('Large &amp; Medium Devices Only', 'fl-builder'), 'medium' => __('Medium Devices Only', 'fl-builder'), 'medium-mobile' => __('Medium &amp; Small Devices Only', 'fl-builder'), 'mobile' => __('Small Devices Only', 'fl-builder')), 'help' => __('Choose whether to show or hide this module at different device sizes.', 'fl-builder'), 'preview' => array('type' => 'none')))), 'animation' => array('title' => __('Animation', 'fl-builder'), 'fields' => array('animation' => array('type' => 'select', 'label' => __('Style', 'fl-builder'), 'options' => array('' => _x('None', 'Animation style.', 'fl-builder'), 'fade-in' => _x('Fade In', 'Animation style.', 'fl-builder'), 'slide-left' => _x('Slide Left', 'Animation style.', 'fl-builder'), 'slide-right' => _x('Slide Right', 'Animation style.', 'fl-builder'), 'slide-up' => _x('Slide Up', 'Animation style.', 'fl-builder'), 'slide-down' => _x('Slide Down', 'Animation style.', 'fl-builder')), 'preview' => array('type' => 'none')), 'animation_delay' => array('type' => 'text', 'label' => __('Delay', 'fl-builder'), 'default' => '0.0', 'maxlength' => '4', 'size' => '5', 'description' => _x('seconds', 'Value unit for form field of time in seconds. Such as: "5 seconds"', 'fl-builder'), 'help' => __('The amount of time in seconds before this animation starts.', 'fl-builder'), 'preview' => array('type' => 'none')))), 'css_selectors' => array('title' => __('CSS Selectors', 'fl-builder'), 'fields' => array('id' => array('type' => 'text', 'label' => __('ID', 'fl-builder'), 'help' => __("A unique ID that will be applied to this module's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. No spaces.", 'fl-builder'), 'preview' => array('type' => 'none')), 'class' => array('type' => 'text', 'label' => __('Class', 'fl-builder'), 'help' => __("A class that will be applied to this module's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. Separate multiple classes with spaces.", 'fl-builder'), 'preview' => array('type' => 'none')))))));
コード例 #7
0
$module_form_children = wma_bb_shortcode_def($module, 'form_children');
/**
 * 20) Registration
 */
/**
 * Module registration class
 */
class WM_BB_Module_Call_to_action extends FLBuilderModule
{
    public function __construct()
    {
        $module = wma_bb_get_custom_module_slug(__FILE__);
        parent::__construct(apply_filters('wmhook_wmamp_' . 'bb_module_construct_' . $module, wma_bb_shortcode_def($module, 'register')));
    }
}
// /WM_BB_Module_Call_to_action
/**
 * 30) Forms
 */
/**
 * Register the module and its form
 */
if (!empty($module_form) && is_array($module_form)) {
    FLBuilder::register_module('WM_BB_Module_Call_to_action', $module_form);
}
/**
 * Module children form
 */
if (!empty($module_form_children) && is_array($module_form_children)) {
    FLBuilder::register_settings_form('wm_children_form_' . $module, $module_form_children);
}
コード例 #8
0
<?php

$global_settings = FLBuilderModel::get_global_settings();
FLBuilder::register_settings_form('row', array('title' => __('Row Settings', 'fl-builder'), 'tabs' => array('style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('width' => array('type' => 'select', 'label' => __('Width', 'fl-builder'), 'default' => $global_settings->row_width_default, 'options' => array('fixed' => __('Fixed', 'fl-builder'), 'full' => __('Full Width', 'fl-builder')), 'toggle' => array('full' => array('fields' => array('content_width'))), 'help' => __('Full width rows span the width of the page from edge to edge. Fixed rows are no wider than the Row Max Width set in the Global Settings.', 'fl-builder'), 'preview' => array('type' => 'none')), 'content_width' => array('type' => 'select', 'label' => __('Content Width', 'fl-builder'), 'default' => $global_settings->row_content_width_default, 'options' => array('fixed' => __('Fixed', 'fl-builder'), 'full' => __('Full Width', 'fl-builder')), 'help' => __('Full width content spans the width of the page from edge to edge. Fixed content is no wider than the Row Max Width set in the Global Settings.', 'fl-builder'), 'preview' => array('type' => 'none')))), 'colors' => array('title' => __('Colors', 'fl-builder'), 'fields' => array('text_color' => array('type' => 'color', 'label' => __('Text Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'link_color' => array('type' => 'color', 'label' => __('Link Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'hover_color' => array('type' => 'color', 'label' => __('Link Hover Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'heading_color' => array('type' => 'color', 'label' => __('Heading Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')))), 'background' => array('title' => __('Background', 'fl-builder'), 'fields' => array('bg_type' => array('type' => 'select', 'label' => __('Type', 'fl-builder'), 'default' => 'none', 'options' => array('none' => _x('None', 'Background type.', 'fl-builder'), 'color' => _x('Color', 'Background type.', 'fl-builder'), 'photo' => _x('Photo', 'Background type.', 'fl-builder'), 'video' => _x('Video', 'Background type.', 'fl-builder'), 'slideshow' => array('label' => _x('Slideshow', 'Background type.', 'fl-builder'), 'premium' => true), 'parallax' => array('label' => _x('Parallax', 'Background type.', 'fl-builder'), 'premium' => true)), 'toggle' => array('color' => array('sections' => array('bg_color')), 'photo' => array('sections' => array('bg_photo', 'bg_overlay')), 'video' => array('sections' => array('bg_video', 'bg_overlay')), 'slideshow' => array('sections' => array('bg_slideshow', 'bg_overlay')), 'parallax' => array('sections' => array('bg_parallax', 'bg_overlay'))), 'preview' => array('type' => 'none')))), 'bg_color' => array('title' => __('Background Color', 'fl-builder'), 'fields' => array('bg_color' => array('type' => 'color', 'label' => __('Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'bg_opacity' => array('type' => 'text', 'label' => __('Opacity', 'fl-builder'), 'default' => '100', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'preview' => array('type' => 'none')))), 'bg_photo' => array('title' => __('Background Photo', 'fl-builder'), 'fields' => array('bg_image' => array('type' => 'photo', 'label' => __('Photo', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_repeat' => array('type' => 'select', 'label' => __('Repeat', 'fl-builder'), 'default' => 'none', 'options' => array('no-repeat' => _x('None', 'Background repeat.', 'fl-builder'), 'repeat' => _x('Tile', 'Background repeat.', 'fl-builder'), 'repeat-x' => _x('Horizontal', 'Background repeat.', 'fl-builder'), 'repeat-y' => _x('Vertical', 'Background repeat.', 'fl-builder')), 'help' => __('Repeat applies to how the image should display in the background. Choosing none will display the image as uploaded. Tile will repeat the image as many times as needed to fill the background horizontally and vertically. You can also specify the image to only repeat horizontally or vertically.', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_position' => array('type' => 'select', 'label' => __('Position', 'fl-builder'), 'default' => 'center center', 'options' => array('left top' => __('Left Top', 'fl-builder'), 'left center' => __('Left Center', 'fl-builder'), 'left bottom' => __('Left Bottom', 'fl-builder'), 'right top' => __('Right Top', 'fl-builder'), 'right center' => __('Right Center', 'fl-builder'), 'right bottom' => __('Right Bottom', 'fl-builder'), 'center top' => __('Center Top', 'fl-builder'), 'center center' => __('Center', 'fl-builder'), 'center bottom' => __('Center Bottom', 'fl-builder')), 'help' => __('Position will tell the image where it should sit in the background.', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_attachment' => array('type' => 'select', 'label' => __('Attachment', 'fl-builder'), 'default' => 'scroll', 'options' => array('scroll' => __('Scroll', 'fl-builder'), 'fixed' => __('Fixed', 'fl-builder')), 'help' => __('Attachment will specify how the image reacts when scrolling a page. When scrolling is selected, the image will scroll with page scrolling. This is the default setting. Fixed will allow the image to scroll within the background if fill is selected in the scale setting.', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_size' => array('type' => 'select', 'label' => __('Scale', 'fl-builder'), 'default' => 'cover', 'options' => array('' => _x('None', 'Background scale.', 'fl-builder'), 'contain' => __('Fit', 'fl-builder'), 'cover' => __('Fill', 'fl-builder')), 'help' => __('Scale applies to how the image should display in the background. You can select either fill or fit to the background.', 'fl-builder'), 'preview' => array('type' => 'none')))), 'bg_video' => array('title' => __('Background Video', 'fl-builder'), 'fields' => array('bg_video' => array('type' => 'video', 'label' => __('Video', 'fl-builder'), 'help' => __('An HTML5 video to use as the background of this row. Supported types are MP4, WebM and Ogg.', 'fl-builder'), 'preview' => array('type' => 'refresh')), 'bg_video_fallback' => array('type' => 'photo', 'label' => __('Fallback Photo', 'fl-builder'), 'help' => __('A photo that will be displayed if the video fails to load.', 'fl-builder'), 'preview' => array('type' => 'refresh')))), 'bg_slideshow' => array('title' => __('Background Slideshow', 'fl-builder'), 'fields' => array('ss_source' => array('type' => 'select', 'label' => __('Source', 'fl-builder'), 'default' => 'wordpress', 'options' => array('wordpress' => __('Media Library', 'fl-builder'), 'smugmug' => 'SmugMug'), 'help' => __('Pull images from the WordPress media library or a gallery on your SmugMug site by inserting the RSS feed URL from SmugMug. The RSS feed URL can be accessed by using the get a link function in your SmugMug gallery.', 'fl-builder'), 'toggle' => array('wordpress' => array('fields' => array('ss_photos')), 'smugmug' => array('fields' => array('ss_feed_url'))), 'preview' => array('type' => 'none')), 'ss_photos' => array('type' => 'multiple-photos', 'label' => __('Photos', 'fl-builder'), 'preview' => array('type' => 'none')), 'ss_feed_url' => array('type' => 'text', 'label' => __('Feed URL', 'fl-builder'), 'preview' => array('type' => 'none')), 'ss_speed' => array('type' => 'text', 'label' => __('Speed', 'fl-builder'), 'default' => '3', 'size' => '5', 'description' => _x('seconds', 'Value unit for form field of time in seconds. Such as: "5 seconds"', 'fl-builder'), 'preview' => array('type' => 'none')), 'ss_transition' => array('type' => 'select', 'label' => __('Transition', 'fl-builder'), 'default' => 'fade', 'options' => array('none' => _x('None', 'Slideshow transition type.', 'fl-builder'), 'fade' => __('Fade', 'fl-builder'), 'kenBurns' => __('Ken Burns', 'fl-builder'), 'slideHorizontal' => __('Slide Horizontal', 'fl-builder'), 'slideVertical' => __('Slide Vertical', 'fl-builder'), 'blinds' => __('Blinds', 'fl-builder'), 'bars' => __('Bars', 'fl-builder'), 'barsRandom' => __('Random Bars', 'fl-builder'), 'boxes' => __('Boxes', 'fl-builder'), 'boxesRandom' => __('Random Boxes', 'fl-builder'), 'boxesGrow' => __('Boxes Grow', 'fl-builder')), 'preview' => array('type' => 'none')), 'ss_transitionDuration' => array('type' => 'text', 'label' => __('Transition Speed', 'fl-builder'), 'default' => '1', 'size' => '5', 'description' => _x('seconds', 'Value unit for form field of time in seconds. Such as: "5 seconds"', 'fl-builder'), 'preview' => array('type' => 'none')), 'ss_randomize' => array('type' => 'select', 'label' => __('Randomize Photos', 'fl-builder'), 'default' => 'false', 'options' => array('false' => __('No', 'fl-builder'), 'true' => __('Yes', 'fl-builder')), 'preview' => array('type' => 'none')))), 'bg_parallax' => array('title' => __('Background Parallax', 'fl-builder'), 'fields' => array('bg_parallax_image' => array('type' => 'photo', 'label' => __('Photo', 'fl-builder'), 'preview' => array('type' => 'none')), 'bg_parallax_speed' => array('type' => 'select', 'label' => __('Speed', 'fl-builder'), 'default' => 'fast', 'options' => array('2' => __('Fast', 'fl-builder'), '5' => _x('Medium', 'Speed.', 'fl-builder'), '8' => __('Slow', 'fl-builder')), 'preview' => array('type' => 'none')))), 'bg_overlay' => array('title' => __('Background Overlay', 'fl-builder'), 'fields' => array('bg_overlay_color' => array('type' => 'color', 'label' => __('Overlay Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'bg_overlay_opacity' => array('type' => 'text', 'label' => __('Overlay Opacity', 'fl-builder'), 'default' => '50', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'preview' => array('type' => 'none')))), 'border' => array('title' => __('Border', 'fl-builder'), 'fields' => array('border_type' => array('type' => 'select', 'label' => __('Type', 'fl-builder'), 'default' => '', 'help' => __('The type of border to use. Double borders must have a width of at least 3px to render properly.', 'fl-builder'), 'options' => array('' => _x('None', 'Border type.', 'fl-builder'), 'solid' => _x('Solid', 'Border type.', 'fl-builder'), 'dashed' => _x('Dashed', 'Border type.', 'fl-builder'), 'dotted' => _x('Dotted', 'Border type.', 'fl-builder'), 'double' => _x('Double', 'Border type.', 'fl-builder')), 'toggle' => array('' => array('fields' => array()), 'solid' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right')), 'dashed' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right')), 'dotted' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right')), 'double' => array('fields' => array('border_color', 'border_opacity', 'border_top', 'border_bottom', 'border_left', 'border_right'))), 'preview' => array('type' => 'none')), 'border_color' => array('type' => 'color', 'label' => __('Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'border_opacity' => array('type' => 'text', 'label' => __('Opacity', 'fl-builder'), 'default' => '100', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'preview' => array('type' => 'none')), 'border_top' => array('type' => 'text', 'label' => __('Top Width', 'fl-builder'), 'default' => '1', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'border_bottom' => array('type' => 'text', 'label' => __('Bottom Width', 'fl-builder'), 'default' => '1', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'border_left' => array('type' => 'text', 'label' => __('Left Width', 'fl-builder'), 'default' => '0', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')), 'border_right' => array('type' => 'text', 'label' => __('Right Width', 'fl-builder'), 'default' => '0', 'description' => 'px', 'maxlength' => '3', 'size' => '5', 'placeholder' => '0', 'preview' => array('type' => 'none')))))), 'advanced' => array('title' => __('Advanced', 'fl-builder'), 'sections' => array('margins' => array('title' => __('Margins', 'fl-builder'), 'fields' => array('margin_top' => array('type' => 'text', 'label' => __('Top', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_margins, 'preview' => array('type' => 'none')), 'margin_bottom' => array('type' => 'text', 'label' => __('Bottom', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_margins, 'preview' => array('type' => 'none')), 'margin_left' => array('type' => 'text', 'label' => __('Left', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_margins, 'preview' => array('type' => 'none')), 'margin_right' => array('type' => 'text', 'label' => __('Right', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_margins, 'preview' => array('type' => 'none')))), 'padding' => array('title' => __('Padding', 'fl-builder'), 'fields' => array('padding_top' => array('type' => 'text', 'label' => __('Top', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_padding, 'preview' => array('type' => 'none')), 'padding_bottom' => array('type' => 'text', 'label' => __('Bottom', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_padding, 'preview' => array('type' => 'none')), 'padding_left' => array('type' => 'text', 'label' => __('Left', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_padding, 'preview' => array('type' => 'none')), 'padding_right' => array('type' => 'text', 'label' => __('Right', 'fl-builder'), 'default' => '', 'description' => 'px', 'maxlength' => '4', 'size' => '5', 'placeholder' => $global_settings->row_padding, 'preview' => array('type' => 'none')))), 'responsive' => array('title' => __('Responsive Layout', 'fl-builder'), 'fields' => array('responsive_display' => array('type' => 'select', 'label' => __('Display', 'fl-builder'), 'options' => array('' => __('Always', 'fl-builder'), 'desktop' => __('Large Devices Only', 'fl-builder'), 'desktop-medium' => __('Large &amp; Medium Devices Only', 'fl-builder'), 'medium' => __('Medium Devices Only', 'fl-builder'), 'medium-mobile' => __('Medium &amp; Small Devices Only', 'fl-builder'), 'mobile' => __('Small Devices Only', 'fl-builder')), 'help' => __('Choose whether to show or hide this row at different device sizes.', 'fl-builder'), 'preview' => array('type' => 'none')))), 'css_selectors' => array('title' => __('CSS Selectors', 'fl-builder'), 'fields' => array('id' => array('type' => 'text', 'label' => __('ID', 'fl-builder'), 'help' => __("A unique ID that will be applied to this row's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. No spaces.", 'fl-builder'), 'preview' => array('type' => 'none')), 'class' => array('type' => 'text', 'label' => __('Class', 'fl-builder'), 'help' => __("A class that will be applied to this row's HTML. Must start with a letter and only contain dashes, underscores, letters or numbers. Separate multiple classes with spaces.", 'fl-builder'), 'preview' => array('type' => 'none')))))))));
コード例 #9
0
 /**
  * Renders the assets for the layout or a node.
  *
  * @since 1.7
  * @access private
  * @return array
  */
 private static function render_assets()
 {
     $partial_refresh_data = self::get_partial_refresh_data();
     $asset_info = FLBuilderModel::get_asset_info();
     $asset_ver = FLBuilderModel::get_asset_version();
     $assets = array('js' => '', 'css' => '');
     // Render the JS.
     if ($partial_refresh_data['is_partial_refresh']) {
         if (!class_exists('FLJSMin')) {
             include FL_BUILDER_DIR . 'classes/class-fl-jsmin.php';
         }
         switch ($partial_refresh_data['node']->type) {
             case 'row':
                 $assets['js'] = FLBuilder::render_row_js($partial_refresh_data['node']);
                 $assets['js'] .= FLBuilder::render_row_modules_js($partial_refresh_data['node']);
                 break;
             case 'column':
                 $assets['js'] = FLBuilder::render_column_modules_js($partial_refresh_data['node']);
                 break;
             case 'module':
                 $assets['js'] = FLBuilder::render_module_js($partial_refresh_data['node']);
                 break;
         }
         $assets['js'] .= 'FLBuilder._renderLayoutComplete();';
         $assets['js'] = FLJSMin::minify($assets['js']);
     } else {
         $assets['js'] = $asset_info['js_url'] . '?ver=' . $asset_ver;
     }
     // Render the CSS.
     $assets['css'] = $asset_info['css_url'] . '?ver=' . $asset_ver;
     // Return the assets.
     return $assets;
 }
コード例 #10
0
ファイル: map-module.php プロジェクト: Nirajjcu/minime3d
<?php

class TesseractGoogleMapModule extends FLBuilderModule
{
    /**
     * Constructor function for the module. You must pass the
     * name, description, dir, url and enabled in an array to the parent class.
     *
     * @method __construct
     */
    public function __construct()
    {
        parent::__construct(array('name' => __('Map', 'fl-builder'), 'description' => __('Google Map', 'fl-builder'), 'category' => __('Advanced Modules', 'fl-builder'), 'dir' => TESSERACT_BB_MODULE_DIR . 'map/', 'url' => TESSERACT_BB_MODULE_URL . 'map/', 'enabled' => true));
        if (!defined('GOOGLE_MAPS_API_KEY')) {
            define('GOOGLE_MAPS_API_KEY', 'AIzaSyDdg6IMS4WeWJRORd0wU_gcE-kFOUKt4zE');
        }
        $this->add_js('google-maps-javascript-api', 'https://maps.googleapis.com/maps/api/js?key=' . GOOGLE_MAPS_API_KEY, array('jquery'), '3.0', true);
    }
}
FLBuilder::register_module('TesseractGoogleMapModule', array('tesseract-map-module' => array('title' => __('General', 'fl-builder'), 'sections' => array('display' => array('title' => __('Display', 'fl-builder'), 'fields' => array('fullwidth' => array('type' => 'select', 'label' => __('Full width map?', 'fl-builder'), 'default' => 'yes', 'options' => array('yes' => __('Yes', 'fl-builder'), 'no' => __('No', 'fl-builder')), 'toggle' => array('no' => array('fields' => array('width', 'height', 'float', 'query')), 'yes' => array('fields' => array('height', 'query')))), 'width' => array('type' => 'text', 'label' => __('Width', 'fl-builder'), 'description' => __('Width in pixels', 'fl-builder'), 'default' => '600'), 'height' => array('type' => 'text', 'label' => __('Height', 'fl-builder'), 'description' => __('Height in pixels', 'fl-builder'), 'default' => '400'), 'float' => array('type' => 'select', 'label' => __('Float', 'fl-builder'), 'default' => __('none', 'fl-builder'), 'options' => array('none' => 'None', 'left' => 'Left', 'right' => 'Right')), 'zoom' => array('type' => 'select', 'label' => __('Zoom Level', 'fl-builder'), 'default' => '8', 'options' => range(0, 20), 'preview' => array('type' => 'none')), 'lat' => array('type' => 'text', 'hidden' => true), 'lng' => array('type' => 'text', 'hidden' => true), 'query' => array('type' => 'text', 'label' => __('Search location', 'fl-builder'), 'description' => __('Enter an address. eg. 123 Main st, Los Angeles, CA', 'fl-builder'), 'default' => '', 'preview' => array('type' => 'none'))))))));
コード例 #11
0
ファイル: widget.php プロジェクト: meftasadat/DSL_SITE
        // Make sure we have a widget.
        if (!isset($settings->widget) || !isset($wp_widget_factory->widgets[$settings->widget])) {
            return $settings;
        }
        // Get the widget instance.
        $factory = $wp_widget_factory->widgets[$settings->widget];
        $class = get_class($factory);
        $instance = new $class($factory->id_base, $factory->name, $factory->widget_options);
        // Get the widget settings.
        $settings_key = 'widget-' . $instance->id_base;
        $widget_settings = array();
        if (isset($settings->{$settings_key})) {
            $widget_settings = (array) $settings->{$settings_key};
        }
        // Run the widget update method.
        $widget_settings = $instance->update($widget_settings, array());
        // Save the widget settings as an object.
        if (is_array($widget_settings)) {
            $settings->{$settings_key} = (object) $widget_settings;
        }
        // Delete the WordPress cache for this widget.
        wp_cache_delete($settings->widget, 'widget');
        // Return the settings.
        return $settings;
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLWidgetModule', array('general' => array('title' => __('General', 'fl-builder'), 'file' => FL_BUILDER_DIR . 'modules/widget/includes/settings-general.php')));
コード例 #12
0
ファイル: cta.php プロジェクト: spokencode/bophillips
 /**
  * @method render_button
  */
 public function render_button()
 {
     $btn_settings = array('align' => '', 'bg_color' => $this->settings->btn_bg_color, 'bg_hover_color' => $this->settings->btn_bg_hover_color, 'bg_opacity' => $this->settings->btn_bg_opacity, 'border_radius' => $this->settings->btn_border_radius, 'border_size' => $this->settings->btn_border_size, 'font_size' => $this->settings->btn_font_size, 'icon' => $this->settings->btn_icon, 'icon_position' => $this->settings->btn_icon_position, 'link' => $this->settings->btn_link, 'link_target' => $this->settings->btn_link_target, 'padding' => $this->settings->btn_padding, 'style' => $this->settings->btn_style, 'text' => $this->settings->btn_text, 'text_color' => $this->settings->btn_text_color, 'text_hover_color' => $this->settings->btn_text_hover_color, 'width' => $this->settings->layout == 'stacked' ? 'auto' : 'full');
     FLBuilder::render_module_html('button', $btn_settings);
 }
コード例 #13
0
ファイル: post-grid.php プロジェクト: spokencode/bophillips
 */
class FLPostGridModule extends FLBuilderModule
{
    /**
     * @method __construct
     */
    public function __construct()
    {
        parent::__construct(array('name' => __('Posts', 'fl-builder'), 'description' => __('Display a grid of your WordPress posts.', 'fl-builder'), 'category' => __('Advanced Modules', 'fl-builder'), 'editor_export' => false, 'enabled' => true));
    }
    /**
     * @method enqueue_scripts
     */
    public function enqueue_scripts()
    {
        if (FLBuilderModel::is_builder_active() || $this->settings->layout == 'grid') {
            $this->add_js('jquery-masonry');
        }
        if (FLBuilderModel::is_builder_active() || $this->settings->layout == 'gallery') {
            $this->add_js('fl-gallery-grid');
        }
        if (FLBuilderModel::is_builder_active() || $this->settings->pagination == 'scroll') {
            $this->add_js('jquery-infinitescroll');
        }
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLPostGridModule', array('layout' => array('title' => __('Layout', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('layout' => array('type' => 'select', 'label' => __('Layout Style', 'fl-builder'), 'default' => 'grid', 'options' => array('grid' => __('Grid', 'fl-builder'), 'gallery' => __('Gallery', 'fl-builder'), 'feed' => __('Feed', 'fl-builder')), 'toggle' => array('grid' => array('sections' => array('grid', 'image', 'content'), 'fields' => array('show_author')), 'feed' => array('sections' => array('image', 'content'), 'fields' => array('image_position', 'show_author', 'show_comments', 'content_type')), 'gallery' => array('tabs' => array('style')))), 'pagination' => array('type' => 'select', 'label' => __('Pagination Style', 'fl-builder'), 'default' => 'numbers', 'options' => array('numbers' => __('Numbers', 'fl-builder'), 'scroll' => __('Scroll', 'fl-builder'), 'none' => _x('None', 'Pagination style.', 'fl-builder'))), 'posts_per_page' => array('type' => 'text', 'label' => __('Posts Per Page', 'fl-builder'), 'default' => '10', 'size' => '4'))), 'grid' => array('title' => __('Grid', 'fl-builder'), 'fields' => array('post_width' => array('type' => 'text', 'label' => __('Post Width', 'fl-builder'), 'default' => '300', 'maxlength' => '3', 'size' => '4', 'description' => 'px'), 'post_spacing' => array('type' => 'text', 'label' => __('Post Spacing', 'fl-builder'), 'default' => '60', 'maxlength' => '3', 'size' => '4', 'description' => 'px'))), 'image' => array('title' => __('Featured Image', 'fl-builder'), 'fields' => array('show_image' => array('type' => 'select', 'label' => __('Image', 'fl-builder'), 'default' => '1', 'options' => array('1' => __('Show', 'fl-builder'), '0' => __('Hide', 'fl-builder')), 'toggle' => array('1' => array('fields' => array('image_size')))), 'image_position' => array('type' => 'select', 'label' => __('Position', 'fl-builder'), 'default' => 'above', 'options' => array('above' => __('Above Text', 'fl-builder'), 'beside' => __('Beside Text', 'fl-builder'))), 'image_size' => array('type' => 'photo-sizes', 'label' => __('Size', 'fl-builder'), 'default' => 'medium'))), 'info' => array('title' => __('Post Info', 'fl-builder'), 'fields' => array('show_author' => array('type' => 'select', 'label' => __('Author', 'fl-builder'), 'default' => '1', 'options' => array('1' => __('Show', 'fl-builder'), '0' => __('Hide', 'fl-builder'))), 'show_date' => array('type' => 'select', 'label' => __('Date', 'fl-builder'), 'default' => '1', 'options' => array('1' => __('Show', 'fl-builder'), '0' => __('Hide', 'fl-builder')), 'toggle' => array('1' => array('fields' => array('date_format')))), 'date_format' => array('type' => 'select', 'label' => __('Date Format', 'fl-builder'), 'default' => 'default', 'options' => array('default' => __('Default', 'fl-builder'), 'M j, Y' => date('M j, Y'), 'F j, Y' => date('F j, Y'), 'm/d/Y' => date('m/d/Y'), 'm-d-Y' => date('m-d-Y'), 'd M Y' => date('d M Y'), 'd F Y' => date('d F Y'), 'Y-m-d' => date('Y-m-d'), 'Y/m/d' => date('Y/m/d'))), 'show_comments' => array('type' => 'select', 'label' => __('Comments', 'fl-builder'), 'default' => '1', 'options' => array('1' => __('Show', 'fl-builder'), '0' => __('Hide', 'fl-builder'))))), 'content' => array('title' => __('Content', 'fl-builder'), 'fields' => array('show_content' => array('type' => 'select', 'label' => __('Content', 'fl-builder'), 'default' => '1', 'options' => array('1' => __('Show', 'fl-builder'), '0' => __('Hide', 'fl-builder'))), 'content_type' => array('type' => 'select', 'label' => __('Content Type', 'fl-builder'), 'default' => 'excerpt', 'options' => array('excerpt' => __('Excerpt', 'fl-builder'), 'full' => __('Full Text', 'fl-builder'))), 'show_more_link' => array('type' => 'select', 'label' => __('More Link', 'fl-builder'), 'default' => '0', 'options' => array('1' => __('Show', 'fl-builder'), '0' => __('Hide', 'fl-builder'))), 'more_link_text' => array('type' => 'text', 'label' => __('More Link Text', 'fl-builder'), 'default' => __('Read More', 'fl-builder')))))), 'style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('gallery_general' => array('title' => '', 'fields' => array('hover_transition' => array('type' => 'select', 'label' => __('Hover Transition', 'fl-builder'), 'default' => 'fade', 'options' => array('fade' => __('Fade', 'fl-builder'), 'slide-up' => __('Slide Up', 'fl-builder'), 'slide-down' => __('Slide Down', 'fl-builder'), 'scale-up' => __('Scale Up', 'fl-builder'), 'scale-down' => __('Scale Down', 'fl-builder'))))), 'icons' => array('title' => __('Icons', 'fl-builder'), 'fields' => array('has_icon' => array('type' => 'select', 'label' => __('Use Icon for Posts', 'fl-builder'), 'default' => 'no', 'options' => array('yes' => __('Yes', 'fl-builder'), 'no' => __('No', 'fl-builder')), 'toggle' => array('yes' => array('fields' => array('icon', 'icon_position', 'icon_color', 'icon_size')))), 'icon' => array('type' => 'icon', 'label' => __('Post Icon', 'fl-builder')), 'icon_position' => array('type' => 'select', 'label' => __('Post Icon Position', 'fl-builder'), 'default' => 'above', 'options' => array('above' => __('Above Text', 'fl-builder'), 'below' => __('Below Text', 'fl-builder'))), 'icon_size' => array('type' => 'text', 'label' => __('Post Icon Size', 'fl-builder'), 'default' => '24', 'maxlength' => '3', 'size' => '4', 'description' => 'px'))), 'text_style' => array('title' => __('Colors', 'fl-builder'), 'fields' => array('text_color' => array('type' => 'color', 'label' => __('Text Color', 'fl-builder'), 'default' => 'ffffff', 'show_reset' => true), 'icon_color' => array('type' => 'color', 'label' => __('Post Icon Color', 'fl-builder'), 'show_reset' => true), 'text_bg_color' => array('type' => 'color', 'label' => __('Text Background Color', 'fl-builder'), 'default' => '333333', 'help' => __('The color applies to the overlay behind text over the background selections.', 'fl-builder'), 'show_reset' => true), 'text_bg_opacity' => array('type' => 'text', 'label' => __('Text Background Opacity', 'fl-builder'), 'default' => '50', 'maxlength' => '3', 'size' => '4', 'description' => '%'))))), 'content' => array('title' => __('Content', 'fl-builder'), 'file' => FL_BUILDER_DIR . 'includes/loop-settings.php')));
コード例 #14
0
px;
	-moz-border-radius: <?php 
echo $settings->btn_border_radius;
?>
px;
	-webkit-border-radius: <?php 
echo $settings->btn_border_radius;
?>
px;
}
.fl-subscribe-form-inline .fl-form-field input,
.fl-subscribe-form-inline .fl-form-field input[type=text] {
	height: <?php 
echo $settings->btn_padding * 2 + ($settings->btn_font_size + 4);
?>
px;
}
.fl-subscribe-form-inline a.fl-button {
	height: <?php 
echo $settings->btn_padding * 2 + ($settings->btn_font_size + 4);
?>
px;
	line-height: <?php 
echo $settings->btn_font_size;
?>
px !important;
}

<?php 
FLBuilder::render_module_css('button', $id, array('align' => '', 'bg_color' => $settings->btn_bg_color, 'bg_hover_color' => $settings->btn_bg_hover_color, 'bg_opacity' => $settings->btn_bg_opacity, 'border_radius' => $settings->btn_border_radius, 'border_size' => $settings->btn_border_size, 'font_size' => $settings->btn_font_size, 'icon' => $settings->btn_icon, 'icon_position' => $settings->btn_icon_position, 'link' => '#', 'link_target' => '_self', 'padding' => $settings->btn_padding, 'style' => $settings->btn_style, 'text' => $settings->btn_text, 'text_color' => $settings->btn_text_color, 'text_hover_color' => $settings->btn_text_hover_color, 'width' => 'full'));
 /**
  * Register the product module and configure the module for use in the Page Builder
  * 
  * @since 1.0.4
  */
 function register_twenty_sixty_product_module()
 {
     require_once 'modules/twenty-sixty-product-module/twenty-sixty-product-module.php';
     $terms = get_terms('product_category', array('hide_empty' => false, 'fields' => 'all'));
     $product_categories = array();
     if (!empty($terms) && !is_wp_error($terms)) {
         foreach ($terms as $term) {
             $faq_categories[$term->slug] = __($term->name, 'fl-builder');
         }
     }
     FLBuilder::register_module('TwentySixtyProductModule', array('general' => array('title' => __('Products', 'fl-builder'), 'sections' => array('general' => array('title' => __('Section Title', 'fl-builder'), 'fields' => array('display_title' => array('type' => 'checkbox', 'label' => __('Display FAQ Category Title?', 'fl-builder'), 'default' => 0), 'product_category' => array('type' => 'select', 'label' => __('Select a product category', 'fl-builder'), 'help' => 'Select any of the Product Categories to display. If the category is left blank, all Products will be pulled in on the same page', 'default' => '', 'options' => $product_categories)))))));
 }
コード例 #16
0
 /**
  * Render thumbnail image for mobile.
  *
  * Get's the post ID and renders the html markup for the featured image
  * in the desired cropped size.
  * 
  * @param  int $id    The post ID.
  * @since  1.5.9
  * @return void
  */
 public function render_mobile_img($id)
 {
     // check if image_type is set
     if (isset($this->settings->image_type)) {
         // check if "background" is choosed as image type for featured image
         if ($this->settings->image_type == 'background') {
             // get image source and data
             $src = $this->_get_uncropped_url($id);
             $photo_data = $this->_get_img_data($id);
             // set params
             $photo_settings = array('align' => 'center', 'link_type' => 'url', 'link_url' => get_the_permalink($id), 'photo' => $photo_data, 'photo_src' => $src, 'photo_source' => 'library');
             // render image
             echo '<div class="fl-post-slider-mobile-img">';
             FLBuilder::render_module_html('photo', $photo_settings);
             echo '</div>';
         }
     }
 }
コード例 #17
0
ファイル: numbers.php プロジェクト: onedaylabs/onedaylabs.com
    }
    public function render_number()
    {
        $number = $this->settings->number ? $this->settings->number : 0;
        $layout = $this->settings->layout ? $this->settings->layout : 'default';
        $type = $this->settings->number_type ? $this->settings->number_type : 'percent';
        $prefix = $type == 'percent' ? '' : $this->settings->number_prefix;
        $suffix = $type == 'percent' ? '%' : $this->settings->number_suffix;
        $html = '<div class="fl-number-string">' . $prefix . '<span class="fl-number-int">' . number_format($number) . '</span>' . $suffix . '</div>';
        echo $html;
    }
    public function render_circle_bar()
    {
        $width = !empty($this->settings->circle_width) ? $this->settings->circle_width : 100;
        $pos = $width / 2;
        $radius = $pos - 10;
        $dash = number_format(M_PI * 2 * $radius, 2, '.', '');
        $html = '<div class="svg-container">';
        $html .= '<svg class="svg" viewBox="0 0 ' . $width . ' ' . $width . '" version="1.1" preserveAspectRatio="xMinYMin meet">
			<circle class="fl-bar-bg" r="' . $radius . '" cx="' . $pos . '" cy="' . $pos . '" fill="transparent" stroke-dasharray="' . $dash . '" stroke-dashoffset="0"></circle>
			<circle class="fl-bar" r="' . $radius . '" cx="' . $pos . '" cy="' . $pos . '" fill="transparent" stroke-dasharray="' . $dash . '" stroke-dashoffset="' . $dash . '" transform="rotate(-90 ' . $pos . ' ' . $pos . ')"></circle>
		</svg>';
        $html .= '</div>';
        echo $html;
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLNumbersModule', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('layout' => array('type' => 'select', 'label' => __('Layout', 'fl-builder'), 'default' => 'default', 'options' => array('default' => __('Only Numbers', 'fl-builder'), 'circle' => __('Circle Counter', 'fl-builder'), 'bars' => __('Bars Counter', 'fl-builder')), 'toggle' => array('circle' => array('sections' => array('circle_bar_style')), 'bars' => array('sections' => array('bar_style'), 'fields' => array('number_position')))), 'number_type' => array('type' => 'select', 'label' => __('Number Type', 'fl-builder'), 'default' => 'percent', 'options' => array('percent' => __('Percent', 'fl-builder'), 'standard' => __('Standard', 'fl-builder')), 'toggle' => array('standard' => array('fields' => array('number_prefix', 'number_suffix')))), 'number' => array('type' => 'text', 'label' => __('Number', 'fl-builder'), 'size' => '5', 'default' => '100', 'placeholder' => '100'), 'max_number' => array('type' => 'text', 'label' => __('Total', 'fl-builder'), 'size' => '5', 'help' => __('The total number of units for this counter. For example, if the Number is set to 250 and the Total is set to 500, the counter will animate to 50%.', 'fl-builder')), 'number_position' => array('type' => 'select', 'label' => __('Number Position', 'fl-builder'), 'size' => '5', 'help' => __('Where to display the number in relation to the bar.', 'fl-builder'), 'options' => array('default' => __('Inside Bar', 'fl-builder'), 'above' => __('Above Bar', 'fl-builder'), 'below' => __('Below Bar', 'fl-builder'))), 'before_number_text' => array('type' => 'text', 'label' => __('Text Before Number', 'fl-builder'), 'size' => '20', 'help' => __('Text to appear above the number. Leave it empty for none.', 'fl-builder')), 'after_number_text' => array('type' => 'text', 'label' => __('Text After Number', 'fl-builder'), 'size' => '20', 'help' => __('Text to appear after the number. Leave it empty for none.', 'fl-builder')), 'number_prefix' => array('type' => 'text', 'label' => __('Number Prefix', 'fl-builder'), 'size' => '10', 'help' => __('For example, if your number is US$ 10, your prefix would be "US$ ".', 'fl-builder')), 'number_suffix' => array('type' => 'text', 'label' => __('Number Suffix', 'fl-builder'), 'size' => '10', 'help' => __('For example, if your number is 10%, your prefix would be "%".', 'fl-builder')), 'animation_speed' => array('type' => 'text', 'label' => __('Animation Speed', 'fl-builder'), 'size' => '5', 'default' => '1', 'placeholder' => '1', 'description' => __('second(s)', 'fl-builder'), 'help' => __('Number of seconds to complete the animation.', 'fl-builder')), 'delay' => array('type' => 'text', 'label' => __('Animation Delay', 'fl-builder'), 'size' => '5', 'default' => '1', 'placeholder' => '1', 'description' => __('second(s)', 'fl-builder')))))), 'style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('text_style' => array('title' => __('Colors', 'fl-builder'), 'fields' => array('text_color' => array('type' => 'color', 'label' => __('Text Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-number-before-text, .fl-number-after-text', 'property' => 'color')), 'number_color' => array('type' => 'color', 'label' => __('Number Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-number-string', 'property' => 'color')), 'number_size' => array('type' => 'text', 'label' => __('Number Size', 'fl-builder'), 'default' => '32', 'maxlength' => '3', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'selector' => '.fl-number-string', 'property' => 'font-size', 'unit' => 'px')))), 'circle_bar_style' => array('title' => __('Circle Bar Styles', 'fl-builder'), 'fields' => array('circle_width' => array('type' => 'text', 'label' => __('Cirle Size', 'fl-builder'), 'default' => '200', 'maxlength' => '4', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'rules' => array(array('selector' => '.fl-number-circle-container', 'property' => 'max-width', 'unit' => 'px'), array('selector' => '.fl-number-circle-container', 'property' => 'max-height', 'unit' => 'px')))), 'circle_dash_width' => array('type' => 'text', 'label' => __('Cirle Stroke Size', 'fl-builder'), 'default' => '10', 'maxlength' => '2', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'selector' => '.svg circle', 'property' => 'stroke-width', 'unit' => 'px')), 'circle_color' => array('type' => 'color', 'label' => __('Circle Foreground Color', 'fl-builder'), 'default' => 'f7951e', 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.svg .fl-bar', 'property' => 'stroke')), 'circle_bg_color' => array('type' => 'color', 'label' => __('Circle Background Color', 'fl-builder'), 'default' => 'eaeaea', 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.svg .fl-bar-bg', 'property' => 'stroke')))), 'bar_style' => array('title' => __('Bar Styles', 'fl-builder'), 'fields' => array('bar_color' => array('type' => 'color', 'label' => __('Bar Foreground Color', 'fl-builder'), 'default' => 'f7951e', 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-number-bar', 'property' => 'background-color')), 'bar_bg_color' => array('type' => 'color', 'label' => __('Bar Background Color', 'fl-builder'), 'default' => 'eaeaea', 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-number-bars-container', 'property' => 'background-color'))))))));
コード例 #18
0
        $this->add_css('font-awesome');
        add_action('brj_theme_elements_render/after_setup_theme', 'BRJ_Sidebar::render_php');
        add_action('after_setup_theme', 'BRJ_Sidebar::register_sidebars');
    }
    static function render_php()
    {
        $modules = BRJ_ThemeElements::get_modules();
        $modules = $modules['brj-sidebar'];
        if (!empty($modules)) {
            require dirname(__FILE__) . '/generator/generator.php';
        }
    }
    static function get_args($module)
    {
        $args = array('name' => $module->settings->label, 'id' => $module->settings->handle, 'description' => $module->settings->description, 'class' => $module->settings->class, 'before_widget' => $module->settings->before_widget, 'after_widget' => $module->settings->after_widget, 'before_title' => $module->settings->before_title, 'after_title' => $module->settings->after_title);
        return $args;
    }
    static function register_sidebars()
    {
        $modules = BRJ_ThemeElements::get_modules();
        $modules = $modules['brj-sidebar'];
        if (!empty($modules)) {
            foreach ($modules as $module) {
                $args = self::get_args($module);
                register_sidebar($args);
            }
        }
    }
}
FLBuilder::register_module('BRJ_Sidebar', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('handle' => array('type' => 'text', 'label' => 'Handle', 'placeholder' => 'default_sidebar'), 'label' => array('type' => 'text', 'label' => 'Name', 'placeholder' => 'Default Sidebar'), 'description' => array('type' => 'textarea', 'label' => 'Description'), 'class' => array('type' => 'text', 'label' => 'Class'), 'before_widget' => array('type' => 'text', 'label' => 'Before Widget', 'placeholder' => ''), 'after_widget' => array('type' => 'text', 'label' => 'After Widget', 'placeholder' => ''), 'before_title' => array('type' => 'text', 'label' => 'Before Title', 'placeholder' => ''), 'after_title' => array('type' => 'text', 'label' => 'After Title', 'placeholder' => '')))))));
コード例 #19
0
        $timestamp = $date . ' ' . $time;
        $timezone = new DateTimeZone($this->settings->time_zone);
        $date = new DateTime($timestamp, $timezone);
        return $date->format('c');
    }
    /**
     * Renders a svg circle for the current number.
     *
     * @since 1.6.4
     * @return void
     */
    public function render_circle()
    {
        $width = !empty($this->settings->circle_width) ? $this->settings->circle_width : 100;
        $pos = $width / 2;
        $radius = $pos - 10;
        $dash = number_format(M_PI * 2 * $radius, 2, '.', '');
        $html = '<div class="svg-container">';
        $html .= '<svg class="svg" viewBox="0 0 ' . $width . ' ' . $width . '" version="1.1" preserveAspectRatio="xMinYMin meet">
			<circle class="fl-number-bg" r="' . $radius . '" cx="' . $pos . '" cy="' . $pos . '" fill="transparent" stroke-dasharray="' . $dash . '" stroke-dashoffset="0"></circle>
			<circle class="fl-number" r="' . $radius . '" cx="' . $pos . '" cy="' . $pos . '" fill="transparent" stroke-dasharray="' . $dash . '" stroke-dashoffset="' . $dash . '" transform="rotate(-90 ' . $pos . ' ' . $pos . ')"></circle>
		</svg>';
        $html .= '</div>';
        echo $html;
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLCountdownModule', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('date' => array('title' => __('Date', 'fl-builder'), 'fields' => array('day' => array('type' => 'text', 'label' => __('Day', 'fl-builder'), 'default' => date('j'), 'maxlength' => '2', 'size' => '5', 'preview' => array('type' => 'none')), 'month' => array('type' => 'text', 'label' => __('Month', 'fl-builder'), 'default' => date('n'), 'maxlength' => '2', 'size' => '5', 'preview' => array('type' => 'none')), 'year' => array('type' => 'text', 'label' => __('Year', 'fl-builder'), 'default' => date('Y'), 'maxlength' => '4', 'size' => '5', 'preview' => array('type' => 'none')))), 'time' => array('title' => __('Time', 'fl-builder'), 'fields' => array('time' => array('type' => 'time', 'label' => __('Time', 'fl-builder'), 'default' => array('hours' => '01', 'minutes' => '00', 'day_period' => 'am')), 'time_zone' => array('type' => 'timezone', 'label' => __('Time Zone', 'fl-builder'), 'default' => 'UTC'))))), 'style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('layout' => array('type' => 'select', 'label' => __('Layout', 'fl-builder'), 'default' => 'default', 'options' => array('default' => __('Numbers', 'fl-builder'), 'circle' => __('Numbers + Circles', 'fl-builder')), 'toggle' => array('circle' => array('sections' => array('circle_bar_style'), 'fields' => array('after_number_text')), 'default' => array('sections' => array('numbers_style', 'separator_style'), 'fields' => array('horizontal_padding', 'vertical_padding')))))), 'text_style' => array('title' => __('Numbers and Text', 'fl-builder'), 'fields' => array('number_color' => array('type' => 'color', 'label' => __('Number Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .fl-countdown-unit-number', 'property' => 'color')), 'label_color' => array('type' => 'color', 'label' => __('Text Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .fl-countdown-unit-label', 'property' => 'color')), 'number_size' => array('type' => 'text', 'label' => __('Number Size', 'fl-builder'), 'default' => '24', 'maxlength' => '3', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .fl-countdown-unit-number', 'property' => 'font-size', 'unit' => 'px')), 'label_size' => array('type' => 'text', 'label' => __('Text Size', 'fl-builder'), 'default' => '13', 'maxlength' => '3', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .fl-countdown-unit-label', 'property' => 'font-size', 'unit' => 'px')), 'horizontal_padding' => array('type' => 'text', 'label' => __('Horizontal Padding', 'fl-builder'), 'default' => '10', 'maxlength' => '3', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'rules' => array(array('selector' => '.fl-countdown .fl-countdown-unit', 'property' => 'padding-left', 'unit' => 'px'), array('selector' => '.fl-countdown .fl-countdown-unit', 'property' => 'padding-right', 'unit' => 'px')))), 'vertical_padding' => array('type' => 'text', 'label' => __('Vertical Padding', 'fl-builder'), 'default' => '10', 'maxlength' => '3', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'rules' => array(array('selector' => '.fl-countdown .fl-countdown-unit', 'property' => 'padding-top', 'unit' => 'px'), array('selector' => '.fl-countdown .fl-countdown-unit', 'property' => 'padding-bottom', 'unit' => 'px')))), 'number_spacing' => array('type' => 'text', 'label' => __('Number Spacing', 'fl-builder'), 'default' => '10', 'maxlength' => '3', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'rules' => array(array('selector' => '.fl-countdown .fl-countdown-number', 'property' => 'margin-left', 'unit' => 'px'), array('selector' => '.fl-countdown .fl-countdown-number', 'property' => 'margin-right', 'unit' => 'px')))))), 'numbers_style' => array('title' => __('Backgrounds', 'fl-builder'), 'fields' => array('number_bg_color' => array('type' => 'color', 'label' => __('Number Background Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .fl-countdown-unit', 'property' => 'background-color')), 'number_bg_opacity' => array('type' => 'text', 'label' => __('Number Background Opacity', 'fl-builder'), 'default' => '100', 'maxlength' => '3', 'size' => '4', 'description' => '%'), 'border_radius' => array('type' => 'text', 'label' => __('Number Border Radius', 'fl-builder'), 'default' => '0', 'maxlength' => '3', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .fl-countdown-unit', 'property' => 'border-radius', 'unit' => 'px')))), 'separator_style' => array('title' => __('Separator', 'fl-builder'), 'fields' => array('show_separator' => array('type' => 'select', 'label' => __('Show Time Separators', 'fl-builder'), 'default' => 'no', 'options' => array('no' => __('No', 'fl-builder'), 'yes' => __('Yes', 'fl-builder')), 'toggle' => array('yes' => array('fields' => array('separator_type', 'separator_color')))), 'separator_type' => array('type' => 'select', 'label' => __('Separator Type', 'fl-builder'), 'default' => 'line', 'options' => array('colon' => __('Colon', 'fl-builder'), 'line' => __('Line', 'fl-builder')), 'toggle' => array('colon' => array('fields' => array('separator_size')))), 'separator_color' => array('type' => 'color', 'label' => __('Separator Color', 'fl-builder'), 'show_reset' => true), 'separator_size' => array('type' => 'text', 'label' => __('Separator Size', 'fl-builder'), 'default' => '15', 'maxlength' => '3', 'size' => '4', 'description' => 'px'))), 'circle_bar_style' => array('title' => __('Circle Styles', 'fl-builder'), 'fields' => array('circle_width' => array('type' => 'text', 'label' => __('Circle Size', 'fl-builder'), 'default' => '200', 'maxlength' => '4', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'rules' => array(array('selector' => '.fl-countdown-number', 'property' => 'max-width', 'unit' => 'px'), array('selector' => '.fl-countdown-number', 'property' => 'max-height', 'unit' => 'px'), array('selector' => '.fl-countdown-circle-container', 'property' => 'max-width', 'unit' => 'px'), array('selector' => '.fl-countdown-circle-container', 'property' => 'max-height', 'unit' => 'px')))), 'circle_dash_width' => array('type' => 'text', 'label' => __('Circle Stroke Size', 'fl-builder'), 'default' => '10', 'maxlength' => '2', 'size' => '4', 'description' => 'px', 'preview' => array('type' => 'css', 'selector' => '.svg circle', 'property' => 'stroke-width', 'unit' => 'px')), 'circle_color' => array('type' => 'color', 'label' => __('Circle Foreground Color', 'fl-builder'), 'default' => 'f7951e', 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .svg .fl-number', 'property' => 'stroke')), 'circle_bg_color' => array('type' => 'color', 'label' => __('Circle Background Color', 'fl-builder'), 'default' => 'eaeaea', 'show_reset' => true, 'preview' => array('type' => 'css', 'selector' => '.fl-countdown .svg .fl-number-bg', 'property' => 'stroke'))))))));
コード例 #20
0
        if (isset($_POST['email'])) {
            $template .= "Email: {$_POST['email']} \r\n";
        }
        if (isset($_POST['phone'])) {
            $template .= "Phone: {$_POST['phone']} \r\n";
        }
        $template .= __('Message', 'fl-builder') . ": \r\n" . $_POST['message'];
        // Double check the mailto email is proper and send
        if ($mailto) {
            wp_mail($mailto, $subject, $template);
            die('1');
        } else {
            die($mailto);
        }
    }
    public static function mail_from($original_email_address)
    {
        global $fl_contact_from_email;
        return $fl_contact_from_email != '' ? $fl_contact_from_email : $original_email_address;
    }
    public static function from_name($original_name)
    {
        global $fl_contact_from_name;
        return $fl_contact_from_name != '' ? $fl_contact_from_name : $original_name;
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLContactFormModule', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('mailto_email' => array('type' => 'text', 'label' => __('Send To Email', 'fl-builder'), 'default' => '', 'placeholder' => __('*****@*****.**', 'fl-builder'), 'help' => __('The contact form will send to this e-mail', 'fl-builder'), 'preview' => array('type' => 'none')), 'name_toggle' => array('type' => 'select', 'label' => __('Name Field', 'fl-builder'), 'default' => 'show', 'options' => array('show' => __('Show', 'fl-builder'), 'hide' => __('Hide', 'fl-builder'))), 'subject_toggle' => array('type' => 'select', 'label' => __('Subject Field', 'fl-builder'), 'default' => 'hide', 'options' => array('show' => __('Show', 'fl-builder'), 'hide' => __('Hide', 'fl-builder'))), 'email_toggle' => array('type' => 'select', 'label' => __('Email Field', 'fl-builder'), 'default' => 'show', 'options' => array('show' => __('Show', 'fl-builder'), 'hide' => __('Hide', 'fl-builder'))), 'phone_toggle' => array('type' => 'select', 'label' => __('Phone Field', 'fl-builder'), 'default' => 'hide', 'options' => array('show' => __('Show', 'fl-builder'), 'hide' => __('Hide', 'fl-builder'))))), 'success' => array('title' => __('Success', 'fl-builder'), 'fields' => array('success_action' => array('type' => 'select', 'label' => __('Success Action', 'fl-builder'), 'options' => array('none' => __('None', 'fl-builder'), 'show_message' => __('Show Message', 'fl-builder'), 'redirect' => __('Redirect', 'fl-builder')), 'toggle' => array('show_message' => array('fields' => array('success_message')), 'redirect' => array('fields' => array('success_url'))), 'preview' => array('type' => 'none')), 'success_message' => array('type' => 'editor', 'label' => '', 'media_buttons' => false, 'rows' => 8, 'default' => __('Thanks for your message! We’ll be in touch soon.', 'fl-builder'), 'preview' => array('type' => 'none')), 'success_url' => array('type' => 'link', 'label' => __('Success URL', 'fl-builder'), 'preview' => array('type' => 'none'))))))));
コード例 #21
0
foreach (FLBuilderLoop::post_types() as $slug => $type) {
    ?>
		<table class="fl-form-table fl-loop-builder-filter fl-loop-builder-<?php 
    echo $slug;
    ?>
-filter" <?php 
    if ($slug == $settings->post_type) {
        echo 'style="display:table;"';
    }
    ?>
>
		<?php 
    // Posts
    FLBuilder::render_settings_field('posts_' . $slug, array('type' => 'suggest', 'action' => 'fl_as_posts', 'data' => $slug, 'label' => $type->label, 'help' => sprintf(__('Enter a comma separated list of %s. Only these %s will be shown.', 'fl-builder'), $type->label, $type->label)), $settings);
    // Taxonomies
    $taxonomies = FLBuilderLoop::taxonomies($slug);
    foreach ($taxonomies as $tax_slug => $tax) {
        FLBuilder::render_settings_field('tax_' . $slug . '_' . $tax_slug, array('type' => 'suggest', 'action' => 'fl_as_terms', 'data' => $tax_slug, 'label' => $tax->label, 'help' => sprintf(__('Enter a comma separated list of %s. Only posts with these %s will be shown.', 'fl-builder'), $tax->label, $tax->label)), $settings);
    }
    ?>
		</table>
	<?php 
}
?>
	<table class="fl-form-table">
	<?php 
// Author
FLBuilder::render_settings_field('users', array('type' => 'suggest', 'action' => 'fl_as_users', 'label' => __('Authors', 'fl-builder'), 'help' => __('Enter a comma separated list of authors usernames. Only posts with these authors will be shown.', 'fl-builder')), $settings);
?>
	</table>
</div>
コード例 #22
0
ファイル: callout.php プロジェクト: spokencode/bophillips
 /**
  * @method render_image
  */
 public function render_image($position)
 {
     if ($this->settings->image_type == 'photo' && $this->settings->photo_position == $position) {
         if (empty($this->settings->photo)) {
             return;
         }
         $photo_data = FLBuilderPhoto::get_attachment_data($this->settings->photo);
         if (!$photo_data) {
             $photo_data = $this->settings->photo_data;
         }
         $photo_settings = array('align' => 'center', 'crop' => $this->settings->photo_crop, 'link_target' => $this->settings->link_target, 'link_type' => 'url', 'link_url' => $this->settings->link, 'photo' => $photo_data, 'photo_src' => $this->settings->photo_src, 'photo_source' => 'library');
         echo '<div class="fl-callout-photo">';
         FLBuilder::render_module_html('photo', $photo_settings);
         echo '</div>';
     } else {
         if ($this->settings->image_type == 'icon' && $this->settings->icon_position == $position) {
             $icon_settings = array('bg_color' => $this->settings->icon_bg_color, 'bg_hover_color' => $this->settings->icon_bg_hover_color, 'color' => $this->settings->icon_color, 'exclude_wrapper' => true, 'hover_color' => $this->settings->icon_hover_color, 'icon' => $this->settings->icon, 'link' => $this->settings->link, 'link_target' => $this->settings->link_target, 'size' => $this->settings->icon_size, 'text' => '', 'three_d' => $this->settings->icon_3d);
             FLBuilder::render_module_html('icon', $icon_settings);
         }
     }
 }
コード例 #23
0
ファイル: video.php プロジェクト: nullality/FEWD-SEA-7
                $this->data->poster = isset($this->settings->poster_src) ? $this->settings->poster_src : '';
                $this->data->loop = isset($this->settings->loop) && $this->settings->loop ? ' loop="yes"' : '';
                $this->data->autoplay = isset($this->settings->autoplay) && $this->settings->autoplay ? ' autoplay="yes"' : '';
                // WebM format
                $webm_data = FLBuilderPhoto::get_attachment_data($this->settings->video_webm);
                $this->data->video_webm = isset($this->settings->video_webm) && $webm_data ? ' webm="' . $webm_data->url . '"' : '';
            }
        }
        return $this->data;
    }
    /**
     * @method update
     * @param $settings {object}
     */
    public function update($settings)
    {
        // Cache the attachment data.
        if ($settings->video_type == 'media_library') {
            $video = FLBuilderPhoto::get_attachment_data($settings->video);
            if ($video) {
                $settings->data = $video;
            }
        }
        return $settings;
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLVideoModule', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('video_type' => array('type' => 'select', 'label' => __('Video Type', 'fl-builder'), 'default' => 'wordpress', 'options' => array('media_library' => __('Media Library', 'fl-builder'), 'embed' => __('Embed', 'fl-builder')), 'toggle' => array('media_library' => array('fields' => array('video', 'video_webm', 'poster', 'autoplay', 'loop')), 'embed' => array('fields' => array('embed_code')))), 'video' => array('type' => 'video', 'label' => __('Video (MP4)', 'fl-builder'), 'help' => __('A video in the MP4 format. Most modern browsers support this format.', 'fl-builder')), 'video_webm' => array('type' => 'video', 'label' => __('Video (WebM)', 'fl-builder'), 'help' => __('A video in the WebM format to use as fallback. This format is required to support browsers such as FireFox and Opera.', 'fl-builder'), 'preview' => array('type' => 'none')), 'poster' => array('type' => 'photo', 'label' => _x('Poster', 'Video preview/fallback image.', 'fl-builder')), 'autoplay' => array('type' => 'select', 'label' => __('Auto Play', 'fl-builder'), 'default' => '0', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder')), 'preview' => array('type' => 'none')), 'loop' => array('type' => 'select', 'label' => __('Loop', 'fl-builder'), 'default' => '0', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder')), 'preview' => array('type' => 'none')), 'embed_code' => array('type' => 'textarea', 'label' => __('Video Embed Code', 'fl-builder'), 'rows' => '6')))))));
コード例 #24
0
 /**
  * Render markup for the groups field. 
  *
  * @since 1.6.0
  * @param string $list_id The ID of the list for this groups.
  * @param array $groups An array of group data.
  * @param object $settings Saved module settings.
  * @return string The markup for the group field.
  * @access private
  */
 private function render_groups_field($list_id, $groups, $settings)
 {
     if (!is_array($groups) || 0 === count($groups)) {
         return;
     }
     ob_start();
     $options = array('' => __('No Group', 'fl-builder'));
     foreach ($groups as $group) {
         foreach ($group['groups'] as $subgroup) {
             $options[$list_id . '_' . $group['id'] . '_' . $subgroup['id']] = $group['name'] . ' - ' . $subgroup['name'];
         }
     }
     FLBuilder::render_settings_field('groups', array('row_class' => 'fl-builder-service-field-row', 'class' => 'fl-builder-mailchimp-group-select', 'type' => 'select', 'label' => _x('Groups', 'MailChimp list group.', 'fl-builder'), 'multi-select' => true, 'options' => $options, 'preview' => array('type' => 'none')), $settings);
     return ob_get_clean();
 }
コード例 #25
0
ファイル: audio.php プロジェクト: nullality/FEWD-SEA-7
                if (!$this->data && isset($this->settings->data)) {
                    $this->data = $this->settings->data;
                }
            }
        }
        return $this->data;
    }
    /**
     * @method update
     * @param $settings {object}
     */
    public function update($settings)
    {
        // Cache the attachment data.
        if ($settings->audio_type == 'media_library') {
            // Get audio data if user selected only one audio file
            if (is_array($settings->audios) && count($settings->audios) == 1) {
                $audios = FLBuilderPhoto::get_attachment_data($settings->audios[0]);
                if ($audios) {
                    $settings->data = $audios;
                }
            }
        }
        return $settings;
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLAudioModule', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('audio_type' => array('type' => 'select', 'label' => __('Audio Type', 'fl-builder'), 'default' => 'wordpress', 'options' => array('media_library' => __('Media Library', 'fl-builder'), 'link' => __('Link', 'fl-builder')), 'toggle' => array('link' => array('fields' => array('link')), 'media_library' => array('fields' => array('audios')))), 'audios' => array('type' => 'multiple-audios', 'label' => __('Audio', 'fl-builder'), 'toggle' => array('playlist' => array('fields' => array('style', 'tracklist', 'tracknumbers', 'images', 'artists')), 'single_audio' => array('fields' => array('autoplay', 'loop')))), 'link' => array('type' => 'text', 'label' => __('Link', 'fl-builder')), 'autoplay' => array('type' => 'select', 'label' => __('Auto Play', 'fl-builder'), 'default' => '0', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder')), 'preview' => array('type' => 'none')), 'loop' => array('type' => 'select', 'label' => __('Loop', 'fl-builder'), 'default' => '0', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder')), 'preview' => array('type' => 'none')), 'style' => array('type' => 'select', 'label' => __('Style', 'fl-builder'), 'default' => 'light', 'options' => array('light' => __('Light', 'fl-builder'), 'dark' => __('Dark', 'fl-builder'))), 'tracklist' => array('type' => 'select', 'label' => __('Show Playlist', 'fl-builder'), 'default' => '1', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder')), 'toggle' => array('1' => array('fields' => array('tracknumbers')))), 'tracknumbers' => array('type' => 'select', 'label' => __('Show Track Numbers', 'fl-builder'), 'default' => '1', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder')), 'preview' => array('type' => 'none')), 'images' => array('type' => 'select', 'label' => __('Show Thumbnail', 'fl-builder'), 'default' => '1', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder'))), 'artists' => array('type' => 'select', 'label' => __('Show Artist Name', 'fl-builder'), 'default' => '1', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder')))))))));
コード例 #26
0
<?php

/**
 * This is an example module with only the basic
 * setup necessary to get it working.
 *
 * @class CBCustomShadeModule
 */
class CBCustomShadeModule extends FLBuilderModule
{
    /** 
     * Constructor function for the module. You must pass the
     * name, description, dir and url in an array to the parent class.
     *
     * @method __construct
     */
    public function __construct()
    {
        parent::__construct(array('name' => __('Shade', 'fl-builder'), 'description' => __('Throw some custom shade.', 'fl-builder'), 'category' => __('CB Custom Modules', 'fl-builder'), 'dir' => CB_CUSTOM_MODULE_DIR . 'cb-shade/', 'url' => CB_CUSTOM_MODULE_URL . 'cb-shade/', 'editor_export' => true, 'enabled' => true, 'partial_refresh' => true));
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('CBCustomShadeModule', array('content' => array('title' => __('Content', 'fl-builder'), 'sections' => array('content' => array('title' => __('Content', 'fl-builder'), 'fields' => array('cb_shade_link_field' => array('type' => 'link', 'label' => __('Link (optional)', 'fl-builder'), 'help' => __('Set the entire module to be a link. You can also input links in the editor below.', 'fl-builder')), 'cb_shade_vertical_align' => array('type' => 'select', 'label' => __('Vertical Alignment', 'fl-builder'), 'default' => 'center', 'options' => array('flex-start' => __('Top', 'fl-builder'), 'center' => __('Center', 'fl-builder'), 'flex-end' => __('Bottom', 'fl-builder')), 'help' => __('Vertical alignment is not currently supported in Internet Explorer.', 'fl-builder')), 'cb_shade_editor_field' => array('type' => 'editor', 'media_buttons' => true, 'rows' => 10))))), 'design' => array('title' => __('Design', 'fl-builder'), 'sections' => array('design' => array('title' => __('Design', 'fl-builder'), 'fields' => array('cb_shade_photo_field' => array('type' => 'photo', 'label' => __('Background Photo', 'fl-builder'), 'show_remove' => false), 'cb_shade_bg_align' => array('type' => 'select', 'label' => __('Background Alignment', 'fl-builder'), 'default' => 'center center', 'options' => array('top left' => __('Left Top', 'fl-builder'), 'center left' => __('Left Center', 'fl-builder'), 'bottom left' => __('Left Bottom', 'fl-builder'), 'top center' => __('Center Top', 'fl-builder'), 'center center' => __('Center', 'fl-builder'), 'bottom center' => __('Center Bottom', 'fl-builder'), 'top right' => __('Right Top', 'fl-builder'), 'center right' => __('Right Center', 'fl-builder'), 'bottom right' => __('Right Bottom', 'fl-builder'))), 'cb_shade_bg_size' => array('type' => 'select', 'label' => __('Background Size', 'fl-builder'), 'default' => 'cover', 'options' => array('contain' => __('Fit', 'fl-builder'), 'cover' => __('Fill', 'fl-builder'))), 'cb_shade_color_field' => array('type' => 'color', 'label' => __('Background/Overlay Color', 'fl-builder'), 'default' => '000000', 'show_reset' => true), 'cb_shade_text_field' => array('type' => 'text', 'label' => __('Custom Minimum Height', 'fl-builder'), 'default' => '', 'maxlength' => '4', 'size' => '6', 'placeholder' => __('420', 'fl-builder'), 'class' => 'my-css-class', 'description' => __('px', 'fl-builder'), 'help' => __('Set a custom minimum height in pixels. For smaller screens, the module height may increase to accomodate content.', 'fl-builder'))))))));
コード例 #27
0
        function insertPages_handleShortcode_insert($atts, $content = null)
        {
            global $wp_query, $post, $wp_current_filter;
            // Shortcode attributes.
            $attributes = shortcode_atts(array('page' => '0', 'display' => 'all', 'class' => '', 'inline' => false), $atts);
            // Validation checks.
            if ($attributes['page'] === '0') {
                return $content;
            }
            // Trying to embed same page in itself.
            if (!is_null($post) && property_exists($post, 'ID') && ($attributes['page'] == $post->ID || $attributes['page'] == $post->post_name)) {
                return $content;
            }
            // Get options set in WordPress dashboard (Settings > Insert Pages).
            $options = get_option('wpip_settings');
            if ($options === FALSE || !is_array($options) || !array_key_exists('wpip_format', $options) || !array_key_exists('wpip_wrapper', $options) || !array_key_exists('wpip_insert_method', $options)) {
                $options = wpip_set_defaults();
            }
            $attributes['inline'] = $attributes['inline'] !== false && $attributes['inline'] !== 'false' || array_search('inline', $atts) === 0 || array_key_exists('wpip_wrapper', $options) && $options['wpip_wrapper'] === 'inline';
            /**
             * Filter the flag indicating whether to wrap the inserted content in inline tags (span).
             *
             * @param bool $use_inline_wrapper Indicates whether to wrap the content in span tags.
             */
            $attributes['inline'] = apply_filters('insert_pages_use_inline_wrapper', $attributes['inline']);
            $attributes['wrapper_tag'] = $attributes['inline'] ? 'span' : 'div';
            $attributes['should_apply_the_content_filter'] = true;
            /**
             * Filter the flag indicating whether to apply the_content filter to post
             * contents and excerpts that are being inserted.
             *
             * @param bool $apply_the_content_filter Indicates whether to apply the_content filter.
             */
            $attributes['should_apply_the_content_filter'] = apply_filters('insert_pages_apply_the_content_filter', $attributes['should_apply_the_content_filter']);
            // Disable the_content filter if using inline tags, since wpautop
            // inserts p tags and we can't have any inside inline elements.
            if ($attributes['inline']) {
                $attributes['should_apply_the_content_filter'] = false;
            }
            $attributes['should_apply_nesting_check'] = true;
            /**
             * Filter the flag indicating whether to apply deep nesting check
             * that can prevent circular loops. Note that some use cases rely
             * on inserting pages that themselves have inserted pages, so this
             * check should be disabled for those individuals.
             *
             * @param bool $apply_the_content_filter Indicates whether to apply the_content filter.
             */
            $attributes['should_apply_nesting_check'] = apply_filters('insert_pages_apply_nesting_check', $attributes['should_apply_nesting_check']);
            // Don't allow inserted pages to be added to the_content more than once (prevent infinite loops).
            if ($attributes['should_apply_nesting_check']) {
                $done = false;
                foreach ($wp_current_filter as $filter) {
                    if ('the_content' == $filter) {
                        if ($done) {
                            return $content;
                        } else {
                            $done = true;
                        }
                    }
                }
            }
            // Get the WP_Post object from the provided slug or ID.
            if (!is_numeric($attributes['page'])) {
                // Get list of post types that can be inserted (page, post, custom
                // types), excluding builtin types (nav_menu_item, attachment).
                $insertable_post_types = array_filter(get_post_types(), create_function('$type', 'return ! in_array( $type, array( "nav_menu_item", "attachment" ) );'));
                $inserted_page = get_page_by_path($attributes['page'], OBJECT, $insertable_post_types);
                $attributes['page'] = $inserted_page ? $inserted_page->ID : $attributes['page'];
            } else {
                $inserted_page = get_post(intval($attributes['page']));
            }
            // Use "Normal" insert method (get_post()).
            if ($options['wpip_insert_method'] !== 'legacy') {
                // If we couldn't retrieve the page, fire the filter hook showing a not-found message.
                if ($inserted_page === null) {
                    /**
                     * Filter the html that should be displayed if an inserted page was not found.
                     *
                     * @param string $content html to be displayed. Defaults to an empty string.
                     */
                    $content = apply_filters('insert_pages_not_found_message', $content);
                    // Short-circuit since we didn't find the page.
                    return $content;
                }
                // Start output buffering so we can save the output to a string.
                ob_start();
                // If Beaver Builder plugin is enabled, load any cached styles associated with the inserted page.
                // Note: Temporarily set the global $post->ID to the inserted page ID,
                // since Beaver Builder relies on it to load the appropriate styles.
                if (class_exists('FLBuilder')) {
                    // If we're not in The Loop (i.e., global $post isn't assigned),
                    // temporarily populate it with the post to be inserted so we can
                    // retrieve Beaver Builder styles for that post. Reset $post to null
                    // after we're done.
                    if (is_null($post)) {
                        $old_post_id = null;
                        $post = $inserted_page;
                    } else {
                        $old_post_id = $post->ID;
                        $post->ID = $inserted_page->ID;
                    }
                    FLBuilder::enqueue_layout_styles_scripts($inserted_page->ID);
                    if (is_null($old_post_id)) {
                        $post = null;
                    } else {
                        $post->ID = $old_post_id;
                    }
                }
                // Show either the title, link, content, everything, or everything via a custom template
                // Note: if the sharing_display filter exists, it means Jetpack is installed and Sharing is enabled;
                // This plugin conflicts with Sharing, because Sharing assumes the_content and the_excerpt filters
                // are only getting called once. The fix here is to disable processing of filters on the_content in
                // the inserted page. @see https://codex.wordpress.org/Function_Reference/the_content#Alternative_Usage
                switch ($attributes['display']) {
                    case "title":
                        $title_tag = $attributes['inline'] ? 'span' : 'h1';
                        echo "<{$title_tag} class='insert-page-title'>";
                        echo get_the_title($inserted_page->ID);
                        echo "</{$title_tag}>";
                        break;
                    case "link":
                        ?>
<a href="<?php 
                        echo esc_url(get_permalink($inserted_page->ID));
                        ?>
"><?php 
                        echo get_the_title($inserted_page->ID);
                        ?>
</a><?php 
                        break;
                    case "excerpt":
                        ?>
<h1><a href="<?php 
                        echo esc_url(get_permalink($inserted_page->ID));
                        ?>
"><?php 
                        echo get_the_title($inserted_page->ID);
                        ?>
</a></h1><?php 
                        echo $this->insertPages_trim_excerpt(get_post_field('post_excerpt', $inserted_page->ID), $inserted_page->ID, $attributes['should_apply_the_content_filter']);
                        break;
                    case "excerpt-only":
                        echo $this->insertPages_trim_excerpt(get_post_field('post_excerpt', $inserted_page->ID), $inserted_page->ID, $attributes['should_apply_the_content_filter']);
                        break;
                    case "content":
                        $content = get_post_field('post_content', $inserted_page->ID);
                        if ($attributes['should_apply_the_content_filter']) {
                            $content = apply_filters('the_content', $content);
                        }
                        echo $content;
                        break;
                    case "all":
                        // Title.
                        $title_tag = $attributes['inline'] ? 'span' : 'h1';
                        echo "<{$title_tag} class='insert-page-title'>";
                        echo get_the_title($inserted_page->ID);
                        echo "</{$title_tag}>";
                        // Content.
                        $content = get_post_field('post_content', $inserted_page->ID);
                        if ($attributes['should_apply_the_content_filter']) {
                            $content = apply_filters('the_content', $content);
                        }
                        echo $content;
                        // Meta.
                        // @ref https://core.trac.wordpress.org/browser/tags/4.4/src/wp-includes/post-template.php#L968
                        if ($keys = get_post_custom_keys($inserted_page->ID)) {
                            echo "<ul class='post-meta'>\n";
                            foreach ((array) $keys as $key) {
                                $keyt = trim($key);
                                if (is_protected_meta($keyt, 'post')) {
                                    continue;
                                }
                                $values = array_map('trim', get_post_custom_values($key));
                                $value = implode($values, ', ');
                                /**
                                 * Filter the HTML output of the li element in the post custom fields list.
                                 *
                                 * @since 2.2.0
                                 *
                                 * @param string $html  The HTML output for the li element.
                                 * @param string $key   Meta key.
                                 * @param string $value Meta value.
                                 */
                                echo apply_filters('the_meta_key', "<li><span class='post-meta-key'>{$key}:</span> {$value}</li>\n", $key, $value);
                            }
                            echo "</ul>\n";
                        }
                        break;
                    default:
                        // display is either invalid, or contains a template file to use
                        // Legacy/compatibility code: In order to use custom templates,
                        // we use query_posts() to provide the template with the global
                        // state it requires for the inserted page (in other words, all
                        // template tags will work with respect to the inserted page
                        // instead of the parent page / main loop). Note that this may
                        // cause some compatibility issues with other plugins.
                        // @ref https://codex.wordpress.org/Function_Reference/query_posts
                        if (is_numeric($attributes['page'])) {
                            $args = array('p' => intval($attributes['page']), 'post_type' => get_post_types());
                        } else {
                            $args = array('name' => esc_attr($attributes['page']), 'post_type' => get_post_types());
                        }
                        $inserted_page = query_posts($args);
                        if (have_posts()) {
                            $template = locate_template($attributes['display']);
                            if (strlen($template) > 0) {
                                include $template;
                                // execute the template code
                            } else {
                                // Couldn't find template, so fall back to printing a link to the page.
                                the_post();
                                ?>
<a href="<?php 
                                the_permalink();
                                ?>
"><?php 
                                the_title();
                                ?>
</a><?php 
                            }
                        }
                        wp_reset_query();
                }
                // Save output buffer contents.
                $content = ob_get_clean();
                // Use "Legacy" insert method (query_posts()).
            } else {
                // Construct query_posts arguments.
                if (is_numeric($attributes['page'])) {
                    $args = array('p' => intval($attributes['page']), 'post_type' => get_post_types());
                } else {
                    $args = array('name' => esc_attr($attributes['page']), 'post_type' => get_post_types());
                }
                $posts = query_posts($args);
                if (have_posts()) {
                    // Start output buffering so we can save the output to string
                    ob_start();
                    // If Beaver Builder plugin is enabled, load any cached styles associated with the inserted page.
                    // Note: Temporarily set the global $post->ID to the inserted page ID,
                    // since Beaver Builder relies on it to load the appropriate styles.
                    if (class_exists('FLBuilder')) {
                        // If we're not in The Loop (i.e., global $post isn't assigned),
                        // temporarily populate it with the post to be inserted so we can
                        // retrieve Beaver Builder styles for that post. Reset $post to null
                        // after we're done.
                        if (is_null($post)) {
                            $old_post_id = null;
                            $post = $inserted_page;
                        } else {
                            $old_post_id = $post->ID;
                            $post->ID = $inserted_page->ID;
                        }
                        FLBuilder::enqueue_layout_styles_scripts($inserted_page->ID);
                        if (is_null($old_post_id)) {
                            $post = null;
                        } else {
                            $post->ID = $old_post_id;
                        }
                    }
                    // Show either the title, link, content, everything, or everything via a custom template
                    // Note: if the sharing_display filter exists, it means Jetpack is installed and Sharing is enabled;
                    // This plugin conflicts with Sharing, because Sharing assumes the_content and the_excerpt filters
                    // are only getting called once. The fix here is to disable processing of filters on the_content in
                    // the inserted page. @see https://codex.wordpress.org/Function_Reference/the_content#Alternative_Usage
                    switch ($attributes['display']) {
                        case "title":
                            the_post();
                            $title_tag = $attributes['inline'] ? 'span' : 'h1';
                            echo "<{$title_tag} class='insert-page-title'>";
                            the_title();
                            echo "</{$title_tag}>";
                            break;
                        case "link":
                            the_post();
                            ?>
<a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a><?php 
                            break;
                        case "excerpt":
                            the_post();
                            ?>
<h1><a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></h1><?php 
                            if ($attributes['should_apply_the_content_filter']) {
                                the_excerpt();
                            } else {
                                echo get_the_excerpt();
                            }
                            break;
                        case "excerpt-only":
                            the_post();
                            if ($attributes['should_apply_the_content_filter']) {
                                the_excerpt();
                            } else {
                                echo get_the_excerpt();
                            }
                            break;
                        case "content":
                            the_post();
                            if ($attributes['should_apply_the_content_filter']) {
                                the_content();
                            } else {
                                echo get_the_content();
                            }
                            break;
                        case "all":
                            the_post();
                            $title_tag = $attributes['inline'] ? 'span' : 'h1';
                            echo "<{$title_tag} class='insert-page-title'>";
                            the_title();
                            echo "</{$title_tag}>";
                            if ($attributes['should_apply_the_content_filter']) {
                                the_content();
                            } else {
                                echo get_the_content();
                            }
                            the_meta();
                            break;
                        default:
                            // display is either invalid, or contains a template file to use
                            $template = locate_template($attributes['display']);
                            if (strlen($template) > 0) {
                                include $template;
                                // execute the template code
                            } else {
                                // Couldn't find template, so fall back to printing a link to the page.
                                the_post();
                                ?>
<a href="<?php 
                                the_permalink();
                                ?>
"><?php 
                                the_title();
                                ?>
</a><?php 
                            }
                            break;
                    }
                    // Save output buffer contents.
                    $content = ob_get_clean();
                } else {
                    /**
                     * Filter the html that should be displayed if an inserted page was not found.
                     *
                     * @param string $content html to be displayed. Defaults to an empty string.
                     */
                    $content = apply_filters('insert_pages_not_found_message', $content);
                }
                wp_reset_query();
            }
            /**
             * Filter the markup generated for the inserted page.
             *
             * @param string $content The post content of the inserted page.
             * @param object $inserted_page The post object returned from querying the inserted page.
             * @param array $attributes Extra parameters modifying the inserted page.
             *   page: Page ID or slug of page to be inserted.
             *   display: Content to display from inserted page.
             *   class: Extra classes to add to inserted page wrapper element.
             *   inline: Boolean indicating wrapper element should be a span.
             *   should_apply_nesting_check: Whether to disable nested inserted pages.
             *   should_apply_the_content_filter: Whether to apply the_content filter to post contents and excerpts.
             *   wrapper_tag: Tag to use for the wrapper element (e.g., div, span).
             */
            $content = apply_filters('insert_pages_wrap_content', $content, $inserted_page, $attributes);
            return $content;
        }
コード例 #28
0
<?php

/**
 * @class FLSeparatorModule
 */
class FLSeparatorModule extends FLBuilderModule
{
    /**
     * @method __construct
     */
    public function __construct()
    {
        parent::__construct(array('name' => __('Separator', 'fl-builder'), 'description' => __('A divider line to separate content.', 'fl-builder'), 'category' => __('Basic Modules', 'fl-builder'), 'editor_export' => false, 'partial_refresh' => true));
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLSeparatorModule', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('color' => array('type' => 'color', 'label' => __('Color', 'fl-builder'), 'default' => 'cccccc', 'preview' => array('type' => 'css', 'selector' => '.fl-separator', 'property' => 'border-top-color')), 'opacity' => array('type' => 'text', 'label' => __('Opacity', 'fl-builder'), 'default' => '100', 'description' => '%', 'maxlength' => '3', 'size' => '5', 'preview' => array('type' => 'css', 'selector' => '.fl-separator', 'property' => 'opacity', 'unit' => '%')), 'height' => array('type' => 'text', 'label' => __('Height', 'fl-builder'), 'default' => '1', 'maxlength' => '2', 'size' => '3', 'description' => 'px', 'preview' => array('type' => 'css', 'selector' => '.fl-separator', 'property' => 'border-top-width', 'unit' => 'px')), 'style' => array('type' => 'select', 'label' => __('Style', 'fl-builder'), 'default' => 'solid', 'options' => array('solid' => _x('Solid', 'Border type.', 'fl-builder'), 'dashed' => _x('Dashed', 'Border type.', 'fl-builder'), 'dotted' => _x('Dotted', 'Border type.', 'fl-builder'), 'double' => _x('Double', 'Border type.', 'fl-builder')), 'preview' => array('type' => 'css', 'selector' => '.fl-separator', 'property' => 'border-top-style'), 'help' => __('The type of border to use. Double borders must have a height of at least 3px to render properly.', 'fl-builder'))))))));
コード例 #29
0
ファイル: icon.php プロジェクト: onedaylabs/onedaylabs.com
<?php

/**
 * @class FLIconModule
 */
class FLIconModule extends FLBuilderModule
{
    /**
     * @method __construct
     */
    public function __construct()
    {
        parent::__construct(array('name' => __('Icon', 'fl-builder'), 'description' => __('Display an icon and optional title.', 'fl-builder'), 'category' => __('Advanced Modules', 'fl-builder'), 'editor_export' => false, 'partial_refresh' => true));
    }
}
/**
 * Register the module and its form settings.
 */
FLBuilder::register_module('FLIconModule', array('general' => array('title' => __('General', 'fl-builder'), 'sections' => array('general' => array('title' => '', 'fields' => array('icon' => array('type' => 'icon', 'label' => __('Icon', 'fl-builder')))), 'link' => array('title' => __('Link', 'fl-builder'), 'fields' => array('link' => array('type' => 'link', 'label' => __('Link', 'fl-builder'), 'preview' => array('type' => 'none')), 'link_target' => array('type' => 'select', 'label' => __('Link Target', 'fl-builder'), 'default' => '_self', 'options' => array('_self' => __('Same Window', 'fl-builder'), '_blank' => __('New Window', 'fl-builder')), 'preview' => array('type' => 'none')))), 'text' => array('title' => 'Text', 'fields' => array('text' => array('type' => 'editor', 'label' => '', 'media_buttons' => false))))), 'style' => array('title' => __('Style', 'fl-builder'), 'sections' => array('colors' => array('title' => __('Colors', 'fl-builder'), 'fields' => array('color' => array('type' => 'color', 'label' => __('Color', 'fl-builder'), 'show_reset' => true), 'hover_color' => array('type' => 'color', 'label' => __('Hover Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'bg_color' => array('type' => 'color', 'label' => __('Background Color', 'fl-builder'), 'show_reset' => true), 'bg_hover_color' => array('type' => 'color', 'label' => __('Background Hover Color', 'fl-builder'), 'show_reset' => true, 'preview' => array('type' => 'none')), 'three_d' => array('type' => 'select', 'label' => __('Gradient', 'fl-builder'), 'default' => '0', 'options' => array('0' => __('No', 'fl-builder'), '1' => __('Yes', 'fl-builder'))))), 'structure' => array('title' => __('Structure', 'fl-builder'), 'fields' => array('size' => array('type' => 'text', 'label' => __('Size', 'fl-builder'), 'default' => '30', 'maxlength' => '3', 'size' => '4', 'description' => 'px'), 'align' => array('type' => 'select', 'label' => __('Alignment', 'fl-builder'), 'default' => 'left', 'options' => array('center' => __('Center', 'fl-builder'), 'left' => __('Left', 'fl-builder'), 'right' => __('Right', 'fl-builder')))))))));
コード例 #30
0
 /**
  * Render the account settings for a saved connection.
  *
  * @since 1.5.4
  * @param string $service The service id such as "mailchimp".
  * @param string $active The name of the active account, if any.
  * @return string The account settings markup.
  */
 public static function render_account_settings($service, $active = '')
 {
     ob_start();
     $saved_services = FLBuilderModel::get_services();
     $settings = new stdClass();
     $settings->service_account = $active;
     $options = array('' => __('Choose...', 'fl-builder'));
     // Build the account select options.
     foreach ($saved_services[$service] as $account => $data) {
         $options[$account] = $account;
     }
     $options['add_new_account'] = __('Add Account...', 'fl-builder');
     // Render the account select.
     FLBuilder::render_settings_field('service_account', array('row_class' => 'fl-builder-service-account-row', 'class' => 'fl-builder-service-account-select', 'type' => 'select', 'label' => __('Account', 'fl-builder'), 'options' => $options, 'preview' => array('type' => 'none')), $settings);
     // Render additional service fields if we have a saved account.
     if (!empty($active) && isset($saved_services[$service][$active])) {
         $post_data = FLBuilderModel::get_post_data();
         $module = FLBuilderModel::get_module($post_data['node_id']);
         $instance = self::get_service_instance($service);
         $response = $instance->render_fields($active, $module->settings);
         if (!$response['error']) {
             echo $response['html'];
         }
     }
     return ob_get_clean();
 }