Skip to content

Commit 2cc0a61

Browse files
committed
(4,7) Extension download check #194452744474995
1 parent 8ab7cb9 commit 2cc0a61

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

Diff for: visualcomposer/Modules/Hub/Download/JsonActionsController.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ protected function ajaxGetRequiredActions(
4141
$response['actions'] = $requiredActions;
4242
if (count($reRenderPosts) > 0 && vcvenv('VCV_TF_POSTS_RERENDER', false)) {
4343
$postsActions = $this->createPostUpdateObjects($reRenderPosts);
44-
$response['vcvUpdaterUrl'] = $urlHelper->to('public/dist/wpPostRebuild.bundle.js');
45-
$response['vcvVendorUrl'] = $urlHelper->to('public/dist/vendor.bundle.js');
46-
$response['actions'] = array_merge($response['actions'], $postsActions);
44+
if (vcvenv('VCV_ENV_EXTENSION_DOWNLOAD')) {
45+
$response['vcvUpdaterUrl'] = content_url() . '/' . VCV_PLUGIN_ASSETS_DIRNAME . '/editor/wpPostRebuild.bundle.js';
46+
$response['vcvVendorUrl'] = content_url() . '/' . VCV_PLUGIN_ASSETS_DIRNAME . '/editor/vendor.bundle.js';
47+
} else {
48+
$response['vcvUpdaterUrl'] = $urlHelper->to('public/dist/wpPostRebuild.bundle.js');
49+
$response['vcvVendorUrl'] = $urlHelper->to('public/dist/vendor.bundle.js');
50+
}
51+
$response['actions'] = array_merge($response['actions'], $postsActions);
4752
}
4853
} else {
4954
$loggerHelper->log(

Diff for: visualcomposer/resources/views/editor/frontend/frontend-updating.php

+19-12
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
<!DOCTYPE html>
3232
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
3333
<head>
34-
<link rel="profile" href="http://gmpg.org/xfn/11"/>
35-
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>"/>
36-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
34+
<link rel="profile" href="http://gmpg.org/xfn/11" />
35+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
36+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
3737
<title><?php echo sprintf(__('Frontend editor: %s', 'vcwb'), get_the_title()); ?></title>
3838
<link rel="stylesheet"
3939
href="//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic&subset=latin,greek,greek-ext,cyrillic-ext,latin-ext,cyrillic">
@@ -53,15 +53,22 @@
5353
</head>
5454
<body class="vcv-wb-editor vcv-is-disabled-outline">
5555
<script>
56-
window.vcvUpdateUrl = '<?php echo $urlHelper->ajax(['vcv-action' => 'bundle:update:adminNonce']); ?>';
57-
window.vcvAdminNonce = '<?php echo $nonceHelper->admin(); ?>';
58-
window.vcvUpdateActions = <?php echo json_encode($actions); ?>;
59-
window.vcvUpdatePosts = <?php echo json_encode($posts); ?>;
60-
window.vcvActionsUrl = '<?php echo vchelper('Url')->ajax(['vcv-action' => 'hub:action:adminNonce']); ?>';
61-
window.vcvUpdateFinishedUrl = '<?php echo vchelper('Url')->ajax(['vcv-action' => 'bundle:update:finished:adminNonce']); ?>';
62-
window.vcvAjaxTime = <?php echo $time; ?>;
63-
window.vcvUpdaterUrl = '<?php echo vchelper('Url')->to('public/dist/wpPostRebuild.bundle.js'); ?>';
64-
window.vcvVendorUrl = '<?php echo vchelper('Url')->to('public/dist/vendor.bundle.js'); ?>';
56+
window.vcvUpdateUrl = '<?php echo $urlHelper->ajax(['vcv-action' => 'bundle:update:adminNonce']); ?>';
57+
window.vcvAdminNonce = '<?php echo $nonceHelper->admin(); ?>';
58+
window.vcvUpdateActions = <?php echo json_encode($actions); ?>;
59+
window.vcvUpdatePosts = <?php echo json_encode($posts); ?>;
60+
window.vcvActionsUrl = '<?php echo vchelper('Url')->ajax(['vcv-action' => 'hub:action:adminNonce']); ?>';
61+
window.vcvUpdateFinishedUrl = '<?php echo vchelper('Url')->ajax(['vcv-action' => 'bundle:update:finished:adminNonce']); ?>';
62+
window.vcvAjaxTime = <?php echo $time; ?>;
63+
<?php
64+
if (vcvenv('VCV_ENV_EXTENSION_DOWNLOAD')) :
65+
?>
66+
window.vcvUpdaterUrl = '<?php echo content_url() . '/' . VCV_PLUGIN_ASSETS_DIRNAME . '/editor/wpPostRebuild.bundle.js'; ?>';
67+
window.vcvVendorUrl = '<?php echo content_url() . '/' . VCV_PLUGIN_ASSETS_DIRNAME . '/editor/vendor.bundle.js'; ?>';
68+
<?php else : ?>
69+
window.vcvUpdaterUrl = '<?php echo vchelper('Url')->to('public/dist/wpPostRebuild.bundle.js'); ?>';
70+
window.vcvVendorUrl = '<?php echo vchelper('Url')->to('public/dist/vendor.bundle.js'); ?>';
71+
<?php endif; ?>
6572
</script>
6673
<div class="vcv-layout-container vcv-is-disabled-outline">
6774
<div class="vcv-layout" id="vcv-layout">

0 commit comments

Comments
 (0)