$operation = $_POST['operation']; switch ($operation) { case 'create_upload_form': createUploadForm($_POST['videoTitle'], $_POST['videoDescription'], $_POST['videoCategory'], $_POST['videoTags']); break; case 'edit_meta_data': editVideoData($_POST['newVideoTitle'], $_POST['newVideoDescription'], $_POST['newVideoCategory'], $_POST['newVideoTags'], $_POST['videoId']); break; case 'check_upload_status': checkUpload($_POST['videoId']); break; case 'delete_video': deleteVideo($_POST['videoId']); break; case 'auth_sub_request': generateAuthSubRequestLink(); break; case 'auth_sub_token_upgrade': updateAuthSubToken($_GET['token']); break; case 'clear_session_var': clearSessionVar($_POST['name']); break; case 'retrieve_playlists': retrievePlaylists(); break; case 'create_playlist': createPlaylist($_POST['playlistTitle'], $_POST['playlistDescription']); break; case 'delete_playlist': deletePlaylist($_POST['playlistTitle']);
/** * Store the developer key provided in the session variables. * * @param string $developerKey A valid YouTube developer key. * @return void */ function setDeveloperKey($developerKey) { $_SESSION['developerKey'] = $developerKey; if (!isset($_SESSION['sessionToken'])) { echo generateAuthSubRequestLink() . ' (Developer Key set.)<br />'; } else { print 'Developer Key has been set.<br /><a href="">(reload the page)</a>'; } }