<?php

namespace EBCT\App;

use EBCT\App\Controllers\Booking;
use EDPW\Core\Helpers\Plugin;

defined( 'ABSPATH' ) || exit;

class Router {

	/**
	 * Init addon hooks.
	 *
	 * @return void
	 */
	public static function init() {
		if ( ! Plugin::isInternalAddonActive( 'ebct-booking-compatibility' ) ) {
			return;
		}
		if ( is_admin() ) {
			add_action( 'admin_menu', [ Booking::class, 'addAdminMenu' ] );
			add_action( 'admin_footer', [ Booking::class, 'hideMenu' ] );
		}
		if ( Plugin::isActive( 'woocommerce-bookings/woocommerce-bookings.php' ) ) {
			add_filter( 'edpw_templates_image_list', [
				Booking::class,
				'addTemplateImage'
			], 10, 3 );
			add_filter( 'edpw_template_path', [ Booking::class, 'addTemplatePath' ], 10, 2 );
			add_filter( 'edpw_short_code_list', [ Booking::class, 'addShortCodes' ], 10, 2 );
			add_filter( 'edpw_after_template_short_codes', [
				Booking::class,
				'getTemplateShortCodes'
			], 10, 4 );
			add_filter( 'edpw_dummy_data', [ Booking::class, 'addDummyData' ], 10, 2 );
			add_filter( 'edpw_template_plugin_tag', [ Booking::class, 'getTagDetails' ], 10, 2 );
			add_filter( 'edpw_email_template_groups', [ Booking::class, 'addToGroups' ] );
		}
	}
}