[+] BO : Modal module list
This commit is contained in:
1 parent
e33cd2d13b
commit
5e2a3e3c13
5 files changed
+57
-74
No files matched your search
@@ -69,16 +69,24 @@
|
|||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
{else if !isset($module->not_on_disk)}
|
{else if !isset($module->not_on_disk)}
|
||||||
<td>
|
<td> </td>
|
||||||
<p>{$module->optionsHtml}</p>
|
|
||||||
</td>
|
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<p>
|
{if $module->optionsHtml|count > 0}
|
||||||
<a href="#" class="btn btn-default action_tab_module" data-option="select_{$module->name}">
|
<div id="list-action-button" class="btn-group">
|
||||||
<i class="icon-ok"></i>
|
{assign var=option value=$module->optionsHtml[0]}
|
||||||
{l s='Submit'}
|
{$option}
|
||||||
</a>
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" >
|
||||||
</p>
|
<span class="caret"> </span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
{foreach $module->optionsHtml key=key item=option}
|
||||||
|
{if $key != 0}
|
||||||
|
<li>{$option}</li>
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
{else}
|
{else}
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
|||||||
@@ -25,54 +25,19 @@
|
|||||||
*}
|
*}
|
||||||
|
|
||||||
{if isset($tab_modules_list) && !empty($tab_modules_list)}
|
{if isset($tab_modules_list) && !empty($tab_modules_list)}
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function() {
|
|
||||||
|
|
||||||
$('#nav_tabs_modules_installed').click(function () { showInstalledModules() });
|
|
||||||
$('#nav_tabs_modules_not_installed').click(function () { showNotInstalledModules() });
|
|
||||||
|
|
||||||
{if count($tab_modules_list.installed)}
|
|
||||||
showInstalledModules();
|
|
||||||
{else}
|
|
||||||
showNotInstalledModules();
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
bindTabModuleListAction();
|
|
||||||
});
|
|
||||||
|
|
||||||
function showInstalledModules(element)
|
|
||||||
{
|
|
||||||
$('#tab_modules_list_not_installed').hide();
|
|
||||||
$('#tab_modules_list_installed').show();
|
|
||||||
$('#nav_tabs_modules_installed').parent('li').addClass('active');
|
|
||||||
$('#nav_tabs_modules_not_installed').parent('li').removeClass('active');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showNotInstalledModules(element)
|
|
||||||
{
|
|
||||||
$('#tab_modules_list_installed').hide();
|
|
||||||
$('#tab_modules_list_not_installed').show();
|
|
||||||
$(element).parent('li').addClass('active');
|
|
||||||
$('#nav_tabs_modules_not_installed').parent('li').removeClass('active');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<ul class="nav">
|
<ul class="nav nav-tabs">
|
||||||
{if count($tab_modules_list.installed)}
|
{if count($tab_modules_list.installed)}
|
||||||
<li>
|
<li class="active">
|
||||||
<a id="nav_tabs_modules_installed" class="panel-content" href="#" onclick="">
|
<a href="#tab_modules_list_installed" data-toggle="tab">
|
||||||
<i class="icon-plus-sign-alt"></i>
|
|
||||||
{l s='Installed'}
|
{l s='Installed'}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
{if count($tab_modules_list.not_installed)}
|
{if count($tab_modules_list.not_installed)}
|
||||||
<li>
|
<li{if count($tab_modules_list.installed) == 0} class="active"{/if}>
|
||||||
<a href="#" id="nav_tabs_modules_not_installed" class="panel-content">
|
<a href="#tab_modules_list_not_installed" data-toggle="tab">
|
||||||
<i class="icon-minus-sign-alt"></i>
|
|
||||||
{l s='Not Installed'}
|
{l s='Not Installed'}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -80,21 +45,25 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="modules_list_container_content">
|
<div id="modules_list_container_content" class="tab-content">
|
||||||
{if count($tab_modules_list.installed)}
|
<div class="tab-pane{if count($tab_modules_list.installed)} active{/if}" id="tab_modules_list_installed">
|
||||||
<table id="tab_modules_list_installed" class="table">
|
{if count($tab_modules_list.installed)}
|
||||||
{foreach from=$tab_modules_list.installed item=module}
|
<table id="tab_modules_list_installed" class="table">
|
||||||
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
{foreach from=$tab_modules_list.installed item=module}
|
||||||
{/foreach}
|
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
||||||
</table>
|
{/foreach}
|
||||||
{/if}
|
</table>
|
||||||
{if count($tab_modules_list.not_installed)}
|
{/if}
|
||||||
<table id="tab_modules_list_not_installed" class="table">
|
</div>
|
||||||
{foreach from=$tab_modules_list.not_installed item=module}
|
<div class="tab-pane{if count($tab_modules_list.installed) == 0} active{/if}" id="tab_modules_list_not_installed">
|
||||||
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
{if count($tab_modules_list.not_installed)}
|
||||||
{/foreach}
|
<table id="tab_modules_list_not_installed" class="table">
|
||||||
</table>
|
{foreach from=$tab_modules_list.not_installed item=module}
|
||||||
{/if}
|
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}}
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="alert alert-block">
|
<div class="alert alert-block">
|
||||||
|
|||||||
@@ -42,12 +42,19 @@
|
|||||||
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
||||||
</a>
|
</a>
|
||||||
{if $k == 'modules-list'}
|
{if $k == 'modules-list'}
|
||||||
<div id="modules_list_container" style="display:none">
|
<div class="modal fade" id="modules_list_container">
|
||||||
<div style="float:right;margin:5px">
|
<div class="modal-dialog">
|
||||||
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">{l s='Modules'}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div id="modules_list_container_tab" style="display:none;"></div>
|
||||||
|
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0"></div>
|
|
||||||
<div id="modules_list_container_tab" style="display:none;"></div>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</li>
|
</li>
|
||||||
@@ -137,7 +144,7 @@
|
|||||||
|
|
||||||
function openModulesList()
|
function openModulesList()
|
||||||
{
|
{
|
||||||
$('#modules_list_container').slideDown();
|
$('#modules_list_container').modal('show');
|
||||||
if (!modules_list_loaded)
|
if (!modules_list_loaded)
|
||||||
{
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@@ -1727,7 +1727,6 @@ class AdminControllerCore extends Controller
|
|||||||
_PS_JS_DIR_.'ajax.js',
|
_PS_JS_DIR_.'ajax.js',
|
||||||
_PS_JS_DIR_.'toolbar.js',
|
_PS_JS_DIR_.'toolbar.js',
|
||||||
));
|
));
|
||||||
|
|
||||||
//loads specific javascripts for the admin theme, bootstrap.js should be moved into /js root directory
|
//loads specific javascripts for the admin theme, bootstrap.js should be moved into /js root directory
|
||||||
$this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/bootstrap.js');
|
$this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/bootstrap.js');
|
||||||
$this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/admin-theme.js');
|
$this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/admin-theme.js');
|
||||||
@@ -2918,7 +2917,7 @@ class AdminControllerCore extends Controller
|
|||||||
$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);
|
||||||
$link_admin_modules = $this->context->link->getAdminLink('AdminModules', true);
|
$link_admin_modules = $this->context->link->getAdminLink('AdminModules', true);
|
||||||
|
|
||||||
$module->options['install_url'] = $link_admin_modules.'&install='.urlencode($module->name).'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
$module->options['install_url'] = $link_admin_modules.'&install='.urlencode($module->name).'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name);
|
||||||
@@ -3003,7 +3002,7 @@ class AdminControllerCore extends Controller
|
|||||||
if ($option['cond'])
|
if ($option['cond'])
|
||||||
{
|
{
|
||||||
if ($output_type == 'link')
|
if ($output_type == 'link')
|
||||||
$return .= '<li><a class="'.$option_name.' action_module" href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" onclick="'.$option['onclick'].'" title="'.$option['title'].'"><i class="icon-'.(isset($option['icon']) && $option['icon'] ? $option['icon']:'cog' ).'"></i> '.$option['text'].'</a></li>';
|
$return .= '<li><a class="'.$option_name.' action_module" href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" onclick="'.$option['onclick'].'" title="'.$option['title'].'"><i class="icon-'.(isset($option['icon']) && $option['icon'] ? $option['icon']:'cog' ).'"></i> '.$option['text'].'</a></li>';
|
||||||
elseif ($output_type == 'array')
|
elseif ($output_type == 'array')
|
||||||
{
|
{
|
||||||
if (!is_array($return))
|
if (!is_array($return))
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
if ($perm)
|
if ($perm)
|
||||||
{
|
{
|
||||||
$this->fillModuleData($module, 'select', $back);
|
$this->fillModuleData($module, 'array');
|
||||||
if ($module->id)
|
if ($module->id)
|
||||||
$modules_list['installed'][] = $module;
|
$modules_list['installed'][] = $module;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user