Skip to content

Commit 1f35134

Browse files
author
Oleg Zinoviev
committed
Merge branch 'UI' into MAGETWO-32315
2 parents e9c9b69 + b38d9f6 commit 1f35134

File tree

628 files changed

+3866
-1764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

628 files changed

+3866
-1764
lines changed

.htaccess

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,6 @@
170170

171171
</IfModule>
172172

173-
############################################
174-
## By default allow all access
175-
176-
Order allow,deny
177-
Allow from all
178-
179173
###########################################
180174
## Deny access to release notes to prevent disclosure of the installed Magento version
181175

.htaccess.sample

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,6 @@
167167

168168
</IfModule>
169169

170-
############################################
171-
## By default allow all access
172-
173-
Order allow,deny
174-
Allow from all
175-
176170
###########################################
177171
## Deny access to release notes to prevent disclosure of the installed Magento version
178172

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function _construct()
114114
public function getFeedUrl()
115115
{
116116
$httpPath = $this->_backendConfig->isSetFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://';
117-
if (is_null($this->_feedUrl)) {
117+
if ($this->_feedUrl === null) {
118118
$this->_feedUrl = $httpPath . $this->_backendConfig->getValue(self::XML_FEED_URL_PATH);
119119
}
120120
return $this->_feedUrl;

app/code/Magento/AdminNotification/Model/Inbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getSeverities($severity = null)
5555
MessageInterface::SEVERITY_NOTICE => __('notice'),
5656
];
5757

58-
if (!is_null($severity)) {
58+
if ($severity !== null) {
5959
if (isset($severities[$severity])) {
6060
return $severities[$severity];
6161
}

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ public function getUserType()
7272
*/
7373
protected function getUserContext()
7474
{
75-
if (is_null($this->chosenUserContext)) {
75+
if ($this->chosenUserContext === null) {
7676
/** @var UserContextInterface $userContext */
7777
foreach ($this->userContexts as $userContext) {
78-
if ($userContext->getUserType() && !is_null($userContext->getUserId())) {
78+
if ($userContext->getUserType() && $userContext->getUserId() !== null) {
7979
$this->chosenUserContext = $userContext;
8080
break;
8181
}
8282
}
83-
if (is_null($this->chosenUserContext)) {
83+
if ($this->chosenUserContext === null) {
8484
$this->chosenUserContext = false;
8585
}
8686
}

app/code/Magento/Authorization/Test/Unit/Model/CompositeUserContextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ protected function createUserContextMock($userId = null, $userType = null)
161161
{
162162
$useContextMock = $this->getMockBuilder('Magento\Authorization\Model\CompositeUserContext')
163163
->disableOriginalConstructor()->setMethods(['getUserId', 'getUserType'])->getMock();
164-
if (!is_null($userId) && !is_null($userType)) {
164+
if ($userId !== null && $userType !== null) {
165165
$useContextMock->expects($this->any())->method('getUserId')->will($this->returnValue($userId));
166166
$useContextMock->expects($this->any())->method('getUserType')->will($this->returnValue($userType));
167167
}

app/code/Magento/Backend/App/AbstractAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ protected function _processLocaleSettings()
289289
$this->_getSession()->setSessionLocale($forceLocale);
290290
}
291291

292-
if (is_null($this->_getSession()->getLocale())) {
292+
if ($this->_getSession()->getLocale() === null) {
293293
$this->_getSession()->setLocale($this->_localeResolver->getLocale());
294294
}
295295

app/code/Magento/Backend/Block/Dashboard/Bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function setCurrency($currency)
8484
*/
8585
public function getCurrency()
8686
{
87-
if (is_null($this->_currentCurrencyCode)) {
87+
if ($this->_currentCurrencyCode === null) {
8888
if ($this->getRequest()->getParam('store')) {
8989
$this->_currentCurrencyCode = $this->_storeManager->getStore(
9090
$this->getRequest()->getParam('store')

app/code/Magento/Backend/Block/Dashboard/Graph.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public function setDataHelper(\Magento\Backend\Helper\Dashboard\AbstractDashboar
545545
*/
546546
protected function _prepareData()
547547
{
548-
if (!is_null($this->_dataHelper)) {
548+
if ($this->_dataHelper !== null) {
549549
$availablePeriods = array_keys($this->_dashboardData->getDatePeriods());
550550
$period = $this->getRequest()->getParam('period');
551551
$this->getDataHelper()->setParam(

app/code/Magento/Backend/Block/Menu.php

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,24 @@ protected function _renderItemCssClass($menuItem, $level)
210210
*/
211211
protected function _renderAnchor($menuItem, $level)
212212
{
213-
return '<a href="' . $menuItem->getUrl() . '" ' . $this->_renderItemAnchorTitle(
214-
$menuItem
215-
) . $this->_renderItemOnclickFunction(
216-
$menuItem
217-
) . ' class="' . $this->_renderAnchorCssClass(
218-
$menuItem,
219-
$level
220-
) . '">' . '<span>' . $this->_getAnchorLabel(
221-
$menuItem
222-
) . '</span>' . '</a>';
213+
if ($level == 1 && $menuItem->getUrl() == '#') {
214+
$output = '<strong class="submenu-group-title" role="presentation">'
215+
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
216+
. '</strong>';
217+
} else {
218+
$output = '<a href="' . $menuItem->getUrl() . '" ' . $this->_renderItemAnchorTitle(
219+
$menuItem
220+
) . $this->_renderItemOnclickFunction(
221+
$menuItem
222+
) . ' class="' . $this->_renderAnchorCssClass(
223+
$menuItem,
224+
$level
225+
) . '">' . '<span>' . $this->_getAnchorLabel(
226+
$menuItem
227+
) . '</span>' . '</a>';
228+
}
229+
230+
return $output;
223231
}
224232

225233
/**
@@ -397,15 +405,16 @@ protected function _columnBrake($items, $limit)
397405
* @param \Magento\Backend\Model\Menu\Item $menuItem
398406
* @param int $level
399407
* @param int $limit
408+
* @param $id int
400409
* @return string HTML code
401410
*/
402-
protected function _addSubMenu($menuItem, $level, $limit)
411+
protected function _addSubMenu($menuItem, $level, $limit, $id = null)
403412
{
404413
$output = '';
405414
if (!$menuItem->hasChildren()) {
406415
return $output;
407416
}
408-
$output .= '<div class="submenu">';
417+
$output .= '<div class="submenu"' . ($level == 0 && isset($id) ? ' aria-labelledby="' . $id . '"' : '') . '>';
409418
$colStops = null;
410419
if ($level == 0 && $limit) {
411420
$colStops = $this->_columnBrake($menuItem->getChildren(), $limit);
@@ -426,6 +435,7 @@ protected function _addSubMenu($menuItem, $level, $limit)
426435
* @param int $limit
427436
* @param array $colBrakes
428437
* @return string HTML
438+
* @SuppressWarnings(PHPMD.NPathComplexity)
429439
*/
430440
public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
431441
{
@@ -443,18 +453,21 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
443453
$output .= '</ul></li><li class="column"><ul role="menu">';
444454
}
445455

456+
$id = $this->getJsId($menuItem->getId());
446457
$output .= '<li ' . $this->getUiId(
447458
$menuItem->getId()
448459
) . ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass(
449460
$menuItem,
450461
$level
451-
) . '" role="menu-item">' . $this->_renderAnchor(
462+
) . ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
463+
. '" role="menu-item">' . $this->_renderAnchor(
452464
$menuItem,
453465
$level
454466
) . $this->_addSubMenu(
455467
$menuItem,
456468
$level,
457-
$limit
469+
$limit,
470+
$id
458471
) . '</li>';
459472
$itemPosition++;
460473
}

0 commit comments

Comments
 (0)