forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPage.php
More file actions
71 lines (64 loc) · 1.47 KB
/
Page.php
File metadata and controls
71 lines (64 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Copyright 2013 Adobe
* All Rights Reserved.
*/
/**
* Adminhtml page
*/
namespace Magento\Backend\Block;
/**
* @api
* @since 100.0.2
*/
class Page extends \Magento\Backend\Block\Template
{
/**
* @var \Magento\Framework\Locale\ResolverInterface
*/
protected $_localeResolver;
/**
* @param Template\Context $context
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Locale\ResolverInterface $localeResolver,
array $data = []
) {
parent::__construct($context, $data);
$this->_localeResolver = $localeResolver;
}
/**
* Class constructor
*
* @return void
*/
protected function _construct()
{
parent::_construct();
$this->pageConfig->addBodyClass($this->_request->getFullActionName('-'));
}
/**
* Get current language
*
* @return string
*/
public function getLang()
{
if (!$this->hasData('lang')) {
$this->setData('lang', substr($this->_localeResolver->getLocale(), 0, 2));
}
return $this->getData('lang');
}
/**
* Returns true if we are running in single store mode
*
* @return bool
*/
public function isSingleStoreMode()
{
return $this->_storeManager->isSingleStoreMode();
}
}