{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Thelia System Variables'}{/block} {block name="check-resource"}admin.configuration.variable{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="variables.top" location="variables_top" }

{intl l='Thelia system variables'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.variable" access="CREATE"}
{/loop}
{admin_sortable_header current_order=$order order='title' reverse_order='title_reverse' path={url path='/admin/configuration/variables'} label={intl l='Purpose'} } | {admin_sortable_header current_order=$order order='name' reverse_order='name_reverse' path={url path='/admin/configuration/variables'} label={intl l='Name'} } | {admin_sortable_header current_order=$order order='value' reverse_order='value_reverse' path={url path='/admin/configuration/variables'} label={intl l='Value'} } {hook name="variables.table-header" location="variables_table_header" } | {intl l='Action'}
--- | --- | --- | ---
{loop name="config" type="config" hidden="0" secured="*" backend_context="1" lang="$lang_id" order="$order"}
{$TITLE} | {if ! $SECURED} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.variable" access="UPDATE"} {$NAME} {/loop} {elseloop rel="can_change"} {$NAME} {/elseloop} {else} {$NAME} {/if} | {if $SECURED} {$VALUE} {else} {/if} {hook name="variables.table-row" location="variables_table_row" config_id={$ID} } | {if ! $SECURED} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.variable" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.variable" access="DELETE"} {/loop} {else} {/if}
{/loop}

{hook name="variables.bottom" location="variables_bottom" }
{* Adding a new variable *} {form name="thelia.admin.config.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "creation_dialog"} {form_hidden_fields} {form_field field='success_url'} {* on success, redirect to the edition page, _ID_ is replaced with the created variable ID, see controller *} {/form_field} {* We do not allow users to create hidden or secured variables from here *} {form_field field='hidden'} {/form_field} {form_field field='secured'} {/form_field} {form_field field='name'}
{$label} :
{/form_field} {form_field field='value'}
{$label} :
{/form_field} {form_field field='title'}
{$label} : {loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *}
{intl l='Enter here the category name in the default language (%title)' title={$TITLE}}
{form_field field='locale'} {/form_field} {/loop}
{/form_field} {hook name="variable.create-form" location="variable_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" dialog_title = {intl l="Create a new variable"} dialog_body = {$smarty.capture.creation_dialog nofilter} dialog_ok_label = {intl l="Create this variable"} form_action = {url path='/admin/configuration/variables/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete category confirmation dialog *} {capture "delete_dialog"} {hook name="variable.delete-form" location="variable_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_variable_dialog" dialog_title = {intl l="Delete a variable"} dialog_message = {intl l="Do you really want to delete this variable ?"} form_action = {token_url path='/admin/configuration/variables/delete'} form_content = {$smarty.capture.delete_dialog nofilter} } {/block} {block name="javascript-initialization"}
{/block} {block name="javascript-last-call"} {hook name="variables.js" location="variables-js" } {/block}