diff --git a/e107_core/templates/page_template.php b/e107_core/templates/page_template.php
index 20e070cdb..67b3cce9a 100644
--- a/e107_core/templates/page_template.php
+++ b/e107_core/templates/page_template.php
@@ -175,3 +175,29 @@ $sc_style['CPAGENAV|default']['post'] = '';
';
$PAGE_TEMPLATE['nav']['submenu_end'] = '';
+
+
+
+ $PAGE_TEMPLATE['listPages']['start'] = "
";
+ $PAGE_TEMPLATE['listPages']['item'] = "- {CPAGETITLE}
";
+ $PAGE_TEMPLATE['listPages']['end'] = "
";
+
+
+ $PAGE_TEMPLATE['listChapters']['start'] = "";
+ $PAGE_TEMPLATE['listChapters']['item'] = "{CHAPTER_NAME}
{PAGES}";
+ $PAGE_TEMPLATE['listChapters']['end'] = "
";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/e107_plugins/page/e_shortcode.php b/e107_plugins/page/e_shortcode.php
index 8cf0591e3..4b4eb1b27 100644
--- a/e107_plugins/page/e_shortcode.php
+++ b/e107_plugins/page/e_shortcode.php
@@ -19,7 +19,7 @@ class page_shortcodes extends e_shortcode
$this->request = e107::getRegistry('core/pages/request');
- if(varset($this->request['action']) == 'listPages' && vartrue($this->request['id']))
+ if((varset($this->request['action']) == 'listPages' || varset($this->request['action']) == 'listChapters') && vartrue($this->request['id']))
{
$this->var = e107::getDb()->retrieve('page_chapters','chapter_name, chapter_meta_description','chapter_id = '.intval($this->request['id']).' LIMIT 1');
}
diff --git a/e107_plugins/page/e_sitelink.php b/e107_plugins/page/e_sitelink.php
index 78fe31ac7..e268a8091 100644
--- a/e107_plugins/page/e_sitelink.php
+++ b/e107_plugins/page/e_sitelink.php
@@ -78,7 +78,7 @@ class page_sitelink // include plugin-folder in the name.
}
elseif(vartrue($options['book']))
{
- $q[] = "page_chapter IN (SELECT chapter_id FROM #page_chapters WHERE chapter_parent=".intval($options['book']).")";
+ $q[] = "page_title !='' && page_chapter IN (SELECT chapter_id FROM #page_chapters WHERE chapter_parent=".intval($options['book']).")";
}
// XXX discuss FIXED remove DB check, use default title - AND page_title !=''
$q[] = "page_class IN (".USERCLASS_LIST.")";
diff --git a/e107_plugins/page/page_navigation_menu.php b/e107_plugins/page/page_navigation_menu.php
index 5d5064a1e..7aa056baa 100644
--- a/e107_plugins/page/page_navigation_menu.php
+++ b/e107_plugins/page/page_navigation_menu.php
@@ -15,7 +15,7 @@ if (!defined('e107_INIT')) { exit; }
$parm = eHelper::scParams($parm);
-$template = e107::getCoreTemplate('page',vartrue($parm['template'],'nav'), true, true); // always merge
+$template = e107::getCoreTemplate('page','nav',false,true); // always merge
$request = e107::getRegistry('core/pages/request');
if($request && is_array($request))
diff --git a/e107_themes/bootstrap/templates/page_template.php b/e107_themes/bootstrap/templates/page_template.php
index 8f3664d76..ea57f8e6d 100644
--- a/e107_themes/bootstrap/templates/page_template.php
+++ b/e107_themes/bootstrap/templates/page_template.php
@@ -52,37 +52,33 @@
$PAGE_TEMPLATE['navdoc']['end'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_start'] = '';
+ $PAGE_TEMPLATE['navdoc']['submenu_start'] = '';
+ $PAGE_TEMPLATE['navdoc']['submenu_item'] = '';
+ $PAGE_TEMPLATE['navdoc']['submenu_loweritem'] = '';
+ $PAGE_TEMPLATE['navdoc']['submenu_loweritem_active'] = '';
+ $PAGE_TEMPLATE['navdoc']['submenu_item_active'] = '';
+ $PAGE_TEMPLATE['navdoc']['submenu_end'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_item'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
- $PAGE_TEMPLATE['navdoc']['submenu_loweritem'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
- $PAGE_TEMPLATE['navdoc']['submenu_loweritem_active'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
+ $PAGE_TEMPLATE['listPages']['start'] = '';
+ $PAGE_TEMPLATE['listPages']['item'] = '
+
+ ';
+ $PAGE_TEMPLATE['listPages']['end'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_item_active'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
- $PAGE_TEMPLATE['navdoc']['submenu_end'] = '
';
+ $PAGE_TEMPLATE['listChapters']['start'] = '';
+ $PAGE_TEMPLATE['listChapters']['item'] = "{CHAPTER_NAME}
+ {CHAPTER_DESCRIPTION}
+ ";
+ $PAGE_TEMPLATE['listChapters']['end'] = "";
+
?>
\ No newline at end of file
diff --git a/page.php b/page.php
index 7a5e14fb5..f5767b98d 100644
--- a/page.php
+++ b/page.php
@@ -47,29 +47,7 @@ elseif(vartrue($_GET['bk'])) // List Chapters within a specific Book
elseif(vartrue($_GET['ch'])) // List Pages within a specific Chapter
{
$e107CorePage->setRequest('listPages');
-
- if($_GET['action']=='all') // See bootstrap 'docs' layout for an example.
- {
- $template = array();
- $template['start'] = '';
- $template['item'] = '
-
- ';
- $template['end'] = '';
- define('e_PAGETITLE', 'Documentation'); //FIXME - grab from selected chapter.
- }
- else
- {
- $template = array();
- $template['start'] = "";
- $template['item'] = "- {CPAGETITLE}
";
- $template['end'] = "
";
- }
+
require_once(HEADERF);
$text = $e107CorePage->listPages($_GET['ch'],$template);
@@ -216,17 +194,28 @@ class pageClass
$sql = e107::getDb('chap');
$tp = e107::getParser();
+ $template = e107::getCoreTemplate('page','listChapters', true, true); // always merge
+
if($sql->db_Select("page_chapters", "*", "chapter_parent = ".intval($book)." ORDER BY chapter_order ASC "))
{
- $text .= "";
+ $text .= $template['start']; // "";
while($row = $sql->db_Fetch())
{
- $text .= "- ";
- $text .= "
".$tp->toHtml($row['chapter_name'])."
"; // Chapter Title.
- $text .= $this->listPages(intval($row['chapter_id']));
- $text .= " ";
- }
- $text .= "
";
+ $var = array(
+ 'CHAPTER_NAME' => $tp->toHtml($row['chapter_name']),
+ 'CHAPTER_DESCRIPTION' => $tp->toHtml($row['chapter_meta_description'],true,'BODY'),
+ 'PAGES' => $this->listPages(intval($row['chapter_id'])),
+ 'CHAPTER_URL' => e_BASE."page.php?ch=".intval($row['chapter_id']) // FIXME SEF-URL
+ );
+
+ $text .= $tp->simpleParse($template['item'],$var);
+ // $text .= "- ";
+ // $text .= "
".$tp->toHtml($row['chapter_name'])."
"; // Chapter Title.
+ // $text .= $this->listPages(intval($row['chapter_id']));
+ // $text .= " ";
+ }
+ $text .= $template['end'];
+ // $text .= "
";
}
return $text;
@@ -234,14 +223,13 @@ class pageClass
- // TODO template for page list
- function listPages($chapt=0,$template='')
+ function listPages($chapt=0)
{
$sql = e107::getDb('pg');
$tp = e107::getParser();
$this->batch = e107::getScBatch('page',null,'cpage');
-
+ $template = e107::getCoreTemplate('page','listPages',true,true); // always merge
if(!e107::getPref('listPages', false))
{
@@ -258,11 +246,10 @@ class pageClass
}
else
{
-
- // $text .= "";
- $text .= $template['start'];
$pageArray = $sql->db_getList();
+
+ $text .= $template['start'];
foreach($pageArray as $page)
{
@@ -281,7 +268,7 @@ class pageClass
$text .= $template['end'];
- // $text .= "
";
+
// $caption = ($title !='')? $title: LAN_PAGE_11;
// e107::getRender()->tablerender($caption, $text,"cpage_list");
}