Config.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Ui\Model;
  7. use Magento\Framework\App\Config\ScopeConfigInterface;
  8. use Magento\Framework\View\Element\Template;
  9. class Config
  10. {
  11. /**
  12. * Wysiwyg editor configuration path
  13. */
  14. const WYSIWYG_EDITOR_CONFIG_PATH = 'cms/wysiwyg/editor';
  15. /**
  16. * Configuration path to session storage logging setting
  17. */
  18. const XML_PATH_LOGGING = 'dev/js/session_storage_logging';
  19. /**
  20. * Configuration path to session storage key setting
  21. */
  22. const XML_PATH_KEY = 'dev/js/session_storage_key';
  23. /**
  24. * @var ScopeConfigInterface
  25. */
  26. protected $scopeConfig;
  27. /**
  28. * @param ScopeConfigInterface $scopeConfig
  29. */
  30. public function __construct(ScopeConfigInterface $scopeConfig)
  31. {
  32. $this->scopeConfig = $scopeConfig;
  33. }
  34. /**
  35. * Is session storage logging enabled
  36. *
  37. * @return bool
  38. */
  39. public function isLoggingEnabled()
  40. {
  41. return $this->scopeConfig->getValue(self::XML_PATH_LOGGING);
  42. }
  43. /**
  44. * Get session storage key
  45. *
  46. * @return string
  47. */
  48. public function getSessionStorageKey()
  49. {
  50. return $this->scopeConfig->getValue(self::XML_PATH_KEY);
  51. }
  52. }