|
|
@@ -53,21 +53,31 @@ class SectionResolver |
|
|
|
|
|
|
|
// admin |
|
|
|
if (isset($requestAttributesArray['_firewall_context']) && $requestAttributesArray['_firewall_context'] == 'security.firewall.map.context.admin') { |
|
|
|
if (!$this->isCachedSection) { |
|
|
|
$currentAdminSection = null; |
|
|
|
$userMerchant = $this->merchantResolver->getUserMerchant(); |
|
|
|
|
|
|
|
if ($userMerchant !== null) { |
|
|
|
$currentAdminSection = $userMerchant->getCurrentAdminSection(); |
|
|
|
} |
|
|
|
if ($this->cacheSectionCurrent) { |
|
|
|
return $this->cacheSectionCurrent; |
|
|
|
} elseif ($returnDefaultIfOutOfSections && $this->cacheSectionDefault) { |
|
|
|
return $this->cacheSectionDefault; |
|
|
|
} |
|
|
|
|
|
|
|
$this->isCachedSection = true; |
|
|
|
$this->section = $currentAdminSection; |
|
|
|
$sectionCurrent = null; |
|
|
|
$userMerchant = $this->merchantResolver->getUserMerchant(); |
|
|
|
if($userMerchant !== null) { |
|
|
|
$sectionCurrent = $userMerchant->getCurrentAdminSection(); |
|
|
|
} |
|
|
|
|
|
|
|
return $currentAdminSection; |
|
|
|
} else { |
|
|
|
return $this->section; |
|
|
|
$sectionDefault = $this->sectionStore->setMerchant($this->merchantResolver->getCurrent())->getOneDefault(); |
|
|
|
|
|
|
|
if($sectionCurrent) { |
|
|
|
$this->cacheSectionCurrent = $sectionCurrent; |
|
|
|
return $sectionCurrent; |
|
|
|
} elseif($returnDefaultIfOutOfSections && $sectionDefault) { |
|
|
|
$this->cacheSectionDefault = $sectionDefault; |
|
|
|
return $sectionDefault; |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} // front |
|
|
|
else { |
|
|
|
|