function Spider_Video_Player_Playlists()
{
    require_once "Playlist_functions.php";
    // add functions for Spider_Video_Player
    require_once "Playlists_function.html.php";
    // add functions for vive Spider_Video_Player
    if (isset($_GET["task"])) {
        $task = htmlspecialchars($_GET["task"]);
    } else {
        $task = "default";
    }
    if (isset($_GET["id"])) {
        $id = htmlspecialchars($_GET["id"]);
    } else {
        $id = 0;
    }
    switch ($task) {
        case 'playlist':
            show_playlist();
            break;
        case "unpublish_playlist":
            $nonce_sp_vid = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
                die("Are you sure you want to do this?");
            }
            change_tag($id);
            show_playlist();
            break;
        case 'add_playlist':
            add_playlist();
            break;
        case 'cancel_playlist':
            cancel_playlist();
            break;
        case 'Save':
            if ($id) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                Apply_playlist($id);
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                save_playlist();
            }
            show_playlist();
            break;
        case 'Apply':
            if ($id == 0) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                $save_or_no = save_playlist();
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                $save_or_no = Apply_playlist($id);
            }
            if ($save_or_no) {
                edit_playlist($id);
            } else {
                show_playlist();
            }
            break;
        case 'edit_playlist':
            edit_playlist($id);
            break;
        case 'remove_playlist':
            $nonce_sp_vid = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
                die("Are you sure you want to do this?");
            }
            remove_playlist($id);
            show_playlist();
            break;
        case 'select_playlist':
            select_playlist();
            break;
        default:
            show_playlist();
            break;
    }
}
Exemplo n.º 2
0
function Spider_Video_Player_Playlists()
{
    require_once "Playlist_functions.php";
    // add functions for Spider_Video_Player
    require_once "Playlists_function.html.php";
    // add functions for vive Spider_Video_Player
    if (isset($_GET["task"])) {
        $task = htmlspecialchars($_GET["task"]);
    } else {
        $task = "default";
    }
    if (isset($_GET["id"])) {
        $id = htmlspecialchars($_GET["id"]);
    } else {
        $id = 0;
    }
    switch ($task) {
        case 'playlist':
            show_playlist();
            break;
        case "unpublish_playlist":
            change_tag($id);
            show_playlist();
            break;
        case 'add_playlist':
            add_playlist();
            break;
        case 'cancel_playlist':
            cancel_playlist();
            break;
        case 'Save':
            if ($id) {
                Apply_playlist($id);
            } else {
                save_playlist();
            }
            show_playlist();
            break;
        case 'Apply':
            if ($id == 0) {
                $save_or_no = save_playlist();
            } else {
                $save_or_no = Apply_playlist($id);
            }
            if ($save_or_no) {
                edit_playlist($id);
            } else {
                show_playlist();
            }
            break;
        case 'edit_playlist':
            edit_playlist($id);
            break;
        case 'remove_playlist':
            remove_playlist($id);
            show_playlist();
            break;
        case 'select_playlist':
            select_playlist();
            break;
        default:
            show_playlist();
            break;
    }
}