- // create new tmp files with editing page from wiki engine
- $wiki_template = wiki_create_tmp(substr($wikiAll, $j));
+if (Env::v('action') || !$cache_exists) {
+ @unlink($wiki_cache);
+
+ // we leave pmwiki do whatever it wants and store everything
+ ob_start();
+ require_once($globals->spoolroot.'/wiki/pmwiki.php');
+
+ $wikiAll = ob_get_clean();
+ // the pmwiki skin we are using (almost empty) has these keywords:
+ $i = strpos($wikiAll, "<!--/HeaderText-->");
+ $j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
+}
+
+if (Env::v('action')) {
+ $page->assign('xorg_extra_header', substr($wikiAll, 0, $i));
+ $wikiAll = substr($wikiAll, $j);
+} else {
+ if (!$cache_exists) {
+ $wikiAll = substr($wikiAll, $j);
+ wiki_putfile($wiki_cache, $wikiAll);