2 lines
2.3 KiB
PHP
2 lines
2.3 KiB
PHP
<?php $c = file_get_contents('includes/pages/settings.php'); $new_fields = " <!-- Timezone & Working Hours -->\n <div class=\"col-12 mt-4\"><hr></div>\n <div class=\"col-md-4\">\n <label for=\"timezone\" class=\"form-label fw-semibold text-muted small text-uppercase\"><?php echo __('timezone'); ?></label>\n <select class=\"form-select\" id=\"timezone\" name=\"timezone\">\n <?php\n \$timezones = DateTimeZone::listIdentifiers();\n \$current_tz = \$settings['timezone'] ?? 'UTC';\n foreach (\$timezones as \$tz) {\n \$selected = (\$tz === \$current_tz) ? 'selected' : '';\n echo \"<option value=\\\"{\$tz}\\\" {\$selected}>{\$tz}</option>\";\n }\n ?>\n </select>\n </div>\n <div class=\"col-md-4\">\n <label for=\"working_hours_start\" class=\"form-label fw-semibold text-muted small text-uppercase\"><?php echo __('working_hours_start'); ?></label>\n <input type=\"time\" class=\"form-control\" id=\"working_hours_start\" name=\"working_hours_start\" value=\"<?php echo htmlspecialchars(\$settings['working_hours_start'] ?? '08:00'); ?>\">\n </div>\n <div class=\"col-md-4\">\n <label for=\"working_hours_end\" class=\"form-label fw-semibold text-muted small text-uppercase\"><?php echo __('working_hours_end'); ?></label>\n <input type=\"time\" class=\"form-control\" id=\"working_hours_end\" name=\"working_hours_end\" value=\"<?php echo htmlspecialchars(\$settings['working_hours_end'] ?? '17:00'); ?>\">\n </div>"; $c = str_replace('<!-- Branding -->', $new_fields . "\n\n <!-- Branding -->", $c); file_put_contents('includes/pages/settings.php', $c); echo 'patched settings UI';
|