Config.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Translation\Model\Inline;
  7. /**
  8. * Inline Translation config
  9. */
  10. class Config implements \Magento\Framework\Translate\Inline\ConfigInterface
  11. {
  12. /**
  13. * Core store config
  14. *
  15. * @var \Magento\Framework\App\Config\ScopeConfigInterface
  16. */
  17. protected $scopeConfig;
  18. /**
  19. * @var \Magento\Developer\Helper\Data
  20. */
  21. protected $devHelper;
  22. /**
  23. * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  24. * @param \Magento\Developer\Helper\Data $helper
  25. */
  26. public function __construct(
  27. \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
  28. \Magento\Developer\Helper\Data $helper
  29. ) {
  30. $this->scopeConfig = $scopeConfig;
  31. $this->devHelper = $helper;
  32. }
  33. /**
  34. * @inheritdoc
  35. */
  36. public function isActive($scope = null)
  37. {
  38. return $this->scopeConfig->isSetFlag(
  39. 'dev/translate_inline/active',
  40. \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
  41. $scope
  42. );
  43. }
  44. /**
  45. * @inheritdoc
  46. */
  47. public function isDevAllowed($scope = null)
  48. {
  49. return $this->devHelper->isDevAllowed($scope);
  50. }
  51. }