1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Fixes #4398 - Page breadcrumb. Disabled breadcrumb on frontpage.

This commit is contained in:
Cameron
2021-02-18 17:02:37 -08:00
parent 1fae6bf7cf
commit cae8cf1345
2 changed files with 20 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ class cpage_shortcodes extends e_shortcode
// var $var; // parsed DB values
private $chapterData = array();
private $cpageFieldName = null;
private $breadcrumbComplete = false;
// Grab all book/chapter data.
function __construct()
@@ -658,21 +659,33 @@ class cpage_shortcodes extends e_shortcode
{
$breadcrumb = array();
$request = e107::getRegistry('core/page/request');
$action = varset($request['action']);
$row = $this->getChapter();
$brow = $this->getBook($row['chapter_parent']);
if(empty($brow['chapter_sef']))
if(empty($brow['chapter_sef']) || $this->breadcrumbComplete === true || ($action === 'listBooks'))
{
//e107::getDebug()->log($this);
return null;
}
$row['book_sef'] = vartrue($brow['chapter_sef'],"no-sef-found"); //$this->getBook();
$breadcrumb[] = array('text'=> $brow['chapter_name'], 'url'=> e107::getUrl()->create('page/book/index', $brow,'allow=chapter_id,chapter_sef,book_sef,page_sef'));
if($action !== 'listChapters')
{
$breadcrumb[] = array('text'=> $row['chapter_name'], 'url'=> e107::getUrl()->create('page/chapter/index', $row,'allow=chapter_id,chapter_sef,book_sef'));
}
e107::breadcrumb($breadcrumb);
$this->breadcrumbComplete = true;
}

View File

@@ -3632,6 +3632,11 @@ var_dump($select_options);*/
return null;
}
if(deftrue('e_FRONTPAGE'))
{
return null;
}
if(!is_array($array)){ return; }
$opt = array();