{extends file="admin-layout.tpl"} {block name="page-title"}{intl l='API list access'}{/block} {block name="check-resource"}admin.configuration.api{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="api.top" location='api_top'}

{intl l="Api"} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.api" access="CREATE"} {/loop}
{intl l="Label"} | {intl l="Api key"} | {intl l="Secure key"} | {intl l="profile"} | {intl l="Actions"}
--- | --- | --- | --- | ---
{foreach $api_list as $api}
{$api.Label} | {$api.ApiKey} | {intl l="download"} | {if $api.ProfileId} {loop type="profile" name="admin-profile" id={$api.ProfileId}} {$TITLE} {/loop} {else} {intl l='Superadministrator'} {/if} | {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.api" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.api" access="DELETE"} {/loop}
{/foreach}

{hook name="api.bottom" location='api_bottom'}
{form name="thelia_api_create"} {capture name="api_create_dialog"} {form_hidden_fields} {form_field field="success_url"} {/form_field} {form_field field="label"}
{$label} :
{/form_field} {form_field field='profile'}
{$label} :
{/form_field} {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "api_create_dialog" dialog_title = {intl l="Create a new API access"} dialog_body = {$smarty.capture.api_create_dialog nofilter} dialog_ok_label = {intl l="Create"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/api"} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {capture "api_delete_dialog"} {hook name="api.delete-form" location='api_delete_form'} {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "api_delete_dialog" dialog_title = {intl l="Delete api access"} dialog_message = {intl l="Do you really want to delete this api access ?"} form_action = {url path='/admin/configuration/api/delete'} form_content = {$smarty.capture.api_delete_dialog nofilter} } {if $api_id > 0} {form name="thelia_api_update"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "api_update_dialog"} {form_field field='profile'} {form_hidden_fields}
{$label} :
{/form_field} {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "api_update_dialog" dialog_title = {intl l="Edit api access"} dialog_body = {$smarty.capture.api_update_dialog nofilter} dialog_ok_label = {intl l="Save"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/api/update/%id" id={$api_id}} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {/if} {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
{/javascripts}
{/block}