15
15
/**
16
16
* Read configuration from store config
17
17
*/
18
- class Config
18
+ class Config implements ConfigInterface
19
19
{
20
20
public const XML_PATH_ENABLED_BACKEND = 'recaptcha/backend/enabled ' ;
21
21
public const XML_PATH_ENABLED_FRONTEND = 'recaptcha/frontend/enabled ' ;
@@ -41,7 +41,6 @@ class Config
41
41
public const XML_PATH_ENABLED_FRONTEND_CREATE = 'recaptcha/frontend/enabled_create ' ;
42
42
public const XML_PATH_ENABLED_FRONTEND_REVIEW = 'recaptcha/frontend/enabled_review ' ;
43
43
public const XML_PATH_ENABLED_FRONTEND_NEWSLETTER = 'recaptcha/frontend/enabled_newsletter ' ;
44
- public const XML_PATH_ENABLED_FRONTEND_SENDFRIEND = 'recaptcha/frontend/enabled_sendfriend ' ;
45
44
46
45
/**
47
46
* @var ScopeConfigInterface
@@ -93,7 +92,7 @@ public function getPrivateKey(): string
93
92
*/
94
93
public function isEnabledBackend (): bool
95
94
{
96
- if (!$ this ->getPrivateKey () || !$ this ->getPublicKey ()) {
95
+ if (!$ this ->isAreaEnabled (Area:: AREA_ADMINHTML ) || ! $ this -> getPrivateKey () || !$ this ->getPublicKey ()) {
97
96
return false ;
98
97
}
99
98
@@ -106,7 +105,7 @@ public function isEnabledBackend(): bool
106
105
*/
107
106
public function isEnabledFrontend (): bool
108
107
{
109
- if (!$ this ->getPrivateKey () || !$ this ->getPublicKey ()) {
108
+ if (!$ this ->isAreaEnabled (Area:: AREA_FRONTEND ) || ! $ this -> getPrivateKey () || !$ this ->getPublicKey ()) {
110
109
return false ;
111
110
}
112
111
@@ -212,22 +211,6 @@ public function isEnabledFrontendNewsletter(): bool
212
211
);
213
212
}
214
213
215
- /**
216
- * Return true if enabled on frontend send to friend
217
- * @return bool
218
- */
219
- public function isEnabledFrontendSendFriend (): bool
220
- {
221
- if (!$ this ->isEnabledFrontend ()) {
222
- return false ;
223
- }
224
-
225
- return (bool ) $ this ->scopeConfig ->getValue (
226
- static ::XML_PATH_ENABLED_FRONTEND_SENDFRIEND ,
227
- ScopeInterface::SCOPE_WEBSITE
228
- );
229
- }
230
-
231
214
/**
232
215
* @return bool
233
216
*/
0 commit comments