PluginProbe
Metricool – Social media and site statistics / 2.1.1
Metricool – Social media and site statistics v2.1.1
2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
← All changes | app/Controllers/DashboardController.php +5 -2 2.0.2 → 2.1.1 View file →
@@ -7,8 +7,9 @@
7 7 if (!defined('ABSPATH')) {
8 8 exit;
9 9 }
10 10
11 +use Metricool\Support\Helpers\Storages\LanguagesConfig;
11 12 use Metricool\Traits\HasViews;
12 13 use Metricool\Traits\HasUserAccess;
13 14 use Metricool\Services\DashboardService;
14 15 use Metricool\Traits\HasAllowlistControl;
@@ -26,15 +27,17 @@
26 27 private EnvironmentConfig $env;
27 28 private MetricoolApi $metricool;
28 29 private DashboardService $service;
29 30 private MetricoolAccountService $account;
31 + private LanguagesConfig $languages;
30 32
31 - public function __construct(EnvironmentConfig $env, MetricoolApi $metricool, DashboardService $service, MetricoolAccountService $account)
33 + public function __construct(EnvironmentConfig $env, MetricoolApi $metricool, DashboardService $service, MetricoolAccountService $account, LanguagesConfig $languages)
32 34 {
33 35 $this->env = $env;
34 36 $this->metricool = $metricool;
35 37 $this->service = $service;
36 38 $this->account = $account;
39 + $this->languages = $languages;
37 40 }
38 41
39 42 public function register(): void
40 43 {
@@ -287,9 +290,9 @@
287 290 'support' => $this->env->getUrl('metricool.support'),
288 291 'metricool_base_url' => $this->env->getUrl('metricool.base_url'),
289 292 'metricool_help_url' => $this->env->getUrl('metricool.help_url'),
290 293 'locale' => str_replace("_", "-", get_user_locale()),
291 - 'supported_languages' => $this->metricool->supportedLanguages(),
294 + 'supported_languages' => $this->languages->all(),
292 295 'google_recaptcha_url' => $this->getGoogleRecaptchaUrl(),
293 296 'google_recaptcha_key' => $this->env->getString('metricool.google_recaptcha_key'),
294 297 ];
295 298