{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Administration profiles'}{/block} {block name="check-resource"}admin.configuration.profile{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="profiles.top" location="profiles_top" }

{intl l="Administration profiles"} {loop type="auth" name="can_create" role="ADMIN" resource="admin.profile" access="CREATE"} {/loop}
{intl l="Code"} | {intl l="Name"} | {intl l="Description"} {hook name="profile.table-header"} | {intl l="Actions"}
--- | --- | --- | ---
{loop type="profile" name="profiles" backend_context="1"} {$can_change = false} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.profile" access="UPDATE"} {$can_change = true} {/loop}
{if $can_change} {$CODE} {else} {$CODE} {/if} | {if $can_change} {$TITLE} {else} {$TITLE} {/if} | {$DESCRIPTION} {hook name="profile.table-row" profile_id=$ID} | {if $can_change} {/if} {assign linkedAdminCount {count name="linked-admin" type="admin" profile=$ID}} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.profile" access="DELETE"} {/loop}
{/loop} {elseloop rel="profiles"}
{intl l="No administration profile defined yet. Click the + button to create one."}
{/elseloop}

{hook name="profiles.bottom" location="profiles_bottom" }
{* -- Add profile confirmation dialog ----------------------------------- *} {form name="thelia.admin.profile.add"} {if $form_error_message} {$profileCreateError = true} {else} {$profileCreateError = false} {/if} {* Capture the dialog body, to pass it to the generic dialog *} {capture "profile_create_dialog"} {form_hidden_fields} {loop type="lang" name="current-edit-lang" default_only="1"}
{intl l="Enter information in the default language (%title)" title={$TITLE}}
{form_field field='locale'} {/form_field} {/loop} {form_field field='code'}
{$label} :
{/form_field} {form_field field='title'}
{$label} :
{/form_field} {form_field field='chapo'}
{$label} :
{/form_field} {form_field field='description'}
{$label} : {intl l="The detailed description."} {if $form_error}{$value}{/if}
{/form_field} {form_field field='postscriptum'}
{$label} :
{/form_field} {hook name="profile.create-form" location="profile_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "profile_create_dialog" dialog_title = {intl l="Create a new profile"} dialog_body = {$smarty.capture.profile_create_dialog nofilter} dialog_ok_label = {intl l="Create"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/profiles/add"} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Delete profile confirmation dialog ----------------------------------- *} {capture "profile_delete_dialog"} {hook name="profile.delete-form" location="profile_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "profile_delete_dialog" dialog_title = {intl l="Delete profile"} dialog_message = {intl l="Do you really want to delete this profile ?"} form_action = {token_url path='/admin/configuration/profiles/delete'} form_content = {$smarty.capture.profile_delete_dialog nofilter} } {include file = "includes/generic-warning-dialog.html" dialog_id = "profile_cannot_delete_dialog" dialog_title = {intl l="You can't delete this profile"} dialog_body = {intl l="They are some administrator which are linked to this profile. Please edit/remove them before deleting this profile."} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="profiles.js" location="profiles-js" } {hook name="wysiwyg.js" location="wysiwyg-profiles-js" } {/block}