// fix added form.tpl in AdminWebserviceController
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10224 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -95,7 +95,7 @@
|
||||
{else}
|
||||
<input type="text"
|
||||
name="{$input.name}"
|
||||
id="{$input.name}"
|
||||
id="{if isset($input.id)}{$input.id}{else}{$input.name}{/if}"
|
||||
value="{$fields_value[$input.name]}"
|
||||
{if isset($input.size)}size="{$input.size}"{/if}
|
||||
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if}
|
||||
|
||||
@@ -24,46 +24,93 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{extends file="helper/form/form.tpl"}
|
||||
{block name="defaultForm"}
|
||||
{$custom_form}
|
||||
<script type="text/javascript">
|
||||
|
||||
{block name="end_field_block"}
|
||||
{if $input.type == 'text' && $input.name == 'key'}
|
||||
<input type="button" value="{l s=' Generate! '}" class="button" onclick="gencode(32)" />
|
||||
{/if}
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name="start_field_block"}
|
||||
<div class="margin-form">
|
||||
{if $input.type == 'resources'}
|
||||
<p>{l s='Set the resource permissions for this key:'}</p>
|
||||
<table border="0" cellspacing="0" cellpadding="0" class="table accesses">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="center">{l s='Resource'}</th>
|
||||
<th width="30" class="center"></th>
|
||||
<th width="50" class="center">{l s='View (GET)'}</th>
|
||||
<th width="50" class="center">{l s='Modify (PUT)'}</th>
|
||||
<th width="50" class="center">{l s='Add (POST)'}</th>
|
||||
<th width="50" class="center">{l s='Delete (DELETE)'}</th>
|
||||
<th width="50" class="center">{l s='Fast view (HEAD)'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="all" style="vertical-align:middle">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th class="center"><input type="checkbox" class="all_get get " /></th>
|
||||
<th class="center"><input type="checkbox" class="all_put put " /></th>
|
||||
<th class="center"><input type="checkbox" class="all_post post " /></th>
|
||||
<th class="center"><input type="checkbox" class="all_delete delete" /></th>
|
||||
<th class="center"><input type="checkbox" class="all_head head" /></th>
|
||||
</tr>
|
||||
{foreach $ressources as $resource_name => $resource}
|
||||
<tr>
|
||||
<th class="center">{$resource_name}</th>
|
||||
<th class="center"><input type="checkbox" class="all"/></th>
|
||||
<td class="center"><input type="checkbox" {if isset($ressources[$resource_name]['forbidden_method']) && in_array('GET', $ressources[$resource_name]['forbidden_method'])}disabled="disabled"{/if} class="get" name="resources[{$resource_name}][GET]" {if isset($permissions[$resource_name]) && in_array('GET', $permissions[$resource_name])}checked="checked"{/if} /></td>
|
||||
<td class="center"><input type="checkbox" {if isset($ressources[$resource_name]['forbidden_method']) && in_array('PUT', $ressources[$resource_name]['forbidden_method'])}disabled="disabled"{/if} class="put" name="resources[{$resource_name}][PUT]" {if isset($permissions[$resource_name]) && in_array('PUT', $permissions[$resource_name])}checked="checked"{/if}/></td>
|
||||
<td class="center"><input type="checkbox" {if isset($ressources[$resource_name]['forbidden_method']) && in_array('POST', $ressources[$resource_name]['forbidden_method'])}disabled="disabled"{/if} class="post" name="resources[{$resource_name}][POST]" {if isset($permissions[$resource_name]) && in_array('POST', $permissions[$resource_name])}checked="checked"{/if}/></td>
|
||||
<td class="center"><input type="checkbox" {if isset($ressources[$resource_name]['forbidden_method']) && in_array('DELETE', $ressources[$resource_name]['forbidden_method'])}disabled="disabled"{/if} class="delete" name="resources[{$resource_name}][DELETE]" {if isset($permissions[$resource_name]) && in_array('DELETE', $permissions[$resource_name])}checked="checked"{/if}/></td>
|
||||
<td class="center"><input type="checkbox" {if isset($ressources[$resource_name]['forbidden_method']) && in_array('HEAD', $ressources[$resource_name]['forbidden_method'])}disabled="disabled"{/if} class="head" name="resources[{$resource_name}][HEAD]" {if isset($permissions[$resource_name]) && in_array('HEAD', $permissions[$resource_name])}checked="checked"{/if}/></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
$(function() {
|
||||
$('table.permissions input.all').click(function() {
|
||||
$('table.accesses input.all').click(function() {
|
||||
if($(this).is(':checked'))
|
||||
$(this).parent().parent().find('input.get:not(:checked), input.put:not(:checked), input.post:not(:checked), input.delete:not(:checked), input.head:not(:checked)').click();
|
||||
else
|
||||
$(this).parent().parent().find('input.get:checked, input.put:checked, input.post:checked, input.delete:checked, input.head:checked').click();
|
||||
});
|
||||
$('table.permissions .all_get').click(function() {
|
||||
$('table.accesses .all_get').click(function() {
|
||||
if($(this).is(':checked'))
|
||||
$(this).parent().parent().parent().find('input.get:not(:checked)').click();
|
||||
else
|
||||
$(this).parent().parent().parent().find('input.get:checked').click();
|
||||
});
|
||||
$('table.permissions .all_put').click(function() {
|
||||
$('table.accesses .all_put').click(function() {
|
||||
if($(this).is(':checked'))
|
||||
$(this).parent().parent().parent().find('input.put:not(:checked)').click();
|
||||
else
|
||||
$(this).parent().parent().parent().find('input.put:checked').click();
|
||||
});
|
||||
$('table.permissions .all_post').click(function() {
|
||||
$('table.accesses .all_post').click(function() {
|
||||
if($(this).is(':checked'))
|
||||
$(this).parent().parent().parent().find('input.post:not(:checked)').click();
|
||||
else
|
||||
$(this).parent().parent().parent().find('input.post:checked').click();
|
||||
});
|
||||
$('table.permissions .all_delete').click(function() {
|
||||
$('table.accesses .all_delete').click(function() {
|
||||
if($(this).is(':checked'))
|
||||
$(this).parent().parent().parent().find('input.delete:not(:checked)').click();
|
||||
else
|
||||
$(this).parent().parent().parent().find('input.delete:checked').click();
|
||||
});
|
||||
$('table.permissions .all_head').click(function() {
|
||||
$('table.accesses .all_head').click(function() {
|
||||
if($(this).is(':checked'))
|
||||
$(this).parent().parent().parent().find('input.head:not(:checked)').click();
|
||||
else
|
||||
$(this).parent().parent().parent().find('input.head:checked').click();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
Reference in New Issue
Block a user