LayoutSettings.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * MageSpecialist
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to info@magespecialist.it so we can send you a copy immediately.
  14. *
  15. * @category MSP
  16. * @package MSP_ReCaptcha
  17. * @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
  18. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  19. */
  20. namespace MSP\ReCaptcha\Model;
  21. class LayoutSettings
  22. {
  23. /**
  24. * @var Config
  25. */
  26. private $config;
  27. /**
  28. * LayoutSettings constructor.
  29. * @param Config $config
  30. */
  31. public function __construct(
  32. Config $config
  33. ) {
  34. $this->config = $config;
  35. }
  36. /**
  37. * Return captcha config for frontend
  38. * @return array
  39. */
  40. public function getCaptchaSettings()
  41. {
  42. return [
  43. 'siteKey' => $this->config->getPublicKey(),
  44. 'size' => $this->config->getFrontendSize(),
  45. 'badge' => $this->config->getFrontendPosition(),
  46. 'theme' => $this->config->getFrontendTheme(),
  47. 'lang' => $this->config->getLanguageCode(),
  48. 'enabled' => [
  49. 'login' => $this->config->isEnabledFrontendLogin(),
  50. 'create' => $this->config->isEnabledFrontendCreate(),
  51. 'forgot' => $this->config->isEnabledFrontendForgot(),
  52. 'contact' => $this->config->isEnabledFrontendContact(),
  53. ]
  54. ];
  55. }
  56. }