/**
 * Get a list of the files that need uploaded
 */
function get_files($params)
{
    // Ensure CDN instance exists
    if (check_cdn() === false) {
        return array('response' => 'fail', 'message' => 'Error instantiating CDN session.');
    }
    $arr_files_to_sync = get_files_to_sync();
    $arr_files_to_sync = array_merge($arr_files_to_sync['upload'], $arr_files_to_sync['download']);
    echo json_encode($arr_files_to_sync);
    die;
}
/**
 * Get a list of the files that need uploaded
 */
function get_files($params)
{
    $arr_files_to_sync = get_files_to_sync();
    $arr_files_to_sync = array_merge($arr_files_to_sync['upload'], $arr_files_to_sync['download']);
    echo json_encode($arr_files_to_sync);
    die;
}
        $cdn_settings->custom_cname = null;
        $cdn_settings->region = 'ORD';
        $cdn_settings->url = 'https://identity.api.rackspacecloud.com/v2.0/';
    } else {
        $cdn_settings = (object) get_option(RS_CDN_OPTIONS);
        $cdn_settings->url = isset($cdn_settings->url) ? $cdn_settings->url : 'https://identity.api.rackspacecloud.com/v2.0/';
    }
} else {
    $cdn_settings = (object) $_SESSION['cdn']->api_settings;
}
// Get files that need synced
if (isset($cdn_settings->remove_local_files) && $cdn_settings->remove_local_files == true && count(get_local_files() > 0)) {
    $files_to_sync = array('upload' => array(), 'download' => array());
} else {
    try {
        $files_to_sync = get_files_to_sync();
    } catch (Exception $exc) {
        $files_to_sync = array('upload' => array(), 'download' => array());
        $settings_error = true;
    }
}
?>
<script type="text/javascript">
	var plugin_path = "<?php 
echo RS_CDN_URL;
?>
";
</script>
<div class="wrap rs_cdn">
	<h2 class="left">Rackspace CDN</h2>
	<div class="clear"></div>