You are here

public function XMLSitemapIndexWriter::generateXML in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap.xmlsitemap.inc \XMLSitemapIndexWriter::generateXML()

Overrides XMLSitemapWriter::generateXML

File

./xmlsitemap.xmlsitemap.inc, line 211
XML sitemap integration functions for xmlsitemap.module.

Class

XMLSitemapIndexWriter

Code

public function generateXML() {
  $lastmod_format = variable_get('xmlsitemap_lastmod_format', XMLSITEMAP_LASTMOD_MEDIUM);
  for ($i = 1; $i <= $this->sitemap->chunks; $i++) {
    $element = array(
      'loc' => $this
        ->getSitemapUrl('sitemap.xml', array(
        'query' => array(
          'page' => $i,
        ),
      )),
      // @todo Use the actual lastmod value of the chunk file.
      'lastmod' => gmdate($lastmod_format, REQUEST_TIME),
    );
    $this
      ->writeSitemapElement('sitemap', $element);
  }
}