'', ); /* This returs block controls ---------------------------------------------------------- */ public function getColumnControls($controls, $extended_css = '') { global $vc_row_layouts; $controls_start = '
'; $controls_end = '
'; //Create columns $controls_center_start = ''; $controls_layout = ''; foreach($vc_row_layouts as $layout) { $controls_layout .= ' '; } $controls_layout .= '
'.__('Custom layout', 'js_composer').' '; $controls_move = ' '; $controls_delete = ''; $controls_edit = ' '; $controls_clone = ' '; $controls_center_end = '
'; $row_edit_clone_delete = ''; $row_edit_clone_delete .= $controls_delete . $controls_clone . $controls_edit; $row_edit_clone_delete .= ''; //$column_controls_full = $controls_start. $controls_move . $controls_center_start . $controls_layout . $controls_delete . $controls_clone . $controls_edit . $controls_center_end . $controls_end; $column_controls_full = $controls_start. $controls_move . $controls_center_start . $controls_layout . $controls_center_end . $row_edit_clone_delete . $controls_end; return $column_controls_full; } public function contentAdmin($atts, $content = null) { $width = $el_class = ''; extract(shortcode_atts($this->predefined_atts, $atts)); $output = ''; $column_controls = $this->getColumnControls($this->settings('controls')); for ( $i=0; $i < count($width); $i++ ) { $output .= '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); } }