mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Fix for Page-Navigation SEF Urls.
This commit is contained in:
@@ -14,27 +14,34 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
class page_sitelink // include plugin-folder in the name.
|
class page_sitelink // include plugin-folder in the name.
|
||||||
{
|
{
|
||||||
private $chapterSef = array();
|
private $chapterSef = array();
|
||||||
|
private $chapterParent = array();
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
|
|
||||||
$books = $sql->retrieve("SELECT chapter_id,chapter_sef FROM #page_chapters ORDER BY chapter_id ASC" , true);
|
$books = $sql->retrieve("SELECT chapter_id,chapter_sef,chapter_parent FROM #page_chapters ORDER BY chapter_id ASC" , true);
|
||||||
|
|
||||||
foreach($books as $row)
|
foreach($books as $row)
|
||||||
{
|
{
|
||||||
$id = $row['chapter_id'];
|
$id = $row['chapter_id'];
|
||||||
$this->chapterSef[$id] = $row['chapter_sef'];
|
$this->chapterSef[$id] = $row['chapter_sef'];
|
||||||
|
$this->chapterParent[$id] = $row['chapter_parent'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSef($chapter)
|
private function getSef($chapter)
|
||||||
{
|
{
|
||||||
return varset($this->chapterSef[$chapter],'--sef-not-assigned--');
|
return varset($this->chapterSef[$chapter],'--sef-not-assigned--');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getParent($chapter)
|
||||||
|
{
|
||||||
|
return varset($this->chapterParent[$chapter], false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function config()
|
function config()
|
||||||
{
|
{
|
||||||
@@ -179,7 +186,8 @@ class page_sitelink // include plugin-folder in the name.
|
|||||||
$pid = $row['page_chapter'];
|
$pid = $row['page_chapter'];
|
||||||
|
|
||||||
$row['chapter_sef'] = $this->getSef($row['page_chapter']);
|
$row['chapter_sef'] = $this->getSef($row['page_chapter']);
|
||||||
$row['book_sef'] = $this->getSef(); //XXX FIXME - needs to contain the chapter_parent (ie. the 'book')
|
$book = $this->getParent($row['page_chapter']);
|
||||||
|
$row['book_sef'] = $this->getSef($book);
|
||||||
|
|
||||||
$sublinks[$pid][] = $_pdata[] = array(
|
$sublinks[$pid][] = $_pdata[] = array(
|
||||||
'link_id' => $row['page_id'],
|
'link_id' => $row['page_id'],
|
||||||
|
Reference in New Issue
Block a user