From 923d76c0853ac23e7399077693653c81c18d462d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20G=C3=BCnther?=
Date: Wed, 31 Jul 2024 17:53:07 +0200
Subject: [PATCH] Integrated mareike dashboard theme
---
assets/mareike.css | 175 ++++++++++++++++++
bdp-kompass.php | 37 ++--
includes/frontend-functions.php | 41 +---
includes/setup.php | 3 -
.../Controllers/SettingsPage.php | 52 +++++-
modules/KompassSettings/Views/tab-control.php | 9 +-
.../Controllers/class-saveregistration.php | 2 +-
settings/views/settings.php | 134 ++++++++++++++
8 files changed, 397 insertions(+), 56 deletions(-)
create mode 100644 assets/mareike.css
create mode 100644 settings/views/settings.php
diff --git a/assets/mareike.css b/assets/mareike.css
new file mode 100644
index 0000000..9d09b97
--- /dev/null
+++ b/assets/mareike.css
@@ -0,0 +1,175 @@
+/* Allgemeine Anpassungen */
+body {
+ --ame-ms-menu-width: 250px;
+}
+
+#wpwrap {
+ background-color: #f3f3f1; /* Hintergrundfarbe angepasst */
+}
+
+/* Admin Menü */
+#adminmenuback, #adminmenuwrap, #adminmenu {
+ width: 250px;
+ background-color: #ffffff; /* Hintergrundfarbe angepasst */
+}
+
+#adminmenu .wp-has-current-submenu > .wp-submenu {
+ width: 250px;
+}
+
+#wpcontent, #wpfooter {
+ margin-left: 250px;
+ background-color: #ffffff;
+ padding-left: 20px; /* Padding reduziert */
+}
+
+#adminmenu .wp-not-current-submenu .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu .ame-has-deep-submenu:not(.ame-has-highlighted-item) > .wp-submenu {
+ width: 250px;
+}
+
+/* Menüelemente */
+#adminmenu > li {
+ padding: 10px 10px; /* Padding angepasst */
+ font-weight: bold; /* Schriftstärke angepasst */
+}
+
+#adminmenu > li a {
+ color: #333; /* Textfarbe angepasst */
+}
+
+#adminmenu > li div.wp-menu-image:before {
+ color: #333; /* Iconfarbe angepasst */
+}
+
+#adminmenu > li a:hover, #adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus {
+ color: #0056b3; /* Textfarbe bei Hover angepasst */
+}
+
+#adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus {
+ background-color: #e9ecef; /* Hintergrundfarbe bei Hover angepasst */
+}
+
+#adminmenu .wp-submenu, #adminmenu .wp-submenu a {
+ background-color: #f8f9fa; /* Untermenü-Hintergrundfarbe angepasst */
+ color: #333; /* Untermenü-Textfarbe angepasst */
+}
+
+#adminmenu .wp-submenu a:hover {
+ background-color: #e9ecef; /* Untermenü-Hintergrundfarbe bei Hover angepasst */
+ color: #0056b3; /* Untermenü-Textfarbe bei Hover angepasst */
+}
+
+/* Admin Bar */
+#wpadminbar {
+ background-color: #ffffff; /* Admin Bar Hintergrundfarbe angepasst */
+ color: #0056b3; /* Admin Bar Textfarbe angepasst */
+}
+
+#wpadminbar .ab-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon {
+ color: #0056b3; /* Admin Bar Textfarbe angepasst */
+}
+
+#wpadminbar .ab-icon, #wpadminbar .ab-icon:before, #wpadminbar .ab-item:before, #wpadminbar .ab-item:after {
+ color: #0056b3; /* Admin Bar Icon-Farbe angepasst */
+}
+
+#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item, #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
+ background-color: #e9ecef; /* Admin Bar Hintergrundfarbe bei Hover angepasst */
+ color: #0056b3; /* Admin Bar Textfarbe bei Hover angepasst */
+}
+
+#wpadminbar .quicklinks .menupop ul li a:hover, #wpadminbar .quicklinks .menupop ul li a:focus {
+ background-color: #e9ecef; /* Untermenü Hintergrundfarbe bei Hover angepasst */
+ color: #0056b3; /* Untermenü Textfarbe bei Hover angepasst */
+}
+
+/* Buttons */
+.button-primary {
+ border-style: none;
+ background-color: #0056b3 !important; /* Button Hintergrundfarbe angepasst */
+ color: #ffffff !important; /* Button Textfarbe angepasst */
+ box-shadow: none; /* Box-Shadow entfernt */
+}
+
+.button-primary:hover {
+ background-color: #004085 !important; /* Button Hintergrundfarbe bei Hover angepasst */
+}
+
+/* Anpassungen für Bildschirme mit unterschiedlichen Breiten */
+@media screen and (min-width: 783px) {
+ #adminmenu .wp-not-current-submenu .wp-submenu {
+ display: none !important;
+ }
+}
+
+@media screen and (max-width: 960px) and (min-width: 783px) {
+ body.auto-fold #widgets-editor .interface-interface-skeleton {
+ left: var(--ame-ms-collapsed-menu-width, 36px);
+ }
+}
+
+/* Weitere Anpassungen */
+.nav-tab {
+ border-color: #0056b3;
+ background-color: #e9ecef;
+ border-radius: 5px 5px 0 0;
+}
+
+.about-wrap .nav-tab-active, .nav-tab-active, .nav-tab-active:hover {
+ border-style: none;
+ background-color: #ffffff;
+ border-bottom-color: #ffffff;
+ box-shadow: none;
+}
+
+/* Weitere spezifische Anpassungen */
+#collapse-button {
+ display: none;
+}
+
+/* Spezielle Einstellungen Box */
+.bdp_setting_box {
+ margin-right: 10px;
+ background-color: #ffffff;
+ padding: 15px;
+ border: 1px solid #1d94cf;
+}
+
+.bdp_setting_box label {
+ cursor: pointer;
+}
+
+.bdp_setting_box label span {
+ cursor: pointer;
+ width: 10pt;
+ color: #a0a0a0;
+}
+
+@media screen and (min-width: 783px) {
+ .wp-has-current-submenu li a {
+ width: 210px !important;
+ }
+}
+
+.wp-submenu li a:hover {
+ background-color: #e9ecef !important;
+ color: #0056b3 !important;
+}
+
+.current .menu-top .wp-menu-name, .wp-has-current-submenu .wp-menu-name {
+ background-color: #0056b3 !important;
+ border-style: none !important;
+ width: 202px;
+}
+
+@media screen and (min-width: 783px) {
+ .wp-submenu, .wp-submenu-wrap {
+ background-color: #f8f9fa !important;
+ width: 220px !important;
+ }
+
+ #adminmenu .current .menu-top .wp-menu-name {
+ padding: 10px;
+ width: 225px !important;
+ }
+}
diff --git a/bdp-kompass.php b/bdp-kompass.php
index c976809..c7ba2d2 100644
--- a/bdp-kompass.php
+++ b/bdp-kompass.php
@@ -13,7 +13,6 @@
*/
use Bdp\Modules\EventParticipants\Controllers\MainController as EventsMain;
-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;
@@ -78,18 +77,10 @@ function enqueue_custom_password_js() {
add_action( 'after_setup_theme', 'kompass_after_setup_theme' );
+add_action( 'admin_menu', ['Bdp\Modules\KompassSettings\Controllers\SettingsPage', 'add_menu'] );
-
-
-
-
-
-
-
-
-// Add registration form fields
function crp_custom_register_form() {
}
@@ -122,4 +113,28 @@ function crp_allow_umlauts_in_usernames($username, $raw_username, $strict) {
add_filter('sanitize_user', 'crp_allow_umlauts_in_usernames', 10, 3);
-add_action('login_message', ['Bdp\Modules\Registration\Controllers\SaveRegistration','display_custom_message']);
\ No newline at end of file
+add_action('login_message', ['Bdp\Modules\Registration\Controllers\SaveRegistration','display_custom_message']);
+
+if (false === (bool)get_option('user_can_register', false)) {
+
+ add_filter('registration_errors', 'kompass_disable_user_registration', 10, 3);
+
+ function kompass_disable_user_registration($errors, $sanitized_user_login, $user_email) {
+ $errors->add('registration_disabled', __('Die Registrierung ist derzeit deaktiviert.'));
+ return $errors;
+ }
+
+ add_action('login_enqueue_scripts', 'kompass_remove_register_link');
+
+ function kompass_remove_register_link() {
+ ?>
+
+
';
+ case 'tab2':
+ echo '';
break;
- case 'tab2':
+ case 'tab3':
echo '';
break;
}
diff --git a/modules/KompassSettings/Views/tab-control.php b/modules/KompassSettings/Views/tab-control.php
index 2a4733d..c70ae02 100644
--- a/modules/KompassSettings/Views/tab-control.php
+++ b/modules/KompassSettings/Views/tab-control.php
@@ -3,10 +3,15 @@
{
$baseUrl = 'admin.php?page=bdp-kompass-Kompass-settings&tab=';
return '';
diff --git a/modules/Registration/Controllers/class-saveregistration.php b/modules/Registration/Controllers/class-saveregistration.php
index de0c537..6f043c7 100644
--- a/modules/Registration/Controllers/class-saveregistration.php
+++ b/modules/Registration/Controllers/class-saveregistration.php
@@ -24,7 +24,7 @@ class SaveRegistration {
// Assign the 'Standarduser' role to the new user
$user = new WP_User($user_id);
- $user->set_role('standarduser');
+ $user->set_role('user');
// Send confirmation email
$user = get_userdata($user_id);
diff --git a/settings/views/settings.php b/settings/views/settings.php
new file mode 100644
index 0000000..5874117
--- /dev/null
+++ b/settings/views/settings.php
@@ -0,0 +1,134 @@
+
+
+
+
\ No newline at end of file