| 1 |
<?php |
| 2 |
|
| 3 |
if (! defined('ABSPATH')) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
/** |
| 8 |
* @var string|null $name |
| 9 |
*/ |
| 10 |
|
| 11 |
?> |
| 12 |
|
| 13 |
<div class="wrap"> |
| 14 |
<h1><?php echo esc_html(get_admin_page_title()); ?></h1> |
| 15 |
|
| 16 |
<?php if (! sendy_is_authenticated()) : ?> |
| 17 |
<p><?php esc_html_e('In order to start using the plug-in you have to authenticate with Sendy. Click the button to start', 'sendy'); ?></p> |
| 18 |
|
| 19 |
<p> |
| 20 |
<a href="<?php echo esc_url(sendy_initialize_plugin_url()); ?>" class="button button-primary"> |
| 21 |
<?php esc_html_e('Authenticate', 'sendy'); ?> |
| 22 |
</a> |
| 23 |
</p> |
| 24 |
<?php else: ?> |
| 25 |
|
| 26 |
<table class="form-table"> |
| 27 |
<tbody> |
| 28 |
<tr> |
| 29 |
<th><?php esc_html_e('Authentication', 'sendy'); ?></th> |
| 30 |
<td> |
| 31 |
<p><?php |
| 32 |
// translators: %s will be filled with the e-mail address of the authenticated user |
| 33 |
echo esc_html(sprintf(__("Authenticated as %s", 'sendy'), $name)); |
| 34 |
?></p> |
| 35 |
|
| 36 |
<p> |
| 37 |
<a class="button" href="<?php echo esc_url(wp_nonce_url(admin_url('?sendy_logout'), 'sendy_logout')); ?>"> |
| 38 |
<?php esc_html_e('Log out', 'sendy'); ?> |
| 39 |
</a> |
| 40 |
</p> |
| 41 |
</td> |
| 42 |
</tr> |
| 43 |
</tbody> |
| 44 |
</table> |
| 45 |
|
| 46 |
<form action="options.php" method="post"> |
| 47 |
<?php |
| 48 |
|
| 49 |
settings_fields('sendy_general_settings'); |
| 50 |
|
| 51 |
do_settings_sections('sendy'); |
| 52 |
|
| 53 |
submit_button(__('Save settings', 'sendy')); |
| 54 |
?> |
| 55 |
</form> |
| 56 |
<?php endif; ?> |
| 57 |
</div> |
| 58 |
|