| 1 |
<?php |
| 2 |
$opt_alert_class = ''; |
| 3 |
if( isset( $field['disable'] ) && $field['disable'] === true ) { |
| 4 |
$opt_alert_class = 'betterdocs-opt-alert'; |
| 5 |
} |
| 6 |
?> |
| 7 |
<tr data-id="<?php echo $key; ?>" id="<?php echo esc_attr( $id ); ?>" class="betterdocs-field <?php echo $row_class.' type-'.$field['type']; ?>"> |
| 8 |
<?php if( $field['type'] == 'title' && !empty( $field['label'] )) : ?> |
| 9 |
<th colspan="2" class="betterdocs-control betterdocs-title"><h3><?php esc_html_e( $field['label'], 'betterdocs' ); ?></h3></th> |
| 10 |
<?php elseif( $field['type'] == 'card' && !empty( $field['label'] )) : ?> |
| 11 |
<td class="betterdocs-control betterdocs-card"><a href="<?php echo esc_url($field['url']) ?>"><div class="betterdocs-card-content"><img src="<?php echo BETTERDOCS_ADMIN_URL; ?>/assets/img/betterdocs-customize.svg" alt="betterdocs-documentation"><p><?php _e('Design your Documentation and Article page live with Customizer.', 'betterdocs'); ?></p><p class="betterdocs-customize-button"><?php esc_html_e( $field['label'], 'betterdocs' ); ?></p></div></a></td> |
| 12 |
<?php else: ?> |
| 13 |
<?php if( empty( $field['label'] ) ) : ?> |
| 14 |
<td class="betterdocs-control" colspan="2"> |
| 15 |
<?php else : ?> |
| 16 |
<th class="betterdocs-label"> |
| 17 |
<label for="<?php echo esc_attr( $name ); ?>"><?php esc_html_e( $field['label'], 'betterdocs' ); ?></label> |
| 18 |
</th> |
| 19 |
<td class="betterdocs-control"> |
| 20 |
<?php |
| 21 |
endif; |
| 22 |
do_action( 'betterdocs_field_before_wrapper', $name, $value, $field, $post_id ); |
| 23 |
?> |
| 24 |
<div class="betterdocs-control-wrapper <?php echo $opt_alert_class; ?>"> |
| 25 |
<?php |
| 26 |
if( $file_name ) { |
| 27 |
$file = BETTERDOCS_ADMIN_DIR_PATH . 'includes/fields/betterdocs-'. $file_name .'.php'; |
| 28 |
if( file_exists( $file ) ) { |
| 29 |
include $file; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
if( isset( $field['view'] ) && ! empty( $field['view'] ) ) { |
| 34 |
$args = array(); |
| 35 |
if( isset( $field['default'] ) ) { |
| 36 |
$args['default'] = $field['default']; |
| 37 |
} |
| 38 |
if( isset( $field['options'] ) ) { |
| 39 |
$args['options'] = $field['options']; |
| 40 |
} |
| 41 |
if( ! empty( $value ) ) { |
| 42 |
$args['value'] = $value; |
| 43 |
} |
| 44 |
call_user_func_array( $field['view'], $args ); |
| 45 |
} |
| 46 |
|
| 47 |
if( isset( $field['description'] ) && ! empty( $field['description'] ) ) : |
| 48 |
?> |
| 49 |
<p class="betterdocs-field-description"><?php _e( $field['description'], 'betterdocs' ); ?></p> |
| 50 |
<?php |
| 51 |
endif; |
| 52 |
if( isset( $field['help'] ) && ! empty( $field['help'] ) ) : |
| 53 |
?> |
| 54 |
<p class="betterdocs-field-help"><?php _e( $field['help'], 'betterdocs' ); ?></p> |
| 55 |
<?php |
| 56 |
endif; |
| 57 |
?> |
| 58 |
</div> |
| 59 |
<?php do_action( 'betterdocs_field_after_wrapper', $name, $value, $field, $post_id ); ?> |
| 60 |
</td> |
| 61 |
<?php endif; ?> |
| 62 |
</tr> |
| 63 |
|