add big filed
This commit is contained in:
@@ -41,10 +41,10 @@ if (isset($_GET['error']) && $_GET['error'] == 'egd_update_failed')
|
||||
echo '<div style="margin-bottom:15px; display: flex; flex-wrap: wrap; gap: 10px;">';
|
||||
|
||||
action_button('go_form_delete_form', 'Delete Form', 'Delete this form and ALL entries?', $selected_form_id);
|
||||
action_button('go_form_export_csv', 'Export to CSV', 'Confrm Export', $selected_form_id);
|
||||
action_button('go_form_export_pairgoth', 'Export to Pairgoth', 'Confrm Export', $selected_form_id);
|
||||
action_button('go_form_export_opengotha', 'Export to Opengoth', 'Confrm Export', $selected_form_id);
|
||||
action_button('go_form_export_mcmahon', 'Export to McMahon', 'Confrm Export', $selected_form_id);
|
||||
action_button('go_form_export_csv', 'Export to CSV', 'Confirm Export', $selected_form_id);
|
||||
action_button('go_form_export_pairgoth', 'Export to Pairgoth', 'Confirm Export', $selected_form_id);
|
||||
action_button('go_form_export_opengotha', 'Export to Opengoth', 'Confirm Export', $selected_form_id);
|
||||
action_button('go_form_export_mcmahon', 'Export to McMahon', 'Confirm Export', $selected_form_id);
|
||||
action_button('go_form_update_egd_data', 'Update EGD Data', 'Update rank and rating from EGD for all entries with EGD numbers?', $selected_form_id);
|
||||
|
||||
echo '</div>';
|
||||
@@ -69,11 +69,13 @@ if (isset($_GET['error']) && $_GET['error'] == 'egd_update_failed')
|
||||
echo '<option value="select">Dropdown (Select)</option>';
|
||||
echo '<option value="checkbox">Checkbox</option>';
|
||||
echo '<option value="email">Email</option>';
|
||||
echo '<option value="textarea">Textarea</option>';
|
||||
echo '</select>';
|
||||
echo '</td></tr>';
|
||||
echo '<tr><th><label for="field_options">Options (for select, comma-separated):</label></th><td><textarea name="field_options" id="field_options" rows="2" style="width:100%;"></textarea><small>e.g., Option 1,Option 2,Option 3</small></td></tr>';
|
||||
echo '<tr><th><label for="is_public">Public:</label></th><td><input type="checkbox" name="is_public" id="is_public" value="1" checked> <small>Show on public form</small></td></tr>';
|
||||
echo '<tr><th><label for="is_required">Required:</label></th><td><input type="checkbox" name="is_required" id="is_required" value="1"> <small>Required field</small></td></tr>';
|
||||
echo '<tr><th><label for="is_full_width">Full Width:</label></th><td><input type="checkbox" name="is_full_width" id="is_full_width" value="1"> <small>Display on full width (outside grid)</small></td></tr>';
|
||||
echo '</table>';
|
||||
echo '<p class="submit"><input type="submit" class="button button-primary" value="Add Custom Field"></p>';
|
||||
echo '</form>';
|
||||
@@ -82,13 +84,14 @@ if (isset($_GET['error']) && $_GET['error'] == 'egd_update_failed')
|
||||
// List existing custom fields
|
||||
if (!empty($custom_fields)) {
|
||||
echo '<table class="wp-list-table widefat striped" style="margin-top:15px;">';
|
||||
echo '<thead><tr><th>Field Name</th><th>Type</th><th>Public</th><th>Required</th><th>Actions</th></tr></thead><tbody>';
|
||||
echo '<thead><tr><th>Field Name</th><th>Type</th><th>Public</th><th>Required</th><th>Full Width</th><th>Actions</th></tr></thead><tbody>';
|
||||
foreach ($custom_fields as $field) {
|
||||
echo '<tr>';
|
||||
echo '<td>' . esc_html($field->field_name) . '</td>';
|
||||
echo '<td>' . esc_html($field->field_type) . '</td>';
|
||||
echo '<td>' . ($field->is_public ? 'Yes' : 'No') . '</td>';
|
||||
echo '<td>' . ($field->is_required ? 'Yes' : 'No') . '</td>';
|
||||
echo '<td>' . ($field->is_full_width ? 'Yes' : 'No') . '</td>';
|
||||
echo '<td>';
|
||||
// Edit button (toggle to show edit form)
|
||||
echo '<a href="' . add_query_arg(array('page' => 'go-form-settings', 'form_id' => $selected_form_id, 'edit_field' => $field->id), admin_url('admin.php')) . '" class="button button-small">Edit</a> ';
|
||||
@@ -119,11 +122,13 @@ if (isset($_GET['error']) && $_GET['error'] == 'egd_update_failed')
|
||||
echo '<option value="select"' . selected($edit_field->field_type, 'select', false) . '>Dropdown (Select)</option>';
|
||||
echo '<option value="checkbox"' . selected($edit_field->field_type, 'checkbox', false) . '>Checkbox</option>';
|
||||
echo '<option value="email"' . selected($edit_field->field_type, 'email', false) . '>Email</option>';
|
||||
echo '<option value="textarea"' . selected($edit_field->field_type, 'textarea', false) . '>Textarea</option>';
|
||||
echo '</select>';
|
||||
echo '</td></tr>';
|
||||
echo '<tr><th><label for="field_options">Options (for select, comma-separated):</label></th><td><textarea name="field_options" id="field_options" rows="2" style="width:100%;">' . esc_textarea($edit_field->field_options) . '</textarea><small>e.g., Option 1,Option 2,Option 3</small></td></tr>';
|
||||
echo '<tr><th><label for="is_public">Public:</label></th><td><input type="checkbox" name="is_public" id="is_public" value="1" ' . checked($edit_field->is_public, 1, false) . '> <small>Show on public form</small></td></tr>';
|
||||
echo '<tr><th><label for="is_required">Required:</label></th><td><input type="checkbox" name="is_required" id="is_required" value="1" ' . checked($edit_field->is_required, 1, false) . '> <small>Required field</small></td></tr>';
|
||||
echo '<tr><th><label for="is_full_width">Full Width:</label></th><td><input type="checkbox" name="is_full_width" id="is_full_width" value="1" ' . checked($edit_field->is_full_width, 1, false) . '> <small>Display on full width (outside grid)</small></td></tr>';
|
||||
echo '</table>';
|
||||
echo '<p class="submit"><input type="submit" class="button button-primary" value="Update Custom Field"> <a href="' . add_query_arg(array('page' => 'go-form-settings', 'form_id' => $selected_form_id), admin_url('admin.php')) . '" class="button">Cancel</a></p>';
|
||||
echo '</form>';
|
||||
@@ -175,6 +180,9 @@ if (isset($_GET['error']) && $_GET['error'] == 'egd_update_failed')
|
||||
case 'email':
|
||||
echo '<input type="email" name="' . esc_attr($field_id) . '" id="' . esc_attr($field_id) . '" value="' . esc_attr($value) . '"' . ($field->is_required ? ' required' : '') . '>';
|
||||
break;
|
||||
case 'textarea':
|
||||
echo '<textarea name="' . esc_attr($field_id) . '" id="' . esc_attr($field_id) . '" rows="4" style="width:100%;"' . ($field->is_required ? ' required' : '') . '>' . esc_textarea($value) . '</textarea>';
|
||||
break;
|
||||
case 'select':
|
||||
$options = $field->field_options ? explode(',', $field->field_options) : [];
|
||||
echo '<select name="' . esc_attr($field_id) . '" id="' . esc_attr($field_id) . '"' . ($field->is_required ? ' required' : '') . '>';
|
||||
|
||||
Reference in New Issue
Block a user