{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" }
{hook name="variables.table-header" location="variables_table_header" } {loop name="config" type="config" hidden="0" secured="*" backend_context="1" lang="$lang_id" order="$order"} {hook name="variables.table-row" location="variables_table_row" config_id={$ID} } {/loop}
{intl l='Thelia system variables'} {include file='renderer/buttons.html' btn_group=false buttons=[ [ 'type' => 'create', 'class' => 'action-btn', 'title' => {intl l='Add a new variable'}, 'href' => '#creation_dialog', 'auth' => ['resource' => 'admin.configuration.variable'], 'data' => [ 'toggle' => 'modal' ] ], [ 'type' => 'save', 'class' => 'action-btn', 'title' => {intl l='Save chages'}, 'auth' => ['resource' => 'admin.configuration.variable'], 'with_text' => true, 'tag' => 'button', 'attr' => [ 'type' => 'submit' ] ] ]}
{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'} } {intl l='Action'}
{$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} {$typeTemplate = ""} {if preg_match('/^(active-)([a-z]{3,5})(-template)$/',$NAME, $typeTemplate) } {else} {/if} {/if} {if $IS_OVERRIDDEN_IN_ENV} .env {elseif ! $SECURED} {include file='renderer/buttons.html' buttons=[ [ 'type' => 'remove', 'id' => "cancel_edit_btn_$ID", 'class' => 'cancel-edit', 'title' => {intl l='Cancel changes and revert to original value'}, 'href' => "#", 'auth' => ['resource' => 'admin.configuration.variable'], 'data' => [ 'id' => $ID ] ], [ 'type' => 'edit', 'class' => 'config-change', 'title' => {intl l='Change this variable'}, 'href' => {url path='/admin/configuration/variables/update' variable_id=$ID}, 'auth' => ['resource' => 'admin.configuration.variable'] ], [ 'type' => 'delete', 'class' => 'config-delete', 'title' => {intl l='Delete this variable'}, 'href' => '#delete_variable_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.configuration.variable'] ] ]} {else} {/if}
{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'}
{/form_field} {form_field field='value'}
{/form_field} {form_field field='title'}
{loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *}
{$TITLE}
{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}