1<?php
2/**
3 * DokuWiki Plugin Strata (Metadata Preview Renderer Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Brend Wanders <b.wanders@utwente.nl>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) die('Meh.');
11
12require_once DOKU_INC . 'inc/parser/metadata.php';
13
14class renderer_plugin_strata extends Doku_Renderer_metadata {
15    function getFormat() {
16        return 'preview_metadata';
17    }
18
19    function document_start() {
20        global $ID;
21        if(!@file_exists(wikiFN($ID))) {
22            $this->persistent['date']['created'] = time();
23        }
24
25        parent::document_start();
26    }
27
28    function document_end() {
29        global $ID;
30        $this->meta['date']['modified'] = time();
31        parent::document_end();
32    }
33}
34