Data.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Captcha helper for adminhtml area
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Captcha\Helper\Adminhtml;
  12. class Data extends \Magento\Captcha\Helper\Data
  13. {
  14. /**
  15. * @var \Magento\Backend\App\ConfigInterface
  16. */
  17. protected $_backendConfig;
  18. /**
  19. * @param \Magento\Framework\App\Helper\Context $context
  20. * @param \Magento\Store\Model\StoreManager $storeManager
  21. * @param \Magento\Framework\Filesystem $filesystem
  22. * @param \Magento\Captcha\Model\CaptchaFactory $factory
  23. * @param \Magento\Backend\App\ConfigInterface $backendConfig
  24. */
  25. public function __construct(
  26. \Magento\Framework\App\Helper\Context $context,
  27. \Magento\Store\Model\StoreManager $storeManager,
  28. \Magento\Framework\Filesystem $filesystem,
  29. \Magento\Captcha\Model\CaptchaFactory $factory,
  30. \Magento\Backend\App\ConfigInterface $backendConfig
  31. ) {
  32. $this->_backendConfig = $backendConfig;
  33. parent::__construct($context, $storeManager, $filesystem, $factory);
  34. }
  35. /**
  36. * Returns config value for admin captcha
  37. *
  38. * @param string $key The last part of XML_PATH_$area_CAPTCHA_ constant (case insensitive)
  39. * @param \Magento\Store\Model\Store $store
  40. * @return \Magento\Framework\App\Config\Element
  41. */
  42. public function getConfig($key, $store = null)
  43. {
  44. return $this->_backendConfig->getValue('admin/captcha/' . $key);
  45. }
  46. /**
  47. * Get website code
  48. *
  49. * @param mixed $website
  50. * @return string
  51. */
  52. protected function _getWebsiteCode($website = null)
  53. {
  54. return 'admin';
  55. }
  56. }