本文整理汇总了PHP中spb_format_content函数的典型用法代码示例。如果您正苦于以下问题:PHP spb_format_content函数的具体用法?PHP spb_format_content怎么用?PHP spb_format_content使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spb_format_content函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
public function content($atts, $content = null)
{
$col_el_class = $width = $el_position = '';
extract(shortcode_atts(array('col_el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts));
$output = '';
$col_el_class = $this->getExtraClass($col_el_class);
$orig_width = $width;
$width = spb_translateColumnWidthToSpan($width);
if ($this->shortcode == 'spb_column') {
$col_el_class .= ' column_container';
} else {
if ($this->shortcode == 'spb_text_block') {
$col_el_class .= ' spb_text_column';
}
}
global $column_width;
if ($orig_width != "") {
$column_width = $orig_width;
}
$output .= "\n\t" . '<div class="spb_content_element ' . $width . $col_el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper">';
$output .= "\n\t\t\t" . spb_format_content($content);
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$column_width = "";
$output = $this->startRow($el_position, $orig_width) . $output . $this->endRow($el_position, 'column');
return $output;
}
示例2: content
public function content($atts, $content = null)
{
$col_el_class = $inline_style = $inner_inline_style = $width = $el_position = '';
extract(shortcode_atts(array('col_bg_color' => '', 'col_bg_image' => '', 'col_bg_type' => 'cover', 'col_parallax_image_movement' => 'fixed', 'col_parallax_image_speed' => '0.5', 'col_padding' => '', 'col_animation' => '', 'col_animation_delay' => '', 'col_responsive_vis' => '', 'col_el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts));
$output = $animation_output = '';
$col_responsive_vis = str_replace("_", " ", $col_responsive_vis);
$col_el_class = $this->getExtraClass($col_el_class) . ' ' . $col_responsive_vis;
$orig_width = $width;
$width = spb_translateColumnWidthToSpan($width);
$img_url = wp_get_attachment_image_src($col_bg_image, 'full');
if ($col_bg_color != "") {
$inline_style .= 'background-color:' . $col_bg_color . ';';
}
if (isset($img_url) && $img_url[0] != "") {
$inline_style .= 'background-image: url(' . $img_url[0] . ');';
}
if ($col_padding != "") {
$inner_inline_style .= 'padding:' . $col_padding . '%;';
}
if ($col_animation != "" && $col_animation != "none") {
$col_el_class .= ' sf-animation';
$animation_output = 'data-animation="' . $col_animation . '" data-delay="' . $col_animation_delay . '"';
}
global $column_width;
if ($orig_width != "") {
$column_width = $orig_width;
}
if ($col_bg_image != "" && $img_url[0] != "") {
if ($col_parallax_image_movement == "stellar") {
$output .= "\n\t" . '<div class="spb-column-container spb_parallax_asset sf-parallax parallax-' . $col_parallax_image_movement . ' spb_content_element bg-type-' . $col_bg_type . ' ' . $width . ' ' . $col_el_class . '" data-stellar-background-ratio="' . $col_parallax_image_speed . '" ' . $animation_output . ' style="' . $inline_style . '">';
} else {
$output .= "\n\t" . '<div class="spb-column-container spb_parallax_asset sf-parallax parallax-' . $col_parallax_image_movement . ' spb_content_element bg-type-' . $col_bg_type . ' ' . $width . ' ' . $col_el_class . '" ' . $animation_output . ' style="' . $inline_style . '">';
}
} else {
$output .= "\n\t" . '<div class="spb-column-container ' . $width . ' ' . $col_el_class . '" ' . $animation_output . ' style="' . $inline_style . '">';
}
$output .= "\n\t\t" . '<div class="spb-asset-content" style="' . $inner_inline_style . '">';
$output .= "\n\t\t" . spb_format_content($content);
$output .= "\n\t\t" . '</div>';
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$column_width = "";
$output = $this->startRow($el_position, $orig_width) . $output . $this->endRow($el_position, 'column');
if (isset($img_url) && $img_url[0] != "" && $col_parallax_image_movement == "stellar") {
global $sf_include_parallax;
$sf_include_parallax = true;
}
return $output;
}
示例3: content
public function content($atts, $content = null)
{
$title = $el_class = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'language' => '', 'el_class' => '', 'el_position' => '', 'width' => '1'), $atts));
$output = '';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_codesnippet_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content">';
$output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '') : '';
$output .= "\n\t\t" . '<pre><code class="code-block language-' . $language . '">' . spb_format_content($content) . '</code></pre>';
$output .= "\n\t\t" . '</div>';
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
//
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例4: content
protected function content($atts, $content = null)
{
$widget_title = $type = $active_section = $interval = $width = $el_position = $el_class = '';
//
extract(shortcode_atts(array('widget_title' => '', 'interval' => 0, 'active_section' => '', 'width' => '1/1', 'el_position' => '', 'el_class' => ''), $atts));
$output = '';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_accordion spb_content_element ' . $width . $el_class . ' not-column-inherit" data-active="' . $active_section . '">';
//data-interval="'.$interval.'"
$output .= $widget_title != '' ? "\n\t\t\t" . '<h3 class="spb-heading spb_accordion_heading"><span>' . $widget_title . '</span></h3>' : '';
$output .= "\n\t\t" . '<div class="spb_wrapper spb_accordion_wrapper ">';
$output .= "\n\t\t\t" . spb_format_content($content);
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例5: content
public function content($atts, $content = null)
{
$title = $pb_margin_bottom = $el_class = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'pb_margin_bottom' => '', 'el_class' => '', 'el_position' => '', 'width' => '1'), $atts));
$output = '';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
if ($pb_margin_bottom == "yes") {
$el_class .= ' pb-margin-bottom';
}
$output .= "\n\t" . '<div class="spb_codesnippet_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading spb_codesnippet_heading"><span>' . $title . '</span></h3>' : '';
$output .= "\n\t\t\t<code class='code-block'>" . spb_format_content($content) . "</code>";
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
//
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例6: content
public function content($atts, $content = null)
{
$tab_asset_title = $type = $interval = $width = $el_position = $el_class = '';
extract(shortcode_atts(array('tab_asset_title' => '', 'interval' => 0, 'width' => '1/1', 'el_position' => '', 'el_class' => ''), $atts));
$output = '';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$element = 'spb_tabs';
if ('spb_tour' == $this->shortcode) {
$element = 'spb_tour';
}
// Extract tab titles
preg_match_all('/spb_tab title="([^\\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE);
$tab_titles = array();
if (isset($matches[1])) {
$tab_titles = $matches[1];
}
$tabs_nav = '';
$tab_count = 0;
$tabs_nav .= '<ul class="nav nav-tabs">';
foreach ($tab_titles as $tab) {
if ($tab_count == 0) {
$tabs_nav .= '<li class="active"><a href="#' . preg_replace("#[[:punct:]]#", "", strtolower(str_replace(' ', '-', $tab[0]))) . '" data-toggle="tab">' . $tab[0] . '</a></li>';
} else {
$tabs_nav .= '<li><a href="#' . preg_replace("#[[:punct:]]#", "", strtolower(str_replace(' ', '-', $tab[0]))) . '" data-toggle="tab">' . $tab[0] . '</a></li>';
}
$tab_count++;
}
$tabs_nav .= '</ul>' . "\n";
$output .= "\n\t" . '<div class="' . $element . ' spb_content_element ' . $width . $el_class . '" data-interval="' . $interval . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper spb_tabs_wrapper">';
$output .= $tab_asset_title != '' ? "\n\t\t\t" . '<h3 class="spb-heading ' . $element . '_heading"><span>' . $tab_asset_title . '</span></h3>' : '';
$output .= "\n\t\t\t" . $tabs_nav;
$output .= "\n\t\t\t" . '<div class="tab-content">';
$output .= "\n\t\t\t" . spb_format_content($content);
$output .= "\n\t\t\t" . '</div>';
if ('spb_tour' == $this->shortcode) {
$output .= "\n\t\t\t" . '<div class="spb_tour_next_prev_nav"> <span class="spb_prev_slide"><a href="#prev" title="' . __('Previous slide', "swiftframework") . '">' . __('Previous slide', "swiftframework") . '</a></span> <span class="spb_next_slide"><a href="#next" title="' . __('Next slide', "swiftframework") . '">' . __('Next slide', "swiftframework") . '</a></span></div>';
}
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
//
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例7: content
public function content($atts, $content = null)
{
$row_el_class = $width = $row_bg_color = $row_top_style = $row_bottom_style = $row_padding_vertical = $row_padding_horizontal = $row_margin_vertical = $remove_element_spacing = $el_position = $animation_output = '';
extract(shortcode_atts(array('wrap_type' => '', 'row_bg_color' => '', 'color_row_height' => '', 'inner_column_height' => '', 'row_id' => '', 'row_name' => '', 'row_top_style' => '', 'row_bottom_style' => '', 'row_padding_vertical' => '', 'row_padding_horizontal' => '', 'row_margin_vertical' => '30', 'row_overlay_opacity' => '0', 'remove_element_spacing' => '', 'vertical_center' => 'true', 'row_bg_type' => '', 'bg_image' => '', 'bg_video_mp4' => '', 'bg_video_webm' => '', 'bg_video_ogg' => '', 'parallax_video_height' => 'window-height', 'parallax_image_height' => 'content-height', 'parallax_video_overlay' => 'none', 'parallax_image_movement' => 'fixed', 'parallax_image_speed' => '0.5', 'bg_type' => '', 'row_expanding' => '', 'row_expading_text_closed' => '', 'row_expading_text_open' => '', 'row_animation' => '', 'row_animation_delay' => '', 'responsive_vis' => '', 'row_responsive_vis' => '', 'row_el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
$output = $inline_style = $inner_inline_style = $rowId = '';
if ($row_id != "") {
$rowId = 'id="' . $row_id . '" data-rowname="' . $row_name . '"';
}
if ($row_responsive_vis == "" && $responsive_vis != "") {
$row_responsive_vis = $responsive_vis;
}
$responsive_vis = str_replace("_", " ", $row_responsive_vis);
$row_el_class = $this->getExtraClass($row_el_class) . ' ' . $responsive_vis;
$orig_width = $width;
$width = spb_translateColumnWidthToSpan($width);
$img_url = wp_get_attachment_image_src($bg_image, 'full');
if ($remove_element_spacing == "yes") {
$row_el_class .= ' remove-element-spacing';
}
if ($row_bg_color != "") {
$inline_style .= 'background-color:' . $row_bg_color . ';';
}
if ($row_padding_vertical != "") {
$inner_inline_style .= 'padding-top:' . $row_padding_vertical . 'px;padding-bottom:' . $row_padding_vertical . 'px;';
}
if ($row_padding_horizontal != "") {
$inline_style .= 'padding-left:' . $row_padding_horizontal . '%;padding-right:' . $row_padding_horizontal . '%;';
}
if ($row_margin_vertical != "") {
$inline_style .= 'margin-top:' . $row_margin_vertical . 'px;margin-bottom:' . $row_margin_vertical . 'px;';
}
if ($row_bg_type != "color" && isset($img_url) && $img_url[0] != "") {
$inline_style .= 'background-image: url(' . $img_url[0] . ');';
}
if ($row_animation != "" && $row_animation != "none") {
$row_el_class .= ' sf-animation';
$animation_output = 'data-animation="' . $row_animation . '" data-delay="' . $row_animation_delay . '"';
}
if ($row_expanding == "yes") {
$row_el_class .= ' spb-row-expanding';
$output .= "\n\t\t" . '<a href="#" class="spb-row-expand-text container" data-closed-text="' . $row_expading_text_closed . '" data-open-text="' . $row_expading_text_open . '"><span>' . $row_expading_text_closed . '</span></a>';
}
$row_el_class .= ' ' . $inner_column_height;
$data_atts = 'data-v-center="' . $vertical_center . '" data-top-style="' . $row_top_style . '" data-bottom-style="' . $row_bottom_style . '" ' . $animation_output;
if ($row_bg_type == "video") {
if ($img_url[0] != "") {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax sf-parallax-video parallax-' . $parallax_video_height . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $row_el_class . '" ' . $data_atts . ' style="' . $inline_style . '">';
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax sf-parallax-video parallax-' . $parallax_video_height . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $row_el_class . '" ' . $data_atts . ' style="' . $inline_style . '">';
}
} else {
if ($row_bg_type == "image") {
if ($img_url[0] != "") {
if ($parallax_image_movement == "stellar") {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax parallax-' . $parallax_image_height . ' parallax-' . $parallax_image_movement . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $row_el_class . '" ' . $data_atts . ' data-stellar-background-ratio="' . $parallax_image_speed . '" style="' . $inline_style . '">';
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax parallax-' . $parallax_image_height . ' parallax-' . $parallax_image_movement . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $row_el_class . '" ' . $data_atts . ' style="' . $inline_style . '">';
}
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax parallax-' . $parallax_image_height . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $row_el_class . '" ' . $data_atts . ' style="' . $inline_style . '">';
}
} else {
if ($color_row_height == "window-height") {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax parallax-window-height ' . $width . $row_el_class . '" ' . $data_atts . ' style="' . $inline_style . '">';
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' ' . $width . $row_el_class . '" ' . $data_atts . ' style="' . $inline_style . '">';
}
}
}
$output .= "\n\t\t" . '<div class="spb_content_element" style="' . $inner_inline_style . '">';
$output .= "\n\t\t\t" . spb_format_content($content);
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment($width);
if ($row_bg_type == "video") {
if ($img_url) {
$output .= '<video class="parallax-video" poster="' . $img_url[0] . '" preload="auto" autoplay loop="loop" muted="muted">';
} else {
$output .= '<video class="parallax-video" preload="auto" autoplay loop="loop" muted="muted">';
}
if ($bg_video_mp4 != "") {
$output .= '<source src="' . $bg_video_mp4 . '" type="video/mp4">';
}
if ($bg_video_webm != "") {
$output .= '<source src="' . $bg_video_webm . '" type="video/webm">';
}
if ($bg_video_ogg != "") {
$output .= '<source src="' . $bg_video_ogg . '" type="video/ogg">';
}
$output .= '</video>';
if ($parallax_video_overlay != "color") {
$output .= '<div class="video-overlay overlay-' . $parallax_video_overlay . '"></div>';
}
}
if ($row_overlay_opacity != "0" && $parallax_video_overlay == "color") {
$opacity = intval($row_overlay_opacity, 10) / 100;
$output .= '<div class="row-overlay" style="background-color:' . $row_bg_color . ';opacity:' . $opacity . ';"></div>';
} else {
if ($row_overlay_opacity != "0") {
$output .= '<div class="row-overlay overlay-' . $parallax_video_overlay . '"></div>';
}
}
//.........这里部分代码省略.........
示例8: content
protected function content($atts, $content = null)
{
$title = $el_class = $open = null;
extract(shortcode_atts(array('title' => __("Click to toggle", "swift-framework-admin"), 'el_class' => '', 'open' => 'false', 'el_position' => '', 'width' => '1/1'), $atts));
$output = '';
$width = spb_translateColumnWidthToSpan($width);
$el_class = $this->getExtraClass($el_class);
$open = $open == 'true' ? ' spb_toggle_title_active' : '';
$el_class .= $open == ' spb_toggle_title_active' ? ' spb_toggle_open' : '';
$output .= '<div class="toggle-wrap ' . $width . '">';
$output .= '<div class="spb_toggle' . $open . '">' . $title . '</div><div class="spb_toggle_content' . $el_class . '">' . spb_format_content($content) . '</div>' . $this->endBlockComment('toggle') . "\n";
$output .= '</div>';
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例9: content
protected function content($atts, $content = null)
{
$color = $type = $target = $href = $border_top = $include_button = $button_style = $border_bottom = $title = $width = $position = $el_class = '';
extract(shortcode_atts(array('color' => 'btn', 'include_button' => '', 'button_style' => '', 'target' => '', 'type' => '', 'href' => '', 'shadow' => 'yes', 'title' => __('Text on the button', "swift-framework-admin"), 'position' => 'cta_align_right', 'alt_background' => 'none', 'width' => '1/1', 'el_class' => '', 'el_position' => ''), $atts));
$output = '';
$border_class = '';
if ($border_top == "yes") {
$border_class .= 'border-top ';
}
if ($border_bottom == "yes") {
$border_class .= 'border-bottom';
}
$width = spb_translateColumnWidthToSpan($width);
$el_class = $this->getExtraClass($el_class);
$sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
$sidebars = '';
if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
$sidebars = 'one-sidebar';
} else {
if ($sidebar_config == "both-sidebars") {
$sidebars = 'both-sidebars';
} else {
$sidebars = 'no-sidebars';
}
}
if ($target == 'same' || $target == '_self') {
$target = '_self';
}
if ($target != '') {
$target = $target;
}
$a_class = '';
if ($el_class != '') {
$tmp_class = explode(" ", $el_class);
if (in_array("prettyphoto", $tmp_class)) {
wp_enqueue_script('prettyphoto');
wp_enqueue_style('prettyphoto');
$a_class .= ' prettyphoto';
$el_class = str_ireplace("prettyphoto", "", $el_class);
}
}
$button = '';
if ($button_style == "arrow") {
if ($position == "cta_align_left") {
$button = '<a class="impact-text-arrow arrow-left" href="' . $href . '" target="' . $target . '"><i class="ss-navigateleft"></i></a>';
} else {
$button = '<a class="impact-text-arrow arrow-right" href="' . $href . '" target="' . $target . '"><i class="ss-navigateright"></i></a>';
}
} else {
$button = '<a class="sf-button sf-button ' . $color . ' ' . $type . '" href="' . $href . '" target="' . $target . '"><span>' . $title . '</span></a>';
}
// Full width setup
$fullwidth = false;
if ($alt_background != "none" && $sidebars == "no-sidebars") {
$fullwidth = true;
}
$output .= "\n\t" . '<div class="spb_impact_text spb_content_element ' . $width . $el_class . '">';
if ($alt_background != "none") {
$output .= '<div class="impact-text-wrap ' . $position . ' asset-bg ' . $alt_background . ' clearfix">' . "\n";
} else {
$output .= '<div class="impact-text-wrap ' . $position . ' clearfix">' . "\n";
}
$output .= '<div class="spb_call_text">' . spb_format_content($content) . '</div>' . "\n";
if ($include_button == "yes") {
$output .= $button . "\n";
}
$output .= '</div>' . "\n";
$output .= '</div> ' . $this->endBlockComment('.spb_impact_text') . "\n";
$output = $this->startRow($el_position, $width, false, false, $alt_background) . $output . $this->endRow($el_position, $width, false, false);
return $output;
}
示例10: content
public function content($atts, $content = null)
{
$el_class = $width = $row_bg_color = $row_padding_vertical = $row_margin_vertical = $remove_element_spacing = $el_position = '';
extract(shortcode_atts(array('wrap_type' => '', 'row_bg_color' => '', 'row_id' => '', 'row_name' => '', 'row_padding_vertical' => '', 'row_margin_vertical' => '30', 'row_overlay_opacity' => '0', 'remove_element_spacing' => '', 'parallax_type' => '', 'bg_image' => '', 'bg_video_mp4' => '', 'bg_video_webm' => '', 'bg_video_ogg' => '', 'parallax_video_height' => 'video-height', 'parallax_image_height' => 'content-height', 'parallax_video_overlay' => 'none', 'parallax_image_movement' => 'fixed', 'parallax_image_speed' => '0.5', 'bg_type' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
$output = $inline_style = $rowId = '';
if ($row_id != "") {
$rowId = 'id="' . $row_id . '" data-rowname="' . $row_name . '"';
}
$el_class = $this->getExtraClass($el_class);
$orig_width = $width;
$width = spb_translateColumnWidthToSpan($width);
$img_url = wp_get_attachment_image_src($bg_image, 'full');
if ($remove_element_spacing == "yes") {
$el_class .= ' remove-element-spacing';
}
if ($row_bg_color != "") {
$inline_style .= 'background-color:' . $row_bg_color . ';';
}
if ($row_padding_vertical != "") {
$inline_style .= 'padding-top:' . $row_padding_vertical . 'px;padding-bottom:' . $row_padding_vertical . 'px;';
}
if ($row_margin_vertical != "") {
$inline_style .= 'margin-top:' . $row_margin_vertical . 'px;margin-bottom:' . $row_margin_vertical . 'px;';
}
if ($parallax_type != "color") {
$inline_style .= 'background-image: url(' . $img_url[0] . ');';
}
if ($parallax_type == "video") {
if ($img_url[0] != "") {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax sf-parallax-video parallax-' . $parallax_video_height . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $el_class . '" style="' . $inline_style . '" ' . $rowId . '>';
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax sf-parallax-video parallax-' . $parallax_video_height . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $el_class . '" style="' . $inline_style . '" ' . $rowId . '>';
}
} else {
if ($parallax_type == "image") {
if ($img_url[0] != "") {
if ($parallax_image_movement == "stellar") {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax parallax-' . $parallax_image_height . ' parallax-' . $parallax_image_movement . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $el_class . '" data-parallax-speed="' . $parallax_image_speed . '" style="' . $inline_style . '" ' . $rowId . '>';
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax parallax-' . $parallax_image_height . ' parallax-' . $parallax_image_movement . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $el_class . '" style="' . $inline_style . '" ' . $rowId . '>';
}
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . ' spb_parallax_asset sf-parallax parallax-' . $parallax_image_height . ' spb_content_element bg-type-' . $bg_type . ' ' . $width . $el_class . '" style="' . $inline_style . '" ' . $rowId . '>';
}
} else {
$output .= "\n\t" . '<div class="spb-row-container spb-row-' . $wrap_type . '" style="' . $inline_style . '" ' . $rowId . '>';
}
}
if ($wrap_type == "content-width") {
//$output .= "\n\t\t".'<div class="container">';
}
$output .= "\n\t\t" . '<div class="spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t\t" . '<div class="spb_wrapper">';
$output .= "\n\t\t\t\t" . spb_format_content($content);
$output .= "\n\t\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
if ($parallax_type == "video") {
$output .= '<video class="parallax-video" poster="' . $img_url[0] . '" preload="auto" autoplay loop="loop" muted="muted">';
if ($bg_video_mp4 != "") {
$output .= '<source src="' . $bg_video_mp4 . '" type="video/mp4">';
}
if ($bg_video_webm != "") {
$output .= '<source src="' . $bg_video_webm . '" type="video/webm">';
}
if ($bg_video_ogg != "") {
$output .= '<source src="' . $bg_video_ogg . '" type="video/ogg">';
}
$output .= '</video>';
$output .= '<div class="video-overlay overlay-' . $parallax_video_overlay . '"></div>';
}
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment($width);
if ($row_overlay_opacity != "0") {
$opacity = intval($row_overlay_opacity, 10) / 100;
$output .= '<div class="row-overlay" style="background-color:' . $row_bg_color . ';opacity:' . $opacity . ';"></div>';
}
if ($wrap_type == "content-width") {
//$output .= "\n\t\t".'</div>';
}
$output .= "\n\t" . '</div>';
$output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
if ($parallax_type == "image" || $parallax_type == "video") {
global $sf_include_parallax;
$sf_include_parallax = true;
}
return $output;
}
示例11: spbShortcodesJS_callback
public function spbShortcodesJS_callback()
{
$content = $this->post('content');
$content = stripslashes($content);
$output = spb_format_content($content);
echo $output;
die;
}
示例12: content
public function content($atts, $content = null)
{
$tour_asset_title = $type = $interval = $width = $el_position = $el_class = '';
extract(shortcode_atts(array('tab_asset_title' => '', 'interval' => 0, 'width' => '1/1', 'el_position' => '', 'el_class' => ''), $atts));
$output = '';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$element = 'spb_tabs';
if ('spb_tour' == $this->shortcode) {
$element = 'spb_tour';
}
$tab_titles = array();
$tab_icons = array();
// Extract tab titles
preg_match_all('/spb_tab title="([^\\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE);
if (isset($matches[1])) {
$tab_titles = $matches[1];
}
preg_match_all('/spb_tab title="([^\\"]+)" icon="([^\\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE);
if (isset($matches[2])) {
$tab_icons = $matches[2];
}
$tabs_nav = '';
$tab_count = 0;
$tabs_nav .= '<ul class="nav nav-tabs">';
foreach ($tab_titles as $tab) {
if (isset($tab_icons[$tab_count][0])) {
$icon_text = '<i class="' . $tab_icons[$tab_count][0] . '"></i>';
} else {
$icon_text = '';
}
if ($tab_count == 0) {
//$tabs_nav .= '<li class="active"><a href="#' . preg_replace( "#[[:punct:]]#", "", ( strtolower( str_replace( ' ', '-', $tab[0] ) ) ) ) . '" data-toggle="tab">' . $icon_text . $tab[0] . '</a></li>';
$tabs_nav .= '<li class="active"><a href="#' . preg_replace('/\\s+/', '-', sanitize_title($tab[0])) . '" data-toggle="tab">' . $icon_text . $tab[0] . '</a></li>';
} else {
$tabs_nav .= '<li><a href="#' . preg_replace('/\\s+/', '-', sanitize_title($tab[0])) . '" data-toggle="tab">' . $icon_text . $tab[0] . '</a></li>';
}
$tab_count++;
}
$tabs_nav .= '</ul>' . "\n";
$output .= "\n\t" . '<div class="' . $element . ' spb_tour spb_content_element ' . $width . $el_class . '" data-interval="' . $interval . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content spb_wrapper spb_tour_tabs_wrapper">';
$output .= $tour_asset_title != '' ? "\n\t\t\t" . $this->spb_title($tour_asset_title, '') : '';
$output .= "\n\t\t\t" . '<div class="tabbable tabs-left">';
$output .= "\n\t\t\t\t" . $tabs_nav;
$output .= "\n\t\t\t\t" . '<div class="tab-content">';
$output .= "\n\t\t\t\t" . spb_format_content($content);
$output .= "\n\t\t\t\t" . '</div>';
$output .= "\n\t\t\t" . '</div>';
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例13: content
public function content($atts, $content = null)
{
$tab_asset_title = $type = $interval = $center_tabs = $width = $el_position = $el_class = '';
extract(shortcode_atts(array('tab_asset_title' => '', 'tabs_type' => 'standard', 'center_tabs' => '', 'interval' => 0, 'width' => '1/1', 'el_position' => '', 'el_class' => ''), $atts));
$output = '';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$element = 'spb_tabs';
if ('spb_tour' == $this->shortcode) {
$element = 'spb_tour';
}
$tab_titles = array();
$tab_icons = array();
$tab_ids = array();
// Extract tab titles
preg_match_all('/spb_tab title="([^\\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE);
if (isset($matches[1])) {
$tab_titles = $matches[1];
}
preg_match_all('/spb_tab title="([^\\"]+)" icon="([^\\"]+)"/i', $content, $matches, PREG_OFFSET_CAPTURE);
if (isset($matches[2])) {
$tab_icons = $matches[2];
}
preg_match_all('/" id="([^"]+)"/', $content, $matches, PREG_OFFSET_CAPTURE);
if (isset($matches[1])) {
$tab_ids = $matches[1];
}
$tabs_nav = '';
$tab_count = 0;
if ($center_tabs == "yes") {
$tabs_nav .= '<ul class="nav nav-tabs center-tabs">';
} else {
$tabs_nav .= '<ul class="nav nav-tabs">';
}
if ($tabs_type == "dynamic") {
$tabs_nav .= '<li class="menu-icon"><i class="fa-bars"></i></li>';
}
foreach ($tab_titles as $tab) {
if (isset($tab_ids[$tab_count][0])) {
$tab_id = $tab_ids[$tab_count][0];
} else {
$tab_id = $tab[0];
}
$tab_id = sanitize_title($tab_id);
if (isset($tab_icons[$tab_count][0])) {
$icon_text = '<i class="' . $tab_icons[$tab_count][0] . '"></i>';
} else {
$icon_text = '';
}
if ($tab_count == 0) {
$tabs_nav .= '<li class="active"><a href="#' . preg_replace("/[^A-Za-z0-9-]/i", "", strtolower(str_replace(' ', '-', $tab_id))) . '" data-toggle="tab"><span>' . $icon_text . $tab[0] . '</span></a></li>';
} else {
$tabs_nav .= '<li><a href="#' . preg_replace("/[^A-Za-z0-9-]/i", "", strtolower(str_replace(' ', '-', $tab_id))) . '" data-toggle="tab"><span>' . $icon_text . $tab[0] . '</span></a></li>';
}
$tab_count++;
}
$tabs_nav .= '</ul>' . "\n";
$output .= "\n\t" . '<div class="' . $element . ' tabs-type-' . $tabs_type . ' spb_content_element ' . $width . $el_class . '" data-interval="' . $interval . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content spb_wrapper spb_tabs_wrapper">';
$output .= $tab_asset_title != '' ? "\n\t\t\t" . $this->spb_title($tab_asset_title, '') : '';
$output .= "\n\t\t\t" . $tabs_nav;
$output .= "\n\t\t\t" . '<div class="tab-content">';
$output .= "\n\t\t\t" . spb_format_content($content);
$output .= "\n\t\t\t" . '</div>';
if ('spb_tour' == $this->shortcode) {
$output .= "\n\t\t\t" . '<div class="spb_tour_next_prev_nav"> <span class="spb_prev_slide"><a href="#prev" title="' . __('Previous slide', 'swift-framework-plugin') . '">' . __('Previous slide', 'swift-framework-plugin') . '</a></span> <span class="spb_next_slide"><a href="#next" title="' . __('Next slide', 'swift-framework-plugin') . '">' . __('Next slide', 'swift-framework-plugin') . '</a></span></div>';
}
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}