| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class to display a customer add/edit form in the admin. |
| 5 |
* |
| 6 |
* @since 3.0.0 |
| 7 |
*/ |
| 8 |
class ewdotpAdminCustomerFormView extends ewdotpViewAdmin { |
| 9 |
|
| 10 |
/** |
| 11 |
* Render the view and enqueue required stylesheets |
| 12 |
* @since 3.0.0 |
| 13 |
*/ |
| 14 |
public function render() { |
| 15 |
global $ewd_otp_controller; |
| 16 |
|
| 17 |
ob_start(); |
| 18 |
|
| 19 |
$template = $this->find_template( 'admin-customer-form' ); |
| 20 |
|
| 21 |
if ( $template ) { |
| 22 |
include( $template ); |
| 23 |
} |
| 24 |
|
| 25 |
$output = ob_get_clean(); |
| 26 |
|
| 27 |
return apply_filters( 'ewd_otp_admin_customer_output', $output, $this ); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Returns the value for a specified custom field. |
| 32 |
* |
| 33 |
* @since 3.0.0 |
| 34 |
*/ |
| 35 |
public function set_custom_field_value( $custom_field ) { |
| 36 |
global $ewd_otp_controller; |
| 37 |
|
| 38 |
return ! empty( $this->customer->custom_fields[ $custom_field->id ] ) ? $this->customer->custom_fields[ $custom_field->id ] : ''; |
| 39 |
} |
| 40 |
} |
| 41 |
|