<?php
/**
 * Plugin Name:       Angebot-Generator (Presupuestos)
 * Description:       Erstellt B2C-Angebote (Presupuestos) für Privatunterricht als PDF – mit Eingabemaske im Front- und Backend, fortlaufender Nummer (YY_0000) und automatischem Dateinamen. Shortcode: [angebot_generator].
 * Version:           1.4.2
 * Requires at least: 5.8
 * Requires PHP:      7.4
 * Author:            Die Schule
 * Text Domain:       angebot-generator
 */

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

define( 'AG_VERSION', '1.4.2' );
define( 'AG_PLUGIN_FILE', __FILE__ );
define( 'AG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

require_once AG_PLUGIN_DIR . 'includes/class-ag-db.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-settings.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-i18n.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-calendar.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-offer.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-pdf.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-form.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-admin.php';
require_once AG_PLUGIN_DIR . 'includes/class-ag-shortcode.php';

register_activation_hook( AG_PLUGIN_FILE, array( 'AG_DB', 'install' ) );

add_action(
    'plugins_loaded',
    function () {
        AG_Settings::init();
        AG_Calendar::init();
        AG_Admin::init();
        AG_Shortcode::init();
    }
);
