/** * Generate an XML sitemap for webcrawlers * Creates a sitemap index if in site context, else creates a sitemap */ function index() { if (Request::getRequestedJournalPath() == 'index') { $doc = SitemapHandler::_createSitemapIndex(); header("Content-Type: application/xml"); header("Cache-Control: private"); header("Content-Disposition: inline; filename=\"sitemap_index.xml\""); XMLCustomWriter::printXML($doc); } else { $doc = SitemapHandler::_createJournalSitemap(); header("Content-Type: application/xml"); header("Cache-Control: private"); header("Content-Disposition: inline; filename=\"sitemap.xml\""); XMLCustomWriter::printXML($doc); } }