You are here

public function XMLSitemapIndexWriter::generateXML in XML sitemap 7.2

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

Generate XML.

@codingStandardsIgnoreStart

Overrides XMLSitemapWriter::generateXML

File

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

Class

XMLSitemapIndexWriter
XML Sitemap Index Writer.

Code

public function generateXML() {

  // @codingStandardsIgnoreEnd
  $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);
  }
}