コード例 #1
2
ファイル: banner.php プロジェクト: websideas/Mondova
 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => '', 'suffix' => '', 'prefix' => '', 'image' => '', 'link' => '', 'img_size' => 'thumbnail', 'align' => 'center', 'el_class' => '', 'css' => '', 'style' => '1', 'overlay' => '', 'position' => 'middle'), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'banner ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'style' => 'style' . $style, 'overlay' => 'banner-' . $overlay, 'align' => 'banner-' . $align, 'position' => 'position-' . $position);
     $banner_link = '';
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = $img['thumbnail'];
     $suffix = $suffix ? '<p class="banner-suffix">' . $suffix . '</p>' : '';
     $prefix = $prefix ? '<p class="banner-prefix">' . $prefix . '</p>' : '';
     $output .= sprintf('<div class="banner-content">%s<h3 class="banner-title">%s</h3>%s</div>', $suffix, $title, $prefix);
     if ($link) {
         $link = vc_build_link($link);
         $a_href = $link['url'];
         $a_title = $link['title'];
         $a_target = $link['target'];
         $icon_box_link = array('href="' . esc_attr($a_href) . '"', 'title="' . esc_attr($a_title) . '"', 'target="' . esc_attr($a_target) . '"');
         $banner_link = '<a class="banner-link" ' . implode(' ', $icon_box_link) . '></a>';
     }
     $output .= $banner_link;
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>';
 }
コード例 #2
1
ファイル: image_tooltip.php プロジェクト: websideas/Mondova
 protected function content($atts, $content = null)
 {
     $atts = shortcode_atts(array('image' => '', 'img_size' => 'thumbnail', 'values' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts);
     extract($atts);
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'image-tooltip', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation));
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = '';
     $values = (array) vc_param_group_parse_atts($values);
     $text = '';
     $left_text = '';
     $left_right = '';
     foreach ($values as $key => $data) {
         $new_line = $data;
         $new_line['left'] = isset($data['left']) ? $data['left'] : 0;
         $new_line['top'] = isset($data['top']) ? $data['top'] : 0;
         $new_line['label'] = isset($data['label']) ? $data['label'] : '';
         $new_line['color'] = isset($data['color']) ? $data['color'] : 'default';
         $new_line['color'] = isset($data['color']) ? $data['color'] : 'default';
         $new_line['content'] = isset($data['content']) ? $data['content'] : '';
         $active = $key == 0 ? ' active' : '';
         $text .= sprintf('<div class="image-tooltip-item %s" style="top: %s; left: %s;"><div class="image-tooltip-content" data-count="%s" title="%s"></div></div>', 'tooltip-' . $new_line['color'] . $active, $new_line['top'] . '%', $new_line['left'] . '%', $key, $new_line['label']);
         $tooltip = sprintf('<div class="image-tooltip-element %s" data-count="%s"><h4>%s</h4><div>%s</div></div>', $active, $key, $new_line['label'], $data['content']);
         if ($new_line['align'] == 'right') {
             $left_right .= $tooltip;
         } else {
             $left_text .= $tooltip;
         }
     }
     $output = sprintf('<div class="row"><div class="image-tooltip-left col-md-4">%s</div><div class="image-tooltip-center col-md-4">%s %s</div><div class="image-tooltip-right col-md-4">%s</div></div>', $left_text, '<div class="image-tooltip-image">' . $img['thumbnail'] . '</div>', '<div class="image-tooltip-text">' . $text . '</div>', $left_right);
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>';
 }
コード例 #3
0
 public function addPlaceholderImage($img)
 {
     if (NULL === $img || false === $img) {
         $img = array('thumbnail' => '<img class="vc_img-placeholder vc_single_image-img" src="' . vc_asset_url('vc/vc_gitem_image.png') . '" />');
     }
     return $img;
 }
コード例 #4
0
 function check_vc($content)
 {
     if (class_exists('Vc_Base')) {
         global $post;
         $course_status = vibe_get_option('start_course');
         $force_include_pages = apply_filters('wplms_vc_force_include_pages', array($course_status));
         $force_include_post_types = apply_filters('wplms_vc_force_include_custom_post_types', array('course', 'unit', 'quiz', 'question'));
         if (in_array($post->ID, $force_include_pages) || in_array($post->post_type, $force_include_post_types)) {
             if (strpos($content, 'vc_row')) {
                 /*
                 wp_register_style( 'js_composer_front', vc_asset_url( 'css/js_composer.min.css' ), array(), WPB_VC_VERSION );
                 			    	wp_register_script( 'wpb_composer_front_js', vc_asset_url( 'js/dist/js_composer_front.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );
                 			    	wp_enqueue_style( 'js_composer_front');
                 			    	wp_enqueue_script( 'wpb_composer_front_js');
                 */
                 echo "<link rel='stylesheet' id='swiftype-css' href='" . vc_asset_url('css/js_composer.min.css') . "' type='text/css' media='all'/>";
                 echo "<script type='text/javascript' src='" . vc_asset_url('js/dist/js_composer_front.min.js') . "'></script>";
                 global $vc_manager;
                 foreach (WPBMap::getShortCodes() as $sc_base => $el) {
                     $vc_manager->shortcodes[$sc_base] = new WPBakeryShortCodeFishBones($el);
                 }
             }
         }
     }
     return $content;
 }
コード例 #5
0
 public function addImage($img)
 {
     if (empty($img)) {
         $img = '<img src="' . vc_asset_url('vc/vc_gitem_image.png') . '" alt="">';
     }
     return $img;
 }
コード例 #6
0
ファイル: class-vc-pageable.php プロジェクト: k2jysy/wedev
 /**
  * Register scripts and styles for pager
  */
 public function shortcodeScripts()
 {
     wp_register_script('vc_pageable_owl-carousel', vc_asset_url('lib/owl-carousel2-dist/owl.carousel.min.js'), array('jquery'), WPB_VC_VERSION, true);
     wp_register_script('waypoints', vc_asset_url('lib/waypoints/waypoints.min.js'), array('jquery'), WPB_VC_VERSION, true);
     wp_register_style('vc_pageable_owl-carousel-css', vc_asset_url('lib/owl-carousel2-dist/assets/owl.min.css'), array(), WPB_VC_VERSION, false);
     wp_register_style('animate-css', vc_asset_url('lib/bower/animate-css/animate.min.css'), array(), WPB_VC_VERSION, false);
 }
コード例 #7
0
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if ('attach_image' === $param['type'] && 'image' === $param_name) {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         $element_icon = $this->settings('icon');
         $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
         $this->setSettings('logo', ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail vc_element-icon"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>');
         $output .= $this->outputTitleTrue($this->settings['name']);
     } elseif (!empty($param['holder'])) {
         if ($param['holder'] === 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } elseif (in_array($param['holder'], array('img', 'iframe'))) {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">';
         } elseif ($param['holder'] !== 'hidden') {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
         }
     }
     if (!empty($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
コード例 #8
0
ファイル: vc-gallery.php プロジェクト: severnrescue/web
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) && 'hidden' !== $param['holder']) {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     if ('images' === $param_name) {
         $images_ids = empty($value) ? array() : explode(',', trim($value));
         $output .= '<ul class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
         foreach ($images_ids as $image) {
             $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
             $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
         }
         $output .= '</ul>';
         $output .= '<a href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '">' . __('Add images', 'js_composer') . '</a>';
     }
     return $output;
 }
コード例 #9
0
 public function addImageUrl($url)
 {
     if (empty($url)) {
         $url = vc_asset_url('vc/vc_gitem_image.png');
     }
     return $url;
 }
コード例 #10
0
ファイル: team.php プロジェクト: websideas/Mondova
 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('name' => '', 'image' => '', 'image_size' => 'full', 'agency' => '', 'facebook_link' => '', 'twitter_link' => '', 'dribbble_link' => '', 'linkedin_link' => '', 'el_class' => '', 'css' => ''), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'team ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class));
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $image_size, 'class' => 'vc_single_image-img img-responsive team-avatar'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder vc_single_image-img team-avatar" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = '';
     $socials = array('<i class="fa fa-facebook"></i>' => $facebook_link, '<i class="fa fa-twitter"></i>' => $twitter_link, '<i class="fa fa-dribbble"></i>' => $dribbble_link, '<i class="fa fa-linkedin"></i>' => $linkedin_link);
     if ($name) {
         $output .= '<div class="' . $elementClass . '">';
         $output .= $img['thumbnail'];
         $output .= '<div class="team-attr">';
         $output .= '<h4 class="name">' . $name . '</h4>';
         $output .= '<div class="agency">' . $agency . '</div>';
         if ($facebook_link || $twitter_link || $dribbble_link || $linkedin_link) {
             $output .= '<ul class="clearfix">';
             foreach ($socials as $key => $value) {
                 if ($value) {
                     $output .= '<li><a href="' . $value . '">' . $key . '</a></li>';
                 }
             }
             $output .= '</ul>';
         }
         $output .= '</div>';
         $output .= '</div>';
     }
     return $output;
 }
コード例 #11
0
 public function shortcodeScripts()
 {
     parent::shortcodeScripts();
     wp_register_script('vc_masonry', vc_asset_url('lib/bower/masonry/dist/masonry.pkgd.min.js'));
     wp_register_script('vc_grid-style-all-masonry', vc_asset_url('js/components/vc_grid_style_all_masonry.js'), array('vc_grid-style-all'), WPB_VC_VERSION, true);
     wp_register_script('vc_grid-style-lazy-masonry', vc_asset_url('js/components/vc_grid_style_lazy_masonry.js'), array('vc_grid-style-all'), WPB_VC_VERSION, true);
     wp_register_script('vc_grid-style-load-more-masonry', vc_asset_url('js/components/vc_grid_style_load_more_masonry.js'), array('vc_grid-style-all'), WPB_VC_VERSION, true);
 }
コード例 #12
0
function vc_page_editable_enqueue_pointer_scripts()
{
    if (vc_is_page_editable()) {
        wp_enqueue_style('wp-pointer');
        wp_enqueue_script('wp-pointer');
        // Add pointers script to queue. Add custom script.
        wp_enqueue_script('vc_pointer-message', vc_asset_url('js/lib/vc-pointers/vc-pointer-message.js'), array('jquery', 'underscore', 'wp-pointer'), WPB_VC_VERSION, true);
    }
}
コード例 #13
0
 /**
  * Register scripts and styles for pager
  */
 public function shortcodeScripts()
 {
     wp_register_script('vc_pageable_owl-carousel', vc_asset_url('lib/owl-carousel2-dist/owl.carousel.js'), array('jquery'), WPB_VC_VERSION, true);
     wp_register_script('waypoints', vc_asset_url('lib/waypoints/waypoints.min.js'), array('jquery'), WPB_VC_VERSION, true);
     //wp_register_script( 'waypoints-infinite', vc_asset_url( 'lib/jquery-waypoints/shortcuts/infinite-scroll/waypoints-infinite.js' ), array( 'jquery', 'waypoints' ), WPB_VC_VERSION, true );
     wp_register_style('vc_pageable_owl-carousel-css', vc_asset_url('lib/owl-carousel2-dist/assets/owl.carousel.css'), array(), WPB_VC_VERSION, false);
     wp_register_style('vc_pageable_owl-carousel-css-theme', vc_asset_url('lib/owl-carousel2-dist/assets/owl.theme.default.css'), array(), WPB_VC_VERSION, false);
     //wp_register_script( 'jquery-mousewheel', vc_asset_url( 'lib/jquery-mousewheel/jquery.mousewheel.js' ), array( 'jquery' ), WPB_VC_VERSION, false );
     wp_register_style('animate-css', vc_asset_url('lib/animate-css/animate.css'), array(), WPB_VC_VERSION, false);
 }
コード例 #14
0
 public function shortcodeScripts()
 {
     parent::shortcodeScripts();
     wp_register_script('vc_grid-js-imagesloaded', vc_asset_url('lib/bower/imagesloaded/imagesloaded.pkgd.min.js'));
     wp_register_script('vc_grid-style-all', vc_asset_url('js/components/vc_grid_style_all.js'), array(), WPB_VC_VERSION, true);
     wp_register_script('vc_grid-style-load-more', vc_asset_url('js/components/vc_grid_style_load_more.js'), array(), WPB_VC_VERSION, true);
     wp_register_script('vc_grid-style-lazy', vc_asset_url('js/components/vc_grid_style_lazy.js'), array('waypoints'), WPB_VC_VERSION, true);
     wp_register_script('vc_grid-style-pagination', vc_asset_url('js/components/vc_grid_style_pagination.js'), array(), WPB_VC_VERSION, true);
     wp_register_script('vc_grid', vc_asset_url('js/components/vc_grid.js'), array('jquery', 'underscore', 'vc_pageable_owl-carousel', 'waypoints', 'vc_grid-style-all', 'vc_grid-style-load-more', 'vc_grid-style-lazy', 'vc_grid-style-pagination'), WPB_VC_VERSION, true);
 }
コード例 #15
0
ファイル: pages.php プロジェクト: severnrescue/web
function vc_network_menu_page_build()
{
    if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-general-tab')->get()) {
        define('VC_PAGE_MAIN_SLUG', 'vc-general');
    } else {
        define('VC_PAGE_MAIN_SLUG', 'vc-welcome');
    }
    add_menu_page(__('Visual Composer', 'js_composer'), __('Visual Composer', 'js_composer'), 'exist', VC_PAGE_MAIN_SLUG, null, vc_asset_url('vc/visual_composer.png'), 76);
    do_action('vc_network_menu_page_build');
}
コード例 #16
0
ファイル: admin.php プロジェクト: websideas/Mondova
function cruxstore_get_thumbnail_callback()
{
    $image = intval($_POST['image']);
    $img_size = $_POST['size'];
    $img = wpb_getImageBySize(array('attach_id' => $image, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
    if ($img == null) {
        $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
    }
    echo $img['thumbnail'];
    wp_die();
}
コード例 #17
0
ファイル: vc-images-carousel.php プロジェクト: epiii/aros
 public function jsCssScripts()
 {
     // wp_register_script('vc_bxslider', vc_asset_url('lib/bxslider-4/jquery.bxslider.min.js'));
     // wp_register_style('vc_bxslider_css', vc_asset_url('lib/bxslider-4/jquery.bxslider.css'));
     // wp_register_script('vc_swiper', vc_asset_url('lib/swiper/dist/idangerous.swiper-2.2.js'), array(), time());
     // wp_register_style('vc_swiper_css', vc_asset_url('lib/swiper/dist/idangerous.swiper.css'));
     wp_register_script('vc_transition_bootstrap_js', vc_asset_url('lib/vc_carousel/js/transition.js'), array(), WPB_VC_VERSION, true);
     wp_register_script('vc_carousel_js', vc_asset_url('lib/vc_carousel/js/vc_carousel.js'), array('vc_transition_bootstrap_js'), WPB_VC_VERSION, true);
     wp_register_style('vc_carousel_css', vc_asset_url('lib/vc_carousel/css/vc_carousel.css'), array(), WPB_VC_VERSION);
     // try bootstap http://jsfiddle.net/HHsxc/2/
 }
コード例 #18
0
ファイル: css_editor.php プロジェクト: Vatia13/tofido
 function render()
 {
     $output = '<div class="vc-css-editor row vc-row" data-css-editor="true">';
     $output .= $this->onionLayout();
     $output .= '<div class="col-xs-5 vc_span5 vc-settings">' . '    <label>' . __('Border', 'js_composer') . '</label> ' . '    <div class="color-group"><input type="text" name="border_color" value="" class="vc-color-control"></div>' . '    <div class="vc-border-style"><select name="border_style" class="vc-border-style">' . $this->getBorderStyleOptions() . '</select></div>' . '    <label>' . __('Background', 'js_composer') . '</label>' . '    <div class="color-group"><input type="text" name="background_color" value="" class="vc-color-control"></div>' . '    <div class="vc-background-image">' . $this->getBackgroundImageControl() . '<div class="clearfix"></div></div>' . '    <div class="vc-background-style"><select name="background_style" class="vc-background-style">' . $this->getBackgroundStyleOptions() . '</select></div>' . '    <label>' . __('Box controls', 'js_composer') . '</label>' . '    <label class="vc-checkbox"><input type="checkbox" name="simply" class="vc-simplify" value=""> ' . __('Simplify controls', 'js_composer') . '</label>' . '</div>';
     $output .= '<input name="' . $this->setting('param_name') . '" class="wpb_vc_param_value  ' . $this->setting('param_name') . ' ' . $this->setting('type') . '_field" type="hidden" value="' . esc_attr($this->value()) . '"/>';
     $output .= '</div><div class="clearfix"></div>';
     $output .= '<script type="text/html" id="vc-css-editor-image-block">' . '<li class="added">' . '  <div class="inner" style="width: 75px; height: 75px; overflow: hidden;text-align: center;">' . '    <img src="{{ img.url }}?id={{ img.id }}" data-image-id="{{ img.id }}" class="vc-ce-image<# if(!_.isUndefined(img.css_class)) {#> {{ img.css_class }}<# }#>">' . '  </div>' . '  <a href="#" class="icon-remove"></a>' . '</li>' . '</script>';
     $output .= '<script type="text/javascript" src="' . vc_asset_url('js/params/css_editor.js') . '"></script>';
     return apply_filters('vc_css_editor', $output);
 }
コード例 #19
0
 public function setItemsIfEmpty($items)
 {
     if (empty($items)) {
         require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
         $grid_item = new Vc_Grid_Item();
         $grid_item->setGridAttributes($this->atts);
         $grid_item->shortcodes();
         $item = '[vc_gitem]<img src="' . vc_asset_url('vc/vc_gitem_image.png') . '">[/vc_gitem]';
         $grid_item->parseTemplate($item);
         $items = str_repeat($grid_item->renderItem(get_post((int) vc_request_param('vc_post_id'))), 3);
     }
     return $items;
 }
コード例 #20
0
function vc_pointer_load($hook_suffix = '')
{
    global $vc_pointers;
    // Don't run on WP < 3.3
    if (get_bloginfo('version') < '3.3') {
        return;
    }
    $screen = get_current_screen();
    $screen_id = $screen->id;
    // Get pointers for this screen
    $pointers = apply_filters('vc-ui-pointers', array());
    $pointers = apply_filters('vc_ui-pointers-' . $screen_id, $pointers);
    if (!$pointers || !is_array($pointers)) {
        return;
    }
    // Get dismissed pointers
    $dismissed = explode(',', (string) get_user_meta(get_current_user_id(), 'dismissed_wp_pointers', true));
    $vc_pointers = array('pointers' => array());
    // Check pointers and remove dismissed ones.
    foreach ($pointers as $pointer_id => $pointer) {
        // Sanity check
        if (in_array($pointer_id, $dismissed) || empty($pointer) || empty($pointer_id) || empty($pointer['name'])) {
            continue;
        }
        $pointer['pointer_id'] = $pointer_id;
        // Add the pointer to $valid_pointers array
        $vc_pointers['pointers'][] = $pointer;
    }
    // No valid pointers? Stop here.
    if (empty($vc_pointers['pointers'])) {
        return;
    }
    // Add pointers style to queue.
    wp_enqueue_style('wp-pointer');
    // Add pointers script to queue. Add custom script.
    wp_enqueue_script('vc_pointer-message', vc_asset_url('js/lib/vc-pointers/vc-pointer-message.js'), array('jquery', 'underscore', 'wp-pointer'), WPB_VC_VERSION, true);
    wp_enqueue_script('vc_pointers-controller', vc_asset_url('js/lib/vc-pointers/vc-pointers-controller.js'), array('vc_pointer-message', 'wpb_js_composer_js_listeners', 'wpb_scrollTo_js'), WPB_VC_VERSION, true);
    /*
    wp_enqueue_script( 'vc_event-pointers-controller', vc_asset_url( 'js/lib/vc-pointers/vc-event-pointers-controller.js' ), array( 'vc_pointers-controller' ),
    	WPB_VC_VERSION,
    	true );
    */
    wp_enqueue_script('vc_wp-pointer', vc_asset_url('js/lib/vc-pointers/pointers.js'), array('vc_pointers-controller'), WPB_VC_VERSION, true);
    // messages
    $vc_pointers['texts'] = array('finish' => __('Finish', 'js_composer'), 'next' => __('Next', 'js_composer'), 'prev' => __('Prev', 'js_composer'));
    // Add pointer options to script.
    wp_localize_script('vc_wp-pointer', 'vcPointer', $vc_pointers);
}
コード例 #21
0
 /**
  * @since 4.3
  */
 public function enqueueJsFrontend()
 {
     wp_enqueue_script('vc_vendor_qtranslate_frontend', vc_asset_url('js/vendors/qtranslate_frontend.js'), array('vc_inline_shortcodes_builder_js'), '1.0', true);
     global $q_config;
     $q_config['js']['qtrans_save'] = "";
     $q_config['js']['qtrans_integrate_category'] = "";
     $q_config['js']['qtrans_integrate_title'] = "";
     $q_config['js']['qtrans_assign'] = "";
     $q_config['js']['qtrans_tinyMCEOverload'] = "";
     $q_config['js']['qtrans_wpActiveEditorOverload'] = "";
     $q_config['js']['qtrans_updateTinyMCE'] = "";
     $q_config['js']['qtrans_wpOnload'] = "";
     $q_config['js']['qtrans_editorInit'] = "";
     $q_config['js']['qtrans_hook_on_tinyMCE'] = "";
     $q_config['js']['qtrans_switch_postbox'] = "";
     $q_config['js']['qtrans_switch'] = "";
 }
コード例 #22
0
ファイル: lightbox.php プロジェクト: websideas/Mondova
 protected function content($atts, $content = null)
 {
     $atts = shortcode_atts(array('title' => '', 'type' => 'image', 'image' => '', 'link' => '', 'effect' => '', 'max_width' => 650, 'icon_type' => 'icon', 'iconbox_icon' => 'fa fa-adjust', 'iconbox_image' => '', 'color' => '', 'custom_color' => '', 'size' => 'md', 'align' => 'center', 'el_class' => '', 'css_animation' => '', 'animation_delay' => '', 'css' => ''), $atts);
     extract($atts);
     $output = $custom_css = '';
     $uniqid = uniqid();
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'lightbox-content', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'align' => 'text-' . $align);
     $lightbox_icon = '';
     if ($icon_type == 'image') {
         $img_lightbox_id = preg_replace('/[^\\d]/', '', $iconbox_image);
         $img_lightbox = wp_get_attachment_image_src($img_lightbox_id, 'full');
         if (array($img_lightbox)) {
             $lightbox_icon = sprintf('<img src="%s" class="img-responsive" alt="" />', $img_lightbox['0']);
         }
     } else {
         $lightbox_class = array('vc_lightbox size-' . $size);
         if ($color != 'custom') {
             $lightbox_class[] = 'color-' . $color;
             $custom_color = cruxstore_color2Hex($color);
         }
         $lightbox_style = 'style="color: ' . $custom_color . '"';
         $lightbox_icon = sprintf('<span class="%s %s" %s></span>', $iconbox_icon, implode(' ', $lightbox_class), $lightbox_style);
     }
     $link_attr = array('href' => '', 'class' => 'lightbox-link lightbox-' . $type);
     if ($type == 'inline') {
         $link_attr['href'] = '#lightbox-content' . $uniqid;
         $output .= sprintf('<div id="%s" class="%s">%s</div>', 'lightbox-content' . $uniqid, 'mfp-hide lightbox-popup-block mfp-with-anim', $content);
     } elseif ($type == 'iframe') {
         $link_attr['href'] = $link;
     } else {
         $img_lightbox_id = preg_replace('/[^\\d]/', '', $image);
         $img_lightbox = wp_get_attachment_image_src($img_lightbox_id, 'full');
         if (array($img_lightbox)) {
             $link_attr['href'] = $img_lightbox['0'];
         } else {
             $link_attr['href'] = vc_asset_url('vc/no_image.png');
         }
     }
     $output .= sprintf('<a href="%s" class="%s" data-type="%s" data-effect="%s" data-width="%s">%s</a>', $link_attr['href'], $link_attr['class'], $type, $effect, $max_width, $lightbox_icon);
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     return '<div id="lightbox-' . $uniqid . '" class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . $custom_css . '</div>';
 }
コード例 #23
0
ファイル: box_colored.php プロジェクト: websideas/Mondova
 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'image' => '', 'link' => '', 'img_size' => 'thumbnail', 'background_title_color' => '#ebebeb', 'use_theme_fonts' => 'true', 'font_container' => '', 'google_fonts' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'box-colored ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation));
     $style_title = '';
     extract($this->getAttributes($atts));
     unset($font_container_data['values']['text_align']);
     $styles = array();
     extract($this->getStyles($el_class, $css, $google_fonts_data, $font_container_data, $atts));
     $settings = get_option('wpb_js_google_fonts_subsets');
     $subsets = '';
     if (is_array($settings) && !empty($settings)) {
         $subsets = '&subset=' . implode(',', $settings);
     }
     if (!empty($google_fonts_data) && isset($google_fonts_data['values']['font_family'])) {
         wp_enqueue_style('vc_google_fonts_' . vc_build_safe_css_class($google_fonts_data['values']['font_family']), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets);
     }
     if ($background_title_color) {
         $styles[] = 'background-color: ' . $background_title_color . ';';
     }
     if (!empty($styles)) {
         $style_title .= 'style="' . esc_attr(implode(';', $styles)) . '"';
     }
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     if ($link) {
         $link = vc_build_link($link);
         $a_href = $link['url'];
         $a_title = $link['title'];
         $a_target = $link['target'];
         $icon_box_link = array('href="' . esc_attr($a_href) . '"', 'title="' . esc_attr($a_title) . '"', 'target="' . esc_attr($a_target) . '"');
         $title = '<a class="box-link" ' . implode(' ', $icon_box_link) . '>' . $title . '</a>';
         $img['thumbnail'] = '<a class="box-link" ' . implode(' ', $icon_box_link) . '>' . $img['thumbnail'] . '</a>';
     }
     $box_title = $title ? '<' . $font_container_data['values']['tag'] . ' class="box-colored-title" ' . $style_title . '>' . $title . '</' . $font_container_data['values']['tag'] . '>' : '';
     $output = '<div class="box-colored-image">' . $img['thumbnail'] . '</div>' . $box_title;
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>';
 }
コード例 #24
0
 public function singleParamHtmlHolder($param, $value)
 {
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == false || $param['holder'] == 'hidden') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         if ($param['type'] == 'attach_image') {
             $element_icon = $this->settings('icon');
             $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
             $this->setSettings('logo', $img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail small"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />');
             $output .= $this->settings('logo');
         }
     } else {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     return $output;
 }
コード例 #25
0
ファイル: products_price.php プロジェクト: websideas/Mondova
 protected function content($atts, $content = null)
 {
     $atts = shortcode_atts(array('badge' => esc_html__('only', 'cruxstore'), 'price' => 245, 'currency' => esc_html__('$', 'cruxstore'), 'desktop' => 4, 'values' => '', 'el_class' => '', 'css_animation' => '', 'animation_delay' => '', 'css' => ''), $atts);
     extract($atts);
     $output = '';
     $product_columns = 12 / $desktop;
     $product_land = $product_columns == 4 ? 2 : 3;
     $values = (array) vc_param_group_parse_atts($values);
     $text = '';
     foreach ($values as $data) {
         $new_line = $data;
         $button_text = '';
         $img_id = isset($data['image']) ? $data['image'] : 0;
         $pd_link = isset($data['link']) ? $data['link'] : '';
         $pd_title = isset($data['label']) ? $data['label'] : '';
         $img_id = preg_replace('/[^\\d]/', '', $img_id);
         $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => 'full', 'class' => 'img-responsive'));
         if ($img == null) {
             $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
         }
         $pd_image = $img['thumbnail'];
         if (!empty($pd_link)) {
             $pd_link = vc_build_link($pd_link);
             if ($pd_title) {
                 $pd_title = '<a href="' . esc_attr($pd_link['url']) . '"' . ($pd_link['target'] ? ' target="' . esc_attr($pd_link['target']) . '"' : '') . ($pd_link['title'] ? ' title="' . esc_attr($pd_link['title']) . '"' : '') . '>' . $pd_title . '</a>';
             }
             $pd_image = '<a href="' . esc_attr($pd_link['url']) . '"' . ($pd_link['target'] ? ' target="' . esc_attr($pd_link['target']) . '"' : '') . ($pd_link['title'] ? ' title="' . esc_attr($pd_link['title']) . '"' : '') . '>' . $img['thumbnail'] . '</a>';
         }
         $pd_image = sprintf('<div class="product-price-image">%s</div>', $pd_image);
         if ($pd_title) {
             $pd_title = sprintf('<h5>%s</h5>', $pd_title);
         }
         $text .= sprintf('<div class="%s %s">%s</div>', 'col-md-' . $product_columns . ' col-sm-' . $product_land, 'product-price-item', $pd_image . $pd_title);
     }
     $output = '<div class="row multi-columns-row">' . $text . '</div>';
     $output .= sprintf('<div class="products-price-content visible-lg-block"><div class="products-price-circle"><span class="products-price-only">%s</span><span class="products-price-currency">%s</span><span class="products-price-text">%s</span></div><span class="products-price-cart">%s</span></div>', $badge, $currency, $price, '<i class="fa fa-shopping-basket" aria-hidden="true"></i>');
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'products-price ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '));
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>';
 }
コード例 #26
0
ファイル: params_preset.php プロジェクト: SayenkoDesign/ividf
/**
 * Params preset shortcode attribute type generator.
 *
 * Allows to set list of attributes which will be
 *
 * @param $settings
 * @param $value
 *
 * @since 4.4
 * @return string - html string.
 */
function vc_params_preset_form_field($settings, $value)
{
    global $vc_params_preset_form_field_js_appended;
    $output = '';
    $output .= '<select name="' . $settings['param_name'] . '" class="wpb_vc_param_value vc_params-preset-select ' . $settings['param_name'] . ' ' . $settings['type'] . '">';
    foreach ($settings['options'] as $option) {
        $selected = '';
        if (isset($option['value'])) {
            if ($value !== '' && (string) $option['value'] === (string) $value) {
                $selected = ' selected="selected"';
            }
            $output .= '<option class="vc_params-preset-' . $option['value'] . '" value="' . esc_attr($option['value']) . '"' . $selected . ' data-params="' . esc_attr(json_encode($option['params'])) . '">' . esc_html(isset($option['label']) ? $option['label'] : $option['value']) . '</option>';
        }
    }
    $output .= '</select>';
    if (!$vc_params_preset_form_field_js_appended) {
        $output .= '<script type="text/javascript" src="' . vc_asset_url('js/params/params_preset.js') . '"></script>';
        $vc_params_preset_form_field_js_appended = true;
    }
    return $output;
}
コード例 #27
0
 public function singleParamHtmlHolder($param, $value)
 {
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == false || $param['holder'] == 'hidden') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         if ($param['type'] == 'attach_image') {
             $element_icon = $this->settings('icon');
             $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
             $this->setSettings('logo', ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail vc_element-icon"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>');
             $output .= $this->outputTitleTrue($this->settings['name']);
         }
     } else {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     if (!empty($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . __($param['heading'], 'js_composer') . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
コード例 #28
0
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     //$value = __($value, "wt_vcsc");
     //
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == false || $param['holder'] == 'hidden') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         if ($param['type'] == 'attach_image') {
             $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
             $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<img src="' . THEME_URI . '/framework/shortcodes/assets/lib/img/admin/wt.png' . '" class="no_image_image' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'wt_vcsc') . '</a>';
         }
     } else {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     return $output;
 }
コード例 #29
0
 public function singleParamHtmlHolder($param, $value, $settings = array(), $atts = array())
 {
     $output = '';
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $heading = isset($param['heading']) ? $param['heading'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) === true && in_array($param['holder'], array('div', 'span', 'p', 'pre', 'code'))) {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     } else {
         if (isset($param['holder']) === true && $param['holder'] == 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } else {
             if (isset($param['holder']) === true && $param['holder'] == 'img') {
                 $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
                 $output .= $img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail ts_vcsc_holder_image"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />';
             } else {
                 if (isset($param['holder']) === true && $param['holder'] == 'imagelist') {
                     $images_ids = empty($value) ? array() : explode(',', trim($value));
                     $output .= '<ul style="margin-top: 5px;" class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
                     foreach ($images_ids as $image) {
                         $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
                         $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
                     }
                     $output .= '</ul>';
                 }
             }
         }
     }
     if (isset($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span style="max-width: 100%; display: block;" class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
     }
     if ('dropdown' === $param['type'] && 'type' === $param_name) {
         $output .= '<a style="max-width: 100%; display: block;" href="#" class="column_edit_trigger" style="margin-bottom: 10px;">' . __('Add, Change or Remove Image(s)', "ts_visual_composer_extend") . '</a>';
     }
     return $output;
 }
コード例 #30
0
ファイル: vc_grid_item.php プロジェクト: Angelpm28/ong-canada
function vc_load_vc_grid_item_param()
{
    vc_add_shortcode_param('vc_grid_item', 'vc_vc_grid_item_form_field', vc_asset_url('js/params/vc_grid_item/param.js'));
}