1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Fixes #1311 - tablestyle() $style was not available in single page view.

This commit is contained in:
Cameron
2016-02-09 19:13:25 -08:00
parent 69417752b1
commit fc1dfdaae8

View File

@@ -65,9 +65,7 @@ else
$e107CorePage->setPage(); $e107CorePage->setPage();
require_once(HEADERF); require_once(HEADERF);
e107::getRender()->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], 'cpage');
echo $e107CorePage->pageOutput['text'];
require_once(FOOTERF); require_once(FOOTERF);
exit; exit;
} }
@@ -288,10 +286,10 @@ class pageClass
} }
/** /**
* Parse the Book/Chapter "listChapters' template * Parse the Book/Chapter "listChapters' template
* @param int $book
* @return array
*/ */
function listChapters($book=1) function listChapters($book=1)
{ {
@@ -342,7 +340,7 @@ class pageClass
if($sql->select("page_chapters", "*", "chapter_parent = ".intval($book)." AND chapter_visibility IN (".USERCLASS_LIST.") ORDER BY chapter_order ASC ")) if($sql->select("page_chapters", "*", "chapter_parent = ".intval($book)." AND chapter_visibility IN (".USERCLASS_LIST.") ORDER BY chapter_order ASC "))
{ {
$text .= $tp->simpleParse($template['start'],$bvar); $text = $tp->simpleParse($template['start'],$bvar);
while($row = $sql->fetch()) while($row = $sql->fetch())
{ {
@@ -387,6 +385,8 @@ class pageClass
/** /**
* Handle Chapter Icon Glyphs. * Handle Chapter Icon Glyphs.
* @param $icon
* @return null|string
*/ */
private function chapterIcon($icon) private function chapterIcon($icon)
{ {
@@ -394,7 +394,7 @@ class pageClass
if(!vartrue($icon)) if(!vartrue($icon))
{ {
return; return null;
} }
if($glyph = $tp->toGlyph($icon)) if($glyph = $tp->toGlyph($icon))
@@ -435,7 +435,7 @@ class pageClass
if($row['chapter_meta_keywords']) define('META_KEYWORDS', eHelper::formatMetaKeys($row['chapter_meta_keywords'])); if($row['chapter_meta_keywords']) define('META_KEYWORDS', eHelper::formatMetaKeys($row['chapter_meta_keywords']));
} }
$bookId = $row['chapter_parent']; //$bookId = $row['chapter_parent'];
$bookSef = $this->getSef($row['chapter_parent']); $bookSef = $this->getSef($row['chapter_parent']);
$bookTitle = $this->getName($row['chapter_parent']); $bookTitle = $this->getName($row['chapter_parent']);
@@ -482,14 +482,14 @@ class pageClass
$pageArray = $sql->db_getList(); $pageArray = $sql->db_getList();
$header = $tp->simpleParse($template['start'],$var); $header = $tp->simpleParse($template['start'],$var);
$text .= $tp->parseTemplate($header,true); // for parsing {SETIMAGE} etc. $text = $tp->parseTemplate($header,true); // for parsing {SETIMAGE} etc.
foreach($pageArray as $page) foreach($pageArray as $page)
{ {
$data = array( /*$data = array(
'title' => $page['page_title'], 'title' => $page['page_title'],
'text' => $tp->toHtml($page['page_text'],true) 'text' => $tp->toHtml($page['page_text'],true)
); );*/
$page['chapter_sef'] = $this->getSef($page['page_chapter']); // $chapter_sef; $page['chapter_sef'] = $this->getSef($page['page_chapter']); // $chapter_sef;
$page['book_sef'] = $bookSef; $page['book_sef'] = $bookSef;
@@ -712,7 +712,6 @@ class pageClass
{ {
if(null !== $this->cacheData) if(null !== $this->cacheData)
{ {
return $this->renderCache(); return $this->renderCache();
} }
if(true === $this->authorized) if(true === $this->authorized)
@@ -721,19 +720,25 @@ class pageClass
$vars = $this->batch->getParserVars(); $vars = $this->batch->getParserVars();
$template = str_replace('{PAGECOMMENTS}', '[[PAGECOMMENTS]]', $this->template['start'].$this->template['body'].$this->template['end']); $template = str_replace('{PAGECOMMENTS}', '[[PAGECOMMENTS]]', $this->template['start'].$this->template['body'].$this->template['end']);
$ret = $this->renderPage($template); $arr = $this->renderPage($template);
if(!empty($this->template['page'])) if(!empty($this->template['page']))
{ {
$ret = str_replace(array('{PAGE}', '{PAGECOMMENTS}'), array($ret, '[[PAGECOMMENTS]]'), $this->template['page']); $ret = str_replace(array('{PAGE}', '{PAGECOMMENTS}'), array($arr['text'], '[[PAGECOMMENTS]]'), $this->template['page']);
} }
else
{
$ret = $arr['text'];
}
$ret = e107::getParser()->parseTemplate($ret, true, $this->batch); $ret = e107::getParser()->parseTemplate($ret, true, $this->batch);
if($vars->cachecontrol) $this->setCache($ret, $this->batch->sc_cpagetitle(), $this->page['page_comment_flag']); 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)); $this->pageOutput = array('text' => str_replace('[[PAGECOMMENTS]]', $this->batch->cpagecomments(), $ret), 'caption'=>$arr['caption'],'mode'=>$arr['mode']);
return;
return null;
} }
$extend = new e_vars; $extend = new e_vars;
@@ -778,7 +783,8 @@ class pageClass
} }
// return $this->renderPage($template, $extend); // return $this->renderPage($template, $extend);
$this->pageOutput = array('text' => $this->renderPage($template, $extend)); $tmp = $this->renderPage($template, $extend);
$this->pageOutput = array('text' => $tmp['text'], 'caption'=>$tmp['caption'], 'mode'=>$tmp['mode']);
} }
public function renderPage($template, $vars = null) public function renderPage($template, $vars = null)
@@ -802,7 +808,9 @@ class pageClass
$mode = vartrue($this->template['tableRender'], 'cpage-page-view'); $mode = vartrue($this->template['tableRender'], 'cpage-page-view');
} }
return e107::getRender()->tablerender($this->page['page_title'], $ret, $mode, true); return array('caption'=>$this->page['page_title'], 'text'=>$ret, 'mode'=>$mode);
// return e107::getRender()->tablerender($this->page['page_title'], $ret, $mode, true); //table style not parsed in hearder yet.
} }