[+] BO : you can choose where you want to display modules in BO tabs
This commit is contained in:
1 parent
4523f4c849
commit
bc203bfc3a
8 files changed
+260
-132
No files matched your search
@@ -246,10 +246,18 @@ a.module_toggle_all{color: #268CCD;}
|
|||||||
right: 13px;
|
right: 13px;
|
||||||
top: 63px;
|
top: 63px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
padding: 10px;
|
padding: 10px 10px 0px 10px;
|
||||||
box-shadow: 1px 5px 5px #CCCCCC;
|
box-shadow: 1px 5px 5px #CCCCCC;
|
||||||
-moz-box-shadow: 1px 5px 10px #CCCCCC;
|
-moz-box-shadow: 1px 5px 10px #CCCCCC;
|
||||||
-webkit-box-shadow: 1px 5px 10px #CCCCCC;
|
-webkit-box-shadow: 1px 5px 10px #CCCCCC;
|
||||||
|
opacity: 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
.toolbarBox #modules_list_container #modules_list_container_content
|
||||||
|
{
|
||||||
|
max-height: 500px;
|
||||||
|
overflow: scroll;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbarBox #modules_list_container #modules_list_container_tab {margin-top: 10px;width: auto;height: auto; }
|
.toolbarBox #modules_list_container #modules_list_container_tab {margin-top: 10px;width: auto;height: auto; }
|
||||||
@@ -259,6 +267,45 @@ a.module_toggle_all{color: #268CCD;}
|
|||||||
.toolbarBox #modules_list_container #modules_list_container_tab #tab_module_switch {margin-bottom: 10px;}
|
.toolbarBox #modules_list_container #modules_list_container_tab #tab_module_switch {margin-bottom: 10px;}
|
||||||
.toolbarBox #modules_list_container #modules_list_loader {margin-top: 10px}
|
.toolbarBox #modules_list_container #modules_list_loader {margin-top: 10px}
|
||||||
|
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules > li {
|
||||||
|
height: 19px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules > li > a {
|
||||||
|
padding-right: 12px;
|
||||||
|
padding-left: 12px;
|
||||||
|
margin-right: 2px;
|
||||||
|
line-height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules > li > a {
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
-webkit-border-radius: 4px 4px 0 0;
|
||||||
|
-moz-border-radius: 4px 4px 0 0;
|
||||||
|
border-radius: 4px 4px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules > li > a:hover {
|
||||||
|
border-color: #C0C0C0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules > li > a {border: 1px solid #ddd;}
|
||||||
|
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules > .active > a,
|
||||||
|
.toolbarBox #modules_list_container .nav-tabs-modules > .active > a:hover {
|
||||||
|
color: #555555;
|
||||||
|
cursor: default;
|
||||||
|
background-color: #EEE;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:500;}
|
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:500;}
|
||||||
|
|
||||||
@@ -462,7 +509,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
|
|||||||
#moduleContainer .setup.non-install { background-color:#ec7000;}
|
#moduleContainer .setup.non-install { background-color:#ec7000;}
|
||||||
#moduleContainer .setup.must-have { background-color: #ec7000;}
|
#moduleContainer .setup.must-have { background-color: #ec7000;}
|
||||||
#moduleContainer .setup.off{ background-color:#ccc;}
|
#moduleContainer .setup.off{ background-color:#ccc;}
|
||||||
#moduleContainer .row-actions-module span { padding-right:5px;}
|
#moduleContainer .row-actions-module span {padding-right:5px;}
|
||||||
#moduleContainer .row-actions-module span a { font-size:12px;}
|
#moduleContainer .row-actions-module span a { font-size:12px;}
|
||||||
#moduleContainer .button.uninstalled,
|
#moduleContainer .button.uninstalled,
|
||||||
#moduleContainer .button.installed { float:right; clear:both; margin-top:15px; font-size:12px;}
|
#moduleContainer .button.installed { float:right; clear:both; margin-top:15px; font-size:12px;}
|
||||||
@@ -478,7 +525,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
|
|||||||
#modules_list_container_tab table tr td tr td {border: none}
|
#modules_list_container_tab table tr td tr td {border: none}
|
||||||
#modules_list_container_tab table tr:first-child {border-top:1px solid #ccc}
|
#modules_list_container_tab table tr:first-child {border-top:1px solid #ccc}
|
||||||
#modules_list_container_tab .imgm {width:32px;}
|
#modules_list_container_tab .imgm {width:32px;}
|
||||||
#modules_list_container_tab .moduleDesc { font-size:12px; margin-bottom:10px;}
|
#modules_list_container_tab .moduleDesc { font-size:12px;}
|
||||||
#modules_list_container_tab .moduleDesc h3 { color:#3A6EA7;margin: 0;font-size: 1.1em;text-align: left}
|
#modules_list_container_tab .moduleDesc h3 { color:#3A6EA7;margin: 0;font-size: 1.1em;text-align: left}
|
||||||
#modules_list_container_tab .moduleDesc .metadata { float:left; display:block; margin:5px 0;}
|
#modules_list_container_tab .moduleDesc .metadata { float:left; display:block; margin:5px 0;}
|
||||||
#modules_list_container_tab .moduleDesc .metadata dl { float:left; margin:0; padding-right:10px;}
|
#modules_list_container_tab .moduleDesc .metadata dl { float:left; margin:0; padding-right:10px;}
|
||||||
@@ -487,6 +534,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
|
|||||||
#modules_list_container_tab .moduleDesc .metadata dl dt { font-weight:bold; padding-right:5px;}
|
#modules_list_container_tab .moduleDesc .metadata dl dt { font-weight:bold; padding-right:5px;}
|
||||||
#modules_list_container_tab .moduleDesc p.desc { color:#666; font-family: Georgia; font-style: italic; font-size:12px; display:block; clear:both;text-align: left}
|
#modules_list_container_tab .moduleDesc p.desc { color:#666; font-family: Georgia; font-style: italic; font-size:12px; display:block; clear:both;text-align: left}
|
||||||
#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; position:relative; left:10px; padding:0px 4px; display: inline-block; border-radius:3px;}
|
#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; position:relative; left:10px; padding:0px 4px; display: inline-block; border-radius:3px;}
|
||||||
|
#modules_list_container_tab .row-actions-module {float: right;}
|
||||||
#modules_list_container_tab .setup.non-install { background-color:#ec7000;}
|
#modules_list_container_tab .setup.non-install { background-color:#ec7000;}
|
||||||
#modules_list_container_tab .setup.must-have { background-color: #ec7000;}
|
#modules_list_container_tab .setup.must-have { background-color: #ec7000;}
|
||||||
#modules_list_container_tab .setup.off{ background-color:#ccc;}
|
#modules_list_container_tab .setup.off{ background-color:#ccc;}
|
||||||
@@ -497,7 +545,6 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
|
|||||||
#modules_list_container_tab .moduleGridDesc { position:relative; display:block; height:30px;}
|
#modules_list_container_tab .moduleGridDesc { position:relative; display:block; height:30px;}
|
||||||
#modules_list_container_tab .moduleGridDesc h3 { color:#3A6EA7; margin:0;}
|
#modules_list_container_tab .moduleGridDesc h3 { color:#3A6EA7; margin:0;}
|
||||||
#modules_list_container_tab ul.listing-grid-module li select { position:absolute; top:0; right:0px; }
|
#modules_list_container_tab ul.listing-grid-module li select { position:absolute; top:0; right:0px; }
|
||||||
#modules_list_container_tab table tr td.tab_modules_actions_row { height: 20px}
|
|
||||||
|
|
||||||
|
|
||||||
/*MODULE POSITION*/
|
/*MODULE POSITION*/
|
||||||
|
|||||||
@@ -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>{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>
|
<td>
|
||||||
{assign var="module_name" value=$module->name}
|
{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}
|
{foreach $tabs AS $t}
|
||||||
{if $t.active}
|
{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>
|
<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_install_filter').change(function() { setFilter(); });
|
||||||
$('#module_status_filter').change(function() { setFilter(); });
|
$('#module_status_filter').change(function() { setFilter(); });
|
||||||
$('#country_module_value_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
|
// Method to save favorites preferences
|
||||||
$('.moduleFavorite').change(function()
|
$('.moduleFavorite').change(function()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,9 +34,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
|
||||||
<h3>{$module->displayName} {$module->version}
|
<h3>{$module->displayName} {$module->version}
|
||||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
|
||||||
<span class="setup must-have">{l s='Must Have'}</span>
|
|
||||||
{/if}
|
|
||||||
</h3>
|
</h3>
|
||||||
<p class="desc">
|
<p class="desc">
|
||||||
{if isset($module->description) && $module->description ne ''}
|
{if isset($module->description) && $module->description ne ''}
|
||||||
@@ -49,64 +47,33 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<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'}
|
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||||
<a href="{$module->addons_buy_url}" target="_blank" class="button updated">
|
<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>
|
<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}
|
{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">
|
<a href="{$module->options.install_url}" class="button action_tab_module"><span>{l s='Install'}</span></a>
|
||||||
<span>{if isset($module->id) && $module->id gt 0}{l s='Uninstall'}{else}{l s='Install'}{/if}</span>
|
{/if}
|
||||||
</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>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</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>
|
|
||||||
-->
|
|
||||||
@@ -30,28 +30,58 @@
|
|||||||
$('.action_tab_module').each( function (){
|
$('.action_tab_module').each( function (){
|
||||||
$(this).click(function () {
|
$(this).click(function () {
|
||||||
option = $('#'+$(this).data('option')+' :selected');
|
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');
|
window.location.href = $(option).data('href');
|
||||||
return false;
|
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>
|
</script>
|
||||||
<div id="tab_module_switch">
|
<ul class="nav-tabs-modules">
|
||||||
<a href="#" onclick="$('#tab_modules_list_not_installed').hide();$('#tab_modules_list_installed').show();return false;" class="button">{l s='Installed'}</a>
|
<li class="active"><a id="nav_tabs_modules_installed" href="#" onclick="">{l s='Installed'}</a></li>
|
||||||
<a href="#" onclick="$('#tab_modules_list_installed').hide();$('#tab_modules_list_not_installed').show();return false;" class="button">{l s='Not Installed'}</a>
|
<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>
|
</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}
|
{/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>
|
||||||
@@ -49,6 +49,7 @@
|
|||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
var submited = false
|
var submited = false
|
||||||
|
var modules_list_loaded = false;
|
||||||
$(function() {
|
$(function() {
|
||||||
//get reference on save link
|
//get reference on save link
|
||||||
btn_save = $('span[class~="process-icon-save"]').parent();
|
btn_save = $('span[class~="process-icon-save"]').parent();
|
||||||
@@ -117,41 +118,45 @@
|
|||||||
{/block}
|
{/block}
|
||||||
}
|
}
|
||||||
|
|
||||||
var modules_list_loaded = false;
|
if ({$tab_modules_open})
|
||||||
|
openModulesList();
|
||||||
$('.process-icon-modules-list').parent('a').click( function (){
|
|
||||||
$('#modules_list_container').slideDown();
|
|
||||||
if (!modules_list_loaded)
|
|
||||||
{
|
|
||||||
$.ajax({
|
|
||||||
type:"POST",
|
|
||||||
url : '{$admin_module_ajax_url}',
|
|
||||||
async: true,
|
|
||||||
data : {
|
|
||||||
ajax : "1",
|
|
||||||
controller : "AdminModules",
|
|
||||||
action : "getTabModulesList",
|
|
||||||
tab_modules_list : '{$tab_modules_list}'
|
|
||||||
},
|
|
||||||
success : function(data)
|
|
||||||
{
|
|
||||||
$('#modules_list_container_tab').html(data).slideDown();
|
|
||||||
$('#modules_list_loader').hide();
|
|
||||||
modules_list_loaded = true;
|
|
||||||
},
|
|
||||||
error: function(res,textStatus,jqXHR)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('#modules_list_container_tab').slideDown();
|
|
||||||
$('#modules_list_loader').hide();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.process-icon-modules-list').parent('a').unbind().bind('click', function (){
|
||||||
|
openModulesList();
|
||||||
|
});
|
||||||
|
|
||||||
|
function openModulesList()
|
||||||
|
{
|
||||||
|
$('#modules_list_container').slideDown();
|
||||||
|
if (!modules_list_loaded)
|
||||||
|
{
|
||||||
|
$.ajax({
|
||||||
|
type:"POST",
|
||||||
|
url : '{$admin_module_ajax_url}',
|
||||||
|
async: true,
|
||||||
|
data : {
|
||||||
|
ajax : "1",
|
||||||
|
controller : "AdminModules",
|
||||||
|
action : "getTabModulesList",
|
||||||
|
tab_modules_list : '{$tab_modules_list}',
|
||||||
|
back_tab_modules_list : '{$back_tab_modules_list}',
|
||||||
|
},
|
||||||
|
success : function(data)
|
||||||
|
{
|
||||||
|
$('#modules_list_container_tab').html(data).slideDown();
|
||||||
|
$('#modules_list_loader').hide();
|
||||||
|
modules_list_loaded = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#modules_list_container_tab').slideDown();
|
||||||
|
$('#modules_list_loader').hide();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
|
|||||||
@@ -1414,10 +1414,13 @@ class AdminControllerCore extends Controller
|
|||||||
'href' => '#',
|
'href' => '#',
|
||||||
'desc' => $this->l('Modules List')
|
'desc' => $this->l('Modules List')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'tab_modules_list' => implode(',', $tab_modules_list),
|
'tab_modules_list' => implode(',', $tab_modules_list),
|
||||||
'admin_module_ajax_url' => $this->context->link->getAdminLink('AdminModules')));
|
'admin_module_ajax_url' => $this->context->link->getAdminLink('AdminModules'),
|
||||||
|
'back_tab_modules_list' => $this->context->link->getAdminLink(Tools::getValue('controller')),
|
||||||
|
'tab_modules_open' => (int)Tools::getValue('tab_modules_open')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -236,6 +236,9 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
public function ajaxProcessGetTabModulesList()
|
public function ajaxProcessGetTabModulesList()
|
||||||
{
|
{
|
||||||
$tab_modules_list = Tools::getValue('tab_modules_list');
|
$tab_modules_list = Tools::getValue('tab_modules_list');
|
||||||
|
$back = Tools::getValue('back_tab_modules_list');
|
||||||
|
if ($back)
|
||||||
|
$back .= '&tab_modules_open=1';
|
||||||
$modules_list = array('installed' =>array(), 'not_installed' => array());
|
$modules_list = array('installed' =>array(), 'not_installed' => array());
|
||||||
if ($tab_modules_list)
|
if ($tab_modules_list)
|
||||||
{
|
{
|
||||||
@@ -245,7 +248,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
if (in_array($module->name, $tab_modules_list))
|
if (in_array($module->name, $tab_modules_list))
|
||||||
{
|
{
|
||||||
$this->fillModuleData($module, 'select');
|
$this->fillModuleData($module, 'select', $back);
|
||||||
if ($module->id)
|
if ($module->id)
|
||||||
$modules_list['installed'][] = $module;
|
$modules_list['installed'][] = $module;
|
||||||
else
|
else
|
||||||
@@ -294,6 +297,22 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
die('OK');
|
die('OK');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function ajaxProcessSaveTabModulePreferences()
|
||||||
|
{
|
||||||
|
$values = Tools::getValue('value_pref');
|
||||||
|
$module = Tools::getValue('module_pref');
|
||||||
|
if (Validate::isModuleName($module))
|
||||||
|
{
|
||||||
|
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'tab_module_preference` WHERE `id_employee` = '.(int)$this->id_employee.' AND `module` = \''.pSQL($module).'\'');
|
||||||
|
if (is_array($values) && count($values))
|
||||||
|
foreach($values as $value)
|
||||||
|
Db::getInstance()->execute('
|
||||||
|
INSERT INTO `'._DB_PREFIX_.'tab_module_preference` (`id_tab_module_preference`, `id_employee`, `id_tab`, `module`)
|
||||||
|
VALUES (NULL, '.(int)$this->id_employee.', '.(int)$value.', \''.pSQL($module).'\');');
|
||||||
|
}
|
||||||
|
die('OK');
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Get current URL
|
** Get current URL
|
||||||
**
|
**
|
||||||
@@ -759,6 +778,9 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
// Call appropriate module callback
|
// Call appropriate module callback
|
||||||
if (!isset($ppmReturn))
|
if (!isset($ppmReturn))
|
||||||
$this->postProcessCallback();
|
$this->postProcessCallback();
|
||||||
|
|
||||||
|
if ($back = Tools::getValue('back'))
|
||||||
|
Tools::redirectAdmin($back);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -787,12 +809,17 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
return $html_error;
|
return $html_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
** Display Modules Lists
|
* Display modules list
|
||||||
**
|
*
|
||||||
*/
|
* @param $module
|
||||||
|
* @param $output_type (link or select)
|
||||||
|
* @param $back
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
protected $translationsTab = array();
|
protected $translationsTab = array();
|
||||||
public function displayModuleOptions($module, $output_type = 'link')
|
public function displayModuleOptions($module, $output_type = 'link', $back = null)
|
||||||
{
|
{
|
||||||
if (!isset($this->translationsTab['Disable this module']))
|
if (!isset($this->translationsTab['Disable this module']))
|
||||||
{
|
{
|
||||||
@@ -803,10 +830,19 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$this->translationsTab['Reset'] = $this->l('Reset');
|
$this->translationsTab['Reset'] = $this->l('Reset');
|
||||||
$this->translationsTab['Configure'] = $this->l('Configure');
|
$this->translationsTab['Configure'] = $this->l('Configure');
|
||||||
$this->translationsTab['Delete'] = $this->l('Delete');
|
$this->translationsTab['Delete'] = $this->l('Delete');
|
||||||
|
$this->translationsTab['Install'] = $this->l('Install');
|
||||||
|
$this->translationsTab['Uninstall'] = $this->l('Uninstall');
|
||||||
$this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this?'] = $this->l('This action will permanently remove the module from the server. Are you sure you want to do this?');
|
$this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this?'] = $this->l('This action will permanently remove the module from the server. Are you sure you want to do this?');
|
||||||
}
|
}
|
||||||
|
|
||||||
$modules_options = array(
|
$modules_options = array(
|
||||||
|
'configure-module' => array(
|
||||||
|
'href' => self::$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name),
|
||||||
|
'onclick' => $module->onclick_option && isset($module->onclick_option_content['configure']) ? $module->onclick_option_content['configure'] : '',
|
||||||
|
'title' => '',
|
||||||
|
'text' => $this->translationsTab['Configure'],
|
||||||
|
'cond' => $module->id && isset($module->is_configurable) && $module->is_configurable,
|
||||||
|
),
|
||||||
'desactive-module' => array(
|
'desactive-module' => array(
|
||||||
'href' => self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab,
|
'href' => self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab,
|
||||||
'onclick' => $module->active && $module->onclick_option && isset($module->onclick_option_content['desactive']) ? $module->onclick_option_content['desactive'] : '' ,
|
'onclick' => $module->active && $module->onclick_option && isset($module->onclick_option_content['desactive']) ? $module->onclick_option_content['desactive'] : '' ,
|
||||||
@@ -821,13 +857,6 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
'text' => $this->translationsTab['Reset'],
|
'text' => $this->translationsTab['Reset'],
|
||||||
'cond' => $module->id && $module->active,
|
'cond' => $module->id && $module->active,
|
||||||
),
|
),
|
||||||
'configure-module' => array(
|
|
||||||
'href' => self::$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name),
|
|
||||||
'onclick' => $module->onclick_option && isset($module->onclick_option_content['configure']) ? $module->onclick_option_content['configure'] : '',
|
|
||||||
'title' => '',
|
|
||||||
'text' => $this->translationsTab['Configure'],
|
|
||||||
'cond' => $module->id && isset($module->is_configurable) && $module->is_configurable,
|
|
||||||
),
|
|
||||||
'delete-module' => array(
|
'delete-module' => array(
|
||||||
'href' => self::$currentIndex.'&delete='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name),
|
'href' => self::$currentIndex.'&delete='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name),
|
||||||
'onclick' => $module->onclick_option && isset($module->onclick_option_content['delete']) ? $module->onclick_option_content['delete'] : 'return confirm(\''.$this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this?'].'\');',
|
'onclick' => $module->onclick_option && isset($module->onclick_option_content['delete']) ? $module->onclick_option_content['delete'] : 'return confirm(\''.$this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this?'].'\');',
|
||||||
@@ -843,15 +872,22 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
if ($output_type == 'link')
|
if ($output_type == 'link')
|
||||||
$return .= '<span class="'.$option_name.'">
|
$return .= '<span class="'.$option_name.'">
|
||||||
<a class="action_module" href="'.$option['href'].'" onclick="'.$option['onclick'].'" title="'.$option['title'].'">'.$option['text'].'</a>
|
<a class="action_module" href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" onclick="'.$option['onclick'].'" title="'.$option['title'].'">'.$option['text'].'</a>
|
||||||
</span>';
|
</span>';
|
||||||
else if ($output_type == 'select')
|
else if ($output_type == 'select')
|
||||||
$return .= '<option id="'.$option_name.'" data-href="'.$option['href'].'" data-onclick="'.$option['onclick'].'">'.$option['text'].'</option>';
|
$return .= '<option id="'.$option_name.'" data-href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" data-onclick="'.$option['onclick'].'">'.$option['text'].'</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($output_type == 'select')
|
if ($output_type == 'select')
|
||||||
|
{
|
||||||
|
if (!$module->id)
|
||||||
|
$return = '<option data-onclick="" data-href="'.self::$currentIndex.'&install='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(!is_null($back) ? '&back='.urlencode($back) : '').'" >'.$this->translationsTab['Install'].'</option>'.$return;
|
||||||
|
else
|
||||||
|
$return = '<option data-onclick="" data-href="'.self::$currentIndex.'&uninstall='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(!is_null($back) ? '&back='.urlencode($back) : '').'" >'.$this->translationsTab['Uninstall'].'</option>'.$return;
|
||||||
$return = '<select id="select_'.$module->name.'">'.$return.'</select>';
|
$return = '<select id="select_'.$module->name.'">'.$return.'</select>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1038,6 +1074,13 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
// Browse modules list
|
// Browse modules list
|
||||||
foreach ($modules as $km => $module)
|
foreach ($modules as $km => $module)
|
||||||
{
|
{
|
||||||
|
//if we are in favorites view we only display installed modules
|
||||||
|
if (Tools::getValue('select') == 'favorites' && !$module->id)
|
||||||
|
{
|
||||||
|
unset($modules[$km]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Upgrade Module process, init check if a module could be upgraded
|
// Upgrade Module process, init check if a module could be upgraded
|
||||||
if (Module::initUpgradeModule($module))
|
if (Module::initUpgradeModule($module))
|
||||||
{
|
{
|
||||||
@@ -1161,7 +1204,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$smarty->assign($tpl_vars);
|
$smarty->assign($tpl_vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fillModuleData(&$module, $output_type = 'link')
|
public function fillModuleData(&$module, $output_type = 'link', $back = null)
|
||||||
{
|
{
|
||||||
$obj = null;
|
$obj = null;
|
||||||
if ($module->onclick_option)
|
if ($module->onclick_option)
|
||||||
@@ -1172,7 +1215,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$module->logo = 'logo.gif';
|
$module->logo = 'logo.gif';
|
||||||
if (file_exists('../modules/'.$module->name.'/logo.png'))
|
if (file_exists('../modules/'.$module->name.'/logo.png'))
|
||||||
$module->logo = 'logo.png';
|
$module->logo = 'logo.png';
|
||||||
$module->optionsHtml = $this->displayModuleOptions($module, $output_type);
|
$module->optionsHtml = $this->displayModuleOptions($module, $output_type, $back);
|
||||||
$module->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']);
|
$module->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']);
|
||||||
$module->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);
|
$module->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);
|
||||||
$module->options['update_url'] = self::$currentIndex.'&update='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
$module->options['update_url'] = self::$currentIndex.'&update='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
||||||
|
|||||||
Reference in new issue
Block a user