| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Edit Field. |
| 4 |
* |
| 5 |
* This is the template that form edit |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
?> |
| 13 |
<!-- This file should primarily consist of HTML with a little bit of PHP. --> |
| 14 |
|
| 15 |
<div class="wrap wdk-wrap"> |
| 16 |
<h1 class="wp-heading-inline"><?php echo __('Fields Management','wpdirectorykit'); ?></h1> |
| 17 |
<br /><br /> |
| 18 |
<div class="wdk-body"> |
| 19 |
<div class="postbox" style="display: block;"> |
| 20 |
<div class="postbox-header"> |
| 21 |
<h3><?php echo __('Add/Edit Field','wpdirectorykit'); ?></h3> |
| 22 |
</div> |
| 23 |
<div class="inside"> |
| 24 |
|
| 25 |
<form method="post" action="<?php echo wmvc_current_edit_url(); ?>" novalidate="novalidate"> |
| 26 |
<?php |
| 27 |
$form->messages('', sprintf(__('Successfuly saved, <a href="%1$s">Back to Fields Management </a>','wpdirectorykit'),admin_url('admin.php?page=wdk_fields'))); |
| 28 |
?> |
| 29 |
|
| 30 |
<table class="form-table" role="presentation"> |
| 31 |
<tbody> |
| 32 |
<?php if(wmvc_show_data('field_type', $db_data) != "SECTION"):?> |
| 33 |
<tr> |
| 34 |
<th scope="row"> |
| 35 |
<label for="field_type"><?php echo __('Section','wpdirectorykit'); ?></label> |
| 36 |
</th> |
| 37 |
<td> |
| 38 |
<?php |
| 39 |
echo wmvc_select_option('section', $section_list, (!empty(wmvc_show_data('idfield', $db_data, '')) && isset($fields_categories[wmvc_show_data('idfield', $db_data, '')])) ? $fields_categories[wmvc_show_data('idfield', $db_data)] : ''); |
| 40 |
?> |
| 41 |
</td> |
| 42 |
</tr> |
| 43 |
<?php endif;?> |
| 44 |
<tr> |
| 45 |
<th scope="row"> |
| 46 |
<label for="field_type"><?php echo __('Field Type','wpdirectorykit'); ?></label> |
| 47 |
</th> |
| 48 |
<td> |
| 49 |
<?php |
| 50 |
echo wmvc_select_option('field_type', $field_types, wmvc_show_data('field_type', $db_data, '')); |
| 51 |
?> |
| 52 |
</td> |
| 53 |
</tr> |
| 54 |
<tr> |
| 55 |
<th scope="row"> |
| 56 |
<label for="field_label"><?php echo __('Field Label','wpdirectorykit'); ?></label> |
| 57 |
</th> |
| 58 |
<td> |
| 59 |
<input name="field_label" type="text" id="field_label" |
| 60 |
value="<?php echo wmvc_show_data('field_label', $db_data, ''); ?>" |
| 61 |
class="regular-text"> |
| 62 |
</td> |
| 63 |
</tr> |
| 64 |
<tr> |
| 65 |
<th scope="row"><label for="hint"><?php echo __('Hint','wpdirectorykit'); ?></label> |
| 66 |
</th> |
| 67 |
<td> |
| 68 |
<input name="hint" type="text" id="hint" |
| 69 |
value="<?php echo wmvc_show_data('hint', $db_data, ''); ?>" |
| 70 |
class="regular-text"> |
| 71 |
<p class="description" id="hint-description"> |
| 72 |
<?php echo __('Hint is showing below fields like this one','wpdirectorykit'); ?> |
| 73 |
</p> |
| 74 |
</td> |
| 75 |
</tr> |
| 76 |
<tr> |
| 77 |
<th scope="row"><label |
| 78 |
for="columns_number"><?php echo __('Columns number/Width','wpdirectorykit'); ?></label> |
| 79 |
</th> |
| 80 |
<td> |
| 81 |
<input name="columns_number" type="number" id="columns_number" |
| 82 |
value="<?php echo wmvc_show_data('columns_number', $db_data, ''); ?>" |
| 83 |
class="regular-text"> |
| 84 |
<p class="description" id="columns_number-description"> |
| 85 |
<?php echo __('Full width is 12 columns, so define wanted columns allocation number for this field','wpdirectorykit'); ?> |
| 86 |
</p> |
| 87 |
</td> |
| 88 |
</tr> |
| 89 |
<tr> |
| 90 |
<th scope="row"><?php echo __('Field is required','wpdirectorykit'); ?></th> |
| 91 |
<td> |
| 92 |
<fieldset> |
| 93 |
<legend class="screen-reader-text"> |
| 94 |
<span><?php echo __('Field is required','wpdirectorykit'); ?></span> |
| 95 |
</legend> |
| 96 |
<label for="is_required"> |
| 97 |
<input name="is_required" type="checkbox" id="is_required" |
| 98 |
value="1" |
| 99 |
<?php echo !empty(wmvc_show_data('is_required', $db_data, ''))?'checked':''; ?>> |
| 100 |
<?php echo __('Required','wpdirectorykit'); ?> |
| 101 |
</label> |
| 102 |
</fieldset> |
| 103 |
</td> |
| 104 |
</tr> |
| 105 |
<tr> |
| 106 |
<th scope="row"><?php echo __('Price format','wpdirectorykit'); ?></th> |
| 107 |
<td> |
| 108 |
<fieldset> |
| 109 |
<legend class="screen-reader-text"> |
| 110 |
<span><?php echo __('Price format','wpdirectorykit'); ?></span> |
| 111 |
</legend> |
| 112 |
<label for="is_price_format"> |
| 113 |
<input name="is_price_format" type="checkbox" id="is_price_format" |
| 114 |
value="1" |
| 115 |
<?php echo !empty(wmvc_show_data('is_price_format', $db_data, ''))?'checked':''; ?>> |
| 116 |
<?php echo __('Use wp price format based on language ( Only for number field type)','wpdirectorykit'); ?> |
| 117 |
</label> |
| 118 |
</fieldset> |
| 119 |
</td> |
| 120 |
</tr> |
| 121 |
<?php if(false):?> |
| 122 |
<tr> |
| 123 |
<th scope="row"><?php echo __('Visible on','wpdirectorykit'); ?></th> |
| 124 |
<td> |
| 125 |
<fieldset> |
| 126 |
<legend class="screen-reader-text"> |
| 127 |
<span><?php echo __('Visible on','wpdirectorykit'); ?></span> |
| 128 |
</legend> |
| 129 |
<label for="is_visible_frontend"> |
| 130 |
<input name="is_visible_frontend" type="checkbox" id="is_visible_frontend" |
| 131 |
value="1" |
| 132 |
<?php echo !empty(wmvc_show_data('is_visible_frontend', $db_data, ''))?'checked':''; ?>> |
| 133 |
<?php echo __('Frontend','wpdirectorykit'); ?> |
| 134 |
</label> |
| 135 |
<label for="is_visible_dashboard"> |
| 136 |
<input name="is_visible_dashboard" type="checkbox" id="is_visible_dashboard" |
| 137 |
value="1" |
| 138 |
<?php echo !empty(wmvc_show_data('is_visible_dashboard', $db_data, ''))?'checked':''; ?>> |
| 139 |
<?php echo __('Dashboard','wpdirectorykit'); ?> |
| 140 |
</label> |
| 141 |
</fieldset> |
| 142 |
</td> |
| 143 |
</tr> |
| 144 |
<?php endif;?> |
| 145 |
<tr> |
| 146 |
<th scope="row"><label for="icon_id"><?php echo __('Icon','wpdirectorykit'); ?></label> |
| 147 |
</th> |
| 148 |
<td> |
| 149 |
<?php |
| 150 |
echo wmvc_upload_media('icon_id', wmvc_show_data('icon_id', $db_data, '')); |
| 151 |
?> |
| 152 |
<p class="description" id="icon_id-description"> |
| 153 |
<?php echo __('Icon used for amenities or special places on website','wpdirectorykit'); ?> |
| 154 |
</p> |
| 155 |
</td> |
| 156 |
</tr> |
| 157 |
<tr> |
| 158 |
<th scope="row"><label for="prefix"><?php echo __('Prefix','wpdirectorykit'); ?></label> |
| 159 |
</th> |
| 160 |
<td> |
| 161 |
<input name="prefix" type="text" id="prefix" |
| 162 |
value="<?php echo wmvc_show_data('prefix', $db_data, ''); ?>" |
| 163 |
class="regular-text"> |
| 164 |
<p class="description" id="prefix-description"> |
| 165 |
<?php echo __('Visible before field value usable in currency like $999','wpdirectorykit'); ?> |
| 166 |
</p> |
| 167 |
</td> |
| 168 |
</tr> |
| 169 |
<tr> |
| 170 |
<th scope="row"><label for="suffix"><?php echo __('Suffix','wpdirectorykit'); ?></label> |
| 171 |
</th> |
| 172 |
<td> |
| 173 |
<input name="suffix" type="text" id="suffix" |
| 174 |
value="<?php echo wmvc_show_data('suffix', $db_data, ''); ?>" |
| 175 |
class="regular-text"> |
| 176 |
<p class="description" id="suffix-description"> |
| 177 |
<?php echo __('Visible after field value usable in metrics like 200ft','wpdirectorykit'); ?> |
| 178 |
</p> |
| 179 |
</td> |
| 180 |
</tr> |
| 181 |
<tr> |
| 182 |
<th scope="row"><label |
| 183 |
for="values_list"><?php echo __('Values','wpdirectorykit'); ?></label></th> |
| 184 |
<td> |
| 185 |
<input name="values_list" type="text" id="values_list" |
| 186 |
value="<?php echo wmvc_show_data('values_list', $db_data, ''); ?>" |
| 187 |
class="regular-text"> |
| 188 |
<p class="description" id="values_list-description"> |
| 189 |
<?php echo __('Values selectable in dropdown, separate with, like value1,value2,value3','wpdirectorykit'); ?> |
| 190 |
</p> |
| 191 |
</td> |
| 192 |
</tr> |
| 193 |
</tbody> |
| 194 |
</table> |
| 195 |
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo esc_html__('Save Changes','wpdirectorykit'); ?>"> |
| 196 |
</form> |
| 197 |
</div> |
| 198 |
</div> |
| 199 |
</div> |
| 200 |
</div> |
| 201 |
|
| 202 |
<?php $this->view('general/footer', $data); ?> |