'array', 'sanitize_callback' => 'a11ybridge_sanitize_option_array'));
register_setting('a11ybridge_user_settings_group', 'a11ybridge_user_privacy_settings', array('type' => 'array', 'sanitize_callback' => 'a11ybridge_sanitize_option_array'));
register_setting('a11ybridge_user_settings_group', 'a11ybridge_user_storage_settings', array('type' => 'array', 'sanitize_callback' => 'a11ybridge_sanitize_option_array'));
register_setting('a11ybridge_user_settings_group', 'a11ybridge_user_defaults_settings', array('type' => 'array', 'sanitize_callback' => 'a11ybridge_sanitize_option_array'));
}
// Direkt rendern
if (is_admin()) {
$a11ybridge_page_raw = filter_input(INPUT_GET, 'page', FILTER_UNSAFE_RAW);
$a11ybridge_page = is_string($a11ybridge_page_raw) ? sanitize_key(wp_unslash($a11ybridge_page_raw)) : '';
if ($a11ybridge_page === 'a11ybridge-settings') {
a11ybridge_show_user_settings();
}
}
function a11ybridge_show_user_settings() {
// Lade Einstellungen
$profile_settings = get_option('a11ybridge_user_profile_settings', [
'enable_user_profiles' => true,
'allow_guest_settings' => true,
'profile_auto_save' => true,
'profile_sharing' => false,
'sync_across_devices' => false
]);
$privacy_settings = get_option('a11ybridge_user_privacy_settings', [
'data_encryption' => true,
'anonymous_usage' => false,
'cookie_consent' => true,
'data_retention_days' => 90,
'gdpr_compliance' => true
]);
$storage_settings = get_option('a11ybridge_user_storage_settings', [
'storage_method' => 'wordpress_user_meta',
'fallback_cookies' => true,
'session_duration' => 30,
'cleanup_inactive' => true,
'backup_settings' => false
]);
$defaults_settings = get_option('a11ybridge_user_defaults_settings', [
'default_font_size' => '16px',
'default_color_mode' => 'normal',
'default_contrast' => 'normal',
'default_language' => 'auto',
'default_voice_speed' => '1.0',
'default_toolbar_position' => 'top-right'
]);
?>
👥 Benutzer-Management
Verwaltung von Benutzerdaten und Einstellungen.
'; ?>
'; ?>
'; ?>
document.addEventListener('DOMContentLoaded', function() {
// Export User Settings
const exportBtn = document.getElementById('export-user-settings-btn');
const cleanupBtn = document.getElementById('cleanup-old-data-btn');
const resetBtn = document.getElementById('reset-defaults-btn');
const statusDiv = document.getElementById('user-management-status');
if (exportBtn) {
exportBtn.addEventListener('click', function() {
this.disabled = true;
this.textContent = '📦 Exportiere...';
showStatus('Exportiere alle Benutzereinstellungen...', 'info');
fetch(ajaxurl, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
action: 'a11ybridge_export_user_settings',
nonce: ''
})
})
.then(response => response.json())
.then(data => {
showStatus('✅ Export erfolgreich erstellt!', 'success');
this.disabled = false;
this.textContent = '📤 Alle Benutzereinstellungen exportieren';
})
.catch(error => {
showStatus('❌ Export-Fehler: ' + error.message, 'error');
this.disabled = false;
this.textContent = '📤 Alle Benutzereinstellungen exportieren';
});
});
}
if (cleanupBtn) {
cleanupBtn.addEventListener('click', function() {
if (!confirm('Möchten Sie wirklich alle alten/inaktiven Daten löschen?')) return;
this.disabled = true;
this.textContent = '🧹 Bereinige...';
showStatus('Bereinige alte Benutzerdaten...', 'info');
setTimeout(() => {
showStatus('✅ Datenbereinigung abgeschlossen!', 'success');
this.disabled = false;
this.textContent = '🧹 Alte Daten bereinigen';
}, 2000);
});
}
if (resetBtn) {
resetBtn.addEventListener('click', function() {
if (!confirm('ACHTUNG: Alle Benutzereinstellungen werden auf Standard zurückgesetzt! Fortfahren?')) return;
this.disabled = true;
this.textContent = '🔄 Setze zurück...';
showStatus('Setze alle Einstellungen zurück...', 'info');
setTimeout(() => {
showStatus('✅ Alle Einstellungen auf Standard zurückgesetzt!', 'success');
this.disabled = false;
this.textContent = '🔄 Alle auf Standard zurücksetzen';
}, 3000);
});
}
function showStatus(message, type) {
if (statusDiv) {
statusDiv.className = `a11y-status ${type}`;
statusDiv.style.display = 'block';
statusDiv.textContent = message;
}
}
});