{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"}}
 
{/loop}
{hook name="hooks.table-header" location="hooks_table_header" } {loop name="hooks" type="hook" backend_context="1" hook_type=$template_type lang=$lang_id order=$order} {hook name="hooks.table-row" location="hooks_table_row" hook_id={$ID} } {/loop} {elseloop rel="hooks"} {/elseloop}
{intl l='Hooks'} {include file='renderer/buttons.html' btn_group=false buttons=[ [ 'type' => 'create', 'class' => 'action-btn', 'title' => {intl l='Add a new hook'}, 'href' => '#add_hook_dialog', 'auth' => ['resource' => 'admin.hook'], 'data' => [ 'toggle' => 'modal' ] ] ]}
{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"} } {intl l='Actions'}
{$ID} {$CODE} {$TITLE} {if $NATIVE} {else} {/if}
{include file='renderer/buttons.html' buttons=[ [ 'type' => 'edit', 'class' => 'hook-change', 'title' => {intl l='Change this hook'}, 'href' => {url path="/admin/hook/update/%id" id=$ID}, 'auth' => ['resource' => 'admin.hook'] ], [ 'type' => 'delete', 'class' => 'hook-delete', 'title' => {intl l='Delete this hook'}, 'href' => '#delete_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.hook'] ] ]}
{intl l="No hooks has been created yet. Click the + button to create one."}
{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}
{$TITLE}
{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} } {/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}