[-] BO : Bulk action management repaired
This commit is contained in:
@@ -36,14 +36,13 @@
|
|||||||
var ajaxCurrentIndex = '{$ajaxCurrentIndex}';
|
var ajaxCurrentIndex = '{$ajaxCurrentIndex}';
|
||||||
var by = '{l s='by'}';
|
var by = '{l s='by'}';
|
||||||
var errorLogin = '{l s='Could not login to Addons'}';
|
var errorLogin = '{l s='Could not login to Addons'}';
|
||||||
|
{if isset($smarty.get.anchor)}var anchor = '{$smarty.get.anchor|htmlentities|replace:'(':''|replace:')':''|replace:'{':''|replace:'}':''}';{else}var anchor = '';{/if}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{if isset($smarty.get.anchor)}
|
|
||||||
$('document').ready( function() {
|
|
||||||
$.scrollTo('#{$smarty.get.anchor|htmlentities|replace:'(':''|replace:')':''|replace:'{':''|replace:'}':''}', 1200, {literal}{offset: -100}{/literal});
|
|
||||||
});
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{literal}
|
{literal}
|
||||||
|
|
||||||
function getPrestaStore(){if(getE("prestastore").style.display!='block')return;$.post(dirNameCurrentIndex+"/ajax.php",{page:"prestastore"},function(a){getE("prestastore-content").innerHTML=a;})}
|
function getPrestaStore(){if(getE("prestastore").style.display!='block')return;$.post(dirNameCurrentIndex+"/ajax.php",{page:"prestastore"},function(a){getE("prestastore-content").innerHTML=a;})}
|
||||||
function truncate_author(author){return ((author.length > 20) ? author.substring(0, 20)+"..." : author);}
|
function truncate_author(author){return ((author.length > 20) ? author.substring(0, 20)+"..." : author);}
|
||||||
function modules_management(action)
|
function modules_management(action)
|
||||||
@@ -65,7 +64,19 @@
|
|||||||
}
|
}
|
||||||
document.location.href=currentIndex+'&token='+token+'&'+action+'='+module_list.substring(1, module_list.length);
|
document.location.href=currentIndex+'&token='+token+'&'+action+'='+module_list.substring(1, module_list.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$('document').ready( function() {
|
$('document').ready( function() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ScrollTo
|
||||||
|
if (anchor != '')
|
||||||
|
$.scrollTo('#'+anchor, 1200, {offset: -100});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// AutoComplete Search
|
||||||
$('input[name="filtername"]').autocomplete(moduleList, {
|
$('input[name="filtername"]').autocomplete(moduleList, {
|
||||||
minChars: 0,
|
minChars: 0,
|
||||||
width: 310,
|
width: 310,
|
||||||
@@ -84,13 +95,30 @@
|
|||||||
$('input[name="filtername"]').result(function(event, data, formatted) {
|
$('input[name="filtername"]').result(function(event, data, formatted) {
|
||||||
$('#filternameForm').submit();
|
$('#filternameForm').submit();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
// Method to check / uncheck all modules checkbox
|
||||||
|
$('#checkme').click(function()
|
||||||
|
{
|
||||||
|
if ($(this).attr("rel") == 'false')
|
||||||
|
{
|
||||||
|
$(this).attr("checked", "checked");
|
||||||
|
$(this).attr("rel", "true");
|
||||||
|
$("input[name=modules]").attr("checked", "checked");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$(this).attr("checked", "");
|
||||||
|
$(this).attr("rel", "false");
|
||||||
|
$("input[name=modules]").attr("checked", "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Method to reload filter in ajax
|
// Method to reload filter in ajax
|
||||||
$(document).ready(function(){
|
|
||||||
$('.categoryModuleFilterLink').click(function()
|
$('.categoryModuleFilterLink').click(function()
|
||||||
{
|
{
|
||||||
$('.categoryModuleFilterLink').css('background-color', 'white');
|
$('.categoryModuleFilterLink').css('background-color', 'white');
|
||||||
@@ -125,25 +153,22 @@
|
|||||||
catch(e){}
|
catch(e){}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Method to get modules_list.xml from prestashop.com and default_country_modules_list.xml from addons.prestashop.com
|
||||||
// Method to get modules_list.xml from prestashop.com and default_country_modules_list.xml from addons.prestashop.com
|
try
|
||||||
$(document).ready(function(){
|
{
|
||||||
try
|
resAjax = $.ajax({
|
||||||
{
|
type:"POST",
|
||||||
resAjax = $.ajax({
|
url : ajaxCurrentIndex,
|
||||||
type:"POST",
|
async: true,
|
||||||
url : ajaxCurrentIndex,
|
data : {
|
||||||
async: true,
|
ajaxMode : "1",
|
||||||
data : {
|
ajax : "1",
|
||||||
ajaxMode : "1",
|
token : token,
|
||||||
ajax : "1",
|
controller : "AdminModules",
|
||||||
token : token,
|
action : "refreshModuleList"
|
||||||
controller : "AdminModules",
|
|
||||||
action : "refreshModuleList"
|
|
||||||
},
|
},
|
||||||
success : function(res,textStatus,jqXHR)
|
success : function(res,textStatus,jqXHR)
|
||||||
{
|
{
|
||||||
@@ -155,12 +180,11 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e){}
|
catch(e) { }
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Method to log on PrestaShop Addons WebServices
|
|
||||||
$(document).ready(function(){
|
// Method to log on PrestaShop Addons WebServices
|
||||||
$('#addons_login_button').click(function()
|
$('#addons_login_button').click(function()
|
||||||
{
|
{
|
||||||
var username_addons = $("#username_addons").val();
|
var username_addons = $("#username_addons").val();
|
||||||
@@ -204,6 +228,9 @@
|
|||||||
catch(e){}
|
catch(e){}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -33,11 +33,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr class="nodrag nodrop">
|
<tr class="nodrag nodrop">
|
||||||
<th class="center">
|
<th class="center">
|
||||||
<input type="checkbox" onclick="" class="noborder" name="checkme"><br>
|
<input type="checkbox" rel="false" class="noborder" id="checkme"><br>
|
||||||
<!-- TODO
|
|
||||||
<a href="#"><img border="0" src="../img/admin/down.gif"></a>
|
|
||||||
<a href="#"><img border="0" src="../img/admin/up_d.gif"></a>
|
|
||||||
-->
|
|
||||||
</th>
|
</th>
|
||||||
<th class="center"></th>
|
<th class="center"></th>
|
||||||
<th>{l s='Module name'}</th>
|
<th>{l s='Module name'}</th>
|
||||||
@@ -46,7 +42,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$modules item=module}
|
{foreach from=$modules item=module}
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" name="modules" value="{$module->name}" class="noborder"></td>
|
<td><input type="checkbox" name="modules" value="{$module->name}" {if !isset($module->confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if} class="noborder"></td>
|
||||||
<td><img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}"></td>
|
<td><img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}"></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
||||||
@@ -74,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><a href="{if isset($module->id) && $module->id gt 0}{$module->options.uninstall_url}{else}{$module->options.install_url}{/if}" class="button installed"><span>{if isset($module->id) && $module->id gt 0}{l s='Uninstall'}{else}{l s='Install'}{/if}</span></a></td>
|
<td><a {if isset($module->id) && $module->id gt 0 && !empty($module->options.uninstall_onclick)}onclick="{$module->options.uninstall_onclick}"{/if} href="{if isset($module->id) && $module->id gt 0}{$module->options.uninstall_url}{else}{$module->options.install_url}{/if}" class="button installed"><span>{if isset($module->id) && $module->id gt 0}{l s='Uninstall'}{else}{l s='Install'}{/if}</span></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -48,6 +48,12 @@
|
|||||||
|
|
||||||
<div id="moduleContainer">
|
<div id="moduleContainer">
|
||||||
{include file='modules/list.tpl'}
|
{include file='modules/list.tpl'}
|
||||||
|
{if count($modules)}
|
||||||
|
<div style="margin-top: 12px;">
|
||||||
|
<input type="button" class="button big" value="Install the selection" onclick="modules_management('install')"/>
|
||||||
|
<input type="button" class="button big" value="Uninstall the selection" onclick="modules_management('uninstall')" />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -817,7 +817,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$modules[$km]->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']);
|
$modules[$km]->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']);
|
||||||
$modules[$km]->options['install_url'] = self::$currentIndex.'&install='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
$modules[$km]->options['install_url'] = self::$currentIndex.'&install='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
||||||
$modules[$km]->options['uninstall_url'] = self::$currentIndex.'&uninstall='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
$modules[$km]->options['uninstall_url'] = self::$currentIndex.'&uninstall='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
||||||
$modules[$km]->options['uninstall_onclick'] = ((!method_exists($module, 'onclickOption')) ? ((empty($module->confirmUninstall)) ? '' : 'if(confirm(\''.addslashes($module->confirmUninstall).'\')) ').'document.location.href=\''.$modules[$km]->options['uninstall_url'].'\'' : $module->onclickOption('uninstall', $modules[$km]->options['uninstall_url']));
|
$modules[$km]->options['uninstall_onclick'] = ((!method_exists($module, 'onclickOption')) ? ((empty($module->confirmUninstall)) ? '' : 'return confirm(\''.addslashes($module->confirmUninstall).'\');') : $module->onclickOption('uninstall', $modules[$km]->options['uninstall_url']));
|
||||||
if (Tools::getValue('module_name') == $module->name && (int)Tools::getValue('conf') > 0)
|
if (Tools::getValue('module_name') == $module->name && (int)Tools::getValue('conf') > 0)
|
||||||
$modules[$km]->message = $this->_conf[(int)Tools::getValue('conf')];
|
$modules[$km]->message = $this->_conf[(int)Tools::getValue('conf')];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user