- $this->setTxtBody($this->page->run(false));
- $html = trim($this->page->run(true));
- if (!empty($html)) {
- $this->setHtmlBody($html);
+ global $globals;
+ if (!($globals->debug & DEBUG_SMARTY)) {
+ $level = error_reporting(0);
+ }
+ $this->page->assign_by_ref('globals', $globals);
+ $this->page->run('head'); // process page headers
+ $this->wiki = trim($this->page->run('wiki')); // get wiki
+ if (!$this->wiki) {
+ $this->setTxtBody($this->page->run('text'));
+ if ($with_html) {
+ $html = trim($this->page->run('html'));
+ if (!empty($html)) {
+ $this->setHtmlBody($html);
+ }
+ }
+ }
+ if (!($globals->debug & DEBUG_SMARTY)) {
+ error_reporting($level);
+ }
+ }
+ if ($this->wiki) {
+ $this->setTxtBody(MiniWiki::WikiToText($this->wiki, false, 0, 78));
+ if ($with_html) {
+ $this->setHtmlBody('<html><body>' . MiniWiki::WikiToHtml($this->wiki, true) . '</body></html>');