diff --git a/bdp-kompass.php b/bdp-kompass.php index 1b59e88..0df0497 100644 --- a/bdp-kompass.php +++ b/bdp-kompass.php @@ -15,6 +15,7 @@ use Bdp\Modules\Gruppen\Controllers\MainController as GruppenMain; use Bdp\Modules\KompassSettings\Controllers\SettingsPage as KomnpassSettings; use Bdp\Modules\LimitLoginAttempts\Controllers\OptionsPage as OptionsPageAlias; +use Bdp\Modules\Mail\Controllers\MailController; use Bdp\Modules\Security\Security; use Bdp\Modules\Seo\Seo; @@ -47,6 +48,7 @@ add_action('admin_menu', function () { new OptionsPageAlias(); new KomnpassSettings(); new GruppenMain(); + new MailController(); }); diff --git a/includes/action_caller.php b/includes/action_caller.php index c2178a4..f5d09c4 100644 --- a/includes/action_caller.php +++ b/includes/action_caller.php @@ -30,7 +30,7 @@ function add_custom_admin_bar_item() { 'id' => 'kompass_gruppen', 'title' => '' . '' .__('Groups', BDP_LV_PLUGIN_SLUG) . '', - 'href' => 'admin.php?page=kompass-groups', + 'href' => get_admin_url() . 'admin.php?page=kompass-groups', ]; diff --git a/includes/spl.php b/includes/spl.php index b3d4fe1..b23b823 100644 --- a/includes/spl.php +++ b/includes/spl.php @@ -25,16 +25,20 @@ foreach (glob($directoryPath . '*.php') as $file) { require_once $file; } - - -$modules = ['KompassSettings', 'LimitLoginAttempts', 'PasswordStrength', 'seo', 'Gruppen']; $subdirs = ['includes', 'Controllers', 'Views', 'Requests', 'Actions']; -foreach ($modules as $curModule) { - foreach ($subdirs as $dir) { - $directoryPath = BDP_LV_PLUGIN_DIR . 'modules/' . $curModule . '/' . $dir . '/'; - foreach (glob($directoryPath . '*.php') as $file) { - require_once $file; - } - } +foreach (scandir(BDP_LV_PLUGIN_DIR . 'modules/') as $curModule) { + if ($curModule != '.' && $curModule != '..' && is_dir(BDP_LV_PLUGIN_DIR . 'modules/' . $curModule)) + { + if ($curModule == 'calendar') { + continue; + } + + foreach ($subdirs as $dir) { + $directoryPath = BDP_LV_PLUGIN_DIR . 'modules/' . $curModule . '/' . $dir . '/'; + foreach (glob($directoryPath . '*.php') as $file) { + require_once $file; + } + } + } } \ No newline at end of file diff --git a/modules/Gruppen/Views/GruppenOverview.php b/modules/Gruppen/Views/GruppenOverview.php index 0af502e..0e15155 100644 --- a/modules/Gruppen/Views/GruppenOverview.php +++ b/modules/Gruppen/Views/GruppenOverview.php @@ -59,6 +59,13 @@ function kompass_print_gruppen_overview() '; + + // Gutenberg-Editor einbinden + wp_editor( '', 'gutenberg_content', array( + 'textarea_name' => 'gutenberg_content', +// 'media_buttons' => false, // Deaktivieren der Medien-Upload-Schaltfläche + ) ); + } function kompass_get_group_actions(int $groupId, int $participantCount) : string diff --git a/modules/Mail/Controllers/MailCompose.php b/modules/Mail/Controllers/MailCompose.php new file mode 100644 index 0000000..9f65916 --- /dev/null +++ b/modules/Mail/Controllers/MailCompose.php @@ -0,0 +1,10 @@ +isSMTP(); + $phpmailer->Host = $smtp_host; + $phpmailer->Port = $smtp_port; + $phpmailer->SMTPAuth = true; + $phpmailer->Username = $smtp_username; + $phpmailer->Password = $smtp_password; + $phpmailer->setFrom('info@pfadfinden-halle.de', 'Pfadfinden - Halle'); + #$phpmailer->SMTPSecure = $smtp_secure; + } ); + + // Senden Sie die E-Mail + $sent = wp_mail($_REQUEST['mail-to'],$_REQUEST['mail-subject'],$_REQUEST['mail-text'], + ['Reply-To: ' . $_REQUEST['mail-from'], 'Content-Type: text/html; charset=UTF-8']); + + // Überprüfen, ob die E-Mail erfolgreich gesendet wurde + if ( $sent ) { + echo '
E-Mail wurde erfolgreich gesendet!
'; + } else { + echo 'Fehler beim Senden der E-Mail!
'; + } + + + + + + echo $_REQUEST['mail-to'] . '