diff --git a/acp/discord_notifications_module.php b/acp/discord_notifications_module.php index 55813e3..90736bb 100644 --- a/acp/discord_notifications_module.php +++ b/acp/discord_notifications_module.php @@ -58,9 +58,13 @@ class discord_notifications_module /** @var \phpbb\user */ protected $user; + /** @var bool */ + private $curl_available; + public function main($id, $mode) { global $phpbb_container; + $this->cache = $phpbb_container->get('cache.driver'); $this->config = $phpbb_container->get('config'); $this->db = $phpbb_container->get('dbal.conn'); @@ -69,6 +73,7 @@ public function main($id, $mode) $this->request = $phpbb_container->get('request'); $this->template = $phpbb_container->get('template'); $this->user = $phpbb_container->get('user'); + $this->curl_available = extension_loaded('curl'); $this->language->add_lang('acp_discord_notifications', 'mober/discordnotifications'); $this->page_title = $this->language->lang('ACP_DISCORD_NOTIFICATIONS'); @@ -146,6 +151,7 @@ public function main($id, $mode) 'DN_DEFAULT_WEBHOOK' => $this->config['discord_notification_default_webhook'], + 'DN_CURL_AVAILABLE' => $this->curl_available, 'U_ACTION' => $this->u_action, )); } diff --git a/adm/style/acp_discord_notifications_mapping.html b/adm/style/acp_discord_notifications_mapping.html index 5151791..0c5a3bf 100644 --- a/adm/style/acp_discord_notifications_mapping.html +++ b/adm/style/acp_discord_notifications_mapping.html @@ -4,6 +4,12 @@

{{ lang('ACP_DISCORD_NOTIFICATIONS') }}

{{ DN_ACP_DESCRIPTION }}

+{% if not DN_CURL_AVAILABLE %} +
+

{{ lang('DN_MISSING_CURL') }}

+
+{% endif %} +
diff --git a/adm/style/acp_discord_notifications_settings.html b/adm/style/acp_discord_notifications_settings.html index 760a05a..95e9827 100644 --- a/adm/style/acp_discord_notifications_settings.html +++ b/adm/style/acp_discord_notifications_settings.html @@ -4,6 +4,12 @@

{{ lang('ACP_DISCORD_NOTIFICATIONS') }}

{{ DN_ACP_DESCRIPTION }}

+{% if not DN_CURL_AVAILABLE %} +
+

{{ lang('DN_MISSING_CURL') }}

+
+{% endif %} +
diff --git a/adm/style/acp_discord_notifications_webhooks.html b/adm/style/acp_discord_notifications_webhooks.html index 6094e9a..cb4257d 100644 --- a/adm/style/acp_discord_notifications_webhooks.html +++ b/adm/style/acp_discord_notifications_webhooks.html @@ -4,8 +4,13 @@

{{ lang('ACP_DISCORD_NOTIFICATIONS') }}

{{ DN_ACP_DESCRIPTION }}

- +{% if not DN_CURL_AVAILABLE %} +
+

{{ lang('DN_MISSING_CURL') }}

+
+{% endif %} +
{{ lang('DN_WEBHOOK_SETTINGS') }} diff --git a/language/de/acp_discord_notifications.php b/language/de/acp_discord_notifications.php index 98030f4..d5129e7 100644 --- a/language/de/acp_discord_notifications.php +++ b/language/de/acp_discord_notifications.php @@ -21,6 +21,7 @@ $lang = array_merge($lang, array( // ACP Extension Settings Page 'DN_ACP_DESCRIPTION' => 'Diese Einstellungen erlauben es, bei verschiedenen Ereignissen eine Benachrichtigung an einen Discord-Kanal zu schicken.', + 'DN_MISSING_CURL' => 'Damit diese Erweiterung funktioniert, musst du das ext-curl Modul für PHP installieren.', 'DN_MAIN_SETTINGS' => 'Konfiguration', 'DN_MASTER_ENABLE' => 'Discord Benachrichtigungen aktivieren', diff --git a/language/en/acp_discord_notifications.php b/language/en/acp_discord_notifications.php index 22ec103..dd2f182 100644 --- a/language/en/acp_discord_notifications.php +++ b/language/en/acp_discord_notifications.php @@ -21,6 +21,7 @@ $lang = array_merge($lang, array( // ACP Extension Settings Page 'DN_ACP_DESCRIPTION' => 'These settings allow for various forum events to send notification messages to a Discord server.', + 'DN_MISSING_CURL' => 'Please install the ext-curl module for PHP, otherwise this extension will not work.', 'DN_MAIN_SETTINGS' => 'Main Settings', 'DN_MASTER_ENABLE' => 'Enable Discord Notifications', diff --git a/language/fr/acp_discord_notifications.php b/language/fr/acp_discord_notifications.php index 9f6ee59..16dea7d 100644 --- a/language/fr/acp_discord_notifications.php +++ b/language/fr/acp_discord_notifications.php @@ -42,6 +42,7 @@ $lang = array_merge($lang, array( // ACP Extension Settings Page 'DN_ACP_DESCRIPTION' => 'Depuis cette page il est possible de définir les paramètres permettant à différents évènements du forum d’être envoyés comme notification sur un serveur Discord.', + 'DN_MISSING_CURL' => 'Pour que cette extension fonctionne, tu dois installer le module ext-curl pour PHP.', 'DN_MAIN_SETTINGS' => 'Paramètres généraux', 'DN_MASTER_ENABLE' => 'Activer les notifications Discord',