function xmlsitemap_output_xsl in XML sitemap 7.2
Same name and namespace in other branches
- 6.2 xmlsitemap.pages.inc \xmlsitemap_output_xsl()
- 6 xmlsitemap.pages.inc \xmlsitemap_output_xsl()
Output an XML transformation file for the sitemap XML.
1 string reference to 'xmlsitemap_output_xsl'
- xmlsitemap_menu in ./
xmlsitemap.module - Implements hook_menu().
File
- ./
xmlsitemap.pages.inc, line 133 - Page callbacks for the xmlsitemap module.
Code
function xmlsitemap_output_xsl() {
// Read the XSL content from the file.
$module_path = drupal_get_path('module', 'xmlsitemap');
$xsl_content = file_get_contents($module_path . '/xsl/xmlsitemap.xsl');
// Make sure the strings in the XSL content are translated properly.
$replacements = array(
'Sitemap file' => t('Sitemap file'),
'Generated by the <a href="https://www.drupal.org/project/xmlsitemap">Drupal XML sitemap</a>.' => t('Generated by the <a href="@link-xmlsitemap">Drupal XML sitemap</a>.', array(
'@link-xmlsitemap' => 'https://www.drupal.org/project/xmlsitemap',
)),
'Number of sitemaps in this index' => t('Number of sitemaps in this index'),
'Click on the table headers to change sorting.' => t('Click on the table headers to change sorting.'),
'Sitemap URL' => t('Sitemap URL'),
'Last modification date' => t('Last modification date'),
'Number of URLs in this sitemap' => t('Number of URLs in this sitemap'),
'URL location' => t('URL location'),
'Change frequency' => t('Change frequency'),
'Priority' => t('Priority'),
'[jquery]' => base_path() . 'misc/jquery.js',
'[jquery-tablesort]' => base_path() . $module_path . '/xsl/jquery.tablesorter.min.js',
'[xsl-js]' => base_path() . $module_path . '/xsl/xmlsitemap.xsl.js',
'[xsl-css]' => base_path() . $module_path . '/xsl/xmlsitemap.xsl.css',
);
$xsl_content = strtr($xsl_content, $replacements);
// Output the XSL content.
drupal_add_http_header('Content-type', 'application/xml; charset=utf-8');
drupal_add_http_header('X-Robots-Tag', 'noindex, follow');
print $xsl_content;
}