選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

65 行
1.7KB

  1. <?php
  2. namespace Lc\SovBundle\Definition;
  3. class SiteSettingDefinition extends AbstractSettingDefinition implements SiteSettingDefinitionInterface
  4. {
  5. const CATEGORY_GENERAL = 'general';
  6. const CATEGORY_EMAIL = 'email';
  7. const SETTING_MAINTENANCE = 'maintenance';
  8. const SETTING_MAINTENANCE_IP_AUTHORIZED = 'maintenanceIpAuthorized';
  9. const SETTING_EMAIL_SUBJECT_PREFIX = 'emailSubjectPrefix';
  10. const SETTING_EMAIL_FROM = 'emailFrom';
  11. const SETTING_EMAIL_FROM_NAME = 'emailFromName';
  12. const SETTING_MAILER_HOST = 'mailerHost';
  13. const SETTING_MAILER_HOST_MAILJET = 'mailjet';
  14. const SETTING_MAILER_HOST_SMTP = 'smtp';
  15. public function __construct()
  16. {
  17. // général
  18. $this->addSettingSelect(
  19. [
  20. 'category' => self::CATEGORY_GENERAL,
  21. 'name' => self::SETTING_MAINTENANCE,
  22. 'choices' => [
  23. 'Non' => 0,
  24. 'Oui' => 1,
  25. ]
  26. ]
  27. );
  28. $this->addSettingText(
  29. [
  30. 'category' => self::CATEGORY_GENERAL,
  31. 'name' => self::SETTING_MAINTENANCE_IP_AUTHORIZED,
  32. ]
  33. );
  34. $this->addSettingSelect(
  35. [
  36. 'category' => self::CATEGORY_GENERAL,
  37. 'name' => self::SETTING_MAILER_HOST,
  38. 'choices' => [
  39. 'Mailjet' => self::SETTING_MAILER_HOST_MAILJET,
  40. 'SMTP (par défaut alwaysdata)' => self::SETTING_MAILER_HOST_SMTP,
  41. ]
  42. ]
  43. );
  44. }
  45. public function getCategories(): array
  46. {
  47. return [
  48. self::CATEGORY_GENERAL,
  49. ];
  50. }
  51. }