Started category modification
This commit is contained in:
@@ -37,6 +37,7 @@ use Thelia\Model\Lang;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Core\Event\CategoryUpdatePositionEvent;
|
||||
use Thelia\Model\CategoryQuery;
|
||||
use Thelia\Form\CategoryModificationForm;
|
||||
|
||||
class CategoryController extends BaseAdminController
|
||||
{
|
||||
@@ -46,13 +47,10 @@ class CategoryController extends BaseAdminController
|
||||
* @return Symfony\Component\HttpFoundation\Response the response
|
||||
*/
|
||||
protected function renderList() {
|
||||
|
||||
$args = $this->setupArgs();
|
||||
|
||||
return $this->render('categories', $args);
|
||||
return $this->render('categories', $this->getTemplateArgs());
|
||||
}
|
||||
|
||||
protected function setupArgs() {
|
||||
protected function getTemplateArgs() {
|
||||
|
||||
// Get the category ID
|
||||
$category_id = $this->getRequest()->get('category_id', 0);
|
||||
@@ -164,8 +162,14 @@ class CategoryController extends BaseAdminController
|
||||
// Prepare the data that will hydrate the form
|
||||
$data = array(
|
||||
'id' => $category->getId(),
|
||||
'name' => $category->getTitle(),
|
||||
'locale' => $category->getLocale(),
|
||||
'title' => $category->getTitle(),
|
||||
'chapo' => $category->getChapo(),
|
||||
'description' => $category->getDescription(),
|
||||
'postscriptum' => $category->getPostscriptum(),
|
||||
'parent' => $category->getParent(),
|
||||
'visible' => $category->getVisible() ? true : false,
|
||||
'url' => $category->getUrl($this->getCurrentEditionLocale())
|
||||
// tbc !!!
|
||||
);
|
||||
|
||||
@@ -177,7 +181,7 @@ class CategoryController extends BaseAdminController
|
||||
}
|
||||
|
||||
// Render the edition template.
|
||||
return $this->render('category-edit', array('category_id' => $this->getRequest()->get('category_id')));
|
||||
return $this->render('category-edit', $this->getTemplateArgs());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,7 +126,7 @@ class AsseticHelper
|
||||
//
|
||||
// before generating 3bc974a-ad3ef47.css, delete 3bc974a-* files.
|
||||
//
|
||||
if (/*$dev_mode == true || */! file_exists($target_file)) {
|
||||
if ($dev_mode == true || ! file_exists($target_file)) {
|
||||
|
||||
// Delete previous version of the file
|
||||
list($commonPart, $dummy) = explode('-', $asset_target_path);
|
||||
|
||||
@@ -23,51 +23,33 @@
|
||||
namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Model\LangQuery;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
/**
|
||||
* A base form for all objects with standard contents.
|
||||
*
|
||||
* @author Franck Allimant <franck@cqfdev.fr>
|
||||
*/
|
||||
abstract class BaseDescForm extends BaseForm
|
||||
class CategoryModificationForm extends CategoryCreationForm
|
||||
{
|
||||
use StandardDescriptionFieldsTrait;
|
||||
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm(true);
|
||||
|
||||
$this->formBuilder
|
||||
->add("locale", "hidden", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Title",
|
||||
"label_attr" => array(
|
||||
"for" => "title"
|
||||
)
|
||||
)
|
||||
)
|
||||
->add("chapo", "text", array(
|
||||
"label" => "Summary",
|
||||
"label_attr" => array(
|
||||
"for" => "summary"
|
||||
)
|
||||
))
|
||||
->add("description", "text", array(
|
||||
"label" => "Detailed description",
|
||||
"label_attr" => array(
|
||||
"for" => "detailed_description"
|
||||
)
|
||||
))
|
||||
->add("postscriptum", "text", array(
|
||||
"label" => "Conclusion",
|
||||
"label_attr" => array(
|
||||
"for" => "conclusion"
|
||||
)
|
||||
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
|
||||
|
||||
->add("visible", "checkbox", array(
|
||||
"label" => Translator::getInstance()->trans("This category is online on the front office.")
|
||||
))
|
||||
;
|
||||
|
||||
// Add standard description fields
|
||||
$this->addStandardDescFields(array('title', 'locale'));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_category_modification";
|
||||
}
|
||||
}
|
||||
@@ -27,12 +27,12 @@ use Thelia\Model\LangQuery;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
|
||||
class ConfigModificationForm extends BaseDescForm
|
||||
class ConfigModificationForm extends BaseForm
|
||||
{
|
||||
use StandardDescriptionFieldsTrait;
|
||||
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm(true);
|
||||
|
||||
$this->formBuilder
|
||||
->add("id", "hidden", array(
|
||||
"constraints" => array(
|
||||
@@ -61,6 +61,9 @@ class ConfigModificationForm extends BaseDescForm
|
||||
"label" => "Prevent variable modification or deletion, except for super-admin"
|
||||
))
|
||||
;
|
||||
|
||||
// Add standard description fields
|
||||
$this->addStandardDescFields();
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
||||
@@ -24,35 +24,69 @@ namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
/**
|
||||
* This form defines all standard description fields:
|
||||
* - title
|
||||
* - chapo
|
||||
* - description
|
||||
* - postscriptum
|
||||
* A trait to add standard localized description fields to a form.
|
||||
*
|
||||
* @author Franck Allimant <franck@cqfdev.fr>
|
||||
*/
|
||||
Trait StandardDescriptionFieldsTrait
|
||||
trait StandardDescriptionFieldsTrait
|
||||
{
|
||||
protected function addStandardDescriptionFields()
|
||||
/**
|
||||
* Add standard description fields + locale tot the form
|
||||
*
|
||||
* @param array $exclude name of the fields that should not be added to the form
|
||||
*/
|
||||
protected function addStandardDescFields($exclude = array())
|
||||
{
|
||||
if (! in_array('locale', $exclude))
|
||||
$this->formBuilder
|
||||
->add("locale", "hidden", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (! in_array('title', $exclude))
|
||||
$this->formBuilder
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => Translator::getInstance()->trans("Title"),
|
||||
"label_attr" => array(
|
||||
"for" => "title"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (! in_array('chapo', $exclude))
|
||||
$this->formBuilder
|
||||
->add("chapo", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Summary"),
|
||||
"label_attr" => array(
|
||||
"for" => "summary"
|
||||
)
|
||||
->add("chapo", "text", array())
|
||||
->add("description", "text", array())
|
||||
->add("postscriptum", "text", array())
|
||||
;
|
||||
));
|
||||
|
||||
if (! in_array('description', $exclude))
|
||||
$this->formBuilder
|
||||
->add("description", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Detailed description"),
|
||||
"label_attr" => array(
|
||||
"for" => "detailed_description"
|
||||
)
|
||||
));
|
||||
|
||||
if (! in_array('postscriptum', $exclude))
|
||||
$this->formBuilder
|
||||
->add("postscriptum", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Conclusion"),
|
||||
"label_attr" => array(
|
||||
"for" => "conclusion"
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -331,7 +331,6 @@
|
||||
{form name="thelia.admin.category.creation"}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
|
||||
{capture "category_creation_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="catalog edit-category">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
{include file="includes/categories-breadcrumb.html"}
|
||||
{include file="includes/catalog-breadcrumb.html"}
|
||||
|
||||
<div class="row">
|
||||
{loop name="category_edit" type="category" visible="*" id="{$current_category_id}" backend_context="1" lang="$edit_language_id"}
|
||||
@@ -26,6 +26,7 @@
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs admin-tabs" id="tabbed_menu">
|
||||
<li class="active">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.currencies.create"}
|
||||
<span class="pull-right">
|
||||
<button class="btn btn-default btn-info" title="{intl l='Update rates'}">{intl l='Update rates'} <span class="glyphicon glyphicon-globe"></span></button>
|
||||
<a class="btn btn-default btn-primary" title="{intl l='Add a new currency'}" href="#add_currency_dialog" data-toggle="modal">
|
||||
<a class="btn btn-default btn-primary" title="{intl l='Add a new currency'}" href="#creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
</span>
|
||||
@@ -163,7 +163,7 @@
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.currencies.delete"}
|
||||
<a class="btn btn-default btn-xs currency-delete" title="{intl l='Delete this currency'}" href="#delete_currency_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<a class="btn btn-default btn-xs currency-delete" title="{intl l='Delete this currency'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
@@ -199,19 +199,10 @@
|
||||
|
||||
{* Adding a new currency *}
|
||||
|
||||
<div class="modal fade" id="add_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Create a new currency"}</h3>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.currency.creation"}
|
||||
<form method="POST" action="{url path='/admin/configuration/currencies/create'}" {form_enctype form=$form}>
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
@@ -219,10 +210,6 @@
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/currencies/update' currency_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{if $form_error}<div class="alert alert-block alert-error" id="add_currency_dialog_error">{$form_error_message}</div>{/if}
|
||||
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
@@ -268,47 +255,40 @@
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
</div>
|
||||
{/capture}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this currency"}</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
||||
</div>
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
</form>
|
||||
dialog_id = "creation_dialog"
|
||||
dialog_title = {intl l="Create a new currency"}
|
||||
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||
|
||||
dialog_ok_label = {intl l="Create this currency"}
|
||||
|
||||
form_action = {url path='/admin/configuration/currencies/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
<div class="modal fade" id="delete_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete a currency"}</h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>{intl l="Do you really want to delete this currency ?"}</p>
|
||||
</div>
|
||||
|
||||
<form method="post" action="{url path='/admin/configuration/currencies/delete'}">
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="currency_id" id="currency_delete_id" value="" />
|
||||
{/capture}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
||||
</div>
|
||||
</form>
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
dialog_id = "delete_dialog"
|
||||
dialog_title = {intl l="Delete currency"}
|
||||
dialog_message = {intl l="Do you really want to delete this currency ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/currencies/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
@@ -329,27 +309,12 @@
|
||||
$('#currency_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
{* display the form creation dialog if it contains errors *}
|
||||
|
||||
{form name="thelia.admin.currency.creation"}
|
||||
{if #form_error}
|
||||
$('#add_currency_dialog').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
|
||||
$('#add_currency_dialog').on('hidden',function() {
|
||||
|
||||
// Hide error currency
|
||||
$('#add_currency_dialog_error').remove();
|
||||
|
||||
// Clear error status
|
||||
$("#add_currency_dialog .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#add_currency_dialog input[type=text]").val('');
|
||||
});
|
||||
// JS stuff for creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "creation_dialog"
|
||||
form_name = "thelia.admin.currency.creation"
|
||||
}
|
||||
|
||||
{* Inline editing of object position using bootstrap-editable *}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<caption>
|
||||
{intl l='Thelia mailing templates'}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.messages.create"}
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new mailing template'}" href="#add_message_dialog" data-toggle="modal">
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new mailing template'}" href="#creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
@@ -71,7 +71,7 @@
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.messages.delete"}
|
||||
<a class="btn btn-default btn-xs message-delete" title="{intl l='Delete this mailing template'}" href="#delete_message_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
<a class="btn btn-default btn-xs message-delete" title="{intl l='Delete this mailing template'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
@@ -102,21 +102,13 @@
|
||||
</div>
|
||||
|
||||
|
||||
{* Adding a new message *}
|
||||
{* Adding a new message *}
|
||||
|
||||
<div class="modal fade" id="add_message_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Create a new mailing template"}</h3>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.message.creation"}
|
||||
<form method="POST" action="{url path='/admin/configuration/messages/create'}" {form_enctype form=$form}>
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
@@ -130,10 +122,6 @@
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{if #form_error}<div class="alert alert-danger" id="add_message_dialog_error">#form_error_message</div>{/if}
|
||||
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
@@ -164,48 +152,39 @@
|
||||
|
||||
</div>
|
||||
{/form_field}
|
||||
{/capture}
|
||||
|
||||
</div>
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this mailing template"}</button>
|
||||
</div>
|
||||
dialog_id = "creation_dialog"
|
||||
dialog_title = {intl l="Create a new mailing template"}
|
||||
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||
|
||||
</form>
|
||||
dialog_ok_label = {intl l="Create this mailing template"}
|
||||
|
||||
form_action = {url path='/admin/configuration/messages/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
<div class="modal fade" id="delete_message_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete a mailing template"}</h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>{intl l="Do you really want to delete this mailing template ?"}</p>
|
||||
</div>
|
||||
|
||||
<form method="post" action="{url path='/admin/configuration/messages/delete'}">
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="message_id" id="message_delete_id" value="" />
|
||||
{/capture}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
||||
</div>
|
||||
</form>
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
dialog_id = "delete_dialog"
|
||||
dialog_title = {intl l="Delete mailing template"}
|
||||
dialog_message = {intl l="Do you really want to delete this mailing template ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/messages/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
@@ -217,26 +196,12 @@
|
||||
$('#message_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
{* display the form creation dialog if it contains errors *}
|
||||
|
||||
{form name="thelia.admin.message.creation"}
|
||||
{if #form_error}
|
||||
$('#add_message_dialog').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
|
||||
$('#add_message_dialog').on('hidden',function() {
|
||||
// Hide error message
|
||||
$('#add_message_dialog_error').remove();
|
||||
|
||||
// Clear error status
|
||||
$("#add_message_dialog .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#add_message_dialog input[type=text]").val('');
|
||||
});
|
||||
// JS stuff for creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "creation_dialog"
|
||||
form_name = "thelia.admin.message.creation"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -26,7 +26,7 @@
|
||||
{intl l='Thelia system variables'}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.variables.create"}
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new variable'}" href="#add_variable_dialog" data-toggle="modal">
|
||||
<a class="btn btn-default 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>
|
||||
@@ -135,10 +135,10 @@
|
||||
|
||||
{* Adding a new variable *}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
|
||||
{form name="thelia.admin.config.creation"}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
@@ -199,7 +199,7 @@
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "add_variable_dialog"
|
||||
dialog_id = "creation_dialog"
|
||||
dialog_title = {intl l="Create a new variable"}
|
||||
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
// JS stuff for creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "add_variable_dialog"
|
||||
dialog_id = "creation_dialog"
|
||||
form_name = "thelia.admin.config.creation"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user