<?php

if (!defined('ABSPATH'))
    exit;
if (!current_user_can('manage_options')) {
    wp_die(__('You do not have sufficient permissions to access this page.'));
}
if ($_GET['styleid'] == '') {
    blu_vendor_js_css('admin');
    include Team_Plugins_bullet_list . 'admin/style-new.php';
}
if ($_GET['styleid'] != '' && is_numeric($_GET['styleid'])) {
    $id = (int) $_GET['styleid'];
    global $wpdb;
    $bullet_style = $wpdb->prefix . 'team_bullet_list_ultimate_style';
    $styledata = $wpdb->get_row($wpdb->prepare("SELECT * FROM $bullet_style WHERE id = %d ", $id), ARRAY_A);
    include Team_Plugins_bullet_list . 'admin/' . $styledata['style_name'] . '.php';
    blu_vendor_js_css('style');
    blu_media_uploder();
    add_action('admin_enqueue_scripts', 'blu_media_uploder');
}

function blu_vendor_js_css($data) {
    wp_enqueue_script('jQuery');
    wp_enqueue_style('blu-vendor-style', plugins_url('admin/style.css', __FILE__));
    wp_enqueue_style('font-awesome', plugins_url('css-js/font-awesome.min.css', __FILE__));
    wp_enqueue_style('blu-vendor-bootstrap', plugins_url('css-js/bootstrap.min.css', __FILE__));
    wp_enqueue_script('blu-vendor-bootstrap-jss', plugins_url('css-js/bootstrap.min.js', __FILE__));


    if ($data == 'style') {
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-widget');
        wp_enqueue_script('jquery-ui-mouse');
        wp_enqueue_script('jquery-ui-sortable');
        wp_enqueue_script('jquery-ui-draggable');
        wp_enqueue_script('blu-vendor-minicolors-js', plugins_url('css-js/jquery.minicolors.min.js', __FILE__));
        wp_enqueue_style('blu-vendor-minicolors', plugins_url('css-js/jquery.minicolors.css', __FILE__));
        wp_enqueue_script('blu-vendor-font-select', plugins_url('css-js/font-select.js', __FILE__));
        wp_enqueue_script('blu-vendor-jss', plugins_url('admin/vendor.js', __FILE__));
    }
}

function blu_media_uploder() {
    wp_enqueue_media();
    wp_register_script('blu-media-uploder', plugins_url('css-js/media-uploder.js', __FILE__));
    wp_enqueue_script('blu-media-uploder');
}

?>
