本文整理汇总了PHP中FLBuilder类的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilder类的具体用法?PHP FLBuilder怎么用?PHP FLBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FLBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert_layout
/**
* 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: render_list_field
/**
* 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: render_img
/**
* 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: __construct
<?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: array
<?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 & Medium Devices Only', 'fl-builder'), 'medium' => __('Medium Devices Only', 'fl-builder'), 'medium-mobile' => __('Medium & 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: array
<?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 & Medium Devices Only', 'fl-builder'), 'medium' => __('Medium Devices Only', 'fl-builder'), 'medium-mobile' => __('Medium & 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: wma_bb_shortcode_def
$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: render_assets
/**
* 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;
}
示例9: __construct
<?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'))))))));
示例10: get_class
// 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')));
示例11: render_button
/**
* @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);
}
示例12: __construct
*/
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')));
示例13: array
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'));
示例14: register_twenty_sixty_product_module
/**
* 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)))))));
}
开发者ID:palmermarc,项目名称:twenty-sixty-builder-addons,代码行数:17,代码来源:class-twenty-sixty-builder-addons-public.php
示例15: render_mobile_img
/**
* 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>';
}
}
}