feat: improve campsites and events management UX
- Add map-based location picker with centered pin for campsites (two-step process) - Hide edit buttons for campsites not owned by current user - Allow numbers in campsite names (fix validateName function) - Prepopulate edit form with existing campsite data - Preserve country/province selection when confirming location - Add real-time filter functionality to campsites table - Fix events publish button error handling (use output buffering cleanup) - Improve AJAX response handling with complete callback Changes: - src/pages/bookings/campsites.php: Location mode UI, filter, edit form improvements - src/config/functions.php: Allow numbers in validateName regex - src/admin/toggle_event_published.php: Clean output buffers before JSON response - src/admin/admin_events.php: Use complete callback instead of success/error handlers
This commit is contained in:
@@ -2195,8 +2195,8 @@ function validateName($name, $minLength = 2, $maxLength = 100) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only allow letters, spaces, hyphens, and apostrophes
|
||||
if (!preg_match('/^[a-zA-Z\s\'-]+$/', $name)) {
|
||||
// Allow letters, numbers, spaces, hyphens, and apostrophes
|
||||
if (!preg_match('/^[a-zA-Z0-9\s\'-]+$/', $name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user