'[pagename]'); } function run($dbi, $argstr, $request) { $args = $this->getArgs($argstr, $request); extract($args); if (empty($page)) return ''; $backend = &$dbi->_backend; $html = HTML(HTML::h3(fmt("Querying backend directly for '%s'", $page))); $table = HTML::table(array('border' => 1, 'cellpadding' => 2, 'cellspacing' => 0)); $pagedata = $backend->get_pagedata($page); if (!$pagedata) $html->pushContent(HTML::p(fmt("No pagedata for %s", $page))); else { $table->pushContent($this->_showhash("get_pagedata('$page')", $pagedata, $page)); } for ($version = $backend->get_latest_version($page); $version; $version = $backend->get_previous_version($page, $version)) { $vdata = $backend->get_versiondata($page, $version, true); $content = &$vdata['%content']; if ($content === true) $content = ''; elseif (strlen($content) > 40) $content = substr($content,0,40) . " ..."; unset($vdata['%pagedata']); // problem in backend $table->pushContent(HTML::tr(HTML::td(array('colspan' => 2)))); $table->pushContent($this->_showhash("get_versiondata('$page',$version)", $vdata)); } $html->pushContent($table); return $html; } function _showhash ($heading, $hash, $pagename = '') { $rows[] = HTML::tr(array('bgcolor' => '#ffcccc', 'style' => 'color:#000000'), HTML::td(array('colspan' => 2, 'style' => 'color:#000000'), $heading)); ksort($hash); foreach ($hash as $key => $val) { if (is_string($val) && (substr($val, 0, 2) == 'a:')) { // how to indent this table? $val = unserialize($val); $rows[] = HTML(HTML::raw(' '), HTML::raw(' '), $this->_showhash("get_pagedata('$pagename')['$key']", $val)); } else { if ($key == 'passwd' && ! $request->_user->isAdmin()) $val = $val ? _("") : _(""); $rows[] = HTML::tr(HTML::td(array('align' => 'right', 'bgcolor' => '#cccccc', 'style' => 'color:#000000'), HTML(HTML::raw(' '), $key, HTML::raw(' '))), HTML::td(array('bgcolor' => '#ffffff', 'style' => 'color:#000000'), $val ? $val : HTML::raw(' ')) ); } } return $rows; } }; // $Log: not supported by cvs2svn $ // (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>