<?php
/**
 * Filename: _init.admin.php
 * Created by: BlogProfitNetwork.Com <marcus@blogprofitnetwork.com> (https://BlogProfitNetwork.Com)
 * Copyright 2017 - Andy Christian S. Loyola <acl20032003@gmail.com> (http://AndyLoyola.Com)
 *
 * Skype: blogprofitnetwork
 * Email: marcus@blogprofitnetwork.com
 */
defined('_IN_MAIN_MODULE') or die ('ACCESS DENIED');

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

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

	function adminInit() {
		$pages = array(CLICKVOODOOV4_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');

            //* wp_editor
            wp_enqueue_editor();
            wp_enqueue_media();

            //* 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', CLICKVOODOOV4_URL . 'tmpl/css/base/jquery-ui.css');

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

            //* DataTables
            wp_enqueue_style('datatables-css', CLICKVOODOOV4_URL .'tmpl/js/DataTables/datatables.min.css');
            wp_enqueue_script('datatables-js', CLICKVOODOOV4_URL .'tmpl/js/DataTables/datatables.min.js');

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

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

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

        }
	}
}

new clickVoodooV4AdminInit();
