predefined_atts, $atts ) ); $output = ''; $column_controls = $this->getControls( $this->settings( 'controls' ) ); $output .= '
mainHtmlBlockParams( '12', '' ) . '>'; $output .= $column_controls; $output .= '
containerHtmlBlockParams( '12', '' ) . '>'; $output .= $this->itemGrid(); $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 mainHtmlBlockParams( $width, $i ) { $sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass ); return 'data-element_type="' . $this->settings['base'] . '" class="' . $this->settings['base'] . '-shortcode ' . $sortable . ' wpb_content_holder vc_shortcodes_container"' . $this->customAdminBlockParams(); } public function itemGrid() { $output = '
' . '
' . '
' . '
' . '
' . '
' . '
' . '
' . '
' . '
' . '
'; return $output; } public function containerHtmlBlockParams( $width, $i ) { return 'class="vc_gitem-content"'; } /** * Get rendered controls * * @param array $controls * * @return string */ public function getControls( $controls ) { if ( ! is_array( $controls ) || empty( $controls ) ) { return ''; } $buttons = array(); $editAccess = vc_user_access_check_shortcode_edit( $this->shortcode ); $allAccess = vc_user_access_check_shortcode_all( $this->shortcode ); foreach ( $controls as $control ) { switch ( $control ) { case 'add': if ( $allAccess ) { $buttons[] = ''; } break; case 'edit': if ( $editAccess ) { $buttons[] = ''; } break; case 'delete': if ( $allAccess ) { $buttons[] = ''; } break; } } $html = '
' . implode( ' ', $buttons ) . '
'; return $html; } }