<?php
/**
 * Free Showcase AC Integration Class
 */

namespace Simple_Giveaways;

if ( ! defined( 'ABSPATH' ) ) {
	return;
}

if ( ! class_exists( '\Simple_Giveaways\GA_Active_Campaign_Dummy' ) ) {
	class GA_Active_Campaign_Dummy extends GA_Integration {

		/**
		 * Active Indicator
		 *
		 * @var boolean
		 */
		public $active = false;

		/**
		 * Integration Image
		 *
		 * @var string
		 */
		public $image = '';

		/**
		 * Integration Title
		 *
		 * @var string
		 */
		public $title = '';

		/**
		 * Integration Description
		 *
		 * @var string
		 */
		public $desc = '';

		/**
		 * Get Categories
		 *
		 * @return string[]
		 */
		public function get_categories() {
			return [
				'email',
				'marketing',
				'automation',
			];
		}

		/**
		 * Setting initial params
		 */
		public function __construct() {

			$this->title       = __( 'Active Campaign', 'giveasap' );
			$this->settings_id = 'ga_active_campaign';
			$this->image       = untrailingslashit( GASAP_URI ) . '/includes/integrations/assets/activecampaign.png';
			$this->desc        = __( 'Sends users to your list and grow your email list', 'giveasap' );
		}

		public function buttons( $integrations ) {
			echo '<a href="' . esc_url( giv_fs()->get_upgrade_url() ) . '" class="button button-primary">' . esc_html__( 'Upgrade to PRO', 'giveasap' ) . '</a>';
		}

	}
}

add_filter( 'giveasap_integrations', '\Simple_Giveaways\giveasap_active_campaign' );

/**
 * Registering mailchimp
 *
 * @return array
 */
function giveasap_active_campaign( $integrations ) {

	$integrations['ga_active_campaign'] = '\Simple_Giveaways\GA_Active_Campaign_Dummy';

	return $integrations;
}
