From 32afe1f2a0e57377483cc4853bc01a6bb26bf1c9 Mon Sep 17 00:00:00 2001 From: SecretR Date: Thu, 10 Jul 2014 13:36:58 +0300 Subject: [PATCH] Fix custom page batch data overridden by custom menu (when menu is rendered before the page) --- page.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/page.php b/page.php index 56b101208..206e08bc0 100644 --- a/page.php +++ b/page.php @@ -59,10 +59,11 @@ else { $e107CorePage->setRequest('showPage'); $e107CorePage->processViewPage(); - + $e107CorePage->setPage(); + require_once(HEADERF); - echo $e107CorePage->showPage(); + echo $e107CorePage->pageOutput['text']; require_once(FOOTERF); exit; @@ -679,7 +680,7 @@ class pageClass return str_replace('[[PAGECOMMENTS]]', $comments, $this->cacheData['PAGE']); } - public function showPage() + public function setPage() { @@ -709,7 +710,9 @@ class pageClass if($vars->cachecontrol) $this->setCache($ret, $this->batch->sc_cpagetitle(), $this->page['page_comment_flag']); - return str_replace('[[PAGECOMMENTS]]', $this->batch->cpagecomments(), $ret); + //return str_replace('[[PAGECOMMENTS]]', $this->batch->cpagecomments(), $ret); + $this->pageOutput = array('text' => str_replace('[[PAGECOMMENTS]]', $this->batch->cpagecomments(), $ret)); + return; } $extend = new e_vars; @@ -749,7 +752,8 @@ class pageClass break; } - return $this->renderPage($template, $extend); + // return $this->renderPage($template, $extend); + $this->pageOutput = array('text' => $this->renderPage($template, $extend)); } public function renderPage($template, $vars = null)