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, "js_composer"); // $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="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<img src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/elements_icons/single_image.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', 'js_composer') . '</a>'; } else { if ($param['type'] == 'attach_video') { $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail')); $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<img src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/elements_icons/single_image.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', 'js_composer') . '</a>'; } } } else { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>'; } return $output; }
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, LANGUAGE_ZONE); // $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']) == true && $param['holder'] !== 'hidden') { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>'; } if ($param_name == 'images') { $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="' . WPBakeryVisualComposer::getInstance()->assetURL('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', LANGUAGE_ZONE) . '</a>'; } return $output; }
public function jsCssScripts() { // wp_register_script('vc_bxslider', WPBakeryVisualComposer::getInstance()->assetURL('lib/bxslider-4/jquery.bxslider.min.js')); // wp_register_style('vc_bxslider_css', WPBakeryVisualComposer::getInstance()->assetURL('lib/bxslider-4/jquery.bxslider.css')); wp_register_script('vc_swiper', WPBakeryVisualComposer::getInstance()->assetURL('lib/swiper/dist/idangerous.swiper-2.2.js'), array(), time()); wp_register_style('vc_swiper_css', WPBakeryVisualComposer::getInstance()->assetURL('lib/swiper/dist/idangerous.swiper.css')); }
public function init($settings) { parent::init($settings); $this->composer = WPBakeryVisualComposer::getInstance(); $this->composer->createColumnShortCode(); // Refactored $this->addAction('init', 'setUp'); }
/** * Sets plugin as theme plugin. * @param bool $disable_updater - If value is true disables auto updater options. */ function vc_set_as_theme($disable_updater = false) { $composer = WPBakeryVisualComposer::getInstance(); $composer->setSettingsAsTheme(); if ($disable_updater) { $composer->disableUpdater(); } }
function __construct($dir) { $this->dir = $dir; $this->base_url = plugin_basename($this->dir); $this->composer = WPBakeryVisualComposer::getInstance(); $this->addAction('admin_bar_menu', "adminBarEditLink", 1000); $this->setPost(); $this->initIfActive(); }
public function jsCssScripts() { // wp_register_script('vc_bxslider', WPBakeryVisualComposer::getInstance()->assetURL('lib/bxslider-4/jquery.bxslider.min.js')); // wp_register_style('vc_bxslider_css', WPBakeryVisualComposer::getInstance()->assetURL('lib/bxslider-4/jquery.bxslider.css')); // wp_register_script('vc_swiper', WPBakeryVisualComposer::getInstance()->assetURL('lib/swiper/dist/idangerous.swiper-2.2.js'), array(), time()); // wp_register_style('vc_swiper_css', WPBakeryVisualComposer::getInstance()->assetURL('lib/swiper/dist/idangerous.swiper.css')); wp_register_script('vc_transition_bootstrap_js', WPBakeryVisualComposer::getInstance()->assetURL('lib/vc_carousel/js/transition.js'), array(), time()); wp_register_script('vc_carousel_js', WPBakeryVisualComposer::getInstance()->assetURL('lib/vc_carousel/js/vc_carousel.js'), array('vc_transition_bootstrap_js'), time()); wp_register_style('vc_carousel_css', WPBakeryVisualComposer::getInstance()->assetURL('lib/vc_carousel/css/vc_carousel.css')); // try bootstap http://jsfiddle.net/HHsxc/2/ }
public function init($settings) { parent::init($settings); $this->composer = WPBakeryVisualComposer::getInstance(); $this->composer->createColumnShortCode(); // Refactored $this->composer->setTheme(); $this->setUpTheme(); if (function_exists('add_theme_support')) { add_theme_support('post-thumbnails', array('page')); } load_plugin_textdomain('js_composer', false, self::$config['APP_ROOT'] . '/locale/'); add_post_type_support('page', 'excerpt'); }
public function singleParamHtmlHolder($param, $value, $settings = array(), $atts = array()) { $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, "ts_visual_composer_extend"); // $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 && in_array($param['holder'], array('img', 'iframe'))) { if (!empty($value)) { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">'; } } 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>'; $output .= '<a style="max-width: 100%; display: block;" href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '" style="margin-bottom: 10px;">' . __('Add or Remove Image(s)', "ts_visual_composer_extend") . '</a>'; } } } } 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>'; } return $output; }
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; }
public function registerJavascript() { wp_register_script('isotope', $this->composer->assetURL('lib/isotope/jquery.isotope.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_bootstrap_modals_js', $this->composer->assetURL('lib/bootstrap_modals/js/bootstrap.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_scrollTo_js', $this->composer->assetURL('lib/scrollTo/jquery.scrollTo.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_php_js', $this->composer->assetURL('lib/php.default/php.default.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_json-js', $this->composer->assetURL('lib/json-js/json2.js'), false, WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_tools', $this->composer->assetURL('js/backend/composer-tools.js'), array('jquery', 'backbone', 'wpb_json-js'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_atts', $this->composer->assetURL('js/backend/composer-atts.js'), array('wpb_js_composer_js_tools'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_storage', $this->composer->assetURL('js/backend/composer-storage.js'), array('wpb_js_composer_js_atts'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_models', $this->composer->assetURL('js/backend/composer-models.js'), array('wpb_js_composer_js_storage'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_view', $this->composer->assetURL('js/backend/composer-view.js'), array('wpb_js_composer_js_models'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_custom_views', $this->composer->assetURL('js/backend/composer-custom-views.js'), array('wpb_js_composer_js_view'), WPB_VC_VERSION, true); wp_register_script('wpb_jscomposer_media_editor_js', $this->composer->assetURL('js/backend/media-editor.js'), array('media-views', 'media-editor', 'mce-view', 'wpb_js_composer_js_view'), WPB_VC_VERSION, true); wp_register_script('wpb_jscomposer_autosuggest_js', $this->composer->assetURL('lib/autosuggest/jquery.autoSuggest.js'), array('wpb_js_composer_js_view'), WPB_VC_VERSION, true); wp_register_script('wpb_jscomposer_teaser_js', WPBakeryVisualComposer::getInstance()->assetURL('js/backend/composer-teaser.js'), array(), WPB_VC_VERSION, true); wp_localize_script('wpb_js_composer_js_view', 'i18nLocale', array('add_remove_picture' => __('Add/remove picture', 'js_composer'), 'finish_adding_text' => __('Finish Adding Images', 'js_composer'), 'add_image' => __('Add Image', 'js_composer'), 'add_images' => __('Add Images', 'js_composer'), 'main_button_title' => __('Visual Composer', 'js_composer'), 'main_button_title_backend_editor' => __('BACKEND EDITOR', 'js_composer'), 'main_button_title_frontend_editor' => __('FRONTEND EDITOR', 'js_composer'), 'main_button_title_revert' => __('CLASSIC MODE', 'js_composer'), 'please_enter_templates_name' => __('Please enter template name', 'js_composer'), 'confirm_deleting_template' => __('Confirm deleting "{template_name}" template, press Cancel to leave. This action cannot be undone.', 'js_composer'), 'press_ok_to_delete_section' => __('Press OK to delete section, Cancel to leave', 'js_composer'), 'drag_drop_me_in_column' => __('Drag and drop me in the column', 'js_composer'), 'press_ok_to_delete_tab' => __('Press OK to delete "{tab_name}" tab, Cancel to leave', 'js_composer'), 'slide' => __('Slide', 'js_composer'), 'tab' => __('Tab', 'js_composer'), 'section' => __('Section', 'js_composer'), 'please_enter_new_tab_title' => __('Please enter new tab title', 'js_composer'), 'press_ok_delete_section' => __('Press OK to delete "{tab_name}" section, Cancel to leave', 'js_composer'), 'section_default_title' => __('Section', 'js_composer'), 'please_enter_section_title' => __('Please enter new section title', 'js_composer'), 'error_please_try_again' => __('Error. Please try again.', 'js_composer'), 'if_close_data_lost' => __('If you close this window all shortcode settings will be lost. Close this window?', 'js_composer'), 'header_select_element_type' => __('Select element type', 'js_composer'), 'header_media_gallery' => __('Media gallery', 'js_composer'), 'header_element_settings' => __('Element settings', 'js_composer'), 'add_tab' => __('Add tab', 'js_composer'), 'are_you_sure_convert_to_new_version' => __('Are you sure you want to convert to new version?', 'js_composer'), 'loading' => __('Loading...', 'js_composer'), 'set_image' => __('Set Image', 'js_composer'), 'are_you_sure_reset_css_classes' => __('Are you sure taht you want to remove all your data?', 'js_composer'), 'loop_frame_title' => __('Loop settings'), 'enter_custom_layout' => __('Enter custom layout for your row:', 'js_composer'), 'wrong_cells_layout' => __('Wrong row layout format! Example: 1/2 + 1/2 or span6 + span6.', 'js_composer'), 'row_background_color' => __('Row background color', 'js_composer'), 'row_background_image' => __('Row background image', 'js_composer'), 'guides_on' => __('Guides ON', 'js_composer'), 'guides_off' => __('Guides OFF', 'js_composer'), 'template_save' => __('New template successfully saved!', 'js_composer'), 'template_added' => __('Template added to the page.', 'js_composer'), 'template_is_empty' => __('Nothing to save. Template is empty.', 'js_composer'), 'css_updated' => __('Page settings updated!', 'js_composer'), 'update_all' => __('Update all', 'js_composer'), 'confirm_to_leave' => __('The changes you made will be lost if you navigate away from this page.', 'js_composer'), 'inline_element_saved' => __('%s saved!', 'js_composer'), 'inline_element_deleted' => __('%s deleted!', 'js_composer'), 'inline_element_cloned' => __('%s cloned. <a href="#" class="vc-edit-cloned" data-model-id="%s">Edit now?</a>', 'js_composer'))); wp_register_script('wpb_js_theme_admin', $this->composer->assetURL('js/theme_admin.js'), array('jquery'), WPB_VC_VERSION, true); }
public function jsScripts() { wp_register_script('progressCircle', WPBakeryVisualComposer::getInstance()->assetURL('lib/progress-circle/ProgressCircle.js')); wp_register_script('vc_pie', WPBakeryVisualComposer::getInstance()->assetURL('js/jquery.vc_chart.js'), array('jquery', 'progressCircle')); //wp_enqueue_script('vc_pie'); }
function td_vc_init() { // Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page if (function_exists('vc_set_as_theme')) { vc_set_as_theme(true); } if (function_exists('wpb_map')) { //map all of our blocks in page builder td_global_blocks::wpb_map_all(); } if (function_exists('vc_disable_frontend')) { vc_disable_frontend(); } // @todo - this may not be requiered anynmore if (class_exists('WPBakeryVisualComposer')) { //disable visual composer updater $td_composer = WPBakeryVisualComposer::getInstance(); $td_composer->disableUpdater(); } }
function nectar_page_specific_js() { global $post; global $options; global $nectar_disable_vc; if (!is_object($post)) { $post = (object) array('post_content' => ' ', 'ID' => ' '); } $template_name = get_post_meta($post->ID, '_wp_page_template', true); //home if (is_page_template('template-home-1.php') || $template_name == 'salient/template-home-1.php' || is_page_template('template-home-2.php') || $template_name == 'salient/template-home-2.php' || is_page_template('template-home-3.php') || $template_name == 'salient/template-home-3.php' || is_page_template('template-home-4.php') || $template_name == 'salient/template-home-4.php') { wp_enqueue_script('orbit'); } ////infinite scroll $portfolio_extra_content = get_post_meta($post->ID, '_nectar_portfolio_extra_content', true); $posttype = get_post_type($post); if (stripos($post->post_content, '[nectar_blog') !== FALSE || stripos($portfolio_extra_content, '[nectar_blog') !== FALSE || stripos($post->post_content, 'pagination_type="infinite_scroll"') !== FALSE || stripos($portfolio_extra_content, 'pagination_type="infinite_scroll"') !== FALSE || !empty($options['blog_pagination_type']) && $options['blog_pagination_type'] == 'infinite_scroll' || !empty($options['portfolio_pagination_type']) && $options['portfolio_pagination_type'] == 'infinite_scroll' || (is_archive() || is_author() || is_category() || is_home() || is_tag()) && $posttype == 'post' && !is_singular()) { wp_register_script('infinite_scroll', get_template_directory_uri() . '/js/infinitescroll.js', array('jquery'), '1.0', TRUE); wp_enqueue_script('infinite_scroll'); if (floatval(get_bloginfo('version')) >= "3.6") { wp_enqueue_script('wp-mediaelement'); wp_enqueue_style('wp-mediaelement'); } if (class_exists('WPBakeryVisualComposerAbstract') && $nectar_disable_vc != '1') { wp_register_script('progressCircle', WPBakeryVisualComposer::getInstance()->assetURL('lib/progress-circle/ProgressCircle.js')); wp_register_script('vc_pie', WPBakeryVisualComposer::getInstance()->assetURL('js/jquery.vc_chart.js'), array('jquery', 'progressCircle')); wp_enqueue_script('vc_pie'); } } //nectarSlider mediaElement if (stripos($post->post_content, '[nectar_slider') !== FALSE || stripos($portfolio_extra_content, '[nectar_slider') !== FALSE || stripos($post->post_content, '[vc_gallery type="nectarslider_style"') !== FALSE || stripos($portfolio_extra_content, '[vc_gallery type="nectarslider_style"') !== FALSE) { if (floatval(get_bloginfo('version')) >= "3.6") { //wp_enqueue_script('wp-mediaelement'); //wp_enqueue_style('wp-mediaelement'); } else { //register media element for WordPress 3.5 //wp_register_script('wp-mediaelement', get_template_directory_uri() . '/js/mediaelement-and-player.min.js', array('jquery'), '1.0', TRUE); //wp_register_style('wp-mediaelement', get_template_directory_uri() . '/css/mediaelementplayer.min.css'); //wp_enqueue_script('wp-mediaelement'); //wp_enqueue_style('wp-mediaelement'); } wp_enqueue_script('nectarSlider'); } //comments if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } }
public function contentAdmin($atts, $content = null) { $width = $el_class = $title = ''; extract(shortcode_atts($this->predefined_atts, $atts)); $output = ''; $column_controls = $this->getColumnControls($this->settings('controls')); $column_controls_bottom = $this->getColumnControls('add', 'bottom-controls'); if ($width == 'column_14' || $width == '1/4') { $width = array('span3'); } else { if ($width == 'column_14-14-14-14') { $width = array('span3', 'span3', 'span3', 'span3'); } else { if ($width == 'column_13' || $width == '1/3') { $width = array('span4'); } else { if ($width == 'column_13-23') { $width = array('span4', 'span8'); } else { if ($width == 'column_13-13-13') { $width = array('span4', 'span4', 'span4'); } else { if ($width == 'column_12' || $width == '1/2') { $width = array('span6'); } else { if ($width == 'column_12-12') { $width = array('span6', 'span6'); } else { if ($width == 'column_23' || $width == '2/3') { $width = array('span8'); } else { if ($width == 'column_34' || $width == '3/4') { $width = array('span9'); } else { if ($width == 'column_16' || $width == '1/6') { $width = array('span2'); } else { $width = array(''); } } } } } } } } } } for ($i = 0; $i < count($width); $i++) { $output .= '<div class="group wpb_sortable">'; $output .= '<h3><span class="tab-label"><%= params.title %></span></h3>'; $output .= '<div ' . $this->mainHtmlBlockParams($width, 0) . '>'; $output .= str_replace("%column_size%", wpb_translateColumnWidthToFractional($width[0]), $column_controls); $output .= '<div class="wpb_element_wrapper">'; $output .= '<div ' . $this->containerHtmlBlockParams($width, 0) . '>'; $output .= '<%= params.text %>'; $output .= do_shortcode(shortcode_unautop($content)); $output .= WPBakeryVisualComposer::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; 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 .= '</div>'; $output .= str_replace("%column_size%", wpb_translateColumnWidthToFractional($width[$i]), $column_controls_bottom); $output .= '</div>'; $output .= '</div>'; } return $output; }
public function __construct($settings) { parent::__construct($settings); WPBakeryVisualComposer::getInstance()->addShortCode(array('base' => 'vc_accordion_tab')); }
/** * Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page */ if (function_exists('vc_set_as_theme')) { vc_set_as_theme(); } if (function_exists('wpb_map')) { //map all of our blocks in page builder td_global_blocks::wpb_map_all(); } if (function_exists('vc_disable_frontend')) { vc_disable_frontend(); } if (class_exists('WPBakeryVisualComposer')) { //disable visual composer updater $td_composer = WPBakeryVisualComposer::getInstance(); $td_composer->disableUpdater(); } /* to enable all the visual composer features from a child theme, declare an empty td_disable_visual_composer_features function like so in the child's functions.php: function td_disable_visual_composer_features() { } */ if (!function_exists('td_disable_visual_composer_features')) { function td_disable_visual_composer_features() { //if you want to enable all the features from visual composer delete this code if (function_exists('vc_remove_element')) { //remove unused composer elements; vc_remove_element("vc_separator");
public static function dropShortcode($name) { if (!self::$is_init) { vc_mapper()->addActivity('mapper', 'drop_shortcode', array('name' => $name)); return false; } unset(self::$sc[$name]); WPBakeryVisualComposer::getInstance()->removeShortCode($name); }
public function contentAdmin($atts, $content = null) { $width = ''; extract(shortcode_atts(array('width' => 'column_12'), $atts)); $output = ''; $column_controls = $this->getColumnControls('size_delete'); if ($width == 'column_14' || $width == '1/4') { $width = array('span3'); } else { if ($width == 'column_14-14-14-14') { $width = array('span3', 'span3', 'span3', 'span3'); } else { if ($width == 'column_14-12-14') { $width = array('span3', 'span6', 'span3'); } else { if ($width == 'column_12-14-14') { $width = array('span6', 'span3', 'span3'); } else { if ($width == 'column_14-14-12') { $width = array('span3', 'span3', 'span6'); } else { if ($width == 'column_13' || $width == '1/3') { $width = array('span4'); } else { if ($width == 'column_13-23') { $width = array('span4', 'span8'); } else { if ($width == 'column_23-13') { $width = array('span8', 'span4'); } else { if ($width == 'column_13-13-13') { $width = array('span4', 'span4', 'span4'); } else { if ($width == 'column_12' || $width == '1/2') { $width = array('span6'); } else { if ($width == 'column_12-12') { $width = array('span6', 'span6'); } else { if ($width == 'column_23' || $width == '2/3') { $width = array('span8'); } else { if ($width == 'column_34' || $width == '3/4') { $width = array('span9'); } else { $width = array('span12'); } } } } } } } } } } } } } for ($i = 0; $i < count($width); $i++) { $output .= '<div class="wpb_vc_column wpb_sortable wpb_droppable ' . $width[$i] . ' not-column-inherit">'; $output .= '<input type="hidden" class="wpb_vc_sc_base" name="" value="vc_column" />'; $output .= str_replace("%column_size%", wpb_translateColumnWidthToFractional($width[$i]), $column_controls); $output .= '<div class="wpb_element_wrapper">'; $output .= '<div class="row-fluid wpb_column_container wpb_sortable_container not-column-inherit">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= WPBakeryVisualComposer::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; } return $output; }
/** * Builds custom css file using css options from vc settings. * @return unknown */ public static function buildCustomCss() { /** * Filesystem API init. * */ $url = wp_nonce_url('options-general.php?page=wpb_vc_settings&build_css=1', 'wpb_js_settings_save_action'); self::getFileSystem($url); global $wp_filesystem; /** * Building css file. */ if (($js_composer_upload_dir = self::checkCreateUploadDir($wp_filesystem, 'custom_css', 'custom.css')) === false) { return; } $filename = $js_composer_upload_dir . '/custom.css'; $css_string = ''; $custom_css_string = get_option(self::$field_prefix . 'custom_css'); if (!empty($custom_css_string)) { $assets_url = WPBakeryVisualComposer::getInstance()->assetURL(''); $css_string .= preg_replace('/(url\\(\\.\\.\\/(?!\\.))/', 'url(' . $assets_url, $custom_css_string); } if (!$wp_filesystem->put_contents($filename, $css_string, FS_CHMOD_FILE)) { if (is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) { add_settings_error(self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), __('Something went wrong: custom.css could not be created.', 'js_composer') . $wp_filesystem->errors->get_error_message(), 'error'); } elseif (!$wp_filesystem->connect()) { add_settings_error(self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), __('custom.css could not be created. Connection error.', 'js_composer'), 'error'); } elseif (!$wp_filesystem->is_writable($filename)) { add_settings_error(self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), __('custom.css could not be created. Cannot write custom css to "' . $filename . '".', 'js_composer'), 'error'); } else { add_settings_error(self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), __('custom.css could not be created. Problem with access.', 'js_composer'), 'error'); } } }
/** * Themes Content types checkboxes list callback function */ public function theme_content_types_field_callback() { $pt_array = ($pt_array = get_option('wpb_js_theme_content_types')) ? $pt_array : WPBakeryVisualComposer::getInstance()->config('default_post_types'); foreach ($this->getPostTypes() as $pt) { if (!in_array($pt, $this->getExcluded())) { $checked = in_array($pt, $pt_array) ? ' checked="checked"' : ''; ?> <label> <input type="checkbox"<?php echo $checked; ?> value="<?php echo $pt; ?> " id="wpb_js_post_types_<?php echo $pt; ?> " name="<?php echo self::$field_prefix . 'theme_content_types'; ?> []"> <?php echo $pt; ?> </label><br> <?php } } ?> <p class="description indicator-hint"><?php _e("Select for which content types Visual Composer should be available during post creation/editing.", "js_composer"); ?> </p> <?php }
public function init() { register_setting('dhvc_form', 'dhvc_form'); if (post_type_exists('dhvcform')) { if (class_exists('WPBakeryVisualComposer') && method_exists('WPBakeryVisualComposer', 'isTheme') && WPBakeryVisualComposer::getInstance()->isTheme()) { $wpb_js_content_types = 'wpb_js_theme_content_types'; } else { $wpb_js_content_types = 'wpb_js_content_types'; } $pt_array = ($pt_array = get_option($wpb_js_content_types)) ? $pt_array : array('page'); if (!in_array('dhvcform', $pt_array)) { array_push($pt_array, 'dhvcform'); update_option($wpb_js_content_types, $pt_array); } } $this->setting_fields = array('general' => array('type' => 'heading', 'label' => __('General settings', DHVC_FORM)), 'allowed_file_extension' => array('type' => 'textarea', 'default' => 'zip,rar,tar,7z,jpg,jpeg,png,gif,pdf,doc,docx,ppt,pptx,xls,xlsx', 'label' => __('Allowed Files Upload Types', DHVC_FORM), 'help' => __('Which files are allowed in the attachments? (Separate the extensions by a comma)', DHVC_FORM)), 'date_format' => array('type' => 'text', 'label' => __('Date Format', DHVC_FORM), 'default' => 'Y/m/d'), 'time_format' => array('type' => 'text', 'label' => __('Time Format', DHVC_FORM), 'default' => 'H:i', 'help' => sprintf('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">%s</a>', __('Documentation on date and time formatting', DHVC_FORM))), 'time_picker_step' => array('type' => 'select', 'label' => __('Time picker step', DHVC_FORM), 'default' => '60', 'options' => array('5' => 5, '10' => 10, '15' => 15, '30' => 30, '60' => 60)), 'datetimepicker_lang' => array('type' => 'select', 'label' => __('Datetime Picker Language', DHVC_FORM), 'default' => 'en', 'options' => array('ar' => 'Arabic', 'az' => 'Azerbaijanian (Azeri)', 'bg' => 'Bulgarian', 'bs' => 'Bosanski', 'ca' => 'Català', 'ch' => 'Simplified Chinese', 'cs' => 'Čeština', 'da' => 'Dansk', 'de' => 'German', 'el' => 'Ελληνικά', 'en' => 'English', 'en-GB' => 'English (British)', 'es' => 'Spanish', 'et' => '"Eesti"', 'eu' => 'Euskara', 'fa' => 'Persian', 'fi' => 'Finnish (Suomi)', 'fr' => 'French', 'gl' => 'Galego', 'he' => 'Hebrew (עברית)', 'hr' => 'Hrvatski', 'hu' => 'Hungarian', 'id' => 'Indonesian', 'it' => 'Italian', 'ja' => 'Japanese', 'ko' => 'Korean (한국어)', 'kr' => 'Korean', 'lt' => 'Lithuanian (lietuvių)', 'lv' => 'Latvian (Latviešu)', 'mk' => 'Macedonian (Македонски)', 'mn' => 'Mongolian (Монгол)', 'nl' => 'Dutch', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'pt-BR' => 'Português(Brasil)', 'ro' => 'Romanian', 'ru' => 'Russian', 'se' => 'Swedish', 'sk' => 'Slovenčina', 'sl' => 'Slovenščina', 'sq' => 'Albanian (Shqip)', 'sr' => 'Serbian Cyrillic (Српски)', 'sr-YU' => 'Serbian (Srpski)', 'sv' => 'Svenska', 'th' => 'Thai', 'tr' => 'Turkish', 'uk' => 'Ukrainian', 'vi' => 'Vietnamese', 'zh' => 'Simplified Chinese (简体中文)', 'zh-TW' => 'Traditional Chinese (繁體中文)')), 'container_class' => array('type' => 'text', 'label' => __('Conditional Container Element', DHVC_FORM), 'default' => '.vc_row-fluid'), 'user' => array('type' => 'heading', 'label' => __('Users page settings', DHVC_FORM)), 'user_login' => array("type" => "select", "label" => __("Login page", DHVC_FORM), "options" => dhvc_form_get_pages(true)), 'user_logout_redirect_to' => array("type" => "select", "label" => __("Logout redirect to page", DHVC_FORM), "options" => dhvc_form_get_pages(true)), 'user_regiter' => array("type" => "select", "label" => __("Register page", DHVC_FORM), "options" => dhvc_form_get_pages(true)), 'user_forgotten' => array("type" => "select", "label" => __("Lost password page", DHVC_FORM), "options" => dhvc_form_get_pages(true)), 'email' => array('type' => 'heading', 'label' => __('Email settings', DHVC_FORM)), 'email_method' => array('type' => 'select', 'label' => __('Sender method', DHVC_FORM), 'default' => 'default', 'options' => array('default' => __('PHP Mailer', DHVC_FORM), 'smtp' => __('SMTP', DHVC_FORM))), 'smtp_host' => array('type' => 'text', 'label' => __('SMTP host', DHVC_FORM)), 'smtp_post' => array('type' => 'text', 'value' => 25, 'label' => __('SMTP port', DHVC_FORM)), 'smtp_encryption' => array('type' => 'select', 'label' => __('SMTP encryption', DHVC_FORM), 'options' => array('' => __('None', DHVC_FORM), 'tls' => __('TLS', DHVC_FORM), 'ssl' => __('SSL', DHVC_FORM))), 'smtp_username' => array('type' => 'text', 'label' => __('SMTP username', DHVC_FORM)), 'smtp_password' => array('type' => 'password', 'label' => __('SMTP password', DHVC_FORM)), 'recaptcha' => array('type' => 'heading', 'label' => __('reCaptcha settings', DHVC_FORM), 'help' => __('In order to use the reCAPTCHA element in your form you must <a target="_blank" href="https://www.google.com/recaptcha">sign up</a> for a free account to get your set of API keys.', DHVC_FORM)), 'recaptcha_public_key' => array('type' => 'text', 'label' => __('Public key (Site Key)', DHVC_FORM)), 'recaptcha_private_key' => array('type' => 'text', 'label' => __('Private key (Secret Key)', DHVC_FORM)), 'mailchimp' => array('type' => 'heading', 'label' => __('MailChimp settings', DHVC_FORM)), 'mailchimp_api' => array('type' => 'text', 'label' => __('MailChimp API Key', DHVC_FORM), 'help' => __('Enter your API Key. <a href="http://admin.mailchimp.com/account/api-key-popup" target="_blank">Get your API key</a>', DHVC_FORM)), 'mailchimp_list' => array('type' => 'mailchimp_list', 'label' => __('MailChimp List', DHVC_FORM), 'options' => array('' => __('Nothing Found...', DHVC_FORM)), 'help' => __('After you add your MailChimp API Key above and save it this list will be populated.', DHVC_FORM)), 'mailchimp_opt_in' => array('type' => 'checkbox', 'label' => __('Enable Double Opt-In', DHVC_FORM), 'help' => __("Learn more about <a href='http://kb.mailchimp.com/article/how-does-confirmed-optin-or-double-optin-work' target='_blank'>Double Opt-in</a>.", DHVC_FORM)), 'mailchimp_welcome_email' => array('type' => 'checkbox', 'label' => __('Send Welcome Email', DHVC_FORM), 'help' => __("If your Double Opt-in is false and this is true, MailChimp will send your lists Welcome Email if this subscribe succeeds - this will not fire if MailChimp ends up updating an existing subscriber. If Double Opt-in is true, this has no effect. Learn more about <a href='http://blog.mailchimp.com/sending-welcome-emails-with-mailchimp/' target='_blank'>Welcome Emails</a>.", DHVC_FORM)), 'mailchimp_group_name' => array('type' => 'text', 'label' => __('Group Name', DHVC_FORM), 'help' => __('Optional: Enter the name of the group. Learn more about <a href="http://mailchimp.com/features/groups/" target="_blank">Groups</a>', DHVC_FORM)), 'mailchimp_group' => array('type' => 'text', 'label' => __('Group', DHVC_FORM), 'help' => __('Optional: Comma delimited list of interest groups to add the email to.', DHVC_FORM)), 'mailchimp_replace_interests' => array('type' => 'checkbox', 'label' => __('Replace Interests', DHVC_FORM), 'help' => __("Whether MailChimp will replace the interest groups with the groups provided or add the provided groups to the member's interest groups.", DHVC_FORM))); $this->meta_boxs = array(array("type" => "heading", "label" => __('General', DHVC_FORM)), array("type" => "checkbox", "label" => __("Save Submitted Form to Data ?", DHVC_FORM), "name" => "save_data", "cbvalue" => 1, 'description' => __('If checked, the submitted form data will be saved to your database.', DHVC_FORM)), array("type" => "checkbox", "label" => __("Use Form AJAX ? ", DHVC_FORM), "name" => "use_ajax", 'description' => __('You can not upload file if use form AJAX', DHVC_FORM), "cbvalue" => 1), array("type" => "select", "label" => __("Action Type", DHVC_FORM), "name" => "action_type", "options" => array('default' => __('Default', DHVC_FORM), 'external_url' => __('External URL', DHVC_FORM))), array("type" => "select", "label" => __("Use form action", DHVC_FORM), "name" => "form_action", "options" => $this->_get_form_acition_options()), array("type" => "checklist", "label" => __("Mailpoet subscribers to These Lists", DHVC_FORM), "name" => "mailpoet", "options" => dhvc_form_get_mailpoet_subscribers_list()), array("type" => "checklist", "label" => __("Mymail subscribers to These Lists", DHVC_FORM), "name" => "mymail", "options" => dhvc_form_get_mymail_subscribers_list()), array("type" => "checkbox", "label" => __("Mymail Double Opt In ", DHVC_FORM), "name" => "mymail_double_opt_in", 'description' => __('Users have to confirm their subscription', DHVC_FORM), "cbvalue" => 1), array("type" => "text", "label" => __("Enter URL", DHVC_FORM), "name" => "action_url", "dependency" => array('element' => "action_type", 'value' => array('external_url')), 'description' => __('Enter a action URL.', DHVC_FORM)), array("type" => "select", "label" => __("Method", DHVC_FORM), "name" => "method", "options" => array('post' => __('Post', DHVC_FORM), 'get' => __('Get', DHVC_FORM))), array("type" => "heading", "label" => __('Successful submit settings', DHVC_FORM)), array("type" => "select", "label" => __("On successful submit", DHVC_FORM), "name" => "on_success", "options" => array('message' => __('Display a message', DHVC_FORM), 'redirect' => __('Redirect to another page', DHVC_FORM))), array("type" => "textarea_variable", "label" => __("Message", DHVC_FORM), "name" => "message", "value" => 'Your message has been sent. Thanks!', "dependency" => array('element' => "on_success", 'value' => array('message')), 'description' => __('This is the text or HTML that is displayed when the form is successfully submitted', DHVC_FORM)), array("type" => "select", "label" => __("Message Position", DHVC_FORM), "name" => "message_position", "options" => array('top' => __('Top', DHVC_FORM), 'bottom' => __('Bottom', DHVC_FORM))), array("type" => "select", "label" => __("Redirect to", DHVC_FORM), "name" => "redirect_to", "dependency" => array('element' => "on_success", 'value' => array('redirect')), "options" => array('to_page' => __('Page', DHVC_FORM), 'to_post' => __('Post', DHVC_FORM), 'to_url' => __('Url', DHVC_FORM)), "description" => __('When the form is successfully submitted you can redirect the user to post, page or URL.', DHVC_FORM)), array("type" => "select", "label" => __("Select page", DHVC_FORM), "name" => "page", "options" => dhvc_form_get_pages(), "dependency" => array('element' => "redirect_to", 'value' => array('to_page'))), array("type" => "select", "label" => __("Select post", DHVC_FORM), "name" => "post", "options" => dhvc_form_get_posts(), "dependency" => array('element' => "redirect_to", 'value' => array('to_post'))), array("type" => "text", "label" => __("Enter URL", DHVC_FORM), "name" => "url", "dependency" => array('element' => "redirect_to", 'value' => array('to_url'))), array("type" => "heading", "label" => __('Notifications email settings', DHVC_FORM)), array("type" => "checkbox", "label" => __("Send form data via email ?", DHVC_FORM), "name" => "notice", "cbvalue" => 1), array('type' => 'text', 'label' => __('Sender Name', DHVC_FORM), 'name' => 'notice_name', 'value' => get_bloginfo('name'), "dependency" => array('element' => "notice", 'not_empty' => true)), array('type' => 'select', 'label' => __('Sender Email Type', DHVC_FORM), 'name' => 'notice_email_type', 'value' => 'email_text', 'options' => array('email_text' => __('Email', DHVC_FORM), 'email_field' => __('Email Field', DHVC_FORM)), "dependency" => array('element' => "notice", 'not_empty' => true)), array('type' => 'text', 'label' => __('Sender Email', DHVC_FORM), 'name' => 'notice_email', 'value' => get_bloginfo('admin_email'), "dependency" => array('element' => "notice", 'not_empty' => true)), array('type' => 'select_recipient', 'label' => __('Sender Field', DHVC_FORM), 'name' => 'notice_variables', "description" => __('The form must have at least one Email Address element to use this feature.', DHVC_FORM)), array('type' => 'recipient', 'label' => __('Recipients', DHVC_FORM), 'name' => 'notice_recipients', 'value' => get_bloginfo('admin_email'), "dependency" => array('element' => "notice", 'not_empty' => true), "description" => __('Add email address(es) which the submitted form data will be sent to.', DHVC_FORM)), array('type' => 'input_variable', 'label' => __('Email subject', DHVC_FORM), 'name' => 'notice_subject', "dependency" => array('element' => "notice", 'not_empty' => true), 'value' => __('New form submission', DHVC_FORM)), array('type' => 'textarea_variable', 'label' => __('Email body', DHVC_FORM), 'name' => 'notice_body', 'value' => '[form_body]', "description" => __("Use the label [form_body] to insert the form data in the email body. To use form control in email. please enter form control variables <strong>[form_control_name]</strong> in email.", DHVC_FORM)), array("type" => "checkbox", "label" => __("Use HTML content type ?", DHVC_FORM), "name" => "notice_html", "cbvalue" => 1), array("type" => "heading", "label" => __('Autoreply email settings', DHVC_FORM)), array("type" => "checkbox", "label" => __("Send autoreply email ?", DHVC_FORM), "name" => "reply", "cbvalue" => 1), array('type' => 'text', 'label' => __('Sender Name', DHVC_FORM), 'name' => 'reply_name', 'value' => get_bloginfo('name'), "dependency" => array('element' => "reply", 'not_empty' => true)), array('type' => 'text', 'label' => __('Sender Email', DHVC_FORM), 'name' => 'reply_email', 'value' => get_bloginfo('admin_email'), "dependency" => array('element' => "reply", 'not_empty' => true)), array('type' => 'select_recipient', 'label' => __('Recipients', DHVC_FORM), 'name' => 'reply_recipients', "description" => __('The form must have at least one Email Address element to use this feature.', DHVC_FORM)), array('type' => 'input_variable', 'label' => __('Email subject', DHVC_FORM), 'name' => 'reply_subject', "dependency" => array('element' => "reply", 'not_empty' => true), 'value' => __('Just Confirming', DHVC_FORM)), array('type' => 'textarea_variable', 'label' => __('Email body', DHVC_FORM), 'name' => 'reply_body', "dependency" => array('element' => "reply", 'not_empty' => true), 'value' => __('This is just a confirmation message. We have received you reply.', DHVC_FORM), "description" => __("Use the label [form_body] to insert the form data in the email body. To use form control in email. please enter form control variables <strong>[form_control_name]</strong> in email.", DHVC_FORM)), array("type" => "checkbox", "label" => __("Use HTML content type ?", DHVC_FORM), "name" => "reply_html", "cbvalue" => 1), array("type" => "heading", "label" => __('Form popup settings', DHVC_FORM)), array("type" => "checkbox", "label" => __("Display the form in a popup ?", DHVC_FORM), "name" => "form_popup", "cbvalue" => 1), array("type" => "labelpopup", "name" => 'form_popup_labelpopup', "label" => __('Set data-toggle="dhvcformpopup" on a controller element, like a button, along with a data-target="#dhvcformpopup-{form_ID}" or href="#dhvcformpopup-{form_ID}" to target a specific form popup to toggle.', DHVC_FORM)), array("type" => "checkbox", "label" => __("Show popup title ?", DHVC_FORM), "name" => "form_popup_title", "cbvalue" => 1), array('type' => 'text', 'label' => __('Form popup width (px)', DHVC_FORM), 'name' => 'form_popup_width', 'value' => 600), array("type" => "checkbox", "label" => __("Auto open popup ?", DHVC_FORM), "name" => "form_popup_auto_open", "cbvalue" => 1, "description" => __('If selected, form popup will auto open when load page.', DHVC_FORM)), array('type' => 'text', 'label' => __('Popup open delay (ms)', DHVC_FORM), 'name' => 'form_popup_auto_open_delay', 'value' => 2000, "description" => __('Time delay for open popup.', DHVC_FORM)), array("type" => "checkbox", "label" => __("Auto close popup ?", DHVC_FORM), "name" => "form_popup_auto_close", "cbvalue" => 1, "description" => __('If selected, form popup will auto close.', DHVC_FORM)), array('type' => 'text', 'label' => __('Popup close delay (ms)', DHVC_FORM), 'name' => 'form_popup_auto_close_delay', 'value' => 10000, "description" => __('Time delay for close popup.', DHVC_FORM)), array("type" => "checkbox", "label" => __("Only one time ?", DHVC_FORM), "name" => "form_popup_one", "cbvalue" => 1, "description" => __('If selected,form will opens only on the first visit your site.', DHVC_FORM)), array("type" => "heading", "label" => __('Style settings', DHVC_FORM)), array("type" => "select", "label" => __("Form layout", DHVC_FORM), "name" => "form_layout", "options" => array('vertical' => __('Vertical', DHVC_FORM), 'horizontal' => __('Horizontal', DHVC_FORM))), array("type" => "select", "label" => __("Input icon position", DHVC_FORM), "name" => "input_icon_position", "options" => array('right' => __('Right', DHVC_FORM), 'left' => __('Left', DHVC_FORM))), array('type' => 'color', 'label' => __('Label Color', DHVC_FORM), 'name' => 'label_color'), array('type' => 'color', 'label' => __('Input Placeholder Text Color', DHVC_FORM), 'name' => 'placeholder_color'), array('type' => 'text', 'label' => __('Input Height (example enter:40px)', DHVC_FORM), 'name' => 'input_height'), array('type' => 'color', 'label' => __('Input Background Color', DHVC_FORM), 'name' => 'input_bg_color'), array('type' => 'color', 'label' => __('Input Text Color', DHVC_FORM), 'name' => 'input_text_color'), array('type' => 'color', 'label' => __('Input border color', DHVC_FORM), 'name' => 'input_border_color'), array('type' => 'text', 'label' => __('Input border Size (example enter:1px)', DHVC_FORM), 'name' => 'input_border_size'), array('type' => 'color', 'label' => __('Input hover border color', DHVC_FORM), 'name' => 'input_hover_border_color'), array('type' => 'color', 'label' => __('Input focus border color', DHVC_FORM), 'name' => 'input_focus_border_color'), array('type' => 'text', 'label' => __('Button Height (example enter:40px)', DHVC_FORM), 'name' => 'button_height'), array('type' => 'color', 'label' => __('Button background color', DHVC_FORM), 'name' => 'button_bg_color'), array('type' => 'textarea', 'label' => __('Additional Settings', DHVC_FORM), "description" => __('Trigger with form AJAX.', DHVC_FORM), 'name' => 'additional_setting')); }
/** * WPBakery Visual Composer helpers functions * * @package WPBakeryVisualComposer * */ function visual_composer() { return WPBakeryVisualComposer::getInstance(); }
public function loadDefaultParams() { global $vc_params_list; if (empty($vc_params_list)) { return false; } $script_url = WPBakeryVisualComposer::getInstance()->assetURL('js/params/all.js'); foreach ($vc_params_list as $param) { add_shortcode_param($param, 'vc_' . $param . '_form_field', $script_url); } }
public function registerJavascript() { wp_register_script('isotope', $this->composer->assetURL('lib/isotope/jquery.isotope.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_bootstrap_modals_js', $this->composer->assetURL('lib/bootstrap_modals/js/bootstrap.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_scrollTo_js', $this->composer->assetURL('lib/scrollTo/jquery.scrollTo.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_php_js', $this->composer->assetURL('lib/php.default/php.default.min.js'), array('jquery'), WPB_VC_VERSION, true); wp_register_script('wpb_json-js', $this->composer->assetURL('lib/json-js/json2.js'), false, WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_tools', $this->composer->assetURL('js/backend/composer-tools.js'), array('jquery', 'backbone', 'wpb_json-js'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_atts', $this->composer->assetURL('js/backend/composer-atts.js'), array('wpb_js_composer_js_tools'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_storage', $this->composer->assetURL('js/backend/composer-storage.js'), array('wpb_js_composer_js_atts'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_models', $this->composer->assetURL('js/backend/composer-models.js'), array('wpb_js_composer_js_storage'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_view', $this->composer->assetURL('js/backend/composer-view.js'), array('wpb_js_composer_js_models'), WPB_VC_VERSION, true); wp_register_script('wpb_js_composer_js_custom_views', $this->composer->assetURL('js/backend/composer-custom-views.js'), array('wpb_js_composer_js_view'), WPB_VC_VERSION, true); wp_register_script('wpb_jscomposer_media_editor_js', $this->composer->assetURL('js/backend/media-editor.js'), array('wpb_js_composer_js_view'), WPB_VC_VERSION, true); wp_register_script('wpb_jscomposer_autosuggest_js', $this->composer->assetURL('lib/autosuggest/jquery.autoSuggest.js'), array('wpb_js_composer_js_view'), WPB_VC_VERSION, true); wp_register_script('wpb_jscomposer_teaser_js', WPBakeryVisualComposer::getInstance()->assetURL('js/backend/composer-teaser.js'), array(), WPB_VC_VERSION, true); wp_localize_script('wpb_js_composer_js_view', 'i18nLocale', array('add_remove_picture' => __('Add/remove picture', 'js_composer'), 'finish_adding_text' => __('Finish Adding Images', 'js_composer'), 'add_image' => __('Add Image', 'js_composer'), 'add_images' => __('Add Images', 'js_composer'), 'client' => __('Client', 'js_composer'), 'column' => __('Column', 'js_composer'), 'item' => __('Item', 'js_composer'), 'main_button_title' => __('Visual Composer', 'js_composer'), 'main_button_title_revert' => __('Classic editor', 'js_composer'), 'please_enter_templates_name' => __('Please enter templates name', 'js_composer'), 'confirm_deleting_template' => __('Confirm deleting "{template_name}" template, press Cancel to leave. This action cannot be undone.', 'js_composer'), 'press_ok_to_delete_section' => __('Press OK to delete section, Cancel to leave', 'js_composer'), 'drag_drop_me_in_column' => __('Drag and drop me in the column', 'js_composer'), 'press_ok_to_delete_tab' => __('Press OK to delete "{tab_name}" tab, Cancel to leave', 'js_composer'), 'slide' => __('Slide', 'js_composer'), 'tab' => __('Tab', 'js_composer'), 'testimonial' => __('Testimonial', 'js_composer'), 'section' => __('Section', 'js_composer'), 'please_enter_new_tab_title' => __('Please enter new tab title', 'js_composer'), 'press_ok_delete_section' => __('Press OK to delete "{tab_name}" section, Cancel to leave', 'js_composer'), 'section_default_title' => __('Section', 'js_composer'), 'please_enter_section_title' => __('Please enter new section title', 'js_composer'), 'error_please_try_again' => __('Error. Please try again.', 'js_composer'), 'if_close_data_lost' => __('If you close this window all shortcode settings will be lost. Close this window?', 'js_composer'), 'header_select_element_type' => __('Select element type', 'js_composer'), 'header_media_gallery' => __('Media gallery', 'js_composer'), 'header_element_settings' => __('Element settings', 'js_composer'), 'add_tab' => __('Add tab', 'js_composer'), 'are_you_sure_convert_to_new_version' => __('Are you sure you want to convert to new version?', 'js_composer'), 'loading' => __('Loading...', 'js_composer'), 'set_image' => __('Set Image', 'js_composer'), 'are_you_sure_reset_css_classes' => __('Are you sure taht you want to remove all your data?', 'js_composer'), 'loop_frame_title' => __('Loop settings'), 'enter_custom_layout' => __('Enter custom layout for your row:', 'js_composer'), 'wrong_cells_layout' => __('Wrong row layout format! Example: 1/2 + 1/2 or span6 + span6.', 'js_composer'), 'row_background_color' => __('Row background color', 'js_composer'), 'row_background_image' => __('Row background image', 'js_composer'))); wp_register_script('wpb_js_theme_admin', $this->composer->assetURL('js/theme_admin.js'), array('jquery'), WPB_VC_VERSION, true); }
public static function dropShortcode($name) { unset(self::$sc[$name]); WPBakeryVisualComposer::getInstance()->removeShortCode($name); }
public function contentAdmin($atts, $content = null) { $width = $el_class = $title = ''; extract(shortcode_atts($this->predefined_atts, $atts)); $output = ''; $column_controls = $this->getColumnControls($this->settings('controls')); $column_controls_bottom = $this->getColumnControls('add', 'bottom-controls'); if ($width == 'column_14' || $width == '1/4') { $width = array('span3'); } else { if ($width == 'column_14-14-14-14') { $width = array('span3', 'span3', 'span3', 'span3'); } else { if ($width == 'column_13' || $width == '1/3') { $width = array('span4'); } else { if ($width == 'column_13-23') { $width = array('span4', 'span8'); } else { if ($width == 'column_13-13-13') { $width = array('span4', 'span4', 'span4'); } else { if ($width == 'column_12' || $width == '1/2') { $width = array('span6'); } else { if ($width == 'column_12-12') { $width = array('span6', 'span6'); } else { if ($width == 'column_23' || $width == '2/3') { $width = array('span8'); } else { if ($width == 'column_34' || $width == '3/4') { $width = array('span9'); } else { if ($width == 'column_16' || $width == '1/6') { $width = array('span2'); } else { $width = array(''); } } } } } } } } } } for ($i = 0; $i < count($width); $i++) { $output .= '<div class="group wpb_sortable">'; $output .= '<div class="wpb_element_wrapper">'; $output .= '<div class="row-fluid wpb_row_container not-row-inherit">'; $output .= '<h3 class="accordion_header"><a href="#">' . $title . '</a></h3>'; $output .= '<div ' . $this->mainHtmlBlockParams($width, $i) . '>'; $output .= '<input type="hidden" class="wpb_vc_sc_base" name="" value="' . $this->settings['base'] . '" />'; $output .= str_replace("%column_size%", wpb_translateColumnWidthToFractional($width[$i]), $column_controls); $output .= '<div class="wpb_element_wrapper">'; $output .= '<div class="row-fluid wpb_column_container wpb_sortable_container wpb_' . $this->settings['base'] . '_container wpb_container_block wpb_no_content_element_inside wpb_nested_accordion_inside wpb_nested_tabs_inside">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= WPBakeryVisualComposer::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; if (isset($this->settings['params'])) { $inner = ''; foreach ($this->settings['params'] as $param) { $param_value = ${$param}['param_name']; //var_dump($param_value); 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 .= '</div>'; $output .= str_replace("%column_size%", wpb_translateColumnWidthToFractional($width[$i]), $column_controls_bottom); $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; } return $output; }
public function jsCssScripts() { wp_register_script('vc_bxslider', WPBakeryVisualComposer::getInstance()->assetURL('lib/bxslider-4/jquery.bxslider.min.js')); wp_register_style('vc_bxslider_css', WPBakeryVisualComposer::getInstance()->assetURL('lib/bxslider-4/jquery.bxslider.css')); }