Inital commit
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<li><a href="{url path='/admin/configuration/variables'}">{intl l="System variables"}</a></li>
|
||||
</ul>
|
||||
|
||||
{module_include location='variables_top'}
|
||||
{hook name="variables.top" location="variables_top" }
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -32,14 +32,20 @@
|
||||
{intl l='Thelia system variables'}
|
||||
{loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.variable" access="CREATE"}
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new variable'}" href="#creation_dialog" data-toggle="modal">
|
||||
<a class="btn btn-primary action-btn" title="{intl l='Add a new variable'}" href="#creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
<button class="btn btn-default btn-primary" title="{intl l='Save chages'}"><span class="glyphicon glyphicon-ok"></span> {intl l='Save changes'}</button>
|
||||
<button class="btn btn-primary" title="{intl l='Save chages'}"><span class="glyphicon glyphicon-ok"></span> {intl l='Save changes'}</button>
|
||||
</div>
|
||||
{/loop}
|
||||
|
||||
</caption>
|
||||
<colgroup>
|
||||
<col />
|
||||
<col />
|
||||
<col width="250" />
|
||||
<col />
|
||||
</colgroup>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -73,7 +79,7 @@
|
||||
}
|
||||
</th>
|
||||
|
||||
{module_include location='variables_table_header'}
|
||||
{hook name="variables.table-header" location="variables_table_header" }
|
||||
|
||||
<th>{intl l='Action'}</th>
|
||||
</tr>
|
||||
@@ -105,23 +111,26 @@
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
{module_include location='variables_table_row'}
|
||||
{hook name="variables.table-row" location="variables_table_row" config_id={$ID} }
|
||||
|
||||
<td class="actions">
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-default btn-xs cancel-edit" id="cancel_edit_btn_{$ID}" data-id="{$ID}" title="{intl l='Cancel changes and revert to original value'}" href="#"><i class="glyphicon glyphicon-remove"></i></a>
|
||||
<div class="btn-toolbar btn toolbar-primary">
|
||||
<span class="glyphicon glyphicon-cog"></span>
|
||||
</div>
|
||||
<div class="toolbar-options hidden">
|
||||
<a class="cancel-edit" id="cancel_edit_btn_{$ID}" data-id="{$ID}" title="{intl l='Cancel changes and revert to original value'}" href="#"><span class="glyphicon glyphicon-remove"></span></a>
|
||||
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.variable" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs config-change" title="{intl l='Change this variable'}" href="{url path='/admin/configuration/variables/update' variable_id="$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
<a class="config-change" title="{intl l='Change this variable'}" href="{url path='/admin/configuration/variables/update' variable_id="$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.variable" access="DELETE"}
|
||||
<a class="btn btn-default btn-xs config-delete" title="{intl l='Delete this variable'}" href="#delete_variable_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
<a class="config-delete" title="{intl l='Delete this variable'}" href="#delete_variable_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This variable could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
<span title="{intl l='This variable could not be changed.'}" class="glyphicon glyphicon-ban-circle"></span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -134,7 +143,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='variables_bottom'}
|
||||
{hook name="variables.bottom" location="variables_bottom" }
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -148,38 +157,38 @@
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
{form_hidden_fields}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{form_field field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created variable ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/variables/update' variable_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{* We do not allow users to create hidden or secured variables from here *}
|
||||
|
||||
{form_field form=$form field='hidden'}
|
||||
{form_field field='hidden'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='secured'}
|
||||
{form_field field='secured'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='name'}
|
||||
{form_field field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Variable name'}" placeholder="{intl l='Variable name'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='value'}
|
||||
{form_field field='value'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" value="{$value}" title="{intl l='Variable value'}" placeholder="{intl l='Variable value'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
{form_field field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
|
||||
@@ -195,7 +204,7 @@
|
||||
|
||||
<div class="help-block">{intl l='Enter here the category name in the default language (%title)' title={$TITLE}}</div>
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
{form_field field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
@@ -203,7 +212,7 @@
|
||||
{/form_field}
|
||||
|
||||
|
||||
{module_include location='variable_create_form'}
|
||||
{hook name="variable.create-form" location="variable_create_form" }
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
@@ -216,7 +225,7 @@
|
||||
dialog_ok_label = {intl l="Create this variable"}
|
||||
|
||||
form_action = {url path='/admin/configuration/variables/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_enctype = {form_enctype}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
@@ -226,7 +235,7 @@
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="variable_id" id="variable_delete_id" value="" />
|
||||
|
||||
{module_include location='variable_delete_form'}
|
||||
{hook name="variable.delete-form" location="variable_delete_form" }
|
||||
|
||||
{/capture}
|
||||
|
||||
@@ -237,7 +246,7 @@
|
||||
dialog_title = {intl l="Delete a variable"}
|
||||
dialog_message = {intl l="Do you really want to delete this variable ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/variables/delete'}
|
||||
form_action = {token_url path='/admin/configuration/variables/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
@@ -286,5 +295,5 @@
|
||||
{/block}
|
||||
|
||||
{block name="javascript-last-call"}
|
||||
{module_include location='variables-js'}
|
||||
{hook name="variables.js" location="variables-js" }
|
||||
{/block}
|
||||
Reference in New Issue
Block a user