| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Edit field DATE_TO. |
| 4 |
* |
| 5 |
* This is the template that field layout for edit form, calendar |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
?> |
| 13 |
<?php |
| 14 |
|
| 15 |
//wmvc_dump($field); |
| 16 |
|
| 17 |
if(isset($field->field)) |
| 18 |
{ |
| 19 |
$field_id = $field->field; |
| 20 |
} |
| 21 |
else |
| 22 |
{ |
| 23 |
$field_id = 'field_'.$field->idfield; |
| 24 |
} |
| 25 |
|
| 26 |
if(!isset($field->hint))$field->hint = ''; |
| 27 |
if(!isset($field->columns_number))$field->columns_number = ''; |
| 28 |
if(!isset($field->class))$field->class = ''; |
| 29 |
|
| 30 |
$field_label = $field->field_label; |
| 31 |
|
| 32 |
$required = ''; |
| 33 |
if(isset($field->is_required) && $field->is_required == 1) |
| 34 |
$required = '*'; |
| 35 |
|
| 36 |
if(isset($field->rules) && strpos($field->rules, 'required') !== FALSE) |
| 37 |
$required = '*'; |
| 38 |
|
| 39 |
?> |
| 40 |
<div class="wdk-field-<?php echo esc_attr($field_id);?> wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>"> |
| 41 |
<label for="<?php echo esc_attr($field_id); ?>"><?php echo esc_html($field_label).esc_html($required); ?></label> |
| 42 |
<div class="wdk-field-container"> |
| 43 |
<input class="regular-text db-date" <?php if(false):?>date-format="<?php echo esc_attr(wdk_jsdateformat(get_option('date_format')));?>"<?php endif;?> name="<?php echo esc_attr($field_id); ?>" type="hidden" id="<?php echo esc_attr($field_id); ?>" value="<?php echo esc_attr(wmvc_show_data($field_id, $db_data, '')); ?>"> |
| 44 |
<input class="regular-text wdk-fielddate_to" <?php if(false):?>date-format="<?php echo esc_attr(wdk_jsdateformat(get_option('date_format')));?>"<?php endif;?> name="<?php echo esc_attr($field_id); ?>_mask" type="text" id="<?php echo esc_attr($field_id); ?>_mask" value="<?php echo esc_attr(wdk_get_date(wmvc_show_data($field_id, $db_data, ''), false)); ?>"> |
| 45 |
<?php if(!empty($field->hint)):?> |
| 46 |
<p class="wdk-hint"> |
| 47 |
<?php echo esc_html($field->hint); ?> |
| 48 |
</p> |
| 49 |
<?php endif;?> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
|
| 53 |
<?php |
| 54 |
wp_enqueue_script( 'jquery-ui-datepicker' ); |
| 55 |
wp_enqueue_style('jquery-ui'); |
| 56 |
?> |
| 57 |
|