<?php
namespace Wpupgrader\WordPress\Plugins\GdprConsentLite\Hooks\Actions;

use Wpupgrader\Libraries\WordPress\Plugins\Core\Hooks\AbstractAction;
use Wpupgrader\WordPress\Plugins\GdprConsentPlugin\GdprConsentPlugin;

class wp_enqueue_scripts extends AbstractAction
{
    /**
     * This method is invoked by Wordpress
     */
    static public function invoke()
    {
        static::addFrontendStyle();
        static::addGdprIconsLibrary();
    }

    static protected function addGdprIconsLibrary()
    {
        $plugin = &GdprConsentPlugin::getInstance();
        \wp_enqueue_style('gdprc_gdpricons', $plugin->getConfig()->get('assets_url').'../lib/gdpricons/css/gdpricons.min.css', [], GdprConsentPlugin::VERSION);
    }

    static protected function addFrontendStyle()
    {
        $plugin = &GdprConsentPlugin::getInstance();
        \wp_enqueue_style('gdprc_style', $plugin->getConfig()->get('assets_url').'css/plugin.min.css', [], GdprConsentPlugin::VERSION);
        \wp_enqueue_script('gdprc_frontend', $plugin->getConfig()->get('assets_url').'js/plugin.min.js', ['jquery'], GdprConsentPlugin::VERSION, true);
    }
}