/** * render the tags for one page (<loc> and <lastmod>) * * @param Tx_Hriseo_Domain_Model_Pages $page * @return string */ public function render($page) { $cObj = new tslib_cObj(); $path = $cObj->getTypoLink_URL($page->getUid()); // @see http://sitemaps.org and // http://php.net/manual/de/function.htmlspecialchars.php $link = htmlspecialchars($this->settings['baseURL'] . $path, ENT_QUOTES, 'UTF-8', false); $this->loc->setContent($link); $ret = $this->loc->render(); $date = new DateTime(); $date->setTimestamp($page->getLastmod()); $this->lastmod->setContent($date->format('Y-m-d')); $ret .= $this->lastmod->render(); $changefreq = $page->getChangefreq(); if (!empty($changefreq)) { $this->tagBuilder->reset(); $this->tagBuilder->setTagName('changefreq'); $this->tagBuilder->setContent($changefreq); $ret .= $this->tagBuilder->render(); } $priority = $page->getPriority(); // 0.0: ignore // 0.5: default - do not display if (0 < $priority and 0.5 != $priority) { $this->tagBuilder->reset(); $this->tagBuilder->setTagName('priority'); $this->tagBuilder->setContent(number_format($priority, 1)); $ret .= $this->tagBuilder->render(); } return $ret; }