/** * 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); } }
/** * 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>'; } } }
/** * @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); } } }
/** * @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); }
/** * Renders the stripped down content for a layout * that is saved to the WordPress editor. * * @since 1.0 * @param string $content The existing content. * @return string */ public static function render_editor_content() { $rows = FLBuilderModel::get_nodes('row'); ob_start(); // Render the modules. foreach ($rows as $row) { $groups = FLBuilderModel::get_nodes('column-group', $row); foreach ($groups as $group) { $cols = FLBuilderModel::get_nodes('column', $group); foreach ($cols as $col) { $modules = FLBuilderModel::get_modules($col); foreach ($modules as $module) { if ($module->editor_export) { // Don't crop photos to ensure media library photos are rendered. if ($module->settings->type == 'photo') { $module->settings->crop = false; } FLBuilder::render_module_html($module->settings->type, $module->settings, $module); } } } } } // Get the content. $content = ob_get_clean(); // Remove unnecessary tags. $content = preg_replace('/<\\/?div[^>]*\\>/i', '', $content); $content = preg_replace('/<\\/?span[^>]*\\>/i', '', $content); $content = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content); $content = preg_replace('/<i [^>]*><\\/i[^>]*>/', '', $content); $content = preg_replace('/ class=".*?"/', '', $content); // Remove empty lines. $content = preg_replace('/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/', "\n", $content); return $content; }
</div> <?php } ?> <div class="fl-form-field"> <input type="text" name="fl-subscribe-form-email" placeholder="<?php _e('Email Address', 'fl-builder'); ?> " /> <div class="fl-form-error-message"><?php _e('Please enter a valid email address.', 'fl-builder'); ?> </div> </div> <div class="fl-form-button" data-wait-text="<?php esc_attr_e('Please Wait...', 'fl-builder'); ?> "> <?php FLBuilder::render_module_html('button', 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')); ?> </div> <div class="fl-form-error-message"><?php _e('Something went wrong. Please check your entries and try again.', 'fl-builder'); ?> </div> </div>
/** * @method render_button */ public function render_button($slide) { if ($slide->cta_type == 'button') { if (!isset($slide->btn_style)) { $slide->btn_style = 'flat'; } $btn_settings = array('align' => '', 'bg_color' => $slide->btn_bg_color, 'bg_hover_color' => $slide->btn_bg_hover_color, 'bg_opacity' => isset($slide->btn_bg_opacity) ? $slide->btn_bg_opacity : 0, 'border_radius' => $slide->btn_border_radius, 'border_size' => isset($slide->btn_border_size) ? $slide->btn_border_size : 2, 'font_size' => $slide->btn_font_size, 'icon' => isset($slide->btn_icon) ? $slide->btn_icon : '', 'icon_position' => isset($slide->btn_icon_position) ? $slide->btn_icon_position : 'before', 'link' => $slide->link, 'link_target' => $slide->link_target, 'padding' => $slide->btn_padding, 'style' => isset($slide->btn_3d) && $slide->btn_3d ? 'gradient' : $slide->btn_style, 'text' => $slide->cta_text, 'text_color' => $slide->btn_text_color, 'text_hover_color' => $slide->btn_text_hover_color, 'width' => 'auto'); echo '<div class="fl-slide-cta-button">'; FLBuilder::render_module_html('button', $btn_settings); echo '</div>'; } }
/** * @method render_button */ public function render_button($column) { $btn_settings = array('align' => $this->settings->pricing_columns[$column]->btn_align, 'bg_color' => $this->settings->pricing_columns[$column]->btn_bg_color, 'bg_hover_color' => $this->settings->pricing_columns[$column]->btn_bg_hover_color, 'bg_opacity' => $this->settings->pricing_columns[$column]->btn_bg_opacity, 'border_radius' => $this->settings->pricing_columns[$column]->btn_border_radius, 'border_size' => $this->settings->pricing_columns[$column]->btn_border_size, 'font_size' => $this->settings->pricing_columns[$column]->btn_font_size, 'icon' => $this->settings->pricing_columns[$column]->btn_icon, 'icon_position' => $this->settings->pricing_columns[$column]->btn_icon_position, 'link' => $this->settings->pricing_columns[$column]->btn_url, 'link_target' => $this->settings->pricing_columns[$column]->btn_link_target, 'padding' => $this->settings->pricing_columns[$column]->btn_padding, 'style' => $this->settings->pricing_columns[$column]->btn_style, 'text' => $this->settings->pricing_columns[$column]->btn_text, 'text_color' => $this->settings->pricing_columns[$column]->btn_text_color, 'text_hover_color' => $this->settings->pricing_columns[$column]->btn_text_hover_color, 'width' => $this->settings->pricing_columns[$column]->btn_width); FLBuilder::render_module_html('button', $btn_settings); }
foreach ($module->get_photos() as $photo) { ?> <div class="fl-mosaicflow-item"> <?php FLBuilder::render_module_html('photo', array('crop' => false, 'link_target' => '_self', 'link_type' => $settings->click_action == 'none' ? '' : 'url', 'link_url' => $settings->click_action == 'none' ? '' : $photo->link, 'photo' => $photo, 'photo_src' => $photo->src, 'show_caption' => $settings->show_captions)); ?> </div> <?php } ?> </div> <div class="fl-clear"></div> </div> <?php } else { ?> <div class="fl-gallery"> <?php foreach ($module->get_photos() as $photo) { ?> <div class="fl-gallery-item"> <?php FLBuilder::render_module_html('photo', array('crop' => false, 'link_target' => '_self', 'link_type' => $settings->click_action == 'none' ? '' : 'url', 'link_url' => $settings->click_action == 'none' ? '' : $photo->link, 'photo' => $photo, 'photo_src' => $photo->src, 'show_caption' => $settings->show_captions)); ?> </div> <?php } ?> </div> <?php }
<div class="fl-icon-group fl-icon-group-<?php echo $settings->align; ?> "> <?php foreach ($settings->icons as $icon) { if (!is_object($icon)) { continue; } $icon_settings = array('bg_color' => $settings->bg_color, 'bg_hover_color' => $settings->bg_hover_color, 'color' => $settings->color, 'exclude_wrapper' => true, 'hover_color' => $settings->hover_color, 'icon' => $icon->icon, 'link' => $icon->link, 'link_target' => '_blank', 'size' => $settings->size, 'text' => '', 'three_d' => $settings->three_d); FLBuilder::render_module_html('icon', $icon_settings); } ?> </div>