mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-07 09:17:35 +00:00
72 lines
1.5 KiB
PHP
72 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* Copyright © Magento, Inc. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
|
|
/**
|
|
* Adminhtml page
|
|
*
|
|
* @author Magento Core Team <core@magentocommerce.com>
|
|
*/
|
|
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');
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isSingleStoreMode()
|
|
{
|
|
return $this->_storeManager->isSingleStoreMode();
|
|
}
|
|
}
|