| @@ -5,8 +5,9 @@ | ||
| 5 | 5 | use FluentCart\Framework\Foundation\RequestGuard; |
| 6 | 6 | use FluentCart\Framework\Support\Arr; |
| 7 | 7 | use FluentCart\App\Services\Permission\PermissionManager; |
| 8 | 8 | use FluentCart\App\Services\Theme\ColorPalette; |
| 9 | +use FluentCart\App\Services\Theme\RadiusPalette; | |
| 9 | 10 | |
| 10 | 11 | class FluentMetaRequest extends RequestGuard |
| 11 | 12 | { |
| 12 | 13 | |
| @@ -26,8 +27,14 @@ | ||
| 26 | 27 | ] |
| 27 | 28 | ]; |
| 28 | 29 | |
| 29 | 30 | $rules = Arr::get($rulesMap, $this->get('settings_name'), []); |
| 31 | + | |
| 32 | + // The radius fields only show under Customize; a value hidden under | |
| 33 | + // another source is dropped by the sanitiser rather than blocking the save. | |
| 34 | + if ($this->get('settings_name') === 'appearance' && $this->get('appearance_source') === ColorPalette::SOURCE_CUSTOM) { | |
| 35 | + $rules = array_merge($rules, RadiusPalette::validationRules()); | |
| 36 | + } | |
| 30 | 37 | // $rules = [ |
| 31 | 38 | // 'object_id' => 'integer|min:1', |
| 32 | 39 | // 'object_type' => 'nullable|sanitizeText|max:50', |
| 33 | 40 | // 'meta_key' => 'nullable|sanitizeText|max:50', |
| @@ -93,8 +100,11 @@ | ||
| 93 | 100 | 'show_cart_icon_in_body' => 'sanitize_text_field', |
| 94 | 101 | 'additional_address_field' => 'sanitize_text_field', |
| 95 | 102 | 'hide_coupon_field' => 'sanitize_text_field', |
| 96 | 103 | 'user_account_creation_mode' => 'sanitize_text_field', |
| 104 | + 'require_customer_email_verification' => function ($value) { | |
| 105 | + return $value === 'no' ? 'no' : 'yes'; | |
| 106 | + }, | |
| 97 | 107 | 'auto_login_after_account_creation' => function ($value) { |
| 98 | 108 | return $value === 'yes' ? 'yes' : 'no'; |
| 99 | 109 | }, |
| 100 | 110 | 'force_ssl' => 'sanitize_text_field', |
| @@ -101,8 +111,9 @@ | ||
| 101 | 111 | 'checkout_page_id' => 'intval', |
| 102 | 112 | 'custom_payment_page_id' => 'intval', |
| 103 | 113 | 'cart_page_id' => 'intval', |
| 104 | 114 | 'receipt_page_id' => 'intval', |
| 115 | + 'order_review_page_id' => 'intval', | |
| 105 | 116 | 'shop_page_id' => 'intval', |
| 106 | 117 | 'customer_profile_page_id' => 'intval', |
| 107 | 118 | 'customer_profile_page_slug' => 'sanitize_text_field', |
| 108 | 119 | 'registration_page_id' => 'intval', |
| @@ -118,8 +129,11 @@ | ||
| 118 | 129 | 'store_state' => 'sanitize_text_field', |
| 119 | 130 | 'template_settings_checkout_page_mode' => 'sanitize_text_field', |
| 120 | 131 | 'show_relevant_product_in_single_page' => 'sanitize_text_field', |
| 121 | 132 | 'show_relevant_product_in_modal' => 'sanitize_text_field', |
| 133 | + 'show_reviews_in_single_page' => 'sanitize_text_field', | |
| 134 | + 'show_rating_in_shop' => 'sanitize_text_field', | |
| 135 | + 'show_rating_in_relevant' => 'sanitize_text_field', | |
| 122 | 136 | 'enable_early_payment_for_installment' => 'sanitize_text_field', |
| 123 | 137 | 'subscription_management_mode' => function ($value) { |
| 124 | 138 | $value = sanitize_text_field($value); |
| 125 | 139 | $allowed = ['gateway_managed', 'store_managed']; |
| @@ -199,8 +213,15 @@ | ||
| 199 | 213 | } |
| 200 | 214 | } |
| 201 | 215 | |
| 202 | 216 | return $colors; |
| 217 | + }, | |
| 218 | + 'appearance_radius' => function ($value) { | |
| 219 | + // Registry-driven like the colours: only the known roles, each | |
| 220 | + // one length. A bare number means pixels; px, rem and em are | |
| 221 | + // kept as typed. An empty field means "not set", so the | |
| 222 | + // stylesheet's own fallback applies; 0 is a real value. | |
| 223 | + return RadiusPalette::sanitizeOwnerMap($value); | |
| 203 | 224 | }, |
| 204 | 225 | 'theme_setup' => function ($value) { |
| 205 | 226 | if (!is_array($value)) { |
| 206 | 227 | return []; |