This commit is contained in:
KhaiNguyen
2020-02-13 10:39:37 +07:00
commit 59401cb805
12867 changed files with 4646216 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<h2 class="nav-tab-wrapper">
<?php foreach ( $tabs as $slug => $title ) : ?>
<?php $url = 'admin.php?page=' . rawurlencode( $slug ); ?>
<a href="<?php echo esc_attr( is_network_admin() ? network_admin_url( $url ) : admin_url( $url ) ); ?>"
class="nav-tab<?php echo $active_tab === $slug ? esc_attr( ' nav-tab-active' ) : ''; ?>">
<?php echo esc_html( $title ); ?>
</a>
<?php endforeach ?>
</h2>

View File

@@ -0,0 +1,14 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<h2 class="nav-tab-wrapper">
<?php foreach ( $tabs as $tab_slug => $title ) : ?>
<?php $url = 'admin.php?page=' . rawurlencode( $slug ) . '&tab=' . rawurlencode( $tab_slug ); ?>
<a href="<?php echo esc_attr( is_network_admin() ? network_admin_url( $url ) : admin_url( $url ) ); ?>"
class="nav-tab<?php echo $active_tab === $tab_slug ? esc_attr( ' nav-tab-active' ) : ''; ?>">
<?php echo esc_html( $title ); ?>
</a>
<?php endforeach ?>
</h2>

View File

@@ -0,0 +1,33 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/** @var string $part */
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 ),
'capabilities' => array(
array(
'disabled_ce_editor',
esc_html__( 'Disable Classic editor', 'js_composer' ),
),
),
'options' => array(
array(
true,
esc_html__( 'Enabled', 'js_composer' ),
),
array(
'default',
esc_html__( 'Enabled and default', 'js_composer' ),
),
array(
false,
esc_html__( 'Disabled', 'js_composer' ),
),
),
'main_label' => esc_html__( 'Backend editor', 'js_composer' ),
'custom_label' => esc_html__( 'Backend editor', 'js_composer' ),
) );

View File

@@ -0,0 +1,17 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/** @var string $part */
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, esc_html__( 'Enabled', 'js_composer' ) ),
array( false, esc_html__( 'Disabled', 'js_composer' ) ),
),
'main_label' => esc_html__( 'Drag and Drop', 'js_composer' ),
'description' => esc_html__( 'Control access rights to drag and drop functionality within the editor.', 'js_composer' ),
) );

View File

@@ -0,0 +1,27 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( vc_frontend_editor()->inlineEnabled() ) {
/** @var string $part */
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,
esc_html__( 'Enabled', 'js_composer' ),
),
array(
false,
esc_html__( 'Disabled', 'js_composer' ),
),
),
'main_label' => esc_html__( 'Frontend editor', 'js_composer' ),
'custom_label' => esc_html__( 'Frontend editor', 'js_composer' ),
) );
}

View File

@@ -0,0 +1,24 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/** @var string $part */
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,
esc_html__( 'Enabled', 'js_composer' ),
),
array(
false,
esc_html__( 'Disabled', 'js_composer' ),
),
),
'main_label' => esc_html__( 'Grid Builder', 'js_composer' ),
'custom_label' => esc_html__( 'Grid Builder', 'js_composer' ),
'description' => esc_html__( 'Control user access to Grid Builder and Grid Builder Elements.', 'js_composer' ),
) );

View File

@@ -0,0 +1,159 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<?php /** @var Vc_Role_Access_Controller $controller */ ?>
<tr>
<th scope="row"><?php echo esc_html( $main_label ); ?></th>
<td>
<fieldset>
<legend class="screen-reader-text">
<span><?php esc_html( $main_label ); ?></span></legend>
<select name="<?php echo esc_attr( $params_prefix . '[_state]' ); ?>"
data-vc-part="<?php echo esc_attr( $part ); ?>"
data-vc-name="<?php echo esc_attr( '_state' ); ?>"
<?php if ( ! empty( $capabilities ) ) : ?>data-vc-roles="part-state"
data-vc-role-part="<?php echo esc_attr( $part . '-' . $role ); ?>"<?php endif; ?>
class="vc_ui-settings-roles-dropdown">
<?php foreach ( $options as $option ) : ?>
<option
value="<?php echo esc_attr( $option[0] ? (string) $option[0] : '0' ); ?>"
<?php echo isset( $option[2] ) ? ' data-vc-custom-selector="' . esc_attr( $option[2] ) . '"' : ''; ?>
<?php echo $controller->getState() === $option[0] ? ' selected' : ''; ?>><?php echo esc_html( $option[1] ); ?></option>
<?php endforeach; ?>
</select>
<?php if ( isset( $description ) && ! empty( $description ) ) : ?>
<p class="description"><?php echo esc_html( $description ); ?></p>
<?php endif; ?>
</fieldset>
</td>
</tr>
<?php if ( ! empty( $capabilities ) ) : ?>
<?php if ( isset( $use_table ) && true === $use_table ) : ?>
<?php
require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-add-element-box.php' );
$add_box = new Vc_Add_Element_Box();
?>
<tr data-vc-role-related-part="<?php echo esc_attr( $part . '-' . $role ); ?>"
data-vc-role-part-state="<?php echo esc_attr( isset( $custom_value ) ? $custom_value : '*' ); ?>"
class="vc_role-custom-settings<?php echo ! isset( $custom_value ) || (string) $controller->getState() === (string) $custom_value ? ' vc_visible' : ''; ?>">
<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 endif; ?>
<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">
<label>
<input type="checkbox" name="all" data-vc-related-controls="tfoot [data-vc-roles-select-all-checkbox]" data-vc-roles-select-all-checkbox="<?php echo esc_attr( $type[0] ); ?>"><?php echo esc_html( $type[1] ); ?>
</label>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tfoot<?php echo isset( $global_set ) ? ' style="display: none;"' : ''; ?>>
<tr>
<th><?php echo esc_html( $item_header_name ); ?></th>
<?php foreach ( $cap_types as $type ) : ?>
<th class="column-date">
<label>
<input type="checkbox" name="all" data-vc-related-controls="thead [data-vc-roles-select-all-checkbox]" data-vc-roles-select-all-checkbox="<?php echo esc_attr( $type[0] ); ?>"><?php echo esc_html( $type[1] ); ?>
</label>
</th>
<?php endforeach; ?>
</tr>
</tfoot>
<tbody<?php echo isset( $global_set ) ? ' style="display: none;"' : ''; ?>>
<?php foreach ( $capabilities as $cap ) : ?>
<?php if ( ! isset( $ignore_capabilities ) || ! in_array( $cap['base'], $ignore_capabilities, true ) ) : ?>
<?php
$category_css_classes = '';
if ( isset( $cap['_category_ids'] ) ) {
foreach ( $cap['_category_ids'] as $id ) {
$category_css_classes .= ' js-category-' . $id;
}
}
?>
<tr data-vc-capability="<?php echo esc_attr( $cap['base'] ); ?>"
class="<?php echo esc_attr( trim( $category_css_classes ) ); ?>">
<td title="<?php echo esc_attr( $cap['base'] ); ?>">
<?php
// @codingStandardsIgnoreLine
print $add_box->renderIcon( $cap );
?>
<div>
<?php echo esc_html( $cap['name'] ); ?>
<?php echo ! empty( $cap['description'] ) ? '<span class="vc_element-description">' . esc_html( $cap['description'] ) . '</span>' : ''; ?>
</div>
</td>
<?php foreach ( $cap_types as $type ) : ?>
<td>
<div class="vc_wp-form-checkbox">
<label>
<input type="checkbox" name="<?php echo esc_attr( $params_prefix . '[' . $role . '][' . $part . ']' . '[' . $cap['base'] . '_' . $type[0] . ']' ); ?>" data-vc-part="<?php echo esc_attr( $part ); ?>" data-vc-name="<?php echo esc_attr( $cap['base'] . '_' . $type[0] ); ?>" data-vc-roles="table-checkbox" data-vc-cap="<?php echo esc_attr( $type[0] ); ?>" value="1"<?php echo ! isset( $global_set ) && $controller->can( $cap['base'] . '_' . $type[0], false )->get() ? ' checked' : ''; ?>>
<?php echo esc_html( $type[1] ); ?>
</label>
</div>
</td>
<?php endforeach; ?>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</fieldset>
</td>
</tr>
<?php else : ?>
<tr data-vc-role-related-part="<?php echo esc_attr( $part . '-' . $role ); ?>" data-vc-role-part-state="<?php echo esc_attr( isset( $custom_value ) ? $custom_value : '*' ); ?>" class="vc_role-custom-settings<?php echo ! isset( $custom_value ) || $controller->getState() === $custom_value ? ' vc_visible' : ''; ?>">
<th scope="row"></th>
<td>
<fieldset>
<legend class="screen-reader-text">
<span><?php echo esc_html( $custom_label ); ?></span>
</legend>
<div class="vc_wp-form-row">
<?php foreach ( $capabilities as $cap ) : ?>
<div class="vc_wp-form-col vc_wp-form-checkbox">
<label>
<input type="checkbox" name="<?php echo esc_attr( $params_prefix . '[' . $cap[0] . ']' ); ?>" value="1" class="vc_roles-settings-checkbox"
<?php
// hard coded yes :)
if ( 'administrator' === $role && 'settings' === $part && ( 'vc-roles-tab' === $cap[0] || 'vc-updater-tab' === $cap[0] ) ) {
echo ' disabled checked';
} else {
?>
data-vc-part="<?php echo esc_attr( $part ); ?>"
data-vc-name="<?php echo esc_attr( $cap[0] ); ?>"
data-vc-roles="serialize"
data-vc-roles="checkbox"
<?php
echo $controller->can( $cap[0], false )->get() ? ' checked' : ''
?>
<?php
}
?>
>
<?php echo esc_html( $cap[1] ); ?>
</label>
</div>
<?php endforeach; ?>
</div>
</fieldset>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,16 @@
<?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 ),
'options' => array(
array( true, esc_html__( 'Enabled', 'js_composer' ) ),
array( false, esc_html__( 'Disabled', 'js_composer' ) ),
),
'main_label' => esc_html__( 'Page settings', 'js_composer' ),
'description' => esc_html__( 'Control access to WPBakery Page Builder page settings. Note: Disable page settings to restrict editing of Custom CSS through page.', 'js_composer' ),
) );

View File

@@ -0,0 +1,21 @@
<?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' => $vc_role->getPostTypes(),
'options' => array(
array( true, esc_html__( 'Pages only', 'js_composer' ) ),
array( 'custom', esc_html__( 'Custom', 'js_composer' ) ),
array( false, esc_html__( 'Disabled', 'js_composer' ) ),
),
'main_label' => esc_html__( 'Post types', 'js_composer' ),
'custom_label' => esc_html__( 'Post types', 'js_composer' ),
'description' => esc_html__( 'Enable WPBakery Page Builder for pages, posts and custom post types. Note: By default WPBakery Page Builder is available for pages only.', 'js_composer' ),
) );

View File

@@ -0,0 +1,17 @@
<?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 ),
'options' => array(
array( true, esc_html__( 'All', 'js_composer' ) ),
array( 'add', esc_html__( 'Apply presets only', 'js_composer' ) ),
array( false, esc_html__( 'Disabled', 'js_composer' ) ),
),
'main_label' => esc_html__( 'Element Presets', 'js_composer' ),
'description' => esc_html__( 'Control access rights to element presets in element edit form. Note: "Apply presets only" restricts users from saving new presets and deleting existing.', 'js_composer' ),
) );

View File

@@ -0,0 +1,24 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$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, esc_html__( 'All', 'js_composer' ) ),
array( 'custom', esc_html__( 'Custom', 'js_composer' ) ),
array( false, esc_html__( 'Disabled', 'js_composer' ) ),
),
'main_label' => esc_html__( 'Settings options', 'js_composer' ),
'custom_label' => esc_html__( 'Settings options', 'js_composer' ),
'description' => esc_html__( 'Control access rights to WPBakery Page Builder admin settings tabs (e.g. General Settings, Shortcode Mapper, ...)', 'js_composer' ),
) );

View File

@@ -0,0 +1,39 @@
<?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', esc_html__( 'All', 'js_composer' ) ),
array( 'edit', esc_html__( 'Edit', 'js_composer' ) ),
),
'item_header_name' => esc_html__( 'Element', 'js_composer' ),
'options' => array(
array( true, esc_html__( 'All', 'js_composer' ) ),
array( 'edit', esc_html__( 'Edit only', 'js_composer' ) ),
array( 'custom', esc_html__( 'Custom', 'js_composer' ) ),
),
'main_label' => esc_html__( 'Elements', 'js_composer' ),
'custom_label' => esc_html__( 'Elements', 'js_composer' ),
'description' => esc_html__( 'Control user access to content elements.', 'js_composer' ),
'use_table' => true,
) );

View File

@@ -0,0 +1,17 @@
<?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 ),
'options' => array(
array( true, esc_html__( 'All', 'js_composer' ) ),
array( 'add', esc_html__( 'Apply templates only', 'js_composer' ) ),
array( false, esc_html__( 'Disabled', 'js_composer' ) ),
),
'main_label' => esc_html__( 'Templates', 'js_composer' ),
'description' => esc_html__( 'Control access rights to templates and predefined templates. Note: "Apply templates only" restricts users from saving new templates and deleting existing.', 'js_composer' ),
) );

View File

@@ -0,0 +1,44 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<fieldset>
<legend class="screen-reader-text">
<span><?php echo esc_html( $title ); ?></span>
</legend>
<table class="vc_general vc_wp-form-table fixed">
<thead>
<tr>
<th><?php esc_html_e( 'Post type', 'js_composer' ); ?></th>
<th><?php esc_html_e( 'Template', 'js_composer' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $post_types as $post_type ) : ?>
<?php $post_type_object = get_post_type_object( $post_type[0] ); ?>
<tr>
<td title="<?php echo esc_attr( $post_type[0] ); ?>">
<?php echo esc_html( $post_type_object ? $post_type_object->labels->name : $post_type[0] ); ?>
</td>
<td>
<select name="<?php echo esc_attr( $field_key ); ?>[<?php echo esc_attr( $post_type[0] ); ?>]">
<option value=""><?php esc_html_e( 'None', 'js_composer' ); ?></option>
<?php foreach ( $templates as $templates_category ) : ?>
<optgroup label="<?php echo esc_attr( $templates_category['category_name'] ); ?>">
<?php foreach ( $templates_category['templates'] as $template ) : ?>
<?php
$key = $template['type'] . '::' . esc_attr( $template['unique_id'] );
?>
<option value="<?php echo esc_attr( $key ); ?>"<?php echo isset( $value[ $post_type[0] ] ) && $value[ $post_type[0] ] === $key ? ' selected="true"' : ''; ?>><?php echo esc_html( $template['name'] ); ?></option>
<?php endforeach; ?>
</optgroup>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</fieldset>

View File

@@ -0,0 +1,17 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<div class="wrap vc_settings" id="wpb-js-composer-settings">
<h2><?php esc_html_e( 'WPBakery Page Builder Settings', 'js_composer' ); ?></h2>
<?php settings_errors(); ?>
<?php
vc_include_template( '/pages/partials/_settings_tabs.php',
array(
'active_tab' => $active_page->getSlug(),
'tabs' => $pages,
) );
?>
<?php $active_page->render(); ?>
</div>

View File

@@ -0,0 +1,89 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$tab = esc_attr( preg_replace( '/^vc\-/', '', $page->getSlug() ) );
$editable_roles = get_editable_roles();
require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-roles.php' );
$vc_role = new Vc_Roles();
?>
<form action="<?php echo esc_attr( admin_url( 'admin-ajax.php' ) ); ?>" method="post"
id="vc_settings-<?php echo esc_attr( $tab ); ?>"
class="vc_settings-tab-content vc_settings-tab-content-active"
data-vc-roles="form">
<div class="tab_intro">
<p><?php esc_html_e( 'Control user group role access to the features and options of WPBakery Page Builder - manage WordPress default and custom roles.', 'js_composer' ); ?></p>
</div>
<!-- Settings template start -->
<div class="vc_wp-settings">
<div class="vc_wp-accordion" data-vc-action="collapseAll">
<?php
foreach ( $editable_roles as $role => $details ) :
$name = translate_user_role( $details['name'] );
$unique_id = 'vc_role-' . $role;
$valid_roles = array();
foreach ( $vc_role->getParts() as $part ) {
if ( $vc_role->hasRoleCapability( $role, $vc_role->getPartCapability( $part ) ) ) {
$valid_roles[] = $part;
}
}
if ( count( $valid_roles ) > 0 ) :
?>
<div
class="vc_wp-accordion-panel vc_ui-settings-roles-role<?php echo ! isset( $next ) ? ' vc_active' : ''; ?>"
data-vc-unique-id="<?php echo esc_attr( $unique_id ); ?>"
data-vc-content=".vc_wp-accordion-panel-body"
data-vc-role="<?php echo esc_attr( $role ); ?>">
<div class="widget" data-vc-accordion=""
data-vc-container=".vc_wp-accordion"
data-vc-target="[data-vc-unique-id=<?php echo esc_attr( $unique_id ); ?>]">
<div class="widget-top">
<div class="widget-title-action">
<button type="button" class="widget-action hide-if-no-js" aria-expanded="true">
<span class="screen-reader-text">Edit widget: Search</span>
<span class="toggle-indicator" aria-hidden="true"></span>
</button>
</div>
<div class="widget-title">
<h4>
<?php echo esc_html( $name ); ?>
<span class="in-widget-title"></span>
</h4>
</div>
</div>
</div>
<div class="vc_wp-accordion-panel-body">
<table class="form-table">
<tbody>
<?php
$next = true;
foreach ( $valid_roles as $part ) {
vc_include_template( 'pages/partials/vc-roles-parts/_' . $part . '.tpl.php', array(
'part' => $part,
'role' => $role,
'vc_role' => $vc_role,
) );
}
?>
</tbody>
</table>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<span class="vc_settings-spinner vc_ui-wp-spinner" style="display: none;" id="vc_wp-spinner"></span>
<!-- Settings template end -->
<?php
wp_nonce_field( 'vc_settings-' . $tab . '-action', 'vc_nonce_field' );
$submit_button_attributes = array();
$submit_button_attributes = apply_filters( 'vc_settings-tab-submit-button-attributes', $submit_button_attributes, $tab );
$submit_button_attributes = apply_filters( 'vc_settings-tab-submit-button-attributes-' . $tab, $submit_button_attributes, $tab );
submit_button( esc_html__( 'Save Changes', 'js_composer' ), 'primary', 'submit_btn', true, $submit_button_attributes );
?>
<input type="hidden" name="action" value="vc_roles_settings_save"
id="vc_settings-<?php echo esc_attr( $tab ); ?>-action"/>
</form>

View File

@@ -0,0 +1,126 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$tab = esc_attr( preg_replace( '/^vc\-/', '', $page->getSlug() ) );
$use_custom = get_option( vc_settings()->getFieldPrefix() . 'use_custom' );
$css = ( ( 'color' === $tab ) && $use_custom ) ? ' color_enabled' : '';
$dev_environment = vc_license()->isDevEnvironment();
$license_key = vc_license()->getLicenseKey();
$classes = 'vc_settings-tab-content vc_settings-tab-content-active ' . esc_attr( $css );
$custom_tag = 'script';
?>
<<?php echo esc_attr( $custom_tag ); ?>>
window.vcAdminNonce = '<?php echo esc_js( vc_generate_nonce( 'vc-admin-nonce' ) ); ?>';
</<?php echo esc_attr( $custom_tag ); ?>>
<?php if ( 'updater' === $tab && $dev_environment && ! vc_license()->isActivated() ) : ?>
<br/>
<div class="updated vc_updater-result-message">
<p>
<strong>
<?php esc_html_e( 'It is optional to activate license on localhost development environment. You can still activate license on localhost to receive plugin updates and get access to template library.', 'js_composer' ); ?>
</strong>
</p>
</div>
<?php endif ?>
<form action="options.php"
method="post"
id="vc_settings-<?php echo esc_attr( $tab ); ?>"
data-vc-ui-element="settings-tab-<?php echo esc_attr( $tab ); ?>"
class="<?php echo esc_attr( $classes ); ?>"
<?php echo apply_filters( 'vc_setting-tab-form-' . esc_attr( $tab ), '' ); ?>
>
<?php settings_fields( vc_settings()->getOptionGroup() . '_' . $tab ); ?>
<?php do_settings_sections( vc_settings()->page() . '_' . $tab ); ?>
<?php if ( 'general' === $tab && vc_pointers_is_dismissed() ) : ?>
<table class="form-table">
<tr>
<th scope="row"><?php esc_html_e( 'Guide tours', 'js_composer' ); ?></th>
<td>
<a href="#" class="button vc_pointers-reset-button"
id="vc_settings-vc-pointers-reset"
data-vc-done-txt="<?php esc_attr_e( 'Done', 'js_composer' ); ?>"><?php esc_html_e( 'Reset', 'js_composer' ); ?></a>
<p
class="description indicator-hint"><?php esc_html_e( 'Guide tours are shown in VC editors to help you to start working with editors. You can see them again by clicking button above.', 'js_composer' ); ?></p>
</td>
</tr>
</table>
<?php endif ?>
<?php
$submit_button_attributes = array();
$submit_button_attributes = apply_filters( 'vc_settings-tab-submit-button-attributes', $submit_button_attributes, $tab );
$submit_button_attributes = apply_filters( 'vc_settings-tab-submit-button-attributes-' . $tab, $submit_button_attributes, $tab );
?>
<?php if ( 'updater' !== $tab ) : ?>
<?php submit_button( esc_html__( 'Save Changes', 'js_composer' ), 'primary', 'submit_btn', true, $submit_button_attributes ); ?>
<?php endif ?>
<input type="hidden" name="vc_action" value="vc_action-<?php echo esc_attr( $tab ); ?>"
id="vc_settings-<?php echo esc_attr( $tab ); ?>-action"/>
<?php if ( 'color' === $tab ) : ?>
<a href="#" class="button vc_restore-button" id="vc_settings-color-restore-default">
<?php echo esc_html__( 'Restore Default', 'js_composer' ); ?>
</a>
<?php endif ?>
<?php if ( 'updater' === $tab ) : ?>
<div class="vc_settings-activation-deactivation">
<?php if ( vc_license()->isActivated() ) : ?>
<p>
<?php echo esc_html__( 'You have activated WPBakery Page Builder version which allows you to access all the customer benefits. Thank you for choosing WPBakery Page Builder as your page builder. If you do not wish to use WPBakery Page Builder on this WordPress site you can deactivate your license below.', 'js_composer' ); ?>
</p>
<br/>
<p>
<button
class="button button-primary button-hero button-updater"
data-vc-action="deactivation"
type="button"
id="vc_settings-updater-button">
<?php echo esc_html__( 'Deactivate WPBakery Page Builder', 'js_composer' ); ?>
</button>
<img src="<?php echo esc_url( get_admin_url() ); ?>/images/wpspin_light.gif" class="vc_updater-spinner"
id="vc_updater-spinner" width="16" height="16" alt="spinner"/>
</p>
<?php else : ?>
<p>
<?php echo sprintf( esc_html__( 'In order to receive all benefits of WPBakery Page Builder, you need to activate your copy of the plugin. By activating WPBakery Page Builder license you will unlock premium options - %1$sdirect plugin updates%2$s, access to %1$stemplate library%2$s and %1$sofficial support.%2$s', 'js_composer' ), '<strong>', '</strong>' ); ?>
</p>
<br/>
<p>
<button
class="button button-primary button-hero button-updater"
data-vc-action="activation"
type="button"
id="vc_settings-updater-button">
<?php echo esc_html__( 'Activate WPBakery Page Builder', 'js_composer' ); ?>
</button>
<img src="<?php echo esc_url( get_admin_url() ); ?>/images/wpspin_light.gif" class="vc_updater-spinner"
id="vc_updater-spinner" width="16" height="16" alt="spinner"/>
</p>
<p class="description">
<?php printf( esc_html__( 'Don\'t have direct license yet? %sPurchase WPBakery Page Builder license%s.', 'js_composer' ), '<a href="' . esc_url( 'https://go.wpbakery.com/wpb-buy' ) . '" target="_blank">', '</a>' ); ?>
</p>
<?php endif ?>
</div>
<?php endif ?>
</form>

View File

@@ -0,0 +1,14 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$custom_tag = 'script';
?>
<<?php echo esc_attr( $custom_tag ); ?>>
window.vcAdminNonce = '<?php echo esc_js( vc_generate_nonce( 'vc-admin-nonce' ) ); ?>';
</<?php echo esc_attr( $custom_tag ); ?>>
<form action="options.php" method="post" id="vc_settings-automapper"
class="vc_settings-tab-content vc_settings-tab-content-active"
>
<?php vc_automapper()->renderHtml(); ?>
</form>

View File

@@ -0,0 +1,53 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
preg_match( '/^(\d+)(\.\d+)?/', WPB_VC_VERSION, $matches );
$custom_tag = 'script'; // Update to wp_add_inline later
?>
<div class="wrap vc-page-welcome about-wrap">
<h1><?php echo sprintf( esc_html__( 'Welcome to WPBakery Page Builder %s', 'js_composer' ), esc_html( isset( $matches[0] ) ? $matches[0] : WPB_VC_VERSION ) ); ?></h1>
<div class="about-text">
<?php esc_html_e( 'Congratulations! You are about to use most powerful time saver for WordPress ever - page builder plugin with Frontend and Backend editors by WPBakery.', 'js_composer' ); ?>
</div>
<div class="wp-badge vc-page-logo">
<?php echo sprintf( esc_html__( 'Version %s', 'js_composer' ), esc_html( WPB_VC_VERSION ) ); ?>
</div>
<p class="vc-page-actions">
<?php
if ( vc_user_access()
->wpAny( 'manage_options' )
->part( 'settings' )
->can( 'vc-general-tab' )
->get() && ( ! is_multisite() || ! is_main_site() )
) :
?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=vc-general' ) ); ?>"
class="button button-primary"><?php esc_html_e( 'Settings', 'js_composer' ); ?></a><?php endif; ?>
<a href="https://twitter.com/share" class="twitter-share-button"
data-via="wpbakery"
data-text="Take full control over your #WordPress site with WPBakery Page Builder page builder"
data-url="https://wpbakery.com" data-size="large">Tweet</a>
<<?php echo esc_attr( $custom_tag ); ?>>! 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' );</<?php echo esc_attr( $custom_tag ); ?>>
</p>
<?php
vc_include_template( '/pages/partials/_tabs.php', array(
'slug' => $page->getSlug(),
'active_tab' => $active_page->getSlug(),
'tabs' => $pages,
) );
?>
<?php
// @codingStandardsIgnoreLine
print $active_page->render();
?>
</div>

View File

@@ -0,0 +1,101 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<div class="vc_faq-tab changelog">
<h3><?php esc_html_e( 'New to WPBakery Page Builder or Looking for More Information?', 'js_composer' ); ?></h3>
<p><?php printf( esc_html__( 'WPBakery has complete documentation available at our knowledge base: %s which covers everything related to WPBakery Page Builder starting from Installation and up to more advanced features based on our Inner API.', 'js_composer' ), '<a target="_blank" href="https://kb.wpbakery.com">kb.wpbakery.com</a>' ); ?></p>
<div class="feature-section vc_row">
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/preface"><?php esc_html_e( 'Preface', 'js_composer' ); ?></a></h4>
<ul>
<li><a target="_blank" href="https://go.wpbakery.com/introduction"><?php esc_html_e( 'Introduction', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/support-and-resources"><?php esc_html_e( 'Support and Resources', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/support-policy"><?php esc_html_e( 'Support Policy', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/release-notes"><?php esc_html_e( 'Release Notes', 'js_composer' ); ?></a></li>
</ul>
</div>
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/licensing"><?php esc_html_e( 'Licensing', 'js_composer' ); ?></a></h4>
<ul>
<li><a target="_blank" href="https://go.wpbakery.com/regular-license"><?php esc_html_e( 'Regular License', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/extended-license"><?php esc_html_e( 'Extended License', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/in-stock-license-terms"><?php esc_html_e( 'In - Stock License( Theme Integration)', 'js_composer' ); ?></a></li>
</ul>
</div>
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/getting-started"><?php esc_html_e( 'Getting Started', 'js_composer' ); ?></a></h4>
<ul>
<li><a target="_blank" href="https://go.wpbakery.com/install"><?php esc_html_e( 'Plugin Installation', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/activation"><?php esc_html_e( 'Activation', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/update"><?php esc_html_e( 'Update', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/content-type"><?php esc_html_e( 'Content Type', 'js_composer' ); ?></a></li>
</ul>
</div>
</div>
<div class="feature-section vc_row">
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/learning-more"><?php esc_html_e( 'Learning More', 'js_composer' ); ?></a>
</h4>
<ul>
<li><a target="_blank" href="https://go.wpbakery.com/basic-concept"><?php esc_html_e( 'Basic Concept', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/content-elements"><?php esc_html_e( 'Content Elements', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/general-settings"><?php esc_html_e( 'General Settings', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/custom-css"><?php esc_html_e( 'Custom CSS', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/element-design-options"><?php esc_html_e( 'Element Design Options', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/responsive-settings"><?php esc_html_e( 'Responsive Settings', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/templates"><?php esc_html_e( 'Templates', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/predefined-layouts"><?php esc_html_e( 'Predefined Layouts', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/shortcode-mapper"><?php esc_html_e( 'Shortcode Mapper', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/grid-builder"><?php esc_html_e( 'Grid Builder', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/image-filters"><?php esc_html_e( 'Image filters', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/element-presets"><?php esc_html_e( 'Element Presets', 'js_composer' ); ?></a></li>
</ul>
</div>
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/vc-how-tos"><?php esc_html_e( 'WPBakery Page Builder "How To\'s"', 'js_composer' ); ?></a></h4>
<p><?php esc_html_e( 'In this section, you will find quick tips in form of video tutorials on how to operate with WPBakery Page Builder . ', 'js_composer' ); ?></p>
</div>
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/faq"><?php esc_html_e( 'FAQ', 'js_composer' ); ?></a></h4>
<p><?php esc_html_e( 'Here you can find answers to the Frequently Asked Question about WPBakery Page Builder . ', 'js_composer' ); ?></p>
</div>
</div>
<div class="feature-section vc_row">
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/addons"><?php esc_html_e( 'Add - ons', 'js_composer' ); ?></a></h4>
<ul>
<li><a target="_blank" href="https://go.wpbakery.com/templatera"><?php esc_html_e( 'Templatera', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/easy-tables"><?php esc_html_e( 'Easy Tables', 'js_composer' ); ?></a></li>
<li><a target="_blank" href="https://go.wpbakery.com/addon-development-rules"><?php esc_html_e( 'Add - on Development Rules', 'js_composer' ); ?></a></li>
</ul>
</div>
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/theme-integration"><?php esc_html_e( 'Theme Integration', 'js_composer' ); ?></a></h4>
<p><?php esc_html_e( 'See how you can integrate WPBakery Page Builder within your WordPress theme . ', 'js_composer' ); ?></p>
</div>
<div class="vc_col-xs-4">
<h4><a target="_blank" href="https://go.wpbakery.com/inner-api"><?php esc_html_e( 'Inner API', 'js_composer' ); ?></a></h4>
<p><?php esc_html_e( 'Inner API section describes capabilities of interaction with WPBakery Page Builder . ', 'js_composer' ); ?></p>
</div>
</div>
</div>
<div class="return-to-dashboard">
<a target="_blank" href="https://kb.wpbakery.com"><?php esc_html_e( 'Visit Knowledge Base for more information', 'js_composer' ); ?></a>
</div>

View File

@@ -0,0 +1,32 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<div class="vc_resources-tab changelog">
<div class="feature-section vc_row">
<div class="vc_col-xs-6">
<h3><?php esc_html_e( 'Resources', 'js_composer' ); ?></h3>
<p><?php esc_html_e( 'There are several resources available to WPBakery Page Builder users to help you to get around plugin:', 'js_composer' ); ?></p>
<ul>
<li>
<a href="https://wpbakery.com/?utm_campaign=VCplugin&amp;utm_source=vc_user&amp;utm_medium=welcome_page" target="_blank"><?php esc_html_e( 'Official website', 'js_composer' ); ?></a>
</li>
<li><a href="https://kb.wpbakery.com" target="_blank"><?php esc_html_e( 'Official Knowledge Base', 'js_composer' ); ?></a></li>
<li><a href="https://wpbakery.com/video-academy/" target="_blank"><?php esc_html_e( 'Video Academy', 'js_composer' ); ?></a></li>
<li><a href="https://support.wpbakery.com" target="_blank"><?php esc_html_e( 'Official support', 'js_composer' ); ?></a></li>
<li><a href="https://facebook.com/wpbakery" target="_blank"><?php esc_html_e( 'Facebook page', 'js_composer' ); ?></a></li>
<li><a href="https://twitter.com/wpbakery" target="_blank"><?php esc_html_e( 'Twitter account', 'js_composer' ); ?></a></li>
</ul>
</div>
<div class="vc_col-xs-6">
<h3><?php esc_html_e( 'Official Support', 'js_composer' ); ?></h3>
<p><?php printf( esc_html__( 'To get your support related question answered in the fastest timing, please head over to our %ssupport page%s and open Support ticket. To open a support ticket you should have a valid support subscription in case if your support has expired you can %spurchase support extension%s on support.wpbakery.com.', 'js_composer' ), '<a href="https://support.wpbakery.com" target="_blank">', '</a>', '<a href="https://support.wpbakery.com" target="_blank">', '</a>' ); ?></p>
<p><?php printf( esc_html__( 'Before applying for support please make sure you understand the rules of support and go through all steps described and listed in %sSupport Policy%s in order to get your issues solved as soon as possible.', 'js_composer' ), '<a href="https://go.wpbakery.com/support-policy" target="_blank">', '</a>' ); ?></p>
</div>
</div>
</div>

View File

@@ -0,0 +1,17 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<div class="vc_welcome-tab changelog">
<div class="vc_feature-section-teaser">
<div>
<img class="vc-featured-img" src="<?php echo esc_url( vc_asset_url( 'vc/vc-welcome/vc_5-6/1.png' ) ); ?>"/>
<h3><?php esc_html_e( 'WordPress 5.0 Compatible', 'js_composer' ); ?></h3>
<p><?php esc_html_e( 'WPBakery Page Builder goes hand in hand with the latest releases of WordPress. Want to stay up to date with WordPress 5.0? No problem, WPBakery Page Builder is fully compatible with the latest WordPress version and the new editor.', 'js_composer' ); ?></p>
</div>
</div>
<p class="vc-thank-you">Thank you for choosing WPBakery Page Builder,<br/>Michael M, CEO at WPBakery</p>
</div>