This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8486def
commit bb5927d
Showing
7 changed files
with
174 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
namespace Smart\ParameterBundle\Admin; | ||
|
||
use Smart\SonataBundle\Admin\AbstractAdmin; | ||
use Sonata\AdminBundle\Datagrid\DatagridMapper; | ||
use Sonata\AdminBundle\Datagrid\ListMapper; | ||
use Sonata\AdminBundle\Form\FormMapper; | ||
use Sonata\AdminBundle\Route\RouteCollection; | ||
use Sonata\AdminBundle\Show\ShowMapper; | ||
|
||
/** | ||
* @author Mathieu Ducrot <[email protected]> | ||
*/ | ||
class ParameterAdmin extends AbstractAdmin | ||
{ | ||
protected function configureRoutes(RouteCollection $collection): void | ||
{ | ||
$collection | ||
->remove('create') | ||
->remove('delete') | ||
; | ||
parent::configureRoutes($collection); | ||
} | ||
|
||
protected function configureListFields(ListMapper $list): void | ||
{ | ||
$list | ||
->addIdentifier('id', null, ['label' => 'field.label_id']) | ||
->addIdentifier('code', null, ['label' => 'field.label_code']) | ||
->add('help', null, ['label' => 'field.label_help']) | ||
->add('value', null, ['label' => 'field.label_value']) | ||
; | ||
} | ||
|
||
protected function configureDatagridFilters(DatagridMapper $filter): void | ||
{ | ||
$filter | ||
->add('code', null, [ | ||
'show_filter' => true, | ||
'label' => 'field.label_code' | ||
]) | ||
; | ||
} | ||
|
||
protected function configureShowFields(ShowMapper $show): void | ||
{ | ||
$show | ||
->with('fieldset.label_general') | ||
->add('id', null, ['label' => 'field.label_id']) | ||
->add('code', null, ['label' => 'field.label_code']) | ||
->add('help', null, ['label' => 'field.label_help']) | ||
->add('value', null, ['label' => 'field.label_value']) | ||
->end() | ||
; | ||
} | ||
|
||
protected function configureFormFields(FormMapper $form): void | ||
{ | ||
$form | ||
->with('fieldset.label_general') | ||
->add('code', null, [ | ||
'label' => 'field.label_code', | ||
'disabled' => true | ||
]) | ||
->add('help', null, [ | ||
'label' => 'field.label_help', | ||
'disabled' => true | ||
]) | ||
->add('value', null, ['label' => 'field.label_value']) | ||
->end() | ||
; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ doctrine: | |
|
||
smart_parameter: | ||
parameters: | ||
# Textual paramter | ||
# Textual parameter | ||
dummy_support_emails: | ||
value: "[email protected], [email protected]" | ||
help: "This parameter is used by the mailer for support recipients. Format : Separate email by comma." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Full config fixture | ||
smart_parameter: | ||
parameters: | ||
# Textual paramter | ||
# Textual parameter | ||
dummy_support_emails: | ||
value: "[email protected], [email protected]" | ||
help: "This parameter is used by the mailer for support recipients. Format : Separate email by comma." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0"?> | ||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
<file source-language="fr" datatype="plaintext" original="file.ext"> | ||
<body> | ||
<trans-unit id="dashboard.label_settings"> | ||
<source>dashboard.label_settings</source> | ||
<target>Settings</target> | ||
</trans-unit> | ||
<trans-unit id="dashboard.label_parameter"> | ||
<source>dashboard.label_parameter</source> | ||
<target>Parameters</target> | ||
</trans-unit> | ||
<trans-unit id="breadcrumb.link_parameter_list"> | ||
<source>breadcrumb.link_parameter_list</source> | ||
<target>Parameter list</target> | ||
</trans-unit> | ||
<trans-unit id="breadcrumb.link_parameter_create"> | ||
<source>breadcrumb.link_parameter_create</source> | ||
<target>Creating a parameter</target> | ||
</trans-unit> | ||
<trans-unit id="fieldset.label_general"> | ||
<source>fieldset.label_general</source> | ||
<target>General informations</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_id"> | ||
<source>field.label_id</source> | ||
<target>#</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_code"> | ||
<source>field.label_code</source> | ||
<target>Code</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_help"> | ||
<source>field.label_help</source> | ||
<target>Help</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_value"> | ||
<source>field.label_value</source> | ||
<target>Value</target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0"?> | ||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
<file source-language="fr" datatype="plaintext" original="file.ext"> | ||
<body> | ||
<trans-unit id="dashboard.label_settings"> | ||
<source>dashboard.label_settings</source> | ||
<target>Paramètrages</target> | ||
</trans-unit> | ||
<trans-unit id="dashboard.label_parameter"> | ||
<source>dashboard.label_parameter</source> | ||
<target>Paramètres</target> | ||
</trans-unit> | ||
<trans-unit id="breadcrumb.link_parameter_list"> | ||
<source>breadcrumb.link_parameter_list</source> | ||
<target>Liste des paramètres</target> | ||
</trans-unit> | ||
<trans-unit id="breadcrumb.link_parameter_create"> | ||
<source>breadcrumb.link_parameter_create</source> | ||
<target>Création d'un paramètre</target> | ||
</trans-unit> | ||
<trans-unit id="fieldset.label_general"> | ||
<source>fieldset.label_general</source> | ||
<target>Informations générales</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_id"> | ||
<source>field.label_id</source> | ||
<target>#</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_code"> | ||
<source>field.label_code</source> | ||
<target>Code</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_help"> | ||
<source>field.label_help</source> | ||
<target>Aide</target> | ||
</trans-unit> | ||
<trans-unit id="field.label_value"> | ||
<source>field.label_value</source> | ||
<target>Valeur</target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |