$params[] = array("type" => "dropdown", "heading" => __("Header Style", 'swift-framework-plugin'), "param_name" => "row_header_style", "value" => array("" => "", __("Light", 'swift-framework-plugin') => "light", __("Dark", 'swift-framework-plugin') => "dark"), "description" => __("If you have the transparent sticky header option enabled in the page meta options, then you can set the header style when scrolling over this row.", 'swift-framework-plugin')); } if (sf_theme_supports('advanced-row-styling')) { $params[] = array("type" => "dropdown", "heading" => __("Row top style", 'swift-framework-plugin'), "param_name" => "row_top_style", "value" => array(__("None", 'swift-framework-plugin') => "none", __("Slant Left-to-right", 'swift-framework-plugin') => "slant-ltr", __("Slant Right-to-left", 'swift-framework-plugin') => "slant-rtl"), "description" => __("Choose the top style for the row, or none.", 'swift-framework-plugin')); $params[] = array("type" => "dropdown", "heading" => __("Row bottom style", 'swift-framework-plugin'), "param_name" => "row_bottom_style", "value" => array(__("None", 'swift-framework-plugin') => "none", __("Slant Left-to-right", 'swift-framework-plugin') => "slant-ltr", __("Slant Right-to-left", 'swift-framework-plugin') => "slant-rtl"), "description" => __("Choose the bottom style for the row, or none.", 'swift-framework-plugin')); } $params[] = array("type" => "dropdown", "heading" => __("Row Overlay style", 'swift-framework-plugin'), "param_name" => "parallax_video_overlay", "value" => array(__("None", 'swift-framework-plugin') => "none", __("Color", 'swift-framework-plugin') => "color", __("Light Grid", 'swift-framework-plugin') => "lightgrid", __("Dark Grid", 'swift-framework-plugin') => "darkgrid", __("Light Grid (Fat)", 'swift-framework-plugin') => "lightgridfat", __("Dark Grid (Fat)", 'swift-framework-plugin') => "darkgridfat", __("Light Diagonal", 'swift-framework-plugin') => "diaglight", __("Dark Diagonal", 'swift-framework-plugin') => "diagdark", __("Light Vertical", 'swift-framework-plugin') => "vertlight", __("Dark Vertical", 'swift-framework-plugin') => "vertdark", __("Light Horizontal", 'swift-framework-plugin') => "horizlight", __("Dark Horizontal", 'swift-framework-plugin') => "horizdark"), "description" => __("If you would like an overlay to appear on top of the image/video, then you can select it here.", 'swift-framework-plugin')); $params[] = array("type" => "uislider", "heading" => __("Row Overlay Opacity", 'swift-framework-plugin'), "param_name" => "row_overlay_opacity", "value" => "30", "step" => "5", "min" => "0", "max" => "100", "description" => __("Adjust the overlay capacity if using an image or video option. This only has effect for the color overlay style option, and shows an overlay over the image/video at the desired opacity. Percentage.", 'swift-framework-plugin')); $params[] = array("type" => "uislider", "heading" => __("Padding - Vertical", 'swift-framework-plugin'), "param_name" => "row_padding_vertical", "value" => "0", "description" => __("Adjust the vertical padding for the row. (px)", 'swift-framework-plugin')); if (sf_theme_supports('advanced-row-styling')) { $params[] = array("type" => "uislider", "heading" => __("Padding - Horizontal", 'swift-framework-plugin'), "param_name" => "row_padding_horizontal", "value" => "0", "min" => "0", "step" => "1", "max" => "20", "description" => __("Adjust the horizontal padding for the row. (%)", 'swift-framework-plugin')); } $params[] = array("type" => "uislider", "heading" => __("Margin - Vertical", 'swift-framework-plugin'), "param_name" => "row_margin_vertical", "value" => "0", "description" => __("Adjust the margin above and below the row. (px)", 'swift-framework-plugin')); $params[] = array("type" => "buttonset", "heading" => __("Remove Element Spacing", 'swift-framework-plugin'), "param_name" => "remove_element_spacing", "value" => array(__('No', 'swift-framework-plugin') => "no", __('Yes', 'swift-framework-plugin') => "yes"), "buttonset_on" => "yes", "description" => __("Enable this option if you wish to remove all spacing from the elements within the row.", 'swift-framework-plugin')); $params[] = array("type" => "buttonset", "heading" => __("Vertically Center Elements Within", 'swift-framework-plugin'), "param_name" => "vertical_center", "value" => array(__('No', 'swift-framework-plugin') => "false", __('Yes', 'swift-framework-plugin') => "true"), "buttonset_on" => "true", "std" => "false", "description" => __("Enable this option if you wish to center the elements within the row.", 'swift-framework-plugin')); $params[] = array("type" => "dropdown", "heading" => __("Inner Column Height", 'swift-framework-plugin'), "param_name" => "inner_column_height", "value" => array(__('Natural', 'swift-framework-plugin') => "col-natural", __('Window Height', 'swift-framework-plugin') => "col-window-height"), "description" => __("If you have the Window Height option selected for the row, and would like inner column assets to be 100% height, then please select the Window Height option here.", 'swift-framework-plugin')); $params[] = array("type" => "buttonset", "heading" => __("Expanding Row", 'swift-framework-plugin'), "param_name" => "row_expanding", "value" => array(__("No", 'swift-framework-plugin') => "no", __("Yes", 'swift-framework-plugin') => "yes"), "buttonset_on" => "yes", "description" => __("If you would like the content to be hidden on load, and have a text link to expand the content, then select Yes.", 'swift-framework-plugin')); $params[] = array("type" => "textfield", "heading" => __("Expanding Link Text (Content Closed)", 'swift-framework-plugin'), "param_name" => "row_expading_text_closed", "value" => "", "required" => array("row_expanding", "=", "yes"), "description" => __("This is the text that is shown when the expanding row is closed.", 'swift-framework-plugin')); $params[] = array("type" => "textfield", "heading" => __("Expanding Link Text (Content Open)", 'swift-framework-plugin'), "param_name" => "row_expading_text_open", "value" => "", "required" => array("row_expanding", "=", "yes"), "description" => __("This is the text that is shown when the expanding row is open.", 'swift-framework-plugin')); $params[] = array("type" => "section_tab", "param_name" => "animation_tab", "heading" => __("Animation", 'swift-framework-plugin')); $params[] = array("type" => "dropdown", "heading" => __("Intro Animation", 'swift-framework-plugin'), "param_name" => "row_animation", "value" => spb_animations_list(), "description" => __("Select an intro animation for the row which will show it when it appears within the viewport.", 'swift-framework-plugin')); $params[] = array("type" => "textfield", "heading" => __("Animation Delay", 'swift-framework-plugin'), "param_name" => "row_animation_delay", "value" => "0", "description" => __("If you wish to add a delay to the animation, then you can set it here (ms).", 'swift-framework-plugin')); $params[] = array("type" => "section_tab", "param_name" => "row_misc_tab", "heading" => __("Misc/ID", 'swift-framework-plugin')); $params[] = array("type" => "dropdown", "heading" => __("Responsive Visiblity", 'swift-framework-plugin'), "param_name" => "row_responsive_vis", "holder" => 'indicator', "value" => spb_responsive_vis_list(), "description" => __("Set the responsive visiblity for the row, if you would only like it to display on certain display sizes.", 'swift-framework-plugin')); $params[] = array("type" => "textfield", "heading" => __("Row ID", 'swift-framework-plugin'), "param_name" => "row_id", "value" => "", "description" => __("If you wish to add an ID to the row, then add it here. You can then use the id to deep link to this section of the page. This is also used for one page navigation. NOTE: Make sure this is unique to the page!!", 'swift-framework-plugin')); $params[] = array("type" => "textfield", "heading" => __("Row Section Name", 'swift-framework-plugin'), "param_name" => "row_name", "value" => "", "description" => __("This is used for the one page navigation, to identify the row. If this is left blank, then the row will be left off of the one page navigation.", 'swift-framework-plugin')); $params[] = array("type" => "textfield", "heading" => __("Row Extra Class", 'swift-framework-plugin'), "param_name" => "row_el_class", "value" => "", "description" => __("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'swift-framework-plugin')); $params[] = array("type" => "buttonset", "heading" => __("Minimize Row", 'swift-framework-plugin'), "param_name" => "minimize_row", "value" => array(__("Yes", 'swift-framework-plugin') => "yes", __("No", 'swift-framework-plugin') => "no"), "buttonset_on" => "yes", "description" => "Choose if you would like to minimize the Row inside the Page Builder editing."); /* SHORTCODE MAP ================================================== */ SPBMap::map('spb_row', array("name" => __("Row", 'swift-framework-plugin'), "base" => "spb_row", "controls" => "edit_delete", "class" => "spb_row spb_tab_layout", "icon" => "icon-row", "content_element" => true, "params" => $params));
$output .= '<div data-element_type="spb_column" class="spb_column spb_sortable spb_droppable ' . $width[$i] . ' not-column-inherit">'; $output .= '<input type="hidden" class="spb_sc_base" name="" value="spb_column" />'; $output .= str_replace("%column_size%", spb_translateColumnWidthToFractional($width[$i]), $column_controls); $output .= '<div class="spb_element_wrapper">'; $output .= '<div class="row-fluid spb_column_container spb_sortable_container not-column-inherit">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= SwiftPageBuilder::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; if (isset($this->settings['params'])) { $inner = ''; foreach ($this->settings['params'] as $param) { $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : ''; //var_dump($param_value); if (is_array($param_value)) { // Get first element from the array reset($param_value); $first_key = key($param_value); $param_value = $param_value[$first_key]; } $inner .= $this->singleParamHtmlHolder($param, $param_value); } $output .= $inner; } $output .= '</div>'; $output .= '</div>'; } return $output; } } SPBMap::map('spb_column', array("name" => __("Column", 'swift-framework-plugin'), "base" => "spb_column", "controls" => "full-column", "content_element" => false, "params" => array(array("type" => "section", "param_name" => "section_bg_video_options", "heading" => __("Column Background Options", 'swift-framework-plugin')), array("type" => "colorpicker", "heading" => __("Background color", 'swift-framework-plugin'), "param_name" => "col_bg_color", "value" => "", "description" => __("Select a background colour for the row here.", 'swift-framework-plugin')), array("type" => "section", "param_name" => "section_bg_image_options", "heading" => __("Column Background Image Options", 'swift-framework-plugin')), array("type" => "attach_image", "heading" => __("Background Image", 'swift-framework-plugin'), "param_name" => "col_bg_image", "value" => "", "description" => "Choose an image to use as the background for the parallax area."), array("type" => "dropdown", "heading" => __("Background Image Type", 'swift-framework-plugin'), "param_name" => "col_bg_type", "value" => array(__("Cover", 'swift-framework-plugin') => "cover", __("Pattern", 'swift-framework-plugin') => "pattern"), "description" => __("If you're uploading an image that you want to spread across the whole asset, then choose cover. Else choose pattern for an image you want to repeat.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Background Image Movement", 'swift-framework-plugin'), "param_name" => "col_parallax_image_movement", "value" => array(__("Fixed", 'swift-framework-plugin') => "fixed", __("Scroll", 'swift-framework-plugin') => "scroll", __("Stellar (dynamic)", 'swift-framework-plugin') => "stellar"), "description" => __("Choose the type of movement you would like the parallax image to have. Fixed means the background image is fixed on the page, Scroll means the image will scroll will the page, and stellar makes the image move at a seperate speed to the page, providing a layered effect.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Parallax Image Speed (Stellar Only)", 'swift-framework-plugin'), "param_name" => "col_parallax_image_speed", "value" => "0.5", "description" => "The speed at which the parallax image moves in relation to the page scrolling. For example, 0.5 would mean the image scrolls at half the speed of the standard page scroll. (Default 0.5)."), array("type" => "section", "param_name" => "section_display_options", "heading" => __("Column Display Options", 'swift-framework-plugin')), array("type" => "uislider", "heading" => __("Padding", 'swift-framework-plugin'), "param_name" => "col_padding", "value" => "0", "min" => "0", "step" => "1", "max" => "20", "description" => __("Adjust the padding for the column. (%)", 'swift-framework-plugin')), array("type" => "section", "param_name" => "col_animation_options", "heading" => __("Animation Options", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Intro Animation", 'swift-framework-plugin'), "param_name" => "col_animation", "value" => spb_animations_list(), "description" => __("Select an intro animation for the column which will show it when it appears within the viewport.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Animation Delay", 'swift-framework-plugin'), "param_name" => "col_animation_delay", "value" => "0", "description" => __("If you wish to add a delay to the animation, then you can set it here (ms).", 'swift-framework-plugin')), array("type" => "section", "param_name" => "section_misc_options", "heading" => __("Column Misc Options", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Responsive Visiblity", 'swift-framework-plugin'), "param_name" => "col_responsive_vis", "holder" => 'indicator', "value" => spb_responsive_vis_list(), "description" => __("Set the responsive visiblity for the row, if you would only like it to display on certain display sizes.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Extra class", 'swift-framework-plugin'), "param_name" => "col_el_class", "value" => "", "description" => __("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'swift-framework-plugin')))));
{ protected function content($atts, $content = null) { $height = $el_class = ''; extract(shortcode_atts(array('height' => '', 'width' => '', 'responsive_vis' => '', 'el_position' => '', 'el_class' => ''), $atts)); $responsive_vis = str_replace("_", " ", $responsive_vis); $width = spb_translateColumnWidthToSpan($width); $el_class = $this->getExtraClass($el_class) . ' ' . $responsive_vis; $output = ''; $output .= '<div class="blank_spacer ' . $width . ' ' . $el_class . '" style="height:' . $height . ';">'; $output .= '</div>' . $this->endBlockComment('divider') . "\n"; $output = $this->startRow($el_position) . $output . $this->endRow($el_position); return $output; } } SPBMap::map('spb_blank_spacer', array("name" => __("Blank Spacer", 'swift-framework-plugin'), "base" => "spb_blank_spacer", "class" => "spb_blank_spacer", 'icon' => 'spb-icon-spacer', "params" => array(array("type" => "textfield", "heading" => __("Height", 'swift-framework-plugin'), "param_name" => "height", "value" => __("30px", 'swift-framework-plugin'), "description" => __("The height of the spacer, in px (required).", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Responsive Visiblity", 'swift-framework-plugin'), "param_name" => "responsive_vis", "holder" => 'indicator', "value" => spb_responsive_vis_list(), "description" => __("Set the responsive visiblity for the row, if you would only like it to display on certain display sizes.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Extra class", 'swift-framework-plugin'), "param_name" => "el_class", "value" => "", "description" => __("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'swift-framework-plugin'))))); /* MESSAGE BOX ASSET ================================================== */ class SwiftPageBuilderShortcode_spb_message extends SwiftPageBuilderShortcode { protected function content($atts, $content = null) { $color = ''; extract(shortcode_atts(array('color' => 'alert-info', 'el_position' => ''), $atts)); $output = ''; if ($color == "alert-block") { $color = ""; } $width = spb_translateColumnWidthToSpan("1/1"); $output .= '<div class="' . $width . '"><div class="alert spb_content_element ' . $color . '"><div class="messagebox_text">' . spb_format_content($content) . '</div></div></div>' . $this->endBlockComment('alert box') . "\n"; //$output .= '<div class="spb_messagebox message '.$color.'"><div class="messagebox_text">'.spb_format_content($content).'</div></div>';
$output .= '<div data-element_type="spb_column" class="spb_column spb_sortable spb_droppable ' . $width[$i] . ' not-column-inherit">'; $output .= '<input type="hidden" class="spb_sc_base" name="" value="spb_column" />'; $output .= str_replace("%column_size%", spb_translateColumnWidthToFractional($width[$i]), $column_controls); $output .= '<div class="spb_element_wrapper">'; $output .= '<div class="row-fluid spb_column_container spb_sortable_container not-column-inherit">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= SwiftPageBuilder::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; if (isset($this->settings['params'])) { $inner = ''; foreach ($this->settings['params'] as $param) { $param_value = isset(${$param['param_name']}) ? ${$param['param_name']} : ''; //var_dump($param_value); if (is_array($param_value)) { // Get first element from the array reset($param_value); $first_key = key($param_value); $param_value = $param_value[$first_key]; } $inner .= $this->singleParamHtmlHolder($param, $param_value); } $output .= $inner; } $output .= '</div>'; $output .= '</div>'; } return $output; } } SPBMap::map('spb_column', array("name" => __("Column", 'swift-framework-plugin'), "base" => "spb_column", "controls" => "full-column", "class" => "spb_column spb_tab_layout", "icon" => "icon-column", "params" => array(array("type" => "dropdown", "heading" => __("Intro Animation", 'swift-framework-plugin'), "param_name" => "col_animation", "value" => spb_animations_list(), "description" => __("Select an intro animation for the column which will show it when it appears within the viewport.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Animation Delay", 'swift-framework-plugin'), "param_name" => "col_animation_delay", "value" => "0", "description" => __("If you wish to add a delay to the animation, then you can set it here (ms).", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Responsive Visiblity", 'swift-framework-plugin'), "param_name" => "col_responsive_vis", "holder" => 'indicator', "value" => spb_responsive_vis_list(), "description" => __("Set the responsive visiblity for the row, if you would only like it to display on certain display sizes.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Extra class", 'swift-framework-plugin'), "param_name" => "col_el_class", "value" => "", "description" => __("If you wish to style this particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'swift-framework-plugin')), array("type" => "section_tab", "param_name" => "column_sizing_tab", "heading" => __("Custom Sizing", 'swift-framework-plugin'), "value" => ""), array("type" => "dropdown", "heading" => __("XS", 'swift-framework-plugin'), "param_name" => "col_xs", "holder" => 'indicator', "value" => array('', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'), "description" => __("XS", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("SM", 'swift-framework-plugin'), "param_name" => "col_sm", "holder" => 'indicator', "value" => array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'), "description" => __("SM", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("MD", 'swift-framework-plugin'), "param_name" => "col_md", "holder" => 'indicator', "value" => array('', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'), "description" => __("MD", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("LG", 'swift-framework-plugin'), "param_name" => "col_lg", "holder" => 'indicator', "value" => array('', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'), "description" => __("LG", 'swift-framework-plugin')), array("type" => "section_tab", "param_name" => "background_tab", "heading" => __("Background Options", 'swift-framework-plugin'), "value" => ""), array("type" => "colorpicker", "heading" => __("Background color", 'swift-framework-plugin'), "param_name" => "col_bg_color", "value" => "", "description" => __("Select a background colour for the row here.", 'swift-framework-plugin')), array("type" => "attach_image", "heading" => __("Background Image", 'swift-framework-plugin'), "param_name" => "col_bg_image", "value" => "", "description" => "Choose an image to use as the background for the parallax area."), array("type" => "dropdown", "heading" => __("Background Image Type", 'swift-framework-plugin'), "param_name" => "col_bg_type", "value" => array(__("Cover", 'swift-framework-plugin') => "cover", __("Pattern", 'swift-framework-plugin') => "pattern"), "description" => __("If you're uploading an image that you want to spread across the whole asset, then choose cover. Else choose pattern for an image you want to repeat.", 'swift-framework-plugin')), array("type" => "dropdown", "heading" => __("Background Image Movement", 'swift-framework-plugin'), "param_name" => "col_parallax_image_movement", "value" => array(__("Fixed", 'swift-framework-plugin') => "fixed", __("Scroll", 'swift-framework-plugin') => "scroll", __("Stellar (dynamic)", 'swift-framework-plugin') => "stellar"), "description" => __("Choose the type of movement you would like the parallax image to have. Fixed means the background image is fixed on the page, Scroll means the image will scroll will the page, and stellar makes the image move at a seperate speed to the page, providing a layered effect.", 'swift-framework-plugin')), array("type" => "textfield", "heading" => __("Parallax Image Speed", 'swift-framework-plugin'), "param_name" => "col_parallax_image_speed", "value" => "0.5", "description" => "The speed at which the parallax image moves in relation to the page scrolling. For example, 0.5 would mean the image scrolls at half the speed of the standard page scroll. (Default 0.5)."), array("type" => "section_tab", "param_name" => "design_tab", "heading" => __("Design Options", 'swift-framework-plugin'), "value" => ""), array("type" => "uislider", "heading" => __("Padding", 'swift-framework-plugin'), "param_name" => "col_padding", "value" => "0", "min" => "0", "step" => "1", "max" => "20", "description" => __("Adjust the padding for the column. (%)", 'swift-framework-plugin')), array("type" => "uislider", "heading" => __("Vertical Offset", 'swift-framework-plugin'), "param_name" => "col_vertical_offset", "value" => "0", "min" => "-1000", "step" => "10", "max" => "1000", "description" => __("Add a vertical offset to the column (px).", 'swift-framework-plugin')), array("type" => "uislider", "heading" => __("Horizontal Offset", 'swift-framework-plugin'), "param_name" => "col_horizontal_offset", "value" => "0", "min" => "-1000", "step" => "10", "max" => "1000", "description" => __("Add a horizontal offset to the column (px).", 'swift-framework-plugin')), array("type" => "uislider", "heading" => __("Custom z-index", 'swift-framework-plugin'), "param_name" => "col_custom_zindex", "value" => "0", "min" => "0", "step" => "1", "max" => "100", "description" => __("Add a custom z-index to the column, for use with offsets and layering.", 'swift-framework-plugin')))));