4 * This filter, closely related with the News filter, generates the
5 * Date metadata associated with a news article.
7 class XHTMLCompiler_DOMFilter_NewsDate
extends XHTMLCompiler_DOMFilter_NewsBase
9 protected $name = 'NewsDate';
10 public function process(DOMDocument
$dom, $page, $manager) {
11 if (!isset($page->attr
['news'])) return;
12 $dateTime = $page->getCreatedTime();
13 if (!$dateTime) return;
14 $manager->addDependency(__FILE__
);
15 $content = $dom->getElementById('content');
16 $body = $content->parentNode
;
17 $date = $this->makeDateNode($dom, $dateTime);
18 $date->setAttribute('id', 'news-date');
19 $body->insertBefore($date, $content);