Finished log configuration. All loggers are currentrly working
This commit is contained in:
@@ -81,7 +81,7 @@ class AdministratorCreationForm extends BaseForm
|
||||
array($this, "verifyPasswordField")
|
||||
)))
|
||||
),
|
||||
"label" => "Password confirmation",
|
||||
"label" => Translator::getInstance()->trans('Password confirmation'),
|
||||
"label_attr" => array(
|
||||
"for" => "password_confirmation"
|
||||
),
|
||||
@@ -94,7 +94,7 @@ class AdministratorCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank(),
|
||||
),
|
||||
"label" => "Profile",
|
||||
"label" => Translator::getInstance()->trans('Profile'),
|
||||
"label_attr" => array(
|
||||
"for" => "profile"
|
||||
),
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Thelia\Form;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
class ConfigCreationForm extends BaseForm
|
||||
{
|
||||
@@ -41,7 +42,7 @@ class ConfigCreationForm extends BaseForm
|
||||
$this->formBuilder
|
||||
->add("name", "text", array(
|
||||
"constraints" => $name_constraints,
|
||||
"label" => "Name *",
|
||||
"label" => Translator::getInstance()->trans('Name *'),
|
||||
"label_attr" => array(
|
||||
"for" => "name"
|
||||
)
|
||||
@@ -50,7 +51,7 @@ class ConfigCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank()
|
||||
),
|
||||
"label" => "Purpose *",
|
||||
"label" => Translator::getInstance()->trans('Purpose *'),
|
||||
"label_attr" => array(
|
||||
"for" => "purpose"
|
||||
)
|
||||
@@ -61,14 +62,14 @@ class ConfigCreationForm extends BaseForm
|
||||
)
|
||||
))
|
||||
->add("value", "text", array(
|
||||
"label" => "Value *",
|
||||
"label" => Translator::getInstance()->trans('Value *'),
|
||||
"label_attr" => array(
|
||||
"for" => "value"
|
||||
)
|
||||
))
|
||||
->add("hidden", "hidden", array())
|
||||
->add("secured", "hidden", array(
|
||||
"label" => "Prevent variable modification or deletion, except for super-admin"
|
||||
"label" => Translator::getInstance()->trans('Prevent variable modification or deletion, except for super-admin')
|
||||
))
|
||||
;
|
||||
}
|
||||
@@ -83,7 +84,7 @@ class ConfigCreationForm extends BaseForm
|
||||
$config = ConfigQuery::create()->findOneByName($value);
|
||||
|
||||
if ($config) {
|
||||
$context->addViolation(sprintf("A variable with name \"%s\" already exists.", $value));
|
||||
$context->addViolation(Translator::getInstance()->trans('A variable with name "%name" already exists.', array('%name' => $value)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
class ConfigModificationForm extends BaseForm
|
||||
{
|
||||
@@ -43,20 +44,20 @@ class ConfigModificationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Name",
|
||||
"label" => Translator::getInstance()->trans('Name'),
|
||||
"label_attr" => array(
|
||||
"for" => "name"
|
||||
)
|
||||
))
|
||||
->add("value", "text", array(
|
||||
"label" => "Value",
|
||||
"label" => Translator::getInstance()->trans('Value'),
|
||||
"label_attr" => array(
|
||||
"for" => "value"
|
||||
)
|
||||
))
|
||||
->add("hidden", "hidden", array())
|
||||
->add("secured", "hidden", array(
|
||||
"label" => "Prevent variable modification or deletion, except for super-admin"
|
||||
"label" => Translator::getInstance()->trans('Prevent variable modification or deletion, except for super-admin')
|
||||
))
|
||||
;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class ContentCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Content title *",
|
||||
"label" => Translator::getInstance()->trans('Content title *'),
|
||||
"label_attr" => array(
|
||||
"for" => "title"
|
||||
)
|
||||
|
||||
@@ -26,6 +26,7 @@ use Symfony\Component\Validator\Constraints;
|
||||
use Thelia\Model\CurrencyQuery;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
class CurrencyCreationForm extends BaseForm
|
||||
{
|
||||
@@ -44,7 +45,7 @@ class CurrencyCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Name *",
|
||||
"label" => Translator::getInstance()->trans('Name *'),
|
||||
"label_attr" => array(
|
||||
"for" => "name"
|
||||
))
|
||||
@@ -58,7 +59,7 @@ class CurrencyCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Symbol *",
|
||||
"label" => Translator::getInstance()->trans('Symbol *'),
|
||||
"label_attr" => array(
|
||||
"for" => "symbol"
|
||||
))
|
||||
@@ -67,7 +68,7 @@ class CurrencyCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Rate from € *",
|
||||
"label" => Translator::getInstance()->trans('Rate from € *'),
|
||||
"label_attr" => array(
|
||||
"for" => "rate"
|
||||
))
|
||||
@@ -76,7 +77,7 @@ class CurrencyCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "ISO 4217 code *",
|
||||
"label" => Translator::getInstance()->trans('ISO 4217 code *'),
|
||||
"label_attr" => array(
|
||||
"for" => "iso_4217_code"
|
||||
))
|
||||
@@ -94,7 +95,7 @@ class CurrencyCreationForm extends BaseForm
|
||||
$currency = CurrencyQuery::create()->findOneByCode($value);
|
||||
|
||||
if ($currency) {
|
||||
$context->addViolation(sprintf("A currency with code \"%s\" already exists.", $value));
|
||||
$context->addViolation(Translator::getInstance()->trans('A currency with code "%name" already exists.', array('%name' => $value)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class CustomerPasswordUpdateForm extends BaseForm
|
||||
array($this, "verifyPasswordField")
|
||||
)))
|
||||
),
|
||||
"label" => "Password confirmation",
|
||||
"label" => Translator::getInstance()->trans('Password confirmation'),
|
||||
"label_attr" => array(
|
||||
"for" => "password_confirmation"
|
||||
)
|
||||
|
||||
@@ -58,7 +58,7 @@ class CustomerProfilUpdateForm extends CustomerCreateForm
|
||||
|
||||
// Add Newsletter
|
||||
->add("newsletter", "checkbox", array(
|
||||
"label" => "I would like to receive the newsletter our the latest news.",
|
||||
"label" => Translator::getInstance()->trans('I would like to receive the newsletter or the latest news.'),
|
||||
"label_attr" => array(
|
||||
"for" => "newsletter"
|
||||
),
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Thelia\Form;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
use Thelia\Model\MessageQuery;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
class MessageCreationForm extends BaseForm
|
||||
{
|
||||
@@ -41,7 +42,7 @@ class MessageCreationForm extends BaseForm
|
||||
$this->formBuilder
|
||||
->add("name", "text", array(
|
||||
"constraints" => $name_constraints,
|
||||
"label" => "Name *",
|
||||
"label" => Translator::getInstance()->trans('Name *'),
|
||||
"label_attr" => array(
|
||||
"for" => "name"
|
||||
)
|
||||
@@ -50,7 +51,7 @@ class MessageCreationForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank()
|
||||
),
|
||||
"label" => "Purpose *",
|
||||
"label" => Translator::getInstance()->trans('Purpose *'),
|
||||
"label_attr" => array(
|
||||
"for" => "purpose"
|
||||
)
|
||||
@@ -74,7 +75,7 @@ class MessageCreationForm extends BaseForm
|
||||
$message = MessageQuery::create()->findOneByName($value);
|
||||
|
||||
if ($message) {
|
||||
$context->addViolation(sprintf("A message with name \"%s\" already exists.", $value));
|
||||
$context->addViolation(Translator::getInstance()->trans('A message with name "%name" already exists.', array('%name' => $value)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
class MessageModificationForm extends BaseForm
|
||||
{
|
||||
@@ -33,37 +34,37 @@ class MessageModificationForm extends BaseForm
|
||||
->add("id" , "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
|
||||
->add("name" , "text" , array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => "Name *",
|
||||
"label" => Translator::getInstance()->trans('Name *'),
|
||||
"label_attr" => array(
|
||||
"for" => "name"
|
||||
)
|
||||
))
|
||||
->add("secured" , "text" , array(
|
||||
"label" => "Prevent mailing template modification or deletion, except for super-admin"
|
||||
"label" => Translator::getInstance()->trans('Prevent mailing template modification or deletion, except for super-admin')
|
||||
))
|
||||
->add("locale" , "text" , array())
|
||||
->add("title" , "text" , array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => "Title *",
|
||||
"label" => Translator::getInstance()->trans('Title *'),
|
||||
"label_attr" => array(
|
||||
"for" => "title"
|
||||
)
|
||||
))
|
||||
->add("subject" , "text" , array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => "Message subject *",
|
||||
"label" => Translator::getInstance()->trans('Message subject *'),
|
||||
"label_attr" => array(
|
||||
"for" => "subject"
|
||||
)
|
||||
))
|
||||
->add("html_message" , "text" , array(
|
||||
"label" => "HTML Message",
|
||||
"label" => Translator::getInstance()->trans('HTML Message'),
|
||||
"label_attr" => array(
|
||||
"for" => "html_message"
|
||||
)
|
||||
))
|
||||
->add("text_message" , "text" , array(
|
||||
"label" => "Text Message",
|
||||
"label" => Translator::getInstance()->trans('Text Message'),
|
||||
"label_attr" => array(
|
||||
"for" => "text_message"
|
||||
)
|
||||
|
||||
@@ -43,12 +43,12 @@ class ProductCreationForm extends BaseForm
|
||||
$this->formBuilder
|
||||
->add("ref", "text", array(
|
||||
"constraints" => $ref_constraints,
|
||||
"label" => "Product reference *",
|
||||
"label" => Translator::getInstance()->trans('Product reference *'),
|
||||
"label_attr" => array("for" => "ref")
|
||||
))
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => "Product title *",
|
||||
"label" => Translator::getInstance()->trans('Product title *'),
|
||||
"label_attr" => array("for" => "title")
|
||||
))
|
||||
->add("default_category", "integer", array(
|
||||
|
||||
86
core/lib/Thelia/Form/SystemLogConfigurationForm.php
Normal file
86
core/lib/Thelia/Form/SystemLogConfigurationForm.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Thelia\Log\Tlog;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
class SystemLogConfigurationForm extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add("level", "choice", array(
|
||||
'choices' => array(
|
||||
Tlog::MUET => Translator::getInstance()->trans("Disabled"),
|
||||
Tlog::DEBUG => Translator::getInstance()->trans("Debug"),
|
||||
Tlog::INFO => Translator::getInstance()->trans("Information"),
|
||||
Tlog::NOTICE => Translator::getInstance()->trans("Notices"),
|
||||
Tlog::WARNING => Translator::getInstance()->trans("Warnings"),
|
||||
Tlog::ERROR => Translator::getInstance()->trans("Errors"),
|
||||
Tlog::CRITICAL => Translator::getInstance()->trans("Critical"),
|
||||
Tlog::ALERT => Translator::getInstance()->trans("Alerts"),
|
||||
Tlog::EMERGENCY => Translator::getInstance()->trans("Emergency"),
|
||||
),
|
||||
|
||||
"label" => Translator::getInstance()->trans('Log level *'),
|
||||
"label_attr" => array(
|
||||
"for" => "level_field"
|
||||
)
|
||||
))
|
||||
->add("format", "text", array(
|
||||
"label" => Translator::getInstance()->trans('Log format *'),
|
||||
"label_attr" => array(
|
||||
"for" => "format_field"
|
||||
)
|
||||
))
|
||||
->add("show_redirections", "integer", array(
|
||||
"constraints" => array(new Constraints\NotBlank()),
|
||||
"label" => Translator::getInstance()->trans('Show redirections *'),
|
||||
"label_attr" => array(
|
||||
"for" => "show_redirections_field"
|
||||
)
|
||||
))
|
||||
->add("files", "text", array(
|
||||
"label" => Translator::getInstance()->trans('Activate logs only for these files'),
|
||||
"label_attr" => array(
|
||||
"for" => "files_field"
|
||||
)
|
||||
))
|
||||
->add("ip_addresses", "text", array(
|
||||
"label" => Translator::getInstance()->trans('Activate logs only for these IP Addresses'),
|
||||
"label_attr" => array(
|
||||
"for" => "files_field"
|
||||
)
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_system_log_configuration";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user