Config.php 1.1 KB

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