You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 satır
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. public function __construct()
  13. {
  14. // général
  15. $this->addSettingSelect(
  16. [
  17. 'category' => self::CATEGORY_GENERAL,
  18. 'name' => self::SETTING_MAINTENANCE,
  19. 'choices' => [
  20. 'Non' => 0,
  21. 'Oui' => 1,
  22. ]
  23. ]
  24. );
  25. $this->addSettingText(
  26. [
  27. 'category' => self::CATEGORY_GENERAL,
  28. 'name' => self::SETTING_MAINTENANCE_IP_AUTHORIZED,
  29. ]
  30. );
  31. // email
  32. $this->addSettingText(
  33. [
  34. 'category' => self::CATEGORY_EMAIL,
  35. 'name' => self::SETTING_EMAIL_FROM,
  36. ]
  37. );
  38. $this->addSettingText(
  39. [
  40. 'category' => self::CATEGORY_EMAIL,
  41. 'name' => self::SETTING_EMAIL_FROM_NAME,
  42. ]
  43. );
  44. }
  45. public function getCategories()
  46. {
  47. return [
  48. self::CATEGORY_GENERAL,
  49. self::CATEGORY_EMAIL
  50. ];
  51. }
  52. }