1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 17:14:42 +02:00

Fixes #4586, Fixes #2774, Fixes #49 - Workaround added for page dropdown navigation. Use {CPAGENAV: tmpl=dropdown} in page_template.php

This commit is contained in:
Cameron
2021-11-24 13:48:20 -08:00
parent 81cbe51228
commit 9fffa59a01
3 changed files with 33 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ class cpage_shortcodes extends e_shortcode
private $chapterData = array();
private $cpageFieldName = null;
private $breadcrumbComplete = false;
// Grab all book/chapter data.
function __construct()
{
@@ -210,10 +210,30 @@ class cpage_shortcodes extends e_shortcode
// return $com['comment'].$com['moderate'].$com['comment_form'];
}
function sc_cpagenav()
/**
* @param array $parm
* @param string $parm['tmpl'] page|dropdown
* @usage {CPAGENAV}
* @usage {CPAGENAV: tmpl=dropdown}
*
* @return string|null
*/
function sc_cpagenav($parm=null)
{
return isset($this->var['np']) ? $this->var['np'] : null;
$titles = implode("|", $this->scVars->pageTitles);
$total_items = count($this->scVars->pageTitles);
$row = $this->var;
$row['page'] = '--FROM--';
$url = rawurlencode(e107::getUrl()->create('page/view', $row, 'allow=page_id,page_title,page_sef,page'));
$template = isset($parm['tmpl']) ? (string) $parm['tmpl'] : 'page';
$parms = 'nonavcount&bullet='.rawurlencode($this->scVars->bullet.' ').'&caption=<!-- Empty -->&'.'pagetitle='.rawurlencode($titles).'&tmpl_prefix='.deftrue('PAGE_NEXTPREV_TMPL', $template).'&total='.$total_items.'&amount=1&current='.$this->scVars->pageSelected.'&url='.$url;
$itext = ($total_items) ? e107::getParser()->parseTemplate("{NEXTPREV={$parms}}") : null;
return $itext;
}
function sc_cpagerating()