[+] BO : you can choose where you want to display modules in BO tabs
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
<td>{if isset($module->id) && $module->id gt 0}<span class="setup">{l s='Installed'}</span>{else}<span class="setup non-install">{l s='Not Installed'}</span>{/if}</td>
|
||||
<td>
|
||||
{assign var="module_name" value=$module->name}
|
||||
<select class="chosen" multiple="multiple">
|
||||
<select class="chosen moduleTabPreferencesChoise" name="t_{$module->name}" multiple="multiple">
|
||||
{foreach $tabs AS $t}
|
||||
{if $t.active}
|
||||
<option {if isset($tab_modules_preferences.$module_name) && in_array($t.id_tab, $tab_modules_preferences.$module_name)} selected="selected" {/if} class="group" value="{$t.id_tab}">{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}</option>
|
||||
|
||||
@@ -296,7 +296,40 @@
|
||||
$('#module_install_filter').change(function() { setFilter(); });
|
||||
$('#module_status_filter').change(function() { setFilter(); });
|
||||
$('#country_module_value_filter').change(function() { setFilter(); });
|
||||
|
||||
|
||||
$('.moduleTabPreferencesChoise').change(function()
|
||||
{
|
||||
var value_pref = $(this).val();
|
||||
var module_pref = $(this).attr('name');
|
||||
module_pref = module_pref.substring(2, module_pref.length);
|
||||
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url : ajaxCurrentIndex,
|
||||
async: true,
|
||||
data : {
|
||||
ajax : "1",
|
||||
token : token,
|
||||
controller : "AdminModules",
|
||||
action : "saveTabModulePreferences",
|
||||
module_pref : module_pref,
|
||||
value_pref : value_pref
|
||||
},
|
||||
success : function(data)
|
||||
{
|
||||
// res.status = cache or refresh
|
||||
if (data == 'OK')
|
||||
$('#r_' + module_pref).html(confirmPreferencesSaved);
|
||||
},
|
||||
error: function(res,textStatus,jqXHR)
|
||||
{
|
||||
//jAlert("TECHNICAL ERROR"+res);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Method to save favorites preferences
|
||||
$('.moduleFavorite').change(function()
|
||||
{
|
||||
|
||||
@@ -34,9 +34,7 @@
|
||||
<td>
|
||||
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
||||
<h3>{$module->displayName} {$module->version}
|
||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||
<span class="setup must-have">{l s='Must Have'}</span>
|
||||
{/if}
|
||||
|
||||
</h3>
|
||||
<p class="desc">
|
||||
{if isset($module->description) && $module->description ne ''}
|
||||
@@ -49,64 +47,33 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tab_modules_actions_row">
|
||||
<td>
|
||||
{if isset($module->id) && $module->id gt 0 }
|
||||
{if $module->active}
|
||||
<span class="setup">{l s='Enabled'}</span>
|
||||
{else}
|
||||
<span class="setup off">{l s='Disabled'}</span>
|
||||
{/if}
|
||||
{else}
|
||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||
<span class="setup must-have">{l s='Must Have'}</span>
|
||||
{else}
|
||||
<span class="setup off">{l s='Not installed'}</span>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
</td>
|
||||
<td class="tab_modules_actions_row">
|
||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||
<a href="{$module->addons_buy_url}" target="_blank" class="button updated">
|
||||
<span><img src="../img/admin/cart_addons.png"> {displayPrice price=$module->price currency=$module->id_currency}</span></a>
|
||||
{else if !isset($module->not_on_disk)}
|
||||
{$module->optionsHtml}
|
||||
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">Valider</a>
|
||||
{else}
|
||||
<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>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="tab_modules_actions_row">
|
||||
<div class="row-actions-module">
|
||||
{if !isset($module->not_on_disk)}
|
||||
{$module->optionsHtml}
|
||||
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">Valider</a>
|
||||
{else} {/if}
|
||||
</div>
|
||||
<a href="{$module->options.install_url}" class="button action_tab_module"><span>{l s='Install'}</span></a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<!--
|
||||
|
||||
<td>
|
||||
<img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}">
|
||||
<div>
|
||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||
<a href="{$module->addons_buy_url}" target="_blank" class="button updated">
|
||||
<span><img src="../img/admin/cart_addons.png"> {displayPrice price=$module->price currency=$module->id_currency}</span></a>
|
||||
{else}
|
||||
<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>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
||||
<h3>{$module->displayName} {$module->version}
|
||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||
<span class="setup must-have">{l s='Must Have'}</span>
|
||||
{/if}
|
||||
</h3>
|
||||
<p class="desc">
|
||||
{if isset($module->description) && $module->description ne ''}
|
||||
{$module->description|truncate:100:'…'}
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</p>
|
||||
<div class="row-actions-module" style="float:right">
|
||||
{if !isset($module->not_on_disk)}
|
||||
{$module->optionsHtml}
|
||||
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">Valider</a>
|
||||
{else} {/if}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
</td>
|
||||
@@ -30,28 +30,58 @@
|
||||
$('.action_tab_module').each( function (){
|
||||
$(this).click(function () {
|
||||
option = $('#'+$(this).data('option')+' :selected');
|
||||
/* if ($(option).data('onclick')) */
|
||||
if ($(option).data('onclick') != '')
|
||||
{
|
||||
var f = eval("(function(){ "+$(option).data('onclick')+"})");
|
||||
if (f.call())
|
||||
window.location.href = $(option).data('href');
|
||||
}
|
||||
else
|
||||
window.location.href = $(option).data('href');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$('#nav_tabs_modules_installed').click( function () {
|
||||
$('#tab_modules_list_not_installed').hide();
|
||||
$('#tab_modules_list_installed').show();
|
||||
$(this).parent('li').addClass('active');
|
||||
$('#nav_tabs_modules_not_installed').parent('li').removeClass('active');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#nav_tabs_modules_not_installed').click( function () {
|
||||
$('#tab_modules_list_installed').hide();
|
||||
$('#tab_modules_list_not_installed').show();
|
||||
$(this).parent('li').addClass('active');
|
||||
$('#nav_tabs_modules_installed').parent('li').removeClass('active');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="tab_module_switch">
|
||||
<a href="#" onclick="$('#tab_modules_list_not_installed').hide();$('#tab_modules_list_installed').show();return false;" class="button">{l s='Installed'}</a>
|
||||
<a href="#" onclick="$('#tab_modules_list_installed').hide();$('#tab_modules_list_not_installed').show();return false;" class="button">{l s='Not Installed'}</a>
|
||||
<ul class="nav-tabs-modules">
|
||||
<li class="active"><a id="nav_tabs_modules_installed" href="#" onclick="">{l s='Installed'}</a></li>
|
||||
<li><a href="#" id="nav_tabs_modules_not_installed" >{l s='Not Installed'}</a></li>
|
||||
</ul>
|
||||
<div id="modules_list_container_content" style="clear:both">
|
||||
<table id="tab_modules_list_installed" style="clear:both">
|
||||
{if count($tab_modules_list.installed)}
|
||||
{foreach from=$tab_modules_list.installed item=module}
|
||||
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr><td><b>{l s='No modules available in this section.'}</b></td></tr>
|
||||
{/if}
|
||||
</table>
|
||||
<table id="tab_modules_list_not_installed" style="display:none;clear:both">
|
||||
{if count($tab_modules_list.not_installed)}
|
||||
{foreach from=$tab_modules_list.not_installed item=module}
|
||||
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr><td><b>{l s='No modules available in this section.'}</b></td></tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
<table id="tab_modules_list_installed">
|
||||
{foreach from=$tab_modules_list.installed item=module}
|
||||
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
||||
{/foreach}
|
||||
</table>
|
||||
<table id="tab_modules_list_not_installed" style="display:none">
|
||||
{foreach from=$tab_modules_list.not_installed item=module}
|
||||
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
||||
{/foreach}
|
||||
</table>
|
||||
{else}
|
||||
<b>{l s='No modules available in this section.'}</b>
|
||||
{/if}
|
||||
<p><b><a href="{$admin_module_favorites_view}" style="color:#666">{l s='Click here to choose which modules to display here'}</a></b></p>
|
||||
<p style="text-align:right;text-decoration:underline"><a href="{$admin_module_favorites_view}" style="color:#666">{l s='More options'}</a></p>
|
||||
Reference in New Issue
Block a user