<?php
defined( 'ABSPATH' ) or die;

/**
 *
 * Field: ImdbImport
 *
 * @since 1.0.0
 * @version 1.0.0
 */
class AmyFramework_Option_imdbimport extends AmyFramework_Options {

	public function __construct( $field, $value = '', $unique = '' ) {
		parent::__construct( $field, $value, $unique );
	}

	public function output() {
		echo $this->element_before();

		if ( function_exists( 'amy_movie_extends_init' ) ) {
			?>
				<div class="amy-imdb">
					<input type="text" name="amy-imdb-input" class="amy-imdb-input" placeholder="<?php echo esc_html__( 'Movie ID', 'amy-movie' ); ?>" />
					<a class="button button-primary amy-imdb-button">
						<?php echo esc_html__( 'Add Movie', 'amy-movie' ); ?>
					</a>
					<p class="amy-text-desc">
						<?php echo esc_html__( 'Enter Movie ID. Example: if Link from IMDB http://www.imdb.com/title/tt3748528, This (tt3748528) is movie ID.', 'amy-movie' ); ?>
					</p>
					<div class="imdb-loading"></div>
				</div>
			<?php
		} else {
			$link = admin_url( 'themes.php?page=tgmpa-install-plugins' );
		?>
			<p>
				<?php echo esc_html__( 'You need to activate plugins', 'amy-movie' ); ?>
				<a href="<?php echo esc_url( $link ); ?>">
					<?php echo esc_html__( 'Amy Movie Extends', 'amy-movie' ); ?>
				</a>
				<?php echo esc_html__( 'before importing movie IMDB', 'amy-movie' ); ?>
			</p>
		<?php
		}

		echo $this->element_after();
	}
}
