class Settings extends \Cubist\Backpack\Magic\Models\Settings
{
+ protected $_options = ['name' => 'settings',
+ 'singular' => 'paramètre',
+ 'plural' => 'paramètres',
+ 'oneinstance' => true];
+
public function setFields()
{
- parent::setFields();
-
- $this->addField(['name' => 'email',
- 'type' => 'Email',
- 'label' => 'E-mail',
- 'tab' => 'Informations de contact']);
-
- $this->addField(['name' => 'phone',
- 'type' => 'Text',
- 'label' => 'Téléphone',
- 'translatable' => true,
- 'tab' => 'Informations de contact']);
-
- $this->addField(['name' => 'address',
- 'type' => 'Textarea',
- 'label' => 'Adresse',
- 'translatable' => false,
- 'tab' => 'Informations de contact']);
-
- //=== Social Networks
- $this->addField([
- 'name' => 'social',
- 'type' => 'BunchOfFields',
- 'bunch' => 'App\SubForms\SocialNetworks',
- 'label' => 'Réseaux Sociaux',
- 'tab' => 'Réseaux Sociaux',
- ]);
-
- //=== Forms
- $this->addField([
- 'name' => 'form_default_recipients',
- 'type' => 'Tags',
- 'label' => 'Destinataires par défaut des formulaires',
- 'tab' => 'Formulaires',
- ]);
-
- $this->addField([
- 'name' => 'form_privacy',
- 'type' => 'Markdown',
- 'label' => 'Mention légale vie privée affichée sous les formulaires',
- 'tab' => 'Formulaires',
- ]);
-
-
- //=== Footer
- $this->addField([
- 'name' => 'footer_text',
- 'type' => 'Textarea',
- 'label' => 'Texte de footer',
- 'attributes' => [
- 'rows' => 4,
- ],
- 'tab' => 'Footer',
- ]);
-
- $this->addField([
- 'name' => 'footer_heading_contact',
- 'type' => 'Text',
- 'label' => 'Titre de colonne « Nous contacter »',
- 'tab' => 'Footer',
- ]);
+ $this->addField('pin', 'Text', 'Code PIN', ['pattern' => '\d{4}']);
- $this->addField([
- 'name' => 'footer_heading_strengths',
- 'type' => 'Text',
- 'label' => 'Titre de colonne « PMI à votre service »',
- 'tab' => 'Footer'
- ]);
- //=== Strengths / Points Forts
- $this->addField([
- 'name' => 'strengths',
- 'type' => 'BunchOfFieldsMultiple',
- 'bunch' => 'App\SubForms\Strength',
- 'label' => 'Points Forts',
- 'tab' => 'Footer',
- 'translatable' => true,
- ]);
}
}