2 rcs_id('$Id: pageinfo.php,v 1.9 2001-04-07 00:34:30 dairiki Exp $');
3 // Display the internal structure of a page. Steve Wainstead, June 2000
7 function ViewpageProps($name, $pagestore)
9 global $dbi, $showpagesource, $datetimeformat, $FieldSeparator;
11 $pagehash = RetrievePage($dbi, $name, $pagestore);
12 if ($pagehash == -1) {
14 sprintf (gettext ("Page name '%s' is not in the database"),
19 while (list($key, $val) = each($pagehash)) {
20 if ($key > 0 || !$key)
21 continue; //key is an array index
22 $cols = QElement('td', array('align' => 'right'), $key);
26 if (empty($showpagesource))
28 $cols .= Element('td',
29 nl2br(htmlspecialchars(join("\n", $val))));
31 elseif (($key == 'lastmodified') || ($key == 'created'))
32 $cols .= QElement('td',
33 strftime($datetimeformat, $val));
35 $cols .= QElement('td', $val);
37 $rows .= Element('tr', $cols);
40 return Element('table', array('border' => 1, 'bgcolor' => 'white'), $rows);
46 if (empty($showpagesource))
48 $text = gettext ("Show the page source");
49 $url = WikiURL($pagename, array('action' => 'info',
50 'showpagesource' => 'on'));
51 $html .= QElement('a', array('href' => $url), $text);
54 $html .= Element('p', QElement('b', gettext ("Current version")));
55 $html .= ViewPageProps($pagename, $WikiPageStore);
57 $html .= Element('p', QElement('b', gettext ("Archived version")));
58 $html .= ViewPageProps($pagename, $ArchivePageStore);
60 echo GeneratePage('MESSAGE', $html,
61 gettext("PageInfo").": '$pagename'", 0);