View source
<?php
function crossdomain_menu() {
$items['admin/config/media/crossdomain'] = array(
'title' => 'Cross Domain Settings',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'crossdomain_form',
),
'access arguments' => array(
'administer crossdomain',
),
'file' => 'crossdomain.admin.inc',
);
$items['crossdomain.xml'] = array(
'page callback' => 'crossdomain_render',
'access arguments' => array(
'access content',
),
);
return $items;
}
function crossdomain_permission() {
return array(
'administer crossdomain' => array(
'title' => t('Administer crossdomain'),
'description' => t('Perform administration tasks for crossdomain'),
),
);
}
function crossdomain_render() {
drupal_add_http_header('Content-Type', 'text/xml');
$domains = variable_get('crossdomain', array());
$output = "<?xml version=\"1.0\"?>\n\n<cross-domain-policy>\n";
foreach ($domains as $domain) {
$output .= " <allow-access-from domain=\"{$domain}\" />\n";
}
$output .= '</cross-domain-policy>';
print $output;
exit;
}