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

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

class admin_enqueue_scripts extends AbstractAction
{
    /**
     * This method is invoked by Wordpress
     */
    static public function invoke()
    {
        static::addAdminStyle();
        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 addAdminStyle()
    {
        $plugin = &GdprConsentPlugin::getInstance();
        \wp_enqueue_script('gdprc-admin-init', $plugin->getConfig()->get('assets_url').'js/admin.min.js', ['jquery'], GdprConsentPlugin::VERSION, true);
        \wp_enqueue_style('gdprc-admin-style', $plugin->getConfig()->get('assets_url').'css/admin.min.css', [], GdprConsentPlugin::VERSION);
    }
}