// ajax.php clean and bug fixes
This commit is contained in:
@@ -32,8 +32,8 @@
|
||||
<div id="admin-action-cms">
|
||||
<p>{l s='This CMS page is not visible to your customers.'}
|
||||
<input type="hidden" id="admin-action-cms-id" value="{$cms->id}" />
|
||||
<input type="submit" value="{l s='Publish'}" class="exclusive" onclick="submitPublishCMS('{$base_dir}{$smarty.get.ad}', 0)"/>
|
||||
<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishCMS('{$base_dir}{$smarty.get.ad}', 1)"/>
|
||||
<input type="submit" value="{l s='Publish'}" class="exclusive" onclick="submitPublishCMS('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 0, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
|
||||
<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishCMS('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 1, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
|
||||
</p>
|
||||
<div class="clear" ></div>
|
||||
<p id="admin-action-result"></p>
|
||||
|
||||
@@ -24,12 +24,20 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function submitPublishCMS(url, redirect)
|
||||
function submitPublishCMS(url, redirect, token)
|
||||
{
|
||||
var id_cms = $('#admin-action-cms-id').val();
|
||||
|
||||
$.ajaxSetup({async: false});
|
||||
$.post(url+'/ajax.php', { submitPublishCMS: '1', id_cms: id_cms, status: 1, redirect: redirect },
|
||||
$.post(url+'/index.php', {
|
||||
action: 'PublishCMS',
|
||||
id_cms: id_cms,
|
||||
status: 1,
|
||||
redirect: redirect,
|
||||
ajax: 1,
|
||||
tab: 'AdminCmsContent',
|
||||
token: token
|
||||
},
|
||||
function(data)
|
||||
{
|
||||
if (data.indexOf('error') === -1)
|
||||
|
||||
@@ -588,16 +588,24 @@ function saveCustomization()
|
||||
$('#customizationForm').submit();
|
||||
}
|
||||
|
||||
function submitPublishProduct(url, redirect)
|
||||
function submitPublishProduct(url, redirect, token)
|
||||
{
|
||||
var id_product = $('#admin-action-product-id').val();
|
||||
|
||||
$.ajaxSetup({async: false});
|
||||
$.post(url+'/ajax.php', { submitPublishProduct: '1', id_product: id_product, status: 1, redirect: redirect },
|
||||
$.post(url+'/index.php', {
|
||||
action:'publishProduct',
|
||||
id_product: id_product,
|
||||
status: 1,
|
||||
redirect: redirect,
|
||||
ajax: 1,
|
||||
tab: 'AdminProducts',
|
||||
token: token
|
||||
},
|
||||
function(data)
|
||||
{
|
||||
if (data.indexOf('error') === -1)
|
||||
document.location.href = data;
|
||||
document.location.href = data;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -153,8 +153,8 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus
|
||||
<div id="admin-action">
|
||||
<p>{l s='This product is not visible to your customers.'}
|
||||
<input type="hidden" id="admin-action-product-id" value="{$product->id}" />
|
||||
<input type="submit" value="{l s='Publish'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad}', 0)"/>
|
||||
<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad}', 1)"/>
|
||||
<input type="submit" value="{l s='Publish'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 0, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
|
||||
<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 1, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
|
||||
</p>
|
||||
<p id="admin-action-result"></p>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user