Moved HTML to a single file

This commit is contained in:
Claudio Sanches 2020-01-14 12:20:46 -03:00
parent 0f18570827
commit b3b4e92fe1
2 changed files with 26 additions and 21 deletions

View File

@ -81,27 +81,7 @@ class WC_Integration_MaxMind_Geolocation extends WC_Integration {
public function admin_options() {
parent::admin_options();
$database_path = esc_attr( $this->database_service->get_database_path() );
$label = esc_html__( 'Database File Path', 'woocommerce' );
$description = esc_html__( 'The path to the MaxMind database file that was downloaded by the integration.', 'woocommerce' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo <<<INPUT
<table class="form-table">
<tr valign="top">
<th scope="row" class="titledesc">
<label>{$label}</label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span>{$label}</span></legend>
<input class="input-text regular-input" type="text" value="{$database_path}" readonly>
<p class="description">{$description}</p>
</fieldset>
</td>
</tr>
</table>
INPUT;
include dirname( __FILE__ ) . '/views/html-admin-options.php';
}
/**

View File

@ -0,0 +1,25 @@
<?php
/**
* Admin View: Page - Admin options.
*
* @package WooCommerce\Integrations
*/
defined( 'ABSPATH' ) || exit;
?>
<table class="form-table">
<tr valign="top">
<th scope="row" class="titledesc">
<label><?php esc_html_e( 'Database File Path', 'woocommerce' ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php esc_html_e( 'Database File Path', 'woocommerce' ); ?></span></legend>
<input class="input-text regular-input" type="text" value="<?php echo esc_attr( $this->database_service->get_database_path() ); ?>" readonly>
<p class="description"><?php esc_html_e( 'The path to the MaxMind database file that was downloaded by the integration.', 'woocommerce' ); ?></p>
</fieldset>
</td>
</tr>
</table>