Notices.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Theme\Block\Html;
  7. /**
  8. * Html page notices block
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Notices extends \Magento\Framework\View\Element\Template
  14. {
  15. /**
  16. * @param \Magento\Framework\View\Element\Template\Context $context
  17. * @param array $data
  18. */
  19. public function __construct(\Magento\Framework\View\Element\Template\Context $context, array $data = [])
  20. {
  21. parent::__construct($context, $data);
  22. }
  23. /**
  24. * Check if noscript notice should be displayed
  25. *
  26. * @return boolean
  27. */
  28. public function displayNoscriptNotice()
  29. {
  30. return $this->_scopeConfig->getValue(
  31. 'web/browser_capabilities/javascript',
  32. \Magento\Store\Model\ScopeInterface::SCOPE_STORE
  33. );
  34. }
  35. /**
  36. * Check if no local storage notice should be displayed
  37. *
  38. * @return boolean
  39. */
  40. public function displayNoLocalStorageNotice()
  41. {
  42. return $this->_scopeConfig->getValue(
  43. 'web/browser_capabilities/local_storage',
  44. \Magento\Store\Model\ScopeInterface::SCOPE_STORE
  45. );
  46. }
  47. /**
  48. * Check if demo store notice should be displayed
  49. *
  50. * @return boolean
  51. */
  52. public function displayDemoNotice()
  53. {
  54. return $this->_scopeConfig->getValue(
  55. 'design/head/demonotice',
  56. \Magento\Store\Model\ScopeInterface::SCOPE_STORE
  57. );
  58. }
  59. }