| 1 |
<?php |
| 2 |
/** |
| 3 |
* Fields Managers in Admin |
| 4 |
**/ |
| 5 |
?> |
| 6 |
<div class="table-responsive"> |
| 7 |
<h2 class="wppcomment-heading-style"><?php _e('WP Comments Fields', "wppcomment"); ?><span></span></h2> |
| 8 |
<table class="table wpcomment_field_table table-striped"> |
| 9 |
<thead> |
| 10 |
<tr> |
| 11 |
<th colspan="9"> |
| 12 |
<button type="button" class="btn btn-primary" data-modal-id="wpcomment_fields_model_id"><?php _e('Add field', "wpcomment"); ?></button> |
| 13 |
<button type="button" class="btn btn-danger wpcomment_remove_field"><?php _e('Remove', "wpcomment"); ?></button> |
| 14 |
|
| 15 |
<button type="button" class="btn btn-info wpcomment_settings_toggle wpcomment_settings float-right"><?php _e('Settings', "wpcomment"); ?></button> |
| 16 |
</th> |
| 17 |
</tr> |
| 18 |
<tr class="wpcomment-thead-bg"> |
| 19 |
<th></th> |
| 20 |
<th class="wpcomment-check-all-field wpcomment-checkboxe-style"> |
| 21 |
<label> |
| 22 |
<input type="checkbox"> |
| 23 |
<span></span> |
| 24 |
</label> |
| 25 |
</th> |
| 26 |
<th><?php _e('Status', "wpcomment"); ?></th> |
| 27 |
<th><?php _e('Data Name', "wpcomment"); ?></th> |
| 28 |
<th><?php _e('Type', "wpcomment"); ?></th> |
| 29 |
<th><?php _e('Title', "wpcomment"); ?></th> |
| 30 |
<th><?php _e('Placeholder', "wpcomment"); ?></th> |
| 31 |
<th><?php _e('Required', "wpcomment"); ?></th> |
| 32 |
<th><?php _e('Actions', "wpcomment"); ?></th> |
| 33 |
</tr> |
| 34 |
</thead> |
| 35 |
<tfoot> |
| 36 |
<tr class="wpcomment-thead-bg"> |
| 37 |
<th></th> |
| 38 |
<th class="wpcomment-check-all-field wpcomment-checkboxe-style"> |
| 39 |
<label> |
| 40 |
<input type="checkbox"> |
| 41 |
<span></span> |
| 42 |
</label> |
| 43 |
</th> |
| 44 |
<th><?php _e('Status', "wpcomment"); ?></th> |
| 45 |
<th><?php _e('Data Name', "wpcomment"); ?></th> |
| 46 |
<th><?php _e('Type', "wpcomment"); ?></th> |
| 47 |
<th><?php _e('Title', "wpcomment"); ?></th> |
| 48 |
<th><?php _e('Placeholder', "wpcomment"); ?></th> |
| 49 |
<th><?php _e('Required', "wpcomment"); ?></th> |
| 50 |
<th><?php _e('Actions', "wpcomment"); ?></th> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<th colspan="12"> |
| 54 |
<div class="wpcomment-submit-btn text-right"> |
| 55 |
<span class="wpcomment-meta-save-notice"></span> |
| 56 |
<input type="submit" class="btn btn-primary" value="<?php _e('Save Fields', 'wp-comment-fields');?>"> |
| 57 |
</div> |
| 58 |
</th> |
| 59 |
</tr> |
| 60 |
</tfoot> |
| 61 |
<tbody> |
| 62 |
<?php |
| 63 |
if ( $wpcomment_meta ) { |
| 64 |
|
| 65 |
$f_index = 1; |
| 66 |
foreach ($wpcomment_meta as $field_index => $field_meta) { |
| 67 |
|
| 68 |
$field_type = isset($field_meta['type']) ? $field_meta['type'] : ''; |
| 69 |
$the_title = isset($field_meta['title']) ? $field_meta['title'] : ''; |
| 70 |
$the_field_id = isset($field_meta['data_name']) ? $field_meta['data_name'] : ''; |
| 71 |
$the_placeholder = isset($field_meta['placeholder']) ? $field_meta['placeholder'] : ''; |
| 72 |
$the_required = isset($field_meta['required']) ? $field_meta['required'] : ''; |
| 73 |
$field_status = isset($field_meta['status']) ? $field_meta['status'] : 'on'; |
| 74 |
// wpcomment_pa($field_status); |
| 75 |
if ($the_required == 'on' ) { |
| 76 |
$_ok = 'Yes'; |
| 77 |
}else{ |
| 78 |
$_ok = 'No'; |
| 79 |
} |
| 80 |
?> |
| 81 |
|
| 82 |
<tr class="row_no_<?php echo esc_attr($f_index); ?>" id="wpcomment_sort_id_<?php echo esc_attr($f_index); ?>"> |
| 83 |
<td class="wpcomment-sortable-handle"> |
| 84 |
<i class="fa fa-arrows" aria-hidden="true"></i> |
| 85 |
</td> |
| 86 |
<td class="wpcomment-check-one-field wpcomment-checkboxe-style"> |
| 87 |
<label> |
| 88 |
<input type="checkbox" value="<?php echo esc_attr($f_index); ?>"> |
| 89 |
<span></span> |
| 90 |
</label> |
| 91 |
</td> |
| 92 |
<td> |
| 93 |
<div class="onoffswitch"> |
| 94 |
<input <?php echo checked($field_status, 'on'); ?> type="checkbox" class="onoffswitch-checkbox" id="wpcomment-onoffswitch-<?php echo esc_attr($f_index)?>" tabindex="0"> |
| 95 |
<label class="onoffswitch-label" for="wpcomment-onoffswitch-<?php echo esc_attr($f_index)?>"> |
| 96 |
<span class="onoffswitch-inner"></span> |
| 97 |
<span class="onoffswitch-switch"></span> |
| 98 |
</label> |
| 99 |
<input type="hidden" value="<?php echo $field_status; ?>" name="wpcomment[<?php echo esc_attr($f_index); ?>][status]"> |
| 100 |
</div> |
| 101 |
</td> |
| 102 |
<td class="wpcomment_meta_field_id"><?php echo $the_field_id; ?></td> |
| 103 |
<td class="wpcomment_meta_field_type"><?php echo $field_type; ?></td> |
| 104 |
<td class="wpcomment_meta_field_title"><?php echo $the_title; ?></td> |
| 105 |
<td class="wpcomment_meta_field_plchlder"><?php echo $the_placeholder; ?></td> |
| 106 |
<td class="wpcomment_meta_field_req"><?php echo $_ok; ?></td> |
| 107 |
<td> |
| 108 |
<button class="btn wpcomment_copy_field" data-field-type="<?php echo esc_attr($field_type); ?>" title="<?php _e('Copy Field',"wpcomment"); ?>" id="<?php echo esc_attr($f_index); ?>"><span class="dashicons dashicons-admin-page"></span></span></i></button> |
| 109 |
<button class="btn wpcomment-edit-field" data-modal-id="wpcomment_field_model_<?php echo esc_attr($f_index); ?>" id="<?php echo esc_attr($f_index); ?>" title="<?php _e('Edit Field',"wpcomment"); ?>"><span class="dashicons dashicons-edit"></span></button> |
| 110 |
</td> |
| 111 |
</tr> |
| 112 |
<?php |
| 113 |
$wpcomment_field_index = $f_index; |
| 114 |
$wpcomment_field_index++; |
| 115 |
$f_index++; |
| 116 |
} |
| 117 |
} |
| 118 |
?> |
| 119 |
</tbody> |
| 120 |
</table> |
| 121 |
</div> |