<?php
/**
 * Created by mr2app.
 * User: Hani
 * Date: 3/19/2019
 * Time: 3:21 PM
 */

wp_register_style( 'woo2app_style', WOO2APP_CSS_URL.'woo2app_style.css'  );
wp_enqueue_style( 'woo2app_style'.WOO2APP_FILES_VER );
if(get_locale() == 'fa_IR'){
	wp_register_style('myfont', WOO2APP_CSS_URL . 'font.css');
	wp_enqueue_style( 'myfont'.WOO2APP_FILES_VER);
}

$authentication = get_option('woo2app_authentication');
if(!is_array($authentication)){
	$authentication =  array(
		'consumer_key'        =>   '',
		'consumer_secret' =>   ''
	);

}
?>
<div class="wrap">
    <h1> <?php _e('Set the application API key ', 'woo2app'); ?> </h1>
	<p>

	</p>
	<form method="post" action="options.php">
		<?php
		settings_fields( 'woo2app_authentication-group' );
		do_settings_sections('woo2app_authentication-group' );
		?>
		<table class="form-table">
			<tr valign="top" class="" >
				<th scope="row" class="titledesc">
                    <?php _e('Active', 'woo2app'); ?>
				</th>
				<td class="forminp">
					<input type="checkbox"  name="woo2app_authentication[enable]" <?= checked(isset($authentication['enable']) ? $authentication['enable'] : ''  , 'on');?> />
				</td>
			</tr>
			<tr valign="top" class="" >
				<th scope="row" class="titledesc">
                    <?php _e('Consumer key', 'woo2app'); ?>
				</th>
				<td class="forminp">
					<input type="text" class="regular-text" name="woo2app_authentication[consumer_key]" value="<?= $authentication['consumer_key'];?>" />
				</td>
			</tr>
			<tr valign="top" class="" >
				<th scope="row" class="titledesc">
                    <?php _e('Consumer password', 'woo2app'); ?>
				</th>
				<td class="forminp">
					<input type="text" class="regular-text" name="woo2app_authentication[consumer_secret]" value="<?= $authentication['consumer_secret'];?>" />
				</td>
			</tr>
		</table>
		<div>
            <?php submit_button('Save Change'); ?>
		</div>
	</form>
</div>
