| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) or die(); |
| 3 |
/** @var \Gianism\UI\Screen $this */ |
| 4 |
/** @var \Gianism\Service\Instagram $instance */ |
| 5 |
?> |
| 6 |
|
| 7 |
<h3><i class="lsf lsf-instagram"></i> Instagram</h3> |
| 8 |
<table class="form-table"> |
| 9 |
<tbody> |
| 10 |
<tr> |
| 11 |
<th><label><?php printf( $this->_( 'Connect with %s' ), 'Instagram' ); ?></label></th> |
| 12 |
<td> |
| 13 |
<?php $this->switch_button( 'instagram_enabled', $this->option->is_enabled( 'instagram' ), 1 ) ?> |
| 14 |
<p class="description"> |
| 15 |
<?php printf( |
| 16 |
$this->_( 'You have to create %1$s App <a target="_blank" href="%2$s">here</a> to get required infomation.' ), |
| 17 |
'Instagram Developer', |
| 18 |
'https://www.instagram.com/developer/' |
| 19 |
); ?> |
| 20 |
<?php printf( |
| 21 |
$this->_( 'See detail at <a href="%1$s">%2$s</a>.' ), |
| 22 |
$this->setting_url( 'setup' ), |
| 23 |
$this->_( 'How to set up' ) |
| 24 |
); ?> |
| 25 |
</p> |
| 26 |
</td> |
| 27 |
</tr> |
| 28 |
|
| 29 |
<tr> |
| 30 |
<th><label for="instagram_client_id"><?php $this->e( 'Client ID' ); ?></label></th> |
| 31 |
<td><input class="regular-text" type="text" name="instagram_client_id" id="instagram_client_id" |
| 32 |
value="<?php echo esc_attr( $instance->instagram_client_id ) ?>"/></td> |
| 33 |
</tr> |
| 34 |
<tr> |
| 35 |
<th><label for="instagram_client_secret"><?php $this->e( 'Client Secret' ); ?></label></th> |
| 36 |
<td><input class="regular-text" type="text" name="instagram_client_secret" id="instagram_client_secret" |
| 37 |
value="<?php echo esc_attr( $instance->instagram_client_secret ) ?>"/></td> |
| 38 |
</tr> |
| 39 |
<tr> |
| 40 |
<th><label for="instagram_redirect_uri"><?php $this->e( 'Redirect URI' ); ?></label></th> |
| 41 |
<td> |
| 42 |
<p class="description"> |
| 43 |
<?php |
| 44 |
$end_point = $instance->get_redirect_endpoint(); |
| 45 |
printf( |
| 46 |
$this->_( 'Please set %1$s to %2$s on <a target="_blank" href="%4$s">%3$s</a>.' ), |
| 47 |
$this->_( 'Redirect URI' ), |
| 48 |
'<code>' . $end_point . '</code>', |
| 49 |
'Instagram Developer', |
| 50 |
'https://www.instagram.com/developer/clients/manage/' |
| 51 |
); |
| 52 |
?> |
| 53 |
<a class="button" href="<?php echo esc_attr( $end_point ) ?>" |
| 54 |
onclick="window.prompt('<?php $this->e( 'Please copy this URL.' ) ?>', this.href); return false;"><?php $this->e( 'Copy' ) ?></a> |
| 55 |
</p> |
| 56 |
</td> |
| 57 |
</tr> |
| 58 |
</tbody> |
| 59 |
</table> |
| 60 |
<?php submit_button(); ?> |
| 61 |
|