{extends file="admin-layout.tpl"} {block name="page-title"}{intl l='Hooks'}{/block} {block name="check-resource"}admin.configuration.country{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="hooks.top" location="hooks_top" } {loop type="auth" name="can_create" role="ADMIN" resource="admin.hook" access="UPDATE"}

### {intl l="Check the support of hooks."}

{assign template_type {$smarty.get.type|default:"1"}}
{intl l="Template type"}
{/loop}

{intl l='Hooks'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.hook" access="CREATE"} {/loop}
{admin_sortable_header current_order=$order order='id' reverse_order='id_reverse' path='/admin/hooks' label={intl l='ID'} } | {admin_sortable_header current_order=$order order='code' reverse_order='code_reverse' path='/admin/hooks' label={intl l='Code'} } | {admin_sortable_header current_order=$order order='alpha' reverse_order='alpha_reverse' path='/admin/hooks' label={intl l="Title"} } | {admin_sortable_header current_order=$order order='native' reverse_order='native_reverse' path='/admin/hooks' label={intl l="Official"} } | {admin_sortable_header current_order=$order order='enabled' reverse_order='enabled_reverse' path='/admin/hooks' label={intl l="Active"} } {hook name="hooks.table-header" location="hooks_table_header" } | {intl l='Actions'}
--- | --- | --- | --- | --- | ---
{loop name="hooks" type="hook" backend_context="1" hook_type=$template_type lang=$lang_id order=$order}
{$ID} | {$CODE} | {$TITLE} | {if $NATIVE} {else} {/if} | {hook name="hooks.table-row" location="hooks_table_row" hook_id={$ID} } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.hook" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.hook" access="DELETE"} {/loop}
{/loop} {elseloop rel="hooks"}
{intl l="No hooks has been created yet. Click the + button to create one."}
{/elseloop}

{intl l="Manage modules"} {intl l="Manage modules attachements"}
{hook name="hooks.bottom" location="hooks_bottom" }
{* Adding a new Hook *} {form name="thelia.admin.hook.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "hook_creation_dialog"} {form_hidden_fields exclude="locale,native"} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {render_form_field field="success_url" value={url path="/admin/hook/update/_ID_"}} {custom_render_form_field field="title"} {loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *} {render_form_field field="locale" value=$LOCALE}
{intl l="Enter here the value in the default language (%title)" title={$TITLE}}
{/loop} {/custom_render_form_field} {render_form_field field='code'} {render_form_field field='type'} {render_form_field field='native' value="0"} {render_form_field field='active'} {hook name="hook.create-form" location="hook_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "add_hook_dialog" dialog_title = {intl l="Create a new Hook"} dialog_body = {$smarty.capture.hook_creation_dialog nofilter} dialog_ok_label = {intl l="Create this hook"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path='/admin/hooks/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete confirmation dialog *} {capture "delete_dialog"} {hook name="hook.delete-form" location="hook_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete hook"} dialog_message = {intl l="Do you really want to delete this hook ?"} form_action = {token_url path='/admin/hooks/delete'} form_content = {$smarty.capture.delete_dialog nofilter} }

## {intl l="Error"}

{intl l="Impossible to change official hook. Please contact your administrator or try later"}

## {intl l="Error"}

{intl l="Impossible to change active flag. Please contact your administrator or try later"}
{/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
{/javascripts} {javascripts file='assets/js/libs/underscore-min.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="hooks.js" location="hooks-js" } {/block}