@@ -76,8 +76,8 @@ public function getIdeList()
7676
7777 public function getIdeRegex ()
7878 {
79- if ($ ide = $ this ->getConfig ( ' dev/quickdevbar/ ide ' )) {
80- if (strtolower ($ ide ) == 'custom ' && $ ideCustom = $ this ->getConfig ( ' dev/quickdevbar/ ide_custom ' )) {
79+ if ($ ide = $ this ->getQdbConfig ( ' ide ' )) {
80+ if (strtolower ($ ide ) == 'custom ' && $ ideCustom = $ this ->getQdbConfig ( ' ide_custom ' )) {
8181 return $ ideCustom ;
8282 }
8383
@@ -91,6 +91,10 @@ public function getCacheFrontendPool()
9191 return $ this ->cacheFrontendPool ;
9292 }
9393
94+ public function getQdbConfig ($ key , $ scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT , $ scopeCode = null )
95+ {
96+ return $ this ->getConfig ('dev/quickdevbar/ ' .$ key , $ scopeType , $ scopeCode );
97+ }
9498
9599 public function getConfig ($ path , $ scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT , $ scopeCode = null )
96100 {
@@ -99,13 +103,13 @@ public function getConfig($path, $scopeType = ScopeConfigInterface::SCOPE_TYPE_D
99103
100104 public function defaultAppearance ()
101105 {
102- return $ this ->getConfig ( ' dev/quickdevbar/ appearance ' );
106+ return $ this ->getQdbConfig ( ' appearance ' );
103107 }
104108
105109 public function isToolbarAccessAllowed ($ testWithRestriction =false )
106110 {
107111 $ allow = false ;
108- $ enable = $ this ->getConfig ( ' dev/quickdevbar/ enable ' );
112+ $ enable = $ this ->getQdbConfig ( ' enable ' );
109113
110114 if ($ enable || $ testWithRestriction ) {
111115
@@ -125,7 +129,7 @@ public function isToolbarAccessAllowed($testWithRestriction=false)
125129
126130 public function isToolbarAreaAllowed ($ area )
127131 {
128- $ areaEnabled = $ this ->getConfig ( ' dev/quickdevbar/ area ' );
132+ $ areaEnabled = $ this ->getQdbConfig ( ' area ' );
129133
130134 return ($ areaEnabled == \Magento \Framework \App \Area::AREA_GLOBAL )
131135 || ($ area == $ areaEnabled );
@@ -145,7 +149,7 @@ public function isIpAuthorized()
145149
146150 public function getAllowedIps ($ separator = false )
147151 {
148- $ allowedIps = $ this ->getConfig ( ' dev/quickdevbar/ allow_ips ' );
152+ $ allowedIps = $ this ->getQdbConfig ( ' allow_ips ' );
149153 if ($ allowedIps ) {
150154 $ allowedIps = preg_split ('#\s*,\s*# ' , $ allowedIps , -1 , PREG_SPLIT_NO_EMPTY );
151155 } else {
@@ -165,7 +169,7 @@ public function getClientIp()
165169
166170 public function isUserAgentAuthorized ()
167171 {
168- $ toolbarHeader = $ this ->getConfig ( ' dev/quickdevbar/ toolbar_header ' );
172+ $ toolbarHeader = $ this ->getQdbConfig ( ' toolbar_header ' );
169173
170174 return !empty ($ toolbarHeader ) ? preg_match ('/ ' . preg_quote ($ toolbarHeader , '/ ' ) . '/ ' , $ this ->getUserAgent ()) : false ;
171175 }
0 commit comments