/** * @param $controls * @param string $extended_css * * @return string */ public function getColumnControls($controls, $extended_css = '') { $output = '<div class="vc_controls vc_control-column vc_controls-visible controls' . (!empty($extended_css) ? " {$extended_css}" : '') . '">'; $controls_end = '</div>'; if ($extended_css == 'bottom-controls') { $control_title = __('Append to this column', 'js_composer'); } else { $control_title = __('Prepend to this column', 'js_composer'); } $controls_add = ' <a class="vc_control column_add vc_column-add" data-vc-control="add" href="#" title="' . $control_title . '"><i class="vc_icon"></i></a>'; $controls_edit = ' <a class="vc_control column_edit vc_column-edit" data-vc-control="edit" href="#" title="' . __('Edit this column', 'js_composer') . '"><i class="vc_icon"></i></a>'; $controls_delete = ' <a class="vc_control column_delete vc_column-delete" data-vc-control="delete" href="#" title="' . __('Delete this column', 'js_composer') . '"><i class="vc_icon"></i></a>'; if (is_array($controls) && !empty($controls)) { foreach ($controls as $control) { $method_name = vc_camel_case('output-editor-control-' . $control); if (method_exists($this, $method_name)) { $output .= $this->{$method_name}(); } else { $control_var = 'controls_' . $control; $output .= ${$control_var}; } } return $output . $controls_end; } elseif (is_string($controls) && 'full' === $controls) { return $output . $controls_add . $controls_edit . $controls_delete . $controls_end; } elseif (is_string($controls)) { $control_var = 'controls_' . $controls; if (isset(${$control_var})) { return $output . ${$control_var} . $controls_end; } } return $output . $controls_add . $controls_edit . $controls_delete . $controls_end; }
/** * @param $grid_style * @param $settings * @param string $content * * @param string $css_class * * @return string */ public function renderPagination($grid_style, $settings, $content = '', $css_class = '') { $css_class .= empty($css_class) ? '' : ' ' . 'vc_pageable-wrapper vc_hook_hover'; $content_method = vc_camel_case('content-' . $grid_style); $content = method_exists($this, $content_method) ? $this->{$content_method}($grid_style, $settings, $content) : $content; $output = '<div class="' . esc_attr($css_class) . '" data-vc-pageable-content="true">' . $content . '</div>'; return $output; }
/** * @param $controls * @param string $extended_css * * @return string */ public function getColumnControls($controls, $extended_css = '') { $output = '<div class="vc_controls vc_control-column vc_controls-visible controls' . (!empty($extended_css) ? " {$extended_css}" : '') . '">'; $controls_end = '</div>'; if (' bottom-controls' === $extended_css) { $control_title = __('Append to this column', 'js_composer'); } else { $control_title = __('Prepend to this column', 'js_composer'); } if (vc_user_access()->part('shortcodes')->checkStateAny(true, 'custom', null)->get()) { $controls_add = '<a class="vc_control column_add vc_column-add" data-vc-control="add" href="#" title="' . $control_title . '"><i class="vc_icon"></i></a>'; } else { $controls_add = ''; } $controls_edit = '<a class="vc_control column_edit vc_column-edit" data-vc-control="edit" href="#" title="' . __('Edit this column', 'js_composer') . '"><i class="vc_icon"></i></a>'; $controls_delete = '<a class="vc_control column_delete vc_column-delete" data-vc-control="delete" href="#" title="' . __('Delete this column', 'js_composer') . '"><i class="vc_icon"></i></a>'; $editAccess = vc_user_access_check_shortcode_edit($this->shortcode); $allAccess = vc_user_access_check_shortcode_all($this->shortcode); if (is_array($controls) && !empty($controls)) { foreach ($controls as $control) { if ('add' === $control || $editAccess && 'edit' === $control || $allAccess) { $method_name = vc_camel_case('output-editor-control-' . $control); if (method_exists($this, $method_name)) { $output .= $this->{$method_name}(); } else { $control_var = 'controls_' . $control; if (isset(${$control_var})) { $output .= ${$control_var}; } } } } return $output . $controls_end; } elseif (is_string($controls) && 'full' === $controls) { if ($allAccess) { return $output . $controls_add . $controls_edit . $controls_delete . $controls_end; } elseif ($editAccess) { return $output . $controls_add . $controls_edit . $controls_end; } else { return $output . $controls_add . $controls_end; } return $output . $controls_end; } elseif (is_string($controls)) { $control_var = 'controls_' . $controls; if ('add' === $controls || ($editAccess && 'edit' == $controls || $allAccess) && isset(${$control_var})) { return $output . ${$control_var} . $controls_end; } return $output . $controls_end; } if ($allAccess) { return $output . $controls_add . $controls_edit . $controls_delete . $controls_end; } elseif ($editAccess) { return $output . $controls_add . $controls_edit . $controls_end; } else { return $output . $controls_add . $controls_end; } return $output . $controls_end; }
/** * Generate array of controls by iterating property $controls list. * vc_filter: vc_nav_controls - hook to override list of controls * @return array - list of arrays witch contains key name and html output for button. */ public function getControls() { $list = array(); foreach ($this->controls as $control) { $method = vc_camel_case('get_control_' . $control); if (method_exists($this, $method)) { $list[] = array($control, $this->{$method}() . "\n"); } } return apply_filters($this->controls_filter_name, $list); }
/** * @param $grid_style * @param $settings * @param string $content * * @param string $css_class * * @return string */ public function renderPagination($grid_style, $settings, $content = '', $css_class = '') { //if ( ! isset( $settings['shortcode_hash'] ) ) { // throw new Exception( 'You must provide shortcode_hash' ); //} $css_class .= empty($css_class) ? '' : ' ' . 'vc_pageable-wrapper vc_hook_hover'; $content_method = vc_camel_case('content-' . $grid_style); $content = method_exists($this, $content_method) ? $this->{$content_method}($grid_style, $settings, $content) : $content; $output = '<div class="' . esc_attr($css_class) . '" data-vc-pageable-content="true">' . $content . '</div>'; return $output; }
/** * Set elements templates. */ protected function setShortcodes() { foreach ($this->shortcodes as $tag) { add_shortcode($tag, array($this, vc_camel_case($tag . '_shortcode'))); } }
<?php /** * @deprecated 4.4 due to autoload logic */ // Here comes the list of vendors $vendors_list = array(); // default prefix for auto loaded class $vendor_class_prefix = 'plugins/class-vc-vendor-'; if (!empty($vendors_list)) { foreach ($vendors_list as $vendor_name) { $vendor_file = vc_path_dir('VENDORS_DIR', $vendor_class_prefix . $vendor_name . '.php'); require_once $vendor_file; $vendor_class_name = 'Vc_Vendor_' . vc_camel_case($vendor_name); vc_add_vendor(new $vendor_class_name()); } }