<?php
/**
 * Filename: _init.admin.php
 * Created : EzLinkTools.Com <marcus@blogprofitnetwork.com> (https://EzLinkTools.Com)
 * Copyright 2020 - EzLinkTools.Com <marcus@blogprofitnetwork.com> (https://EzLinkTools.Com)
 */
defined('_IN_MAIN_MODULE') or die ('ACCESS DENIED');

class buttonVoodooAdminInit {
	function __construct() {
		add_action('init', array($this, 'init'));
	}

	function init() {
		add_action('admin_init', array($this, 'adminInit'));
	}

	function adminInit() {
		$pages = array(BUTTONVOODOO_CODE);
        if (in_array(trim(strip_tags($_GET['page'])), $pages)) {

            //* jQueryUI effects
            wp_enqueue_script('jquery-ui-core');
            wp_enqueue_script('jquery-effects-core');

            wp_enqueue_script('jquery-ui-accordion');
            wp_enqueue_script('jquery-ui-autocomplete');
            wp_enqueue_script('jquery-ui-button');
            wp_enqueue_script('jquery-ui-datepicker');
            wp_enqueue_script('jquery-ui-dialog');
            wp_enqueue_script('jquery-ui-draggable');
            wp_enqueue_script('jquery-ui-droppable');
            wp_enqueue_script('jquery-ui-mouse');
            wp_enqueue_script('jquery-ui-position');
            wp_enqueue_script('jquery-ui-progressbar');
            wp_enqueue_script('jquery-ui-selectable');
            wp_enqueue_script('jquery-ui-slider');
            wp_enqueue_script('jquery-ui-sortable');
            wp_enqueue_script('jquery-ui-tabs');
            wp_enqueue_script('jquery-ui-widget');

            //* media upload and popup
            wp_enqueue_script('thickbox');
            wp_enqueue_style('thickbox');
            wp_enqueue_script('media-upload');

            //* colorpicker
            wp_enqueue_script('iris');
			wp_enqueue_script('wp-color-picker');
			wp_enqueue_style('wp-color-picker');

            //* jQueryUI theme
            wp_enqueue_style('jquery-ui-css', BUTTONVOODOO_URL . 'tmpl/css/base/jquery-ui.css');

            //* cookie
            wp_enqueue_script('jquery-cookie-js', BUTTONVOODOO_URL . 'tmpl/js/jquery.cookie.js');

            //* DataTables
            wp_enqueue_script('database-js', BUTTONVOODOO_URL . 'tmpl/js/DataTables/media/js/jquery.dataTables.min.js');
//            wp_enqueue_style('dataTables-css', BUTTONVOODOO_URL . 'tmpl/js/DataTables/media/css/jquery.dataTables_themeroller.css');

            //* tinyMCE fixed
            wp_enqueue_script('tinymce-fixed-js', BUTTONVOODOO_URL . 'tmpl/js/tinymce-fixed.js');

            //* ZeroClipboard
            wp_enqueue_script('zeroclipboard-js', BUTTONVOODOO_URL . 'tmpl/js/ZeroClipboard/ZeroClipboard.min.js');

            //* Fancyapps / Fancybox
            wp_enqueue_script('fancyapps-js', BUTTONVOODOO_URL . 'tmpl/js/fancyapps/source/jquery.fancybox.pack.js');
            wp_enqueue_script('fancyapps-mousewheel-js', BUTTONVOODOO_URL .'tmpl/js/fancyapps/lib/jquery.mousewheel-3.0.6.pack.js');
            wp_enqueue_script('fancyapps-helpers-buttons-js', BUTTONVOODOO_URL .'tmpl/js/fancyapps/source/helpers/jquery.fancybox-buttons.js');
            wp_enqueue_script('fancyapps-helpers-media-js', BUTTONVOODOO_URL .'tmpl/js/fancyapps/source/helpers/jquery.fancybox-media.js');
            wp_enqueue_script('fancyapps-helpers-thumb-js', BUTTONVOODOO_URL .'tmpl/js/fancyapps/source/helpers/jquery.fancybox-thumbs.js');

            wp_enqueue_style('fancyapps-css', BUTTONVOODOO_URL .'tmpl/js/fancyapps/source/jquery.fancybox.css');
            wp_enqueue_style('fancyapps-helpers-buttons-css', BUTTONVOODOO_URL .'tmpl/js/fancyapps/source/helpers/jquery.fancybox-buttons.css');
            wp_enqueue_style('fancyapps-helpers-thumb-css', BUTTONVOODOO_URL .'tmpl/js/fancyapps/source/helpers/jquery.fancybox-thumbs.css');

            //* metroui
            wp_enqueue_style('metro-ui-css', BUTTONVOODOO_URL .'tmpl/css/metro-ui/css/metro.min.css');
            wp_enqueue_style('metro-ui-icons-css', BUTTONVOODOO_URL .'tmpl/css/metro-ui/css/metro-icons.min.css');
            wp_enqueue_style('metro-ui-responsive-css', BUTTONVOODOO_URL .'tmpl/css/metro-ui/css/metro-responsive.min.css');
            wp_enqueue_script('metro-ui-js', BUTTONVOODOO_URL .'tmpl/css/metro-ui/js/metro.min.js');

            //* custom css... always add this to the last part. overriding will be much easy.
            wp_enqueue_style('custom-css', BUTTONVOODOO_URL . 'tmpl/css/custom.css');

        }
	}
}

new buttonVoodooAdminInit();
