// update localization and modules tabs

This commit is contained in:
Sarah Lorenzini
2013-07-31 14:47:21 +02:00
parent a1cc4d14d0
commit d744b9dbf2
14 changed files with 294 additions and 236 deletions
@@ -55,6 +55,7 @@
</tr> </tr>
</table> </table>
<input type="hidden" name="token" value="{$token}" /> <input type="hidden" name="token" value="{$token}" />
</fieldset>
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
@@ -2,7 +2,7 @@
{include file='controllers/modules/header.tpl'} {include file='controllers/modules/header.tpl'}
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<span class="pull-right"> <div class="btn-group pull-right">
<a class="btn btn-default" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}"> <a class="btn btn-default" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}">
<i class="icon-list"></i> <i class="icon-list"></i>
{l s='Normal view'} {l s='Normal view'}
@@ -11,7 +11,7 @@
<i class="icon-star"></i> <i class="icon-star"></i>
{l s='Favorites view'} {l s='Favorites view'}
</a> </a>
</span> </fiv>
</div> </div>
<div class="col-lg-12">&nbsp;</div> <div class="col-lg-12">&nbsp;</div>
<div id="container" class="col-lg-12"> <div id="container" class="col-lg-12">
@@ -31,12 +31,12 @@
</colgroup> </colgroup>
<thead> <thead>
<tr class="nodrag nodrop"> <tr class="nodrag nodrop">
<th class="center">{l s='Logo'}</th> <th>{l s='Logo'}</th>
<th class="center">{l s='Module Name'}</th> <th>{l s='Module Name'}</th>
<th>{l s='Description'}</th> <th>{l s='Description'}</th>
<th class="center">{l s='Status'}</th> <th>{l s='Status'}</th>
<th>{l s='Tab'}</th> <th>{l s='Tab'}</th>
<th class="center">{l s='Categories'}</th> <th>{l s='Categories'}</th>
<th>{l s='Interest'}</th> <th>{l s='Interest'}</th>
<th>{l s='Favorite'}</th> <th>{l s='Favorite'}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
@@ -45,16 +45,16 @@
<tbody> <tbody>
{foreach from=$modules key=km item=module} {foreach from=$modules key=km item=module}
<tr height="32" {if $km % 2 eq 0} class="alt_row"{/if}> <tr height="32" {if $km % 2 eq 0} class="alt_row"{/if}>
<td class="center"> <td>
<img src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}" width="57" height="57" /> <img src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}" width="57" height="57" />
</td> </td>
<td class="center moduleName"> <td class="moduleName">
<h5>{$module->displayName}</h5> <h5>{$module->displayName}</h5>
</td> </td>
<td> <td>
<span class="moduleFavDesc">{$module->description|truncate:80:'...'}</span> <span class="moduleFavDesc">{$module->description|truncate:80:'...'}</span>
</td> </td>
<td class="center setup"> <td class="setup">
{if isset($module->id) && $module->id gt 0} {if isset($module->id) && $module->id gt 0}
<span class="label label-success">{l s='Installed'}</span> <span class="label label-success">{l s='Installed'}</span>
{else} {else}
@@ -77,7 +77,7 @@
{/foreach} {/foreach}
</select> </select>
</td> </td>
<td class="center"> <td>
<span>{$module->categoryName}</span> <span>{$module->categoryName}</span>
</td> </td>
<td> <td>
@@ -94,7 +94,7 @@
<option value="0" {if isset($module->preferences.favorite) && $module->preferences.favorite eq '0'}selected="selected"{/if}>{l s='No'}</option> <option value="0" {if isset($module->preferences.favorite) && $module->preferences.favorite eq '0'}selected="selected"{/if}>{l s='No'}</option>
</select> </select>
</td> </td>
<td class="center" id="r_{$module->name}"> <td id="r_{$module->name}">
<span>&nbsp;</span> <span>&nbsp;</span>
</td> </td>
</tr> </tr>
@@ -28,7 +28,10 @@
<!--start addons login--> <!--start addons login-->
<div id="addons_login_div" class="row" > <div id="addons_login_div" class="row" >
<div class="col-lg-12"> <div class="col-lg-12">
<legend>{l s='You are logged into PrestaShop Addons.'}</legend> <h3>
<i class="icon-user"></i>
{l s='You are logged into PrestaShop Addons.'}
</h3>
<div class="row"> <div class="row">
<label class="control-label col-lg-9"> <label class="control-label col-lg-9">
<i class="icon-user"></i> {l s='Welcome'} {$username_addons} <i class="icon-user"></i> {l s='Welcome'} {$username_addons}
@@ -54,7 +57,10 @@
<div id="addons_login_div" class="row"> <div id="addons_login_div" class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<form id="addons_login_form" method="post" class="form-horizontal"> <form id="addons_login_form" method="post" class="form-horizontal">
<legend>{l s='Do you have a %s account?' sprintf='<a href="http://addons.prestashop.com/">PrestaShop Addons</a>'}</legend> <h3>
<i class="icon-user"></i>
{l s='Do you have a %s account?' sprintf='<a href="http://addons.prestashop.com/">PrestaShop Addons</a>'}
</h3>
<div class="row"> <div class="row">
<label class="control-label col-lg-3">{l s='Addons Login'} :</label> <label class="control-label col-lg-3">{l s='Addons Login'} :</label>
<div class="input-group col-lg-4"> <div class="input-group col-lg-4">
@@ -84,7 +90,6 @@
<!--end addons login--> <!--end addons login-->
{/if} {/if}
{/if} {/if}
<div class="clear">&nbsp;</div>
{/if} {/if}
<!--start filter module--> <!--start filter module-->
@@ -92,32 +92,7 @@
{/if} {/if}
</dl> </dl>
</div> </div>
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else}&nbsp;{/if}</p>
{if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="alert">{$module->message}</div>{/if} {if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="alert">{$module->message}</div>{/if}
<div class="row-fluid">
{if !isset($module->not_on_disk)}
{$module->optionsHtml}
{if isset($module->preferences) && isset($module->preferences['favorite']) && $module->preferences['favorite'] == 1}
<a class="btn btn-default btn-small action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
<a class="btn btn-default btn-small action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
{else}
<a class="btn btn-default btn-small action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
<a class="btn btn-default btn-small action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
{/if}
{else}
&nbsp;
{/if}
</div>
</div> </div>
</td> </td>
<td class="center"> <td class="center">
@@ -159,6 +134,43 @@
{/if} {/if}
</a> </a>
</p> </p>
<div class="row-fluid btn-group btn-group-action">
{if !isset($module->not_on_disk)}
<span class="btn btn-default btn-small">
<i class="icon-cog"></i> {l s='Choose an action'}
</span>
<button data-toggle="dropdown" class="btn btn-default btn-small dropdown-toggle">
<span class="caret"></span>&nbsp;
</button>
<ul class="dropdown-menu">
{$module->optionsHtml}
{if isset($module->preferences) && isset($module->preferences['favorite']) && $module->preferences['favorite'] == 1}
<li>
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
</li>
<li>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
</li>
{else}
<li>
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
</li>
<li>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
</li>
{/if}
{else}
&nbsp;
{/if}
</div>
{/if} {/if}
</div> </div>
</td> </td>
@@ -38,7 +38,7 @@
{/if} {/if}
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<span class="pull-right"> <div class="btn-group pull-right">
<a class="btn btn-default" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}"> <a class="btn btn-default" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}">
<i class="icon-list"></i> <i class="icon-list"></i>
{l s='Normal view'} {l s='Normal view'}
@@ -47,36 +47,37 @@
<i class="icon-star"></i> <i class="icon-star"></i>
{l s='Favorites view'} {l s='Favorites view'}
</a> </a>
</span> </div>
</div> </div>
<div id="container"> <div id="container">
<!--start sidebar module--> <!--start sidebar module-->
<div class="row-fluid"> <div class="row-fluid">
<div class="categorieTitle col-lg-3"> <div class="categorieTitle col-lg-3">
<legend>{l s='Categories'}</legend> <div class="list-group">
<ul class="tab nav nav-pills nav-stacked"> <h3>
<li class="tab-row {if isset($categoryFiltered.favorites)}active{/if}"> <i class="icon-reorder"></i>
<a class="tab-page" href="{$currentIndex}&token={$token}&filterCategory=favorites"> {l s='Categories'}
{l s='Favorites'} <span class="badge pull-right">{$nb_modules_favorites}</span> </h3>
</a> <a class="list-group-item {if isset($categoryFiltered.favorites)}active{/if}" href="{$currentIndex}&token={$token}&filterCategory=favorites">
</li> {l s='Favorites'} <span class="badge pull-right">{$nb_modules_favorites}</span>
<li class="tab-row {if count($categoryFiltered) lte 0}active{/if}"> </a>
<a class="tab-page" href="{$currentIndex}&token={$token}&unfilterCategory=yes">
{l s='Total'} <span class="badge pull-right">{$nb_modules}</span> <a class="list-group-item {if count($categoryFiltered) lte 0}active{/if}" href="{$currentIndex}&token={$token}&unfilterCategory=yes">
</a> {l s='Total'} <span class="badge pull-right">{$nb_modules}</span>
</li> </a>
{foreach from=$list_modules_categories item=module_category key=module_category_key} {foreach from=$list_modules_categories item=module_category key=module_category_key}
<li class="tab-row {if isset($categoryFiltered[$module_category_key])}active{/if}"> <a class="list-group-item {if isset($categoryFiltered[$module_category_key])}active{/if}" href="{$currentIndex}&token={$token}&{if isset($categoryFiltered[$module_category_key])}un{/if}filterCategory={$module_category_key}">
<a class="tab-page" href="{$currentIndex}&token={$token}&{if isset($categoryFiltered[$module_category_key])}un{/if}filterCategory={$module_category_key}"> {$module_category.name} <span class="badge pull-right">{$module_category.nb}</span>
{$module_category.name} <span class="badge pull-right">{$module_category.nb}</span> </a>
</a>
</li>
{/foreach} {/foreach}
</ul> </div>
</div> </div>
</div> </div>
<div id="moduleContainer" class="col-lg-9"> <div id="moduleContainer" class="col-lg-9">
<legend>{l s='Modules list'}</legend> <h3>
<i class="icon-list-ul"></i>
{l s='Modules list'}
</h3>
{include file='controllers/modules/list.tpl'} {include file='controllers/modules/list.tpl'}
</div> </div>
</div> </div>
@@ -26,29 +26,67 @@
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
<div class="leadin">{block name="leadin"}{/block}</div> <div class="leadin">{block name="leadin"}{/block}</div>
<form action="{$url_submit}" id={$table}_form method="post"> <form action="{$url_submit}" id={$table}_form method="post" class="form-horizontal">
{if $display_key} {if $display_key}
<input type="hidden" name="show_modules" value="{$display_key}" /> <input type="hidden" name="show_modules" value="{$display_key}" />
{/if} {/if}
<fieldset> <fieldset>
<legend><img src="../img/t/AdminModulesPositions.gif" />{l s='Transplant a module'}</legend> <h3>
<label>{l s='Module'} :</label> <i class="icon-paste"></i>
<div class="margin-form"> {l s='Transplant a module'}
<select name="id_module" {if $edit_graft} disabled="disabled"{/if}> </h3>
{foreach $modules as $module} <div class="row">
<option value="{$module->id}" {if $id_module == $module->id || (!$id_module && $show_modules == $module->id)}selected="selected"{/if}>{$module->displayName|stripslashes}</option> <label class="control-label col-lg-3 required"> {l s='Module:'}</label>
{/foreach} <div class="col-lg-6">
</select><sup> *</sup> <select name="id_module" {if $edit_graft} disabled="disabled"{/if}>
{foreach $modules as $module}
<option value="{$module->id}" {if $id_module == $module->id || (!$id_module && $show_modules == $module->id)}selected="selected"{/if}>{$module->displayName|stripslashes}</option>
{/foreach}
</select>
</div>
</div> </div>
<label>{l s='Hook into'} :</label> <div class="row">
<div class="margin-form"> <label class="control-label col-lg-3 required"> {l s='Hook into'} :</label>
<select name="id_hook" {if $edit_graft} disabled="disabled"{/if}> <div class="col-lg-6">
{foreach $hooks as $hook} <select name="id_hook" {if $edit_graft} disabled="disabled"{/if}>
<option value="{$hook['id_hook']}" {if $id_hook == $hook['id_hook']} selected="selected"{/if}>{$hook['name']}{if $hook['name'] != $hook['title']} ({$hook['title']}){/if}</option> {foreach $hooks as $hook}
{/foreach} <option value="{$hook['id_hook']}" {if $id_hook == $hook['id_hook']} selected="selected"{/if}>{$hook['name']}{if $hook['name'] != $hook['title']} ({$hook['title']}){/if}</option>
</select><sup> *</sup> {/foreach}
</select>
</div>
</div> </div>
<div class="row">
<label class="control-label col-lg-3">{l s='Exceptions'} :</label>
<div class="col-lg-6">
{if !$except_diff}
{$exception_list}
{else}
{foreach $exception_list_diff as $value}
{$value}
{/foreach}
{/if}
<div class="alert alert-block">
<p>{l s='Please specify the files for which you do not want the module to be displayed.'}.</p>
<p>{l s='Please input each filename, separated by a comma.'}.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
{if $edit_graft}
<input type="hidden" name="id_module" value="{$id_module}" />
<input type="hidden" name="id_hook" value="{$id_hook}" />
{/if}
<input type="submit" value="{l s='Save'}" name="{if $edit_graft}submitEditGraft{else}submitAddToHook{/if}" id="{$table}_form_submit_btn" class="btn btn-primary" />
<p>
<span class="text-danger">*</span>
{l s='Required field'}
</p>
</div>
</div>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA //<![CDATA
function position_exception_add(shopID) function position_exception_add(shopID)
@@ -78,28 +116,6 @@
} }
//]]> //]]>
</script> </script>
<label>{l s='Exceptions'} :</label>
<div class="margin-form">
{if !$except_diff}
{$exception_list}
{else}
{foreach $exception_list_diff as $value}
{$value}
{/foreach}
{/if}
{l s='Please specify the files for which you do not want the module to be displayed.'}.<br />
{l s='Please input each filename, separated by a comma.'}.
<br /><br />
</div>
<div class="margin-form">
{if $edit_graft}
<input type="hidden" name="id_module" value="{$id_module}" />
<input type="hidden" name="id_hook" value="{$id_hook}" />
{/if}
<input type="submit" value="{l s='Save'}" name="{if $edit_graft}submitEditGraft{else}submitAddToHook{/if}" id="{$table}_form_submit_btn" class="button" />
</div>
<div class="small"><sup>*</sup> {l s='Required field'}</div>
</fieldset> </fieldset>
</form> </form>
@@ -72,7 +72,7 @@
{foreach $hooks as $hook} {foreach $hooks as $hook}
<div class="row-light clearfix"> <div class="row-light clearfix">
<a name="{$hook['name']}"></a> <a name="{$hook['name']}"></a>
<table cellpadding="0" cellspacing="0" class="table table-striped table-hover {if $hook['module_count'] >= 2} tableDnD{/if}" id="{$hook['id_hook']}"> <table class="table {if $hook['module_count'] >= 2} tableDnD{/if}" id="{$hook['id_hook']}">
<colgroup> <colgroup>
<col width="10"> <col width="10">
<col width="30"> <col width="30">
@@ -80,94 +80,106 @@
<col width=""> <col width="">
<col width="50"> <col width="50">
</colgroup> </colgroup>
<tr class="nodrag nodrop"> <thead>
<th colspan="5"> <tr class="nodrag nodrop">
{if $hook['module_count'] && $can_move} {if $hook['module_count'] && $can_move}
<input type="checkbox" id="Ghook{$hook['id_hook']}" style="margin-right: 2px;" onclick="hookCheckboxes({$hook['id_hook']}, 0, this)"/> <th>
<input type="checkbox" id="Ghook{$hook['id_hook']}" style="margin-right: 2px;" onclick="hookCheckboxes({$hook['id_hook']}, 0, this)"/>
</th>
{/if} {/if}
<span>{$hook['title']} - </span> <th colspan="5">
<span class="badge">{$hook['module_count']} {if $hook['module_count'] > 1}{l s='Modules'}{else}{l s='Module'}{/if} </span> <h3>
{if !empty($hook['description'])} {$hook['title']} -
<p class="text-muted"> <span class="badge">{$hook['module_count']} {if $hook['module_count'] > 1}{l s='Modules'}{else}{l s='Module'}{/if} </span>
[{$hook['description']}] <span>({l s='Technical name: '}{$hook['name']})</span>
</p> </h3>
{/if} </th>
<p>({l s='Technical name: '}{$hook['name']})</p>
</th>
</tr>
{if $hook['module_count']}
{foreach $hook['modules'] as $position => $module}
{if isset($module['instance'])}
<tr id="{$hook['id_hook']}_{$module['instance']->id}" {cycle values='class="alt_row",'}>
<td align="center">
<input type="checkbox" id="mod{$hook['id_hook']}_{$module['instance']->id}" class="hook{$hook['id_hook']}" onclick="hookCheckboxes({$hook['id_hook']}, 1, this)" name="unhooks[]" value="{$hook['id_hook']}_{$module['instance']->id}"/>
</td>
{if !$display_key}
<td align="center" class="positions">{$module@iteration}</td>
<td {if $can_move && $hook['module_count'] >= 2} align=center class="dragHandle"{/if} id="td_{$hook['id_hook']}_{$module['instance']->id}">
{if $can_move}
<a {if {$module@iteration} == 1} style="display: none;"{/if} href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&direction=0&token={$token}&changePosition#{$hook['name']}">
<img src="../img/admin/up.gif" alt="{l s='Up'}" title="{l s='Up'}" />
</a><br />
<a {if {$module@iteration} == count($hook['modules'])} style="display: none;"{/if} href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&direction=1&token={$token}&changePosition#{$hook['name']}">
<img src="../img/admin/down.gif" alt="{l s='Down'}" title="{l s='Down'}" />
</a>
{/if}
</td>
<td>
<div class="lab_modules_positions" for="mod{$hook['id_hook']}_{$module['instance']->id}">
{else}
<td colspan="3">
<div class="lab_modules_positions" for="mod{$hook['id_hook']}_{$module['instance']->id}">
{/if}
<h4>
<img src="../modules/{$module['instance']->name}/logo.png" alt="{$module['instance']->name|stripslashes}" />
{$module['instance']->displayName|stripslashes}
</h4>
<dl class="dl-horizontal">
<dt>{l s='Version:'}</dt>
<dd>
{if $module['instance']->version}v{if $module['instance']->version|intval == $module['instance']->version}{sprintf('%.1f', $module['instance']->version)}{else}{$module['instance']->version|floatval}{/if}{/if}
</dd>
<dt>{l s='Description:'}</dt>
<dd>
{$module['instance']->description}
</dd>
</dl>
</div>
</td>
<td>
<div class="btn-group btn-group-action">
<span class="btn btn-default btn-small">{l s='Choose an action'}</span>
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>&nbsp;
</button>
<ul class="dropdown-menu">
<li>
<a href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&editGraft{if $display_key}&show_modules={$display_key}{/if}&token={$token}">
<i class="icon-pencil"></i>
{l s='Edit'}
</a>
</li>
<li>
<a href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&deleteGraft{if $display_key}&show_modules={$display_key}{/if}&token={$token}">
<i class="icon-trash"></i>
{l s='Delete'}
</a>
</li>
</ul>
</div>
</td>
</tr>
{/if}
{/foreach}
{else}
<tr>
<td colspan="5">
<p class="text-warning">{l s='No module was found for this hook.'}</p>
</td>
</tr> </tr>
{/if} </thead>
<tbody>
{if !empty($hook['description'])}
<tr>
<td colspan="5">
<p class="text-muted">
[{$hook['description']}]
</p>
</td>
</tr>
{/if}
{if $hook['module_count']}
{foreach $hook['modules'] as $position => $module}
{if isset($module['instance'])}
<tr id="{$hook['id_hook']}_{$module['instance']->id}" {cycle values='class="alt_row",'}>
<td align="center">
<input type="checkbox" id="mod{$hook['id_hook']}_{$module['instance']->id}" class="hook{$hook['id_hook']}" onclick="hookCheckboxes({$hook['id_hook']}, 1, this)" name="unhooks[]" value="{$hook['id_hook']}_{$module['instance']->id}"/>
</td>
{if !$display_key}
<td align="center" class="positions">{$module@iteration}</td>
<td {if $can_move && $hook['module_count'] >= 2} align=center class="dragHandle"{/if} id="td_{$hook['id_hook']}_{$module['instance']->id}">
{if $can_move}
<a {if {$module@iteration} == 1} style="display: none;"{/if} href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&direction=0&token={$token}&changePosition#{$hook['name']}">
<img src="../img/admin/up.gif" alt="{l s='Up'}" title="{l s='Up'}" />
</a><br />
<a {if {$module@iteration} == count($hook['modules'])} style="display: none;"{/if} href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&direction=1&token={$token}&changePosition#{$hook['name']}">
<img src="../img/admin/down.gif" alt="{l s='Down'}" title="{l s='Down'}" />
</a>
{/if}
</td>
<td>
<div class="lab_modules_positions" for="mod{$hook['id_hook']}_{$module['instance']->id}">
{else}
<td colspan="3">
<div class="lab_modules_positions" for="mod{$hook['id_hook']}_{$module['instance']->id}">
{/if}
<h4>
<img src="../modules/{$module['instance']->name}/logo.png" alt="{$module['instance']->name|stripslashes}" />
{$module['instance']->displayName|stripslashes}
</h4>
<dl class="dl-horizontal">
<dt>{l s='Version:'}</dt>
<dd>
{if $module['instance']->version}v{if $module['instance']->version|intval == $module['instance']->version}{sprintf('%.1f', $module['instance']->version)}{else}{$module['instance']->version|floatval}{/if}{/if}
</dd>
<dt>{l s='Description:'}</dt>
<dd>
{$module['instance']->description}
</dd>
</dl>
</div>
</td>
<td>
<div class="btn-group btn-group-action">
<span class="btn btn-default btn-small">{l s='Choose an action'}</span>
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>&nbsp;
</button>
<ul class="dropdown-menu">
<li>
<a href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&editGraft{if $display_key}&show_modules={$display_key}{/if}&token={$token}">
<i class="icon-pencil"></i>
{l s='Edit'}
</a>
</li>
<li>
<a href="{$current}&id_module={$module['instance']->id}&id_hook={$hook['id_hook']}&deleteGraft{if $display_key}&show_modules={$display_key}{/if}&token={$token}">
<i class="icon-trash"></i>
{l s='Delete'}
</a>
</li>
</ul>
</div>
</td>
</tr>
{/if}
{/foreach}
{else}
<tr>
<td colspan="5">
<p class="text-warning">{l s='No module was found for this hook.'}</p>
</td>
</tr>
{/if}
</tbody>
</table> </table>
</div> </div>
{/foreach} {/foreach}
@@ -32,7 +32,6 @@
{$modules_list} {$modules_list}
{/if} {/if}
{if $display_restrictions} {if $display_restrictions}
<legend>{l s='Payment module restrictions'}</legend>
{foreach $lists as $list} {foreach $lists as $list}
{include file='controllers/payment/restrictions.tpl'} {include file='controllers/payment/restrictions.tpl'}
{/foreach} {/foreach}
@@ -24,18 +24,21 @@
*} *}
<form action="{$url_submit}" method="post" id="form_{$list['name_id']}" class="form-horizontal"> <form action="{$url_submit}" method="post" id="form_{$list['name_id']}" class="form-horizontal">
<fieldset class="well"> <fieldset>
<legend><img src="../img/admin/{$list['icon']}.gif" />&nbsp;{$list['title']}</legend> <h3>
<i class="{$list['icon']}"></i>
{$list['title']}
</h3>
<p class="help-block">{$list['desc']}</p> <p class="help-block">{$list['desc']}</p>
<table cellpadding="0" cellspacing="0" class="table table-striped table-hover"> <table cellpadding="0" cellspacing="0" class="table table-striped table-hover">
<tr> <tr>
<th width="20%">{$list['title']}</th> <th width="40%">{$list['title']}</th>
{foreach $payment_modules as $module} {foreach $payment_modules as $module}
{if $module->active} {if $module->active}
<th class="center"> <th>
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'} {if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
<input type="hidden" id="checkedBox_{$list['name_id']}_{$module->name}" value="checked"/> <input type="hidden" id="checkedBox_{$list['name_id']}_{$module->name}" value="checked"/>
<a href="javascript:checkPaymentBoxes('{$list['name_id']}', '{$module->name}')" style="text-decoration:none;"> <a href="javascript:checkPaymentBoxes('{$list['name_id']}', '{$module->name}')">
{/if} {/if}
&nbsp;<img src="{$ps_base_uri}modules/{$module->name}/logo.gif" alt="{$module->name}" title="{$module->displayName}"/> &nbsp;<img src="{$ps_base_uri}modules/{$module->name}/logo.gif" alt="{$module->name}" title="{$module->displayName}"/>
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'} {if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
@@ -46,13 +49,13 @@
{/foreach} {/foreach}
</tr> </tr>
{foreach $list['items'] as $item} {foreach $list['items'] as $item}
<tr class="{cycle values=",alt_row"}"> <tr>
<td> <td>
<span>{$item['name']}</span> <span>{$item['name']}</span>
</td> </td>
{foreach $payment_modules as $key_module => $module} {foreach $payment_modules as $key_module => $module}
{if $module->active} {if $module->active}
<td class="center"> <td>
{assign var='type' value='null'} {assign var='type' value='null'}
{if !$item['check_list'][$key_module]} {if !$item['check_list'][$key_module]}
{* Keep $type to null *} {* Keep $type to null *}
@@ -76,13 +79,13 @@
</tr> </tr>
{/foreach} {/foreach}
{if $list['name_id'] === 'currency'} {if $list['name_id'] === 'currency'}
<tr class="{cycle values=",alt_row"}"> <tr>
<td> <td>
<span>{l s='Customer currency'}</span> <span>{l s='Customer currency'}</span>
</td> </td>
{foreach $payment_modules as $module} {foreach $payment_modules as $module}
{if $module->active} {if $module->active}
<td class="center"> <td>
{if $module->currencies && $module->currencies_mode == 'radio'} {if $module->currencies && $module->currencies_mode == 'radio'}
<input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-1"{if in_array(-1, $module->$list['name_id'])} checked="checked" <input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-1"{if in_array(-1, $module->$list['name_id'])} checked="checked"
{/if} /> {/if} />
@@ -93,13 +96,13 @@
{/if} {/if}
{/foreach} {/foreach}
</tr> </tr>
<tr class="{cycle values=",alt_row"}"> <tr>
<td> <td>
<span>{l s='Shop default currency'}</span> <span>{l s='Shop default currency'}</span>
</td> </td>
{foreach $payment_modules as $module} {foreach $payment_modules as $module}
{if $module->active} {if $module->active}
<td class="center"> <td>
{if $module->currencies && $module->currencies_mode == 'radio'} {if $module->currencies && $module->currencies_mode == 'radio'}
<input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-2"{if in_array(-2, $module->$list['name_id'])} checked="checked" <input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-2"{if in_array(-2, $module->$list['name_id'])} checked="checked"
{/if} {/if}
@@ -114,7 +117,7 @@
{/if} {/if}
</table> </table>
<p class="text-right"> <p class="text-right">
<button type="submit" class="btn btn-default" name="submitModule{$list['name_id']}"> <button type="submit" class="btn btn-primary" name="submitModule{$list['name_id']}">
<i class="icon-ok"></i> <i class="icon-ok"></i>
{l s='Save restrictions'} {l s='Save restrictions'}
</button> </button>
@@ -23,29 +23,33 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<legend>{l s='Modules list'}</legend> <fieldset>
<div id="modules_list_container_tab" class="row"> <h3>
<div class="col-lg-12"> <i class="icon-list-ul"></i>
{if count($modules_list)} {l s='Modules list'}
<table border="0" cellpadding="0" cellspacing="5" class="table table-striped table-hover"> </h3>
{counter start=1 assign="count"} <div id="modules_list_container_tab" class="row">
{foreach from=$modules_list item=module} <div class="col-lg-12">
<div style="width:400px">{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}}</div> {if count($modules_list)}
{if $count %3 == 0} <table class="table">
</li> {counter start=1 assign="count"}
<li> {foreach from=$modules_list item=module}
{/if} <div>{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}}</div>
{counter} {if $count %3 == 0}
{/foreach} {/if}
</table> {counter}
{else} {/foreach}
<table border="0" cellpadding="0" cellspacing="5" class="table table-striped table-hover"> </table>
<tr> {else}
<td> <table border="0" cellpadding="0" cellspacing="5" class="table table-striped table-hover">
<div class="alert alert-block">{l s='No modules available in this section.'}</div> <tr>
</td> <td>
</tr> <div class="alert alert-block">{l s='No modules available in this section.'}</div>
</table> </td>
{/if} </tr>
</table>
{/if}
</div>
</div> </div>
</div> </fieldset>
+5 -5
View File
@@ -3003,11 +3003,11 @@ class AdminControllerCore extends Controller
if ($option['cond']) if ($option['cond'])
{ {
if ($output_type == 'link') if ($output_type == 'link')
$return .= '<span class="'.$option_name.'"> $return .= '<li>
<a class="btn btn-default btn-small action_module" href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" onclick="'.$option['onclick'].'" title="'.$option['title'].'"> <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'].' <i class="icon-'.(isset($option['icon']) && $option['icon'] ? $option['icon']:'cog' ).'"></i> '.$option['text'].'
</a> </a>
</span>'; </li>';
elseif ($output_type == 'select') elseif ($output_type == 'select')
$return .= '<option id="'.$option_name.'" data-href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" 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>';
} }
@@ -394,21 +394,26 @@ class AdminModulesPositionsControllerCore extends AdminController
if (!is_array($file_list)) if (!is_array($file_list))
$file_list = ($file_list) ? array($file_list) : array(); $file_list = ($file_list) ? array($file_list) : array();
$content = '<input type="text" name="exceptions['.$shop_id.']" size="40" value="'.implode(', ', $file_list).'" id="em_text_'.$shop_id.'">'; $content = '<p><input type="text" name="exceptions['.$shop_id.']" size="40" value="'.implode(', ', $file_list).'" id="em_text_'.$shop_id.'"/></p>';
if ($shop_id) if ($shop_id)
{ {
$shop = new Shop($shop_id); $shop = new Shop($shop_id);
$content .= ' ('.$shop->name.')'; $content .= ' ('.$shop->name.')';
} }
$content .= '<br /><select id="em_list_'.$shop_id.'">'; $content .= '<p>
<select id="em_list_'.$shop_id.'">';
// @todo do something better with controllers // @todo do something better with controllers
$controllers = Dispatcher::getControllers(_PS_FRONT_CONTROLLER_DIR_); $controllers = Dispatcher::getControllers(_PS_FRONT_CONTROLLER_DIR_);
ksort($controllers); ksort($controllers);
foreach ($controllers as $k => $v) foreach ($controllers as $k => $v)
$content .= '<option value="'.$k.'">'.$k.'</option>'; $content .= '<option value="'.$k.'">'.$k.'</option>';
$content .= '</select> <input type="button" class="button" value="'.$this->l('Add').'" onclick="position_exception_add('.$shop_id.')" /> $content .= '</select>
<input type="button" class="button" value="'.$this->l('Remove').'" onclick="position_exception_remove('.$shop_id.')" /><br /><br />'; </p>
<p>
<input type="button" class="btn btn-default" value="'.$this->l('Add').'" onclick="position_exception_add('.$shop_id.')" />
<input type="button" class="btn btn-default" value="'.$this->l('Remove').'" onclick="position_exception_remove('.$shop_id.')" />
</p>';
return $content; return $content;
} }
+3 -3
View File
@@ -172,21 +172,21 @@ class AdminPaymentControllerCore extends AdminController
'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'), 'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'),
'name_id' => 'currency', 'name_id' => 'currency',
'identifier' => 'id_currency', 'identifier' => 'id_currency',
'icon' => 'dollar', 'icon' => 'icon-money',
), ),
array('items' => Group::getGroups($this->context->language->id), array('items' => Group::getGroups($this->context->language->id),
'title' => $this->l('Group restrictions'), 'title' => $this->l('Group restrictions'),
'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'), 'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'),
'name_id' => 'group', 'name_id' => 'group',
'identifier' => 'id_group', 'identifier' => 'id_group',
'icon' => 'group', 'icon' => 'icon-group',
), ),
array('items' =>Country::getCountries($this->context->language->id), array('items' =>Country::getCountries($this->context->language->id),
'title' => $this->l('Country restrictions'), 'title' => $this->l('Country restrictions'),
'desc' => $this->l('Please mark each checkbox for the country, or countries, in which you want the payment module(s) to be available.'), 'desc' => $this->l('Please mark each checkbox for the country, or countries, in which you want the payment module(s) to be available.'),
'name_id' => 'country', 'name_id' => 'country',
'identifier' => 'id_country', 'identifier' => 'id_country',
'icon' => 'world', 'icon' => 'icon-globe',
) )
); );
+1 -1
View File
@@ -124,7 +124,7 @@ class AdminStatesControllerCore extends AdminController
'id' => 'id_country', 'id' => 'id_country',
'name' => 'name', 'name' => 'name',
), ),
'desc' => $this->l('Country where the state, region or city is located') 'hint' => $this->l('Country where the state, region or city is located')
), ),
array( array(
'type' => 'select', 'type' => 'select',