app = $app; } /** * Render the page for native global settings components * * @throws \Exception */ public function render() { $this->enqueue(); $this->app->view->render('admin.globalSettings.settings'); } /** * Enqueue necessary resources. * * @throws \Exception */ public function enqueue() { wp_enqueue_script('fluentform-global-settings-js'); $globalSettingAppData = [ 'plugin' => $this->app->config->get('app.slug'), 'akismet_activated' => AkismetHandler::isPluginEnabled(), 'cleantalk_activated' => CleanTalkHandler::isPluginEnabled(), 'has_pro' => Helper::hasPro(), 'is_payment_compatible' => Helper::isPaymentCompatible(), 'form_settings_str' => TranslationString::getGlobalSettingsI18n(), 'ace_path_url' => fluentformMix('libs/ace'), ]; if (Helper::isPaymentCompatible()) { $globalSettingAppData = apply_filters('fluentform/global_settings_component_settings_data', $globalSettingAppData); } wp_localize_script('fluentform-global-settings-js', 'FluentFormApp', $globalSettingAppData); } }