with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
if (!defined('ABSPATH')) {
    exit;
}
$account = get_option(TP_ACCOUNT_OPTIONS_KEY);
if ($account == false || empty($account['mpx_account_id'])) {
    wp_die('<div class="error"><p>mpx Account ID is not set, please configure the plugin before attempting to manage media</p></div>');
}
define('TP_MEDIA_BROWSER', true);
$tp_editor_cap = apply_filters(TP_EDITOR_CAP, TP_EDITOR_DEFAULT_CAP);
if (!current_user_can($tp_editor_cap)) {
    wp_die('<div class="error"><p>You do not have sufficient permissions to browse mpx Media</p></div>');
}
require_once dirname(__FILE__) . '/thePlatform-HTML.php';
$tp_html = new ThePlatform_HTML();
$preferences = get_option(TP_PREFERENCES_OPTIONS_KEY);
$account = get_option(TP_ACCOUNT_OPTIONS_KEY);
global $page_hook;
$IS_EMBED = $page_hook != 'toplevel_page_theplatform';
?>

<div class="wrap">
	<?php 
if (!$IS_EMBED) {
    echo '<h2>mpx Video Manager</h2>';
}
?>

	<!-- Write out the search bar -->
	<?php 
// Detect IE 9 and below which doesn't support HTML 5 File API
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 1) {
    //Then we're using IE
    $version = $matches[1];
    if ($version <= 9) {
        wp_die('<div class="error"><p>Internet Explorer ' . esc_html($version) . ' is not supported</p></div>');
    }
}
$tp_uploader_cap = apply_filters(TP_UPLOADER_CAP, TP_UPLOADER_DEFAULT_CAP);
if (!defined('TP_MEDIA_BROWSER') && !current_user_can($tp_uploader_cap)) {
    wp_die('<div class="error"><p>You do not have sufficient permissions to upload video to mpx</p></div>');
}
$preferences = get_option(TP_PREFERENCES_OPTIONS_KEY);
require_once dirname(__FILE__) . '/thePlatform-HTML.php';
$tp_html = new ThePlatform_HTML();
if (!defined('TP_MEDIA_BROWSER')) {
    ?>
	<div class="wrap">
	<h2>Upload Video to mpx</h2> <?php 
} else {
    $tp_html->edit_tabs_header();
    ?>

	<div class="tab-content">
	<div class="tab-pane active" id="edit_content"> <?php 
}
?>

	<div id="responsive-form" class="clearfix">
		<form role="form">