/** * Create new btn * * @param $value * @param $data * * @since 4.5 * * @return mixed */ function vc_gitem_template_attribute_vc_btn($value, $data) { /** * @var Wp_Post $post * @var string $data */ extract(array_merge(array('post' => null, 'data' => ''), $data)); return vc_include_template('params/vc_grid_item/attributes/vc_btn.php', array('post' => $post, 'data' => $data)); }
public function render() { $this->post_id = vc_request_param('post_id'); $this->shortcodes_string = stripslashes(vc_request_param('shortcodes_string', true)); require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php'); $grid_item = new Vc_Grid_Item(); $grid_item->setIsEnd(false); $grid_item->setGridAttributes(array('element_width' => 4)); $grid_item->setTemplate($this->shortcodes_string, $this->post_id); $this->enqueue(); vc_include_template('params/vc_grid_item/preview.tpl.php', array('preview' => $this, 'grid_item' => $grid_item, 'shortcodes_string' => $this->shortcodes_string, 'post' => $this->mockingPost(), 'default_width_value' => apply_filters('vc_grid_item_preview_render_default_width_value', 4))); }
<?php vc_include_template('pages/partials/vc-roles-parts/_part.tpl.php', array('part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who($role)->part($part), 'options' => array(array(true, __('Enabled', 'js_composer')), array(false, __('Disabled', 'js_composer'))), 'main_label' => __('Grid Builder', 'js_composer'), 'custom_label' => __('Grid Builder', 'js_composer'), 'description' => __('Control user access to Grid Builder and Grid Builder Elements.', 'js_composer')));
<?php if (!defined('ABSPATH')) { die('-1'); } ?> <div class="vc_ui-font-open-sans vc_ui-panel-window vc_media-xs vc_ui-panel" data-vc-panel=".vc_ui-panel-header-header" data-vc-ui-element="panel-add-element" id="vc_ui-panel-add-element"> <div class="vc_ui-panel-window-inner"> <?php vc_include_template('editors/popups/vc_ui-header.tpl.php', array('title' => __('Add Element', 'js_composer'), 'controls' => array('close'), 'header_css_class' => 'vc_ui-add-element-header-container', 'content_template' => 'editors/partials/add_element_tabs.tpl.php', 'search_template' => 'editors/partials/add_element_search.tpl.php', 'template_variables' => $template_variables)); ?> <div class="vc_ui-panel-content-container"> <div class="vc_add-element-container"> <div class="wpb-elements-list vc_filter-all" data-vc-ui-filter="*" data-vc-ui-element="panel-add-element-list"> <ul class="wpb-content-layouts-container"> <li class="vc_add-element-deprecated-warning"> <div class="wpb_element_wrapper"> <?php echo vc_message_warning(__('Elements within this list are deprecated and are no longer supported in newer versions of Visual Composer.', 'js_composer')); ?> </div> </li> <li><?php echo $box->getControls(); ?> </li> <?php if ($box->isShowEmptyMessage() && true !== $box->getPartState()) { ?>
<a href="<?php echo esc_attr(admin_url('admin.php?page=vc-general')); ?> " class="button button-primary"><?php _e('Settings', 'js_composer'); ?> </a><?php } ?> <a href="https://twitter.com/share" class="twitter-share-button" data-text="Take full control over your WordPress site with Visual Composer page builder by @WPBakery" data-url="http://vc.wpbakery.com" data-size="large">Tweet</a> <script>! function ( d, s, id ) { var js, fjs = d.getElementsByTagName( s )[ 0 ], p = /^http:/.test( d.location ) ? 'http' : 'https'; if ( ! d.getElementById( id ) ) { js = d.createElement( s ); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore( js, fjs ); } }( document, 'script', 'twitter-wjs' );</script> </p> <?php vc_include_template('/pages/partials/_tabs.php', array('slug' => $page->getSlug(), 'active_tab' => $active_page->getSlug(), 'tabs' => $pages)); ?> <?php echo $active_page->render(); ?> </div>
/** * @since 4.7 * */ public function renderUITemplate() { vc_include_template('editors/popups/vc_ui-panel-templates.tpl.php', array('box' => $this)); }
public function render() { vc_include_template('editors/popups/vc_ui-panel-add-element.tpl.php', array('box' => $this, 'template_variables' => array('categories' => $this->getCategories()))); }
'[vc_gitem_row position="middle"]' + '[vc_gitem_col width="1/2"][/vc_gitem_col]' + '[vc_gitem_col width="1/2"][/vc_gitem_col]' + '[/vc_gitem_row]' + '[vc_gitem_row position="bottom"]' + '[vc_gitem_col width="1/1"][/vc_gitem_col]' + '[/vc_gitem_row]' + '[/vc_gitem_zone_a]' + '[vc_gitem_zone_b]' + '[vc_gitem_row position="top"]' + '[vc_gitem_col width="1/1"][/vc_gitem_col]' + '[/vc_gitem_row]' + '[vc_gitem_row position="middle"]' + '[vc_gitem_col width="1/2"][/vc_gitem_col]' + '[vc_gitem_col width="1/2"][/vc_gitem_col]' + '[/vc_gitem_row]' + '[vc_gitem_row position="bottom"]' + '[vc_gitem_col width="1/1"][/vc_gitem_col]' + '[/vc_gitem_row]' + '[/vc_gitem_zone_b]' + '[/vc_gitem_animated_block]' + '[/vc_gitem]'; </script> <?php vc_include_template('editors/partials/backend-shortcodes-templates.tpl.php'); do_action('vc_backend_editor_render'); do_action('vc_vc_grid_item_editor_render'); do_action('vc_ui-template-preview'); // fix bug #59741644518985 in firefox wp_dequeue_script('isotope'); require_once ABSPATH . 'wp-admin/admin-footer.php';
/** * @return string */ public function render() { ob_start(); vc_include_template('params/column_offset/template.tpl.php', array('settings' => $this->settings, 'value' => $this->value, 'data' => $this->valueData(), 'sizes' => $this->size_types, 'param' => $this)); return ob_get_clean(); }
/** * Build new modern controls for shortcode. * * @param string $extended_css * * @return string */ public function getColumnControlsModular($extended_css = '') { ob_start(); vc_include_template(apply_filters('vc_wpbakery_shortcode_get_column_controls_modular_template', $this->controls_template_file), array('shortcode' => $this->shortcode, 'position' => $this->controls_css_settings, 'extended_css' => $extended_css, 'name' => $this->settings('name'), 'controls' => $this->getControlsList(), 'name_css_class' => $this->getBackendEditorControlsElementCssClass(), 'add_allowed' => $this->getAddAllowed())); return ob_get_clean(); }
<?php $tabs = array(); foreach (vc_settings()->getTabs() as $tab => $title) { $tabs[] = array($tab . '-tab', $title); } vc_include_template('pages/partials/vc-roles-parts/_part.tpl.php', array('part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who($role)->part($part), 'custom_value' => 'custom', 'capabilities' => $tabs, 'options' => array(array(true, __('All', 'js_composer')), array('custom', __('Custom', 'js_composer')), array(false, __('Disabled', 'js_composer'))), 'main_label' => __('Settings options', 'js_composer'), 'custom_label' => __('Settings options', 'js_composer'), 'description' => __('Control access rights to Visual Composer admin settings tabs (e.g. General Settings, Shortcode Mapper, ...)', 'js_composer')));
/** * Render template. */ public function render() { vc_include_template('editors/navbar/navbar.tpl.php', array('css_class' => $this->css_class, 'controls' => $this->getControls(), 'nav_bar' => $this, 'post' => $this->post())); }
/** * Build new modern controls for shortcode. * * @param string $position - y,x position where to put controls inside block * Possible $position values * cc - center center position of the block * tl - top left * tr - top right * br - bottom right * @param string $extended_css * @return string */ public function getColumnControlsModular($extended_css = '') { ob_start(); vc_include_template($this->controls_template_file, array('position' => $this->controls_css_settings, 'extended_css' => $extended_css, 'name' => $this->settings('name'), 'controls' => $this->controls_list)); return ob_get_clean(); }
<?php vc_include_template('pages/partials/vc-roles-parts/_part.tpl.php', array('part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who($role)->part($part), 'options' => array(array(true, __('All', 'js_composer')), array('add', __('Apply presets only', 'js_composer')), array(false, __('Disabled', 'js_composer'))), 'main_label' => __('Element Presets', 'js_composer'), 'description' => __('Control access rights to element presets in element edit form. Note: "Apply presets only" restricts users from saving new presets, deleting existing and setting defaults.', 'js_composer')));
echo vc_generate_nonce('vc-admin-nonce'); ?> '; </script> <script type="text/html" id="vc_settings-image-block"> <li class="added"> <div class="inner" style="width: 80px; height: 80px; overflow: hidden;text-align: center;"> <img rel="{{ id }}" src="<# if(sizes && sizes.thumbnail) { #>{{ sizes.thumbnail.url }}<# } else {#>{{ url }}<# } #>"/> </div> <a href="#" class="vc_icon-remove"></a> </li> </script> <?php foreach (WpbMap_Grid_Item::getShortCodes() as $sc_base => $el) { ?> <script type="text/html" id="vc_shortcode-template-<?php echo $sc_base; ?> "> <?php echo visual_composer()->getShortCode($sc_base)->template(); ?> </script> <?php } ?> <?php vc_include_template('editors/partials/access-manager-js.tpl.php');
/** * @since 4.4 * @return mixed|string */ public function render() { $output = ""; $edit_form = new Vc_ParamGroup_Edit_Form_Fields($this->settings); $settings = $this->settings; $output .= '<ul class="vc_param_group-list vc_settings" data-settings="' . htmlentities(json_encode($settings), ENT_QUOTES, "utf-8") . '">'; $template = vc_include_template('params/param_group/content.tpl.php'); // Parsing values if (!empty($this->value)) { foreach ($this->value as $values) { $output .= $template; $value_block = "<div class='vc_param_group-wrapper vc_clearfix'>"; $data = $values; foreach ($this->settings['params'] as $param) { $param_value = isset($data[$param['param_name']]) ? $data[$param['param_name']] : (isset($param['value']) ? $param['value'] : ""); $param['param_name'] = $this->settings['param_name'] . '_' . $param['param_name']; $value_block .= $edit_form->renderField($param, $param_value); } $value_block .= "</div>"; $output = str_replace('%content%', $value_block, $output); } } else { $output .= $template; } // Empty fields wrapper and Add new fields wrapper $content = "<div class='vc_param_group-wrapper vc_clearfix'>"; foreach ($this->settings['params'] as $param) { $param['param_name'] = $this->settings['param_name'] . '_' . $param['param_name']; $content .= $edit_form->renderField($param, isset($param['value']) ? $param['value'] : ""); } $content .= "</div>"; $output = str_replace('%content%', $content, $output); // And button on bottom $output .= '<li class="wpb_column_container vc_container_for_children vc_param_group-add_content vc_empty-container"></li></ul>'; $add_template = vc_include_template('params/param_group/add.tpl.php'); $add_template = str_replace('%content%', $content, $add_template); $output .= '<script type="text/html" class="vc_param_group-template">' . json_encode($add_template) . '</script>'; $output .= '<input name="' . $this->settings['param_name'] . '" class="wpb_vc_param_value ' . $this->settings['param_name'] . ' ' . $this->settings['type'] . '_field" type="hidden" value="' . $this->unparsed_value . '" />'; return $output; }
/** * Return rendered title prompt * * @since 4.7 * * @return string */ function vc_action_render_settings_preset_title_prompt() { vc_user_access()->checkAdminNonce()->validateDie()->wpAny('edit_posts', 'edit_pages')->validateDie()->part('presets')->can()->validateDie(); ob_start(); vc_include_template(apply_filters('vc_render_settings_preset_title_prompt', 'editors/partials/prompt.tpl.php')); $html = ob_get_clean(); $response = array('success' => true, 'html' => $html); wp_send_json($response); }
<?php if (!defined('ABSPATH')) { die('-1'); } vc_include_template('pages/partials/vc-roles-parts/_part.tpl.php', array('part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who($role)->part($part), 'custom_value' => 'custom', 'capabilities' => WPBMap::getSortedAllShortCodes(), 'ignore_capabilities' => array('vc_gitem', 'vc_gitem_animated_block', 'vc_gitem_zone', 'vc_gitem_zone_a', 'vc_gitem_zone_b', 'vc_gitem_zone_c', 'vc_column', 'vc_row_inner', 'vc_column_inner', 'vc_posts_grid'), 'categories' => WPBMap::getCategories(), 'cap_types' => array(array('all', __('All', 'js_composer')), array('edit', __('Edit', 'js_composer'))), 'item_header_name' => __('Element', 'js_composer'), 'options' => array(array(true, __('All', 'js_composer')), array('edit', __('Edit only', 'js_composer')), array('custom', __('Custom', 'js_composer'))), 'main_label' => __('Elements', 'js_composer'), 'custom_label' => __('Elements', 'js_composer'), 'description' => __('Control user access to content elements.', 'js_composer'), 'use_table' => true));
vc_vendor_settings_presets = <?php echo json_encode($vc_vendor_settings_presets); ?> , vc_settings_presets = <?php echo json_encode($vc_settings_presets); ?> , vc_roles = [], // @todo fix_roles BC for roles vcAdminNonce = '<?php echo vc_generate_nonce('vc-admin-nonce'); ?> '; </script> <?php vc_include_template('editors/partials/vc_settings-image-block.tpl.php'); ?> <div style="height: 1px; visibility: hidden; overflow: hidden;"> <?php // Disable notice in edit-form-advanced.php $is_IE = false; require_once ABSPATH . 'wp-admin/edit-form-advanced.php'; // Fix: WP 4.0 wp_dequeue_script('editor-expand'); do_action('vc_frontend_editor_render_template'); ?> </div> <?php // other admin footer files and actions. require_once $editor->adminFile('admin-footer.php');
/** * */ public function render() { global $vc_row_layouts; vc_include_template('editors/popups/panel_edit_layout.tpl.php', array('vc_row_layouts' => $vc_row_layouts)); }
/** * Output template from templates dir. * * @since 4.4 * * @param $template * @param array $variables - passed variables to the template. * * @param bool $once * * @return string */ function vc_get_template($template, $variables = array(), $once = false) { ob_start(); vc_include_template($template, $variables, $once); return ob_get_clean(); }
/** * Load frontend default template content by index */ public function renderFrontendDefaultTemplate() { $template_index = vc_post_param('template_name'); $data = $this->getDefaultTemplate($template_index); !$data && die('0'); vc_frontend_editor()->setTemplateContent(trim($data['content'])); vc_frontend_editor()->enqueueRequired(); vc_include_template('editors/frontend_template.tpl.php', array('editor' => vc_frontend_editor())); die; }
"> <span class="vc_description"><?php printf(__('Change title of the current %s (Note: changes may not be displayed in a preview, but will take effect after saving page).', 'js_composer'), get_post_type()); ?> </span> </div> </div> <div class="vc_col-sm-12 vc_column"> <div class="wpb_element_label"><?php _e('Custom CSS settings', 'js_composer'); ?> </div> <div class="edit_form_line"> <pre id="wpb_csseditor" class="wpb_content_element custom_css wpb_frontend"></pre> <span class="vc_description vc_clearfix"><?php _e('Enter custom CSS (Note: it will be outputted only on this particular page).', "js_composer"); ?> </span> </div> </div> </div> </div> </div> <!-- param window footer--> <?php vc_include_template('editors/popups/vc_ui-footer.tpl.php', array('controls' => array(array('name' => 'close', 'label' => __('Close', 'js_composer')), array('name' => 'save', 'label' => __('Save changes', 'js_composer'), 'css_classes' => 'vc_ui-button-fw', 'style' => 'action')))); ?> </div> </div>
<?php if (vc_frontend_editor()->inlineEnabled()) { vc_include_template('pages/partials/vc-roles-parts/_part.tpl.php', array('part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who($role)->part($part), 'custom_value' => 'custom', 'options' => array(array(true, __('Enabled', 'js_composer')), array(false, __('Disabled', 'js_composer'))), 'main_label' => __('Frontend editor', 'js_composer'), 'custom_label' => __('Frontend editor', 'js_composer'))); }
/** * Output required html and js content for VC editor. * * Here comes panels, modals and js objects with data for mapped shortcodes. */ public function renderEditorFooter() { vc_include_template('editors/partials/backend_editor_footer.tpl.php', array('editor' => $this, 'post' => $this->post)); do_action('vc_backend_editor_footer_render'); }
?> "> <th scope="row"></th> <td> <fieldset> <legend class="screen-reader-text"> <span><?php echo esc_html($custom_label); ?> </span> </legend> <?php if (isset($categories) && !empty($categories)) { ?> <?php vc_include_template('editors/partials/add_element_tabs.tpl.php', array('categories' => $categories)); ?> <?php } ?> <table class="vc_general vc_wp-form-table fixed" data-vc-roles="table"> <thead> <tr> <th><?php echo esc_html($item_header_name); ?> </th> <?php foreach ($cap_types as $type) { ?> <th class="column-date">
/** * Render * * @param $tab */ public function renderTab($tab) { require_once vc_path_dir('CORE_DIR', 'class-vc-page.php'); wp_enqueue_style('wp-color-picker'); wp_enqueue_script('wp-color-picker'); if (isset($_GET['build_css']) && ('1' === $_GET['build_css'] || 'true' === $_GET['build_css']) || isset($_GET['settings-updated']) && ('1' === $_GET['settings-updated'] || 'true' === $_GET['settings-updated'])) { $this->buildCustomCss(); // TODO: remove this - no needs to re-save always } $tabs = $this->getTabs(); foreach ($tabs as $key => $value) { if (!vc_user_access()->part('settings')->can($key . '-tab')->get()) { unset($tabs[$key]); } } do_action('vc-settings-render-tab-' . $tab); $page = new Vc_Page(); $page->setSlug($tab)->setTitle(isset($tabs[$tab]) ? $tabs[$tab] : '')->setTemplatePath(apply_filters('vc_settings-render-tab-' . $tab, 'pages/vc-settings/tab.php')); vc_include_template('pages/vc-settings/index.php', array('pages' => $tabs, 'active_page' => $page, 'vc_settings' => $this)); }
/** * @param $template */ function render($template) { vc_include_template('editors/frontend_' . $template . '.tpl.php', array('editor' => $this)); }
<div class="vc_ui-panel-header-header vc_ui-grid-gap" data-vc-panel-container=".vc_ui-panel-header-container"> <h3 class="vc_ui-panel-header-heading" data-vc-ui-element="panel-title"><?php echo isset($title) ? esc_html($title) : ''; ?> </h3> <?php if (isset($search_template) && !empty($search_template)) { ?> <?php vc_include_template($search_template); ?> <?php } ?> </div> <div class="vc_ui-panel-header-content" data-vc-ui-element="panel-header-content"> <?php if (isset($content_template) && !empty($content_template)) { ?> <?php vc_include_template($content_template, isset($template_variables) && is_array($template_variables) ? $template_variables : array()); ?> <?php } ?> </div> </div> </div>
/** * */ public function render() { vc_include_template('editors/popups/panel_post_settings.tpl.php', array('box' => $this)); }