'triangle',
'divider_position' => 'center',
'hide_on_mobile' => fusion_builder_default_visibility( 'string' ),
'class' => '',
'id' => '',
'backgroundcolor' => $fusion_settings->get( 'section_sep_bg' ),
'bordersize' => $fusion_settings->get( 'section_sep_border_size' ),
'bordercolor' => $fusion_settings->get( 'section_sep_border_color' ),
'divider_candy' => 'top',
'icon' => '',
'icon_color' => $fusion_settings->get( 'icon_color' ),
'divider_height' => '',
'divider_height_medium' => '',
'divider_height_small' => '',
'divider_repeat' => 1,
'divider_repeat_medium' => 1,
'divider_repeat_small' => 1,
'margin_bottom' => '',
'margin_left' => '',
'margin_right' => '',
'margin_top' => '',
'custom_svg' => '',
];
}
/**
* Maps settings to param variables.
*
* @static
* @access public
* @since 2.0.0
* @return array
*/
public static function settings_to_params() {
return [
'section_sep_bg' => 'backgroundcolor',
'section_sep_border_size' => 'bordersize',
'section_sep_border_color' => 'bordercolor',
'icon_color' => 'icon_color',
];
}
/**
* Used to set any other variables for use on front-end editor template.
*
* @static
* @access public
* @since 2.0.0
* @return array
*/
public static function get_element_extras() {
$fusion_settings = awb_get_fusion_settings();
return [
'container_padding_100' => $fusion_settings->get( 'container_padding_100' ),
'layout' => fusion_get_option( 'layout' ),
'site_width' => esc_attr( $fusion_settings->get( 'site_width' ) ),
'header_position' => esc_attr( fusion_get_option( 'header_position' ) ),
'side_header_width' => $fusion_settings->get( 'side_header_width' ),
'hundredp_padding' => esc_attr( $fusion_settings->get( 'hundredp_padding' ) ),
'visibility_large' => $fusion_settings->get( 'visibility_large' ),
'visibility_medium' => $fusion_settings->get( 'visibility_medium' ),
'visibility_small' => $fusion_settings->get( 'visibility_small' ),
];
}
/**
* Maps settings to extra variables.
*
* @static
* @access public
* @since 2.0.0
* @return array
*/
public static function settings_to_extras() {
return [
'container_padding_100' => 'container_padding_100',
'layout' => 'layout',
'site_width' => 'site_width',
'header_position' => 'header_position',
'side_header_width' => 'side_header_width',
'hundredp_padding' => 'hundredp_padding',
];
}
/**
* Change args to valid values based on other options.
*
* @access public
* @since 3.4
* @return void
*/
public function validate_args() {
$this->args['bordersize'] = FusionBuilder::validate_shortcode_attr_value( $this->args['bordersize'], 'px' );
$this->args['backgroundcolor'] = esc_attr( $this->args['backgroundcolor'] );
}
/**
* Render the shortcode
*
* @access public
* @since 1.0
* @param array $args Shortcode parameters.
* @param string $content Content between shortcode.
* @return string HTML output.
*/
public function render( $args, $content = '' ) {
global $fusion_fwc_type, $fusion_col_type;
$this->defaults = self::get_element_defaults();
$this->args = FusionBuilder::set_shortcode_defaults( self::get_element_defaults(), $args, 'fusion_section_separator' );
$this->validate_args();
$candy = '';
$icon = '';
if ( 'triangle' === $this->args['divider_type'] ) {
if ( $this->args['icon'] ) {
if ( ! $this->args['icon_color'] ) {
$this->args['icon_color'] = $this->args['bordercolor'];
}
$icon = '
';
}
$candy = '';
if ( false !== strpos( $this->args['divider_candy'], 'top' ) && false !== strpos( $this->args['divider_candy'], 'bottom' ) ) {
$candy = '';
}
$candy = $icon . $candy;
} elseif ( 'bigtriangle' === $this->args['divider_type'] ) {
$candy = '';
} elseif ( 'slant' === $this->args['divider_type'] ) {
$candy = '';
} elseif ( 'rounded-split' === $this->args['divider_type'] ) {
$candy = sprintf( '', FusionBuilder::attributes( 'section-separator-shortcode-divider-rounded-split' ) );
} elseif ( 'big-half-circle' === $this->args['divider_type'] ) {
$candy = '';
} elseif ( 'curved' === $this->args['divider_type'] ) {
$candy = '';
} elseif ( 'clouds' === $this->args['divider_type'] ) {
$candy = '';
} elseif ( 'horizon' === $this->args['divider_type'] ) {
$y_min = ( 'top' === $this->args['divider_candy'] ) ? '-0.5' : '0';
$candy = '';
} elseif ( 'hills' === $this->args['divider_type'] ) {
if ( 'top' === $this->args['divider_candy'] ) {
$candy = '