'',
);
/* This returs block controls
---------------------------------------------------------- */
public function getColumnControls($controls, $extended_css = '') {
global $vc_row_layouts;
$controls_start = '
customAdminBockParams().' data-element_type="'.$this->settings["base"].'" class="wpb_'.$this->settings['base'].' wpb_sortable">';
$output .= str_replace("%column_size%", 1, $column_controls);
$output .= '
';
$output .= '
';
if($content=='' && !empty($this->settings["default_content_in_template"])) {
$output .= do_shortcode( shortcode_unautop($this->settings["default_content_in_template"]) );
} else {
$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 .= '
';
}
return $output;
}
public function customAdminBockParams() {
return '';
}
public function buildStyle($bg_image = '', $bg_color = '', $bg_image_repeat = '', $font_color = '', $padding = '', $margin_bottom = '') {
$has_image = false;
$style = '';
if((int)$bg_image > 0 && ($image_url = wp_get_attachment_url( $bg_image, 'large' )) !== false) {
$has_image = true;
$style .= "background-image: url(".$image_url.");";
}
if(!empty($bg_color)) {
$style .= 'background-color: '.$bg_color.';';
}
if(!empty($bg_image_repeat) && $has_image) {
if($bg_image_repeat === 'cover') {
$style .= "background-repeat:no-repeat;background-size: cover;";
} elseif($bg_image_repeat === 'contain') {
$style .= "background-repeat:no-repeat;background-size: contain;";
} elseif($bg_image_repeat === 'no-repeat') {
$style .= 'background-repeat: no-repeat;';
}
}
if( !empty($font_color) ) {
$style .= 'color: '.$font_color.';';
}
if( $padding != '' ) {
$style .= 'padding: '.(preg_match('/(px|em|\%|pt|cm)$/', $padding) ? $padding : $padding.'px').';';
}
if( $margin_bottom != '' ) {
$style .= 'margin-bottom: '.(preg_match('/(px|em|\%|pt|cm)$/', $margin_bottom) ? $margin_bottom : $margin_bottom.'px').';';
}
return empty($style) ? $style : ' style="'.$style.'"';
}
}
class WPBakeryShortCode_VC_Row_Inner extends WPBakeryShortCode_VC_Row {
protected function getFileName() {
return 'vc_row';
}
public function template($content = '') {
return $this->contentAdmin($this->atts);
}
}