]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/pageinfo.php
This is a near total rewrite of this file. It is responsible for displaying all of...
[SourceForge/phpwiki.git] / lib / pageinfo.php
1 <?php
2 rcs_id('$Id: pageinfo.php,v 1.10 2001-06-26 18:02:43 uckelman Exp $');
3 // Display the internal structure of a page. Steve Wainstead, June 2000
4
5 $html = "\n" . Element('th', 'Version') . "\n" . Element('th', 'Newer') . "\n" . Element('th', 'Older') . "\n" . Element('th', 'Created') . "\n" . Element('th', 'Author') . "\n";
6 $html = "\n" . Element('tr', $html) . "\n";
7
8 // Get all versions of a page, then iterate over them to make version list
9 $pages = RetrievePageVersions($dbi, $pagename, $WikiPageStore, $ArchivePageStore);
10 $i = 0;
11 foreach ($pages as $pagehash) {
12         $row = "\n" . Element('td', array('align' => 'right'), QElement('a', array('href' => "$pagename?version=" . $pagehash['version']), $pagehash['version']));
13         $row .= "\n" . Element('td', array('align' => 'center'), QElement('input', array('type' => 'radio', 'name' => 'ver2', 'value' => ($i ? $pagehash['version'] : 0), 'checked' => ($i ? false : true))));
14         $row .= "\n" . Element('td', array('align' => 'center'), QElement('input', array('type' => 'radio', 'name' => 'ver1', 'value' => ($i ? $pagehash['version'] : 0), 'checked' => ($i++-1 ? false : true))));
15         $row .= "\n" . QElement('td', strftime($datetimeformat, $pagehash['lastmodified']));
16         $row .= "\n" . QElement('td', $pagehash['author']) . "\n";
17
18         $html .= Element('tr', $row) . "\n"; 
19 }
20
21 $html = "\n" . Element('table', $html) . "\n" . Element('input', array('type' => 'hidden', 'name' => 'action', 'value' => 'diff')) . "\n" . Element('input', array('type' => 'submit', 'value' => 'Run Diff')) . "\n";
22 $html = Element('form', array('method' => 'get', 'action' => $pagename), $html);
23
24 echo GeneratePage('MESSAGE', $html, gettext("PageInfo").": '$pagename'", 0);
25 ?>