fediembedi-settings-form.tpl.php 2.3 KB
Newer Older
MediaFormat's avatar
MediaFormat committed
1
<?php
2
define("FEDI_CONNECTED",isset($account) && $account !== null);
MediaFormat's avatar
MediaFormat committed
3 4 5 6 7 8 9 10 11 12
?>


<div class="wrap">
	<h1><?php esc_html_e( 'FediEmbedi Configuration', 'fediembedi' ); ?></h1>
	<br>
<br>
<br>
	<form method="POST">
		<?php wp_nonce_field( 'fediembedi-configuration' ); ?>
13 14 15 16 17
		<div style="display:<?php echo !FEDI_CONNECTED ? "block":"none"?>">
				<input type="text" class="widefat instance_url" id="instance" name="instance" size="80" value="<?php esc_url_raw( $instance, 'https' ); ?>" list="mInstances">
				<select class="widefat instance_type" id="instance_type" name="instance_type" value="<?php sanitize_key( $instance_type ); ?>">
					<option value="mastodon">Mastodon/Pleroma</option>
					<option value="pixelfed">Pixelfed</option>
18
				</select>
19
				<input class="button button-primary" type="submit" value="<?php esc_attr_e( 'Connect to your instance', 'fediembedi' ); ?>" name="save" id="save">
MediaFormat's avatar
MediaFormat committed
20 21
				<br><small><?php _e( 'The currently supported software are Mastodon, Pleroma, Pixelfed.', 'fediembedi' ); ?></small><br>
				<p><?php _e( "Don't have an account?", 'fediembedi' ); ?></p>
MediaFormat's avatar
MediaFormat committed
22 23
				<p><span class="mastodon"></span> Visit <a href="https://joinmastodon.org/" rel="noreferrer noopener" target="_blank" class="">joinmastodon.org</a> to find an instance.</p>
				<p><span class="pixelfed"></span> Visit <a href="https://pixelfed.org/join" rel="noreferrer noopener" target="_blank" class="">pixelfed.org/join</a> to find an instance.</p>
MediaFormat's avatar
MediaFormat committed
24
		</div>
25
		<div style="display:<?php echo FEDI_CONNECTED ? "block" : "none"?>">
MediaFormat's avatar
MediaFormat committed
26 27 28
				<div class="account">
						<a href="<?php echo $account->url ?>" target="_blank"><img class="m-avatar" src="<?php echo $account->avatar ?>"></a>
					<div class="details">
29
						<?php if(FEDI_CONNECTED): ?>
MediaFormat's avatar
MediaFormat committed
30 31 32 33 34 35 36 37 38 39 40 41
							<div class="connected"><?php esc_html_e( 'Connected as', 'fediembedi' ); ?>&nbsp;<?php echo $account->username ?></div>
							<a class="link" href="<?php echo $account->url ?>" target="_blank"><?php echo $account->url ?></a>

							<p><a href="<?php echo $_SERVER['REQUEST_URI'] . '&disconnect' ?>" class="button"><?php esc_html_e( 'Disconnect', 'fediembedi' ); ?></a>

						<?php else: ?>
							<div class="disconnected"><?php esc_html_e( 'Disconnected', 'fediembedi' ); ?></div>
						<?php endif ?>
					</div>
					<div class="separator"></div>
				</div>
		</div>
42
		<div class="clear"></div>
MediaFormat's avatar
MediaFormat committed
43 44 45

	</form>
</div>