2 rcs_id('$Id: _BackendInfo.php,v 1.3 2001-12-16 18:33:25 dairiki Exp $');
3 require_once('lib/Template.php');
6 class WikiPlugin__BackendInfo
10 return _("DebugInfo");
13 function getDescription () {
14 return _("Get debugging information for [pagename].");
17 function WikiPlugin__BackendInfo() {
18 $this->_hashtemplate = new Template('
19 <tr bgcolor="#ffcccc">
20 <td colspan="2">${header}</td>
22 <?php foreach ($hash as $key => $val) { ?>
24 <td align="right" bgcolor="#cccccc"> <?php echo $key;?> </td>
25 <td><?php echo $val;?></td>
31 function getDefaultArguments() {
32 return array('page' => false);
36 function run($dbi, $argstr, $request) {
37 $args = $this->getArgs($argstr, $request);
42 $backend = &$dbi->_backend;
44 $html = QElement('h3',
45 sprintf(_("Querying backend directly for '%s'"), $page));
49 $pagedata = $backend->get_pagedata($page);
51 $html .= QElement('p', sprintf(_("No pagedata for %s\n"), $page));
54 $rows .= $this->_hashtemplate->
55 getExpansion(array('header' => "get_pagedata('$page')",
56 'hash' => $pagedata));
59 for ($version = $backend->get_latest_version($page);
61 $version = $backend->get_previous_version($page, $version)) {
63 $vdata = $backend->get_versiondata($page, $version, true);
65 $content = &$vdata['%content'];
66 if ($content === true)
68 elseif (strlen($content) > 40)
69 $content = substr($content,0,40) . " ...";
71 $rows .= Element('tr', Element('td', array('colspan' => 2))) . "\n";
73 $rows .= $this->_hashtemplate->
74 getExpansion(array('header' => "get_versiondata('$page',$version)",
79 $html .= Element('table', array('border' => 1,
87 // (c-file-style: "gnu")
92 // c-hanging-comment-ender-p: nil
93 // indent-tabs-mode: nil