feat: Dynamic expiry days selector based on max_transfer_days_valid#2518
Conversation
|
Please make this configurable. Some installs explicitly choose these values. |
Do you mean something like this 'transfer_days_valid_is_progressive = true/false' ? |
e1eeb85 to
7a4438b
Compare
- Changed selectable_transfer_days_valid and selectable_guest_days_valid defaults to empty array - When empty: generates progressive day options (1-7 daily, 8-30 weekly, 30+ monthly) - When populated: uses admin-configured values (backward compatible) - Applies to both upload_page.php and new_invitation_page.php
f7c8a8f to
689aecd
Compare
|
Thanks for the feedback! I've updated the implementation: Instead of adding new boolean config flags, I changed the default value of selectable_transfer_days_valid and selectable_guest_days_valid to an empty array. Empty array (default): Uses progressive day generation automatically. |
Description
This PR improves the UX of the expiry days selector in
upload_page. Instead of using a static list or requiring manual configuration ofselectable_transfer_days_valid, this change dynamically generates a progressive list of options based on themax_transfer_days_validsetting.The Problem
Previously (in master/v3), the selector had hardcoded values (7, 15, 30, 40). In development3, it relied on
selectable_transfer_days_valid, but this requires admins to manually sync two configuration arrays. Ifmax_transfer_days_validwas set to a low value (e.g., 5 days), users might see no options or only the default.The Solution
The
selectable_*_days_validarrays now default to empty. When empty, the code generates options dynamically:max_transfer_days_validis always included.default_transfer_days_validis always included.If an admin explicitly configures the array with custom values, those are used instead (backward compatible).
This logic is applied to:
templates/upload_page.php)templates/new_invitation_page.php), respectingmin_guest_days_validExamples
max_days=5-> Options:1, 2, 3, 4, 5max_days=14-> Options:1...7, 10 (default), 14max_days=90-> Options:1...7, 14, 21, 28, 30, 60, 90Type of change