mainHtmlBlockParams( $width, $i ) . '>';
$output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls );
$output .= '
';
$output .= '
containerHtmlBlockParams( $width, $i ) . '>';
$output .= do_shortcode( shortcode_unautop( $content ) );
$output .= '
';
if ( isset( $this->settings['params'] ) ) {
$inner = '';
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( ${$param['param_name']} ) ? ${$param['param_name']} : '';
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 .= '
';
$output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls_bottom );
$output .= '
';
}
return $output;
}
/**
* @return string
*/
public function customAdminBlockParams() {
return '';
}
/**
* @param $width
* @param $i
*
* @return string
* @throws \Exception
*/
public function mainHtmlBlockParams( $width, $i ) {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass );
return 'data-element_type="' . $this->settings['base'] . '" data-vc-column-width="' . wpb_vc_get_column_width_indent( $width[ $i ] ) . '" class="wpb_' . $this->settings['base'] . ' ' . $sortable . '' . ( ! empty( $this->settings['class'] ) ? ' ' . $this->settings['class'] : '' ) . ' ' . $this->templateWidth() . ' wpb_content_holder"' . $this->customAdminBlockParams();
}
/**
* @param $width
* @param $i
*
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="wpb_column_container vc_container_for_children"';
}
/**
* @param string $content
*
* @return string
*/
public function template( $content = '' ) {
return $this->contentAdmin( $this->atts );
}
/**
* @return string
*/
protected function templateWidth() {
return '<%= window.vc_convert_column_size(params.width) %>';
}
/**
* @param string $font_color
*
* @return string
*/
public function buildStyle( $font_color = '' ) {
$style = '';
if ( ! empty( $font_color ) ) {
$style .= vc_get_css_color( 'color', $font_color );
}
return empty( $style ) ? $style : ' style="' . esc_attr( $style ) . '"';
}
}